Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
99048aca
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
99048aca
编写于
9月 26, 1997
作者:
M
Marc G. Fournier
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Get these two files finally committed for Peter...sorry for delay :(
上级
c5d49902
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
241 addition
and
0 deletion
+241
-0
src/interfaces/jdbc/Makefile
src/interfaces/jdbc/Makefile
+89
-0
src/interfaces/jdbc/README
src/interfaces/jdbc/README
+152
-0
未找到文件。
src/interfaces/jdbc/Makefile
0 → 100644
浏览文件 @
99048aca
#-------------------------------------------------------------------------
#
# Makefile
# Makefile for Java JDBC interface
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/Makefile,v 1.1 1997/09/26 08:22:21 scrappy Exp $
#
#-------------------------------------------------------------------------
# These are commented out, but would be included in the postgresql source
FIND
=
find
JAR
=
jar
JAVA
=
java
JAVAC
=
javac
JAVADOC
=
javadoc
RM
=
rm
-f
# This defines how to compile a java class
.java.class
:
$(JAVAC)
$<
.SUFFIXES
:
.class .java
.PHONY
:
all clean doc
all
:
postgresql.jar
doc
:
$(JAVADOC)
-public
postgresql
OBJS
=
postgresql/CallableStatement.class
\
postgresql/Connection.class
\
postgresql/DatabaseMetaData.class
\
postgresql/Driver.class
\
postgresql/Field.class
\
postgresql/PG_Object.class
\
postgresql/PG_Stream.class
\
postgresql/PGbox.class
\
postgresql/PGcircle.class
\
postgresql/PGlobj.class
\
postgresql/PGlseg.class
\
postgresql/PGpath.class
\
postgresql/PGpoint.class
\
postgresql/PGpolygon.class
\
postgresql/PGtokenizer.class
\
postgresql/PreparedStatement.class
\
postgresql/ResultSet.class
\
postgresql/ResultSetMetaData.class
\
postgresql/Statement.class
postgresql.jar
:
$(OBJS)
$(JAR)
-c0vf
$@
$^
# This rule removes any temporary and compiled files from the source tree.
clean
:
$(FIND)
.
-name
"*~"
-exec
$(RM)
{}
\;
$(FIND)
.
-name
"*.class"
-exec
$(RM)
{}
\;
$(RM)
postgres.jar
#######################################################################
# This helps make workout what classes are from what source files
#
# Java is unlike C in that one source file can generate several
# _Different_ file names
#
postgresql/CallableStatement.class
:
postgresql/CallableStatement.java
postgresql/Connection.class
:
postgresql/Connection.java
postgresql/DatabaseMetaData.class
:
postgresql/DatabaseMetaData.java
postgresql/Driver.class
:
postgresql/Driver.java
postgresql/Field.class
:
postgresql/Field.java
postgresql/PG_Object.class
:
postgresql/PG_Object.java
postgresql/PG_Stream.class
:
postgresql/PG_Stream.java
postgresql/PGbox.class
:
postgresql/PGbox.java
postgresql/PGcircle.class
:
postgresql/PGcircle.java
postgresql/PGlobj.class
:
postgresql/PGlobj.java
postgresql/PGlseg.class
:
postgresql/PGlseg.java
postgresql/PGpath.class
:
postgresql/PGpath.java
postgresql/PGpoint.class
:
postgresql/PGpoint.java
postgresql/PGpolygon.class
:
postgresql/PGpolygon.java
postgresql/PGtokenizer.class
:
postgresql/PGtokenizer.java
postgresql/PreparedStatement.class
:
postgresql/PreparedStatement.java
postgresql/ResultSet.class
:
postgresql/ResultSet.java
postgresql/ResultSetMetaData.class
:
postgresql/ResultSetMetaData.java
postgresql/Statement.class
:
postgresql/Statement.java
src/interfaces/jdbc/README
0 → 100644
浏览文件 @
99048aca
This is a simple readme describing how to compile and use the jdbc driver.
This isn't a guide on how to use JDBC - for that refer to Javasoft's web site:
http://www.javasoft.com
or the JDBC mailing list:
jdbc@java.blackdown.org
http://www.blackdown.org
---------------------------------------------------------------------------
COMPILING
To compile the driver, simply use make in the src/interfaces/jdbc directory.
This will compile the driver, and build a .jar file (Java ARchive).
REMEMBER: once you have compiled the driver, it will work on ALL platforms
that support the JDK 1.1 api or later.
That means you don't have to compile it on every platform. Believe me, I
still hear from people who ask me "I've compiled it ok under Solaris, but it
won't compile under Linux" - there's no difference.
PS: When you run make, don't worry if you see just one or two calls to javac.
If, while compiling a class, javac needs another class that's not compiled,
it will compile it automatically. This reduces the numer of calls to javac
that make has to do.
---------------------------------------------------------------------------
INSTALLING THE DRIVER
To install the driver, the .class files have to be in the classpath. This can be
done in two ways:
1: create a directory "postgresql" (and it must be called this) in the current
directory (or a directory in the class path), and copy all .class files
into it.
2: copy the postgres.jar file into a directory, and add it to the classpath.
ie: under LINUX/SOLARIS (the example here is my linux box):
export CLASSPATH=.:/usr/local/lib/postgresql.jar:/usr/local/jdk1.1.1/lib/classes.zip
note: in java, .zip and .jar files hold collections of classes.
---------------------------------------------------------------------------
USING THE DRIVER
To use the driver, you must introduce it to JDBC. Again, there's two ways
of doing this:
1: Hardcoded.
This method hardcodes your driver into your application/applet. You
introduce the driver using the following snippet of code:
try {
Class.forName("postgresql.Driver");
} catch(Exception e) {
// your error handling code goes here
}
Remember, this method restricts your code to just the postgresql database.
2: Parameters
This method specifies the driver from the command line. When running the
application, you specify the driver using the option:
-Djdbc.drivers=postgresql.Driver
eg: This is an example of running one of my other projects with the driver:
java -Djdbc.drivers=postgresql.Driver finder.finder
note: This method only works with Applications (not for Applets).
However, the application is not tied to one driver, so if you needed
to switch databases (why I don't know ;-) ), you don't need to
recompile the application (as long as you havent hardcoded the url's).
---------------------------------------------------------------------------
JDBC URL syntax
The driver recognises JDBC URL's of the form:
jdbc:postgresql:database
jdbc:postgresql://host/database
jdbc:postgresql://host:port/database
Also, you can supply both username and passwords as arguments, by appending
them to the URL. eg:
jdbc:postgresql:database?user=me
jdbc:postgresql:database?user=me&password=mypass
---------------------------------------------------------------------------
That's the basics related to this driver. You'll need to read the JDBC Docs
on how to use it.
POSTGRESQL SPECIFICS
--------------------
JDBC supports database specific data types using the getObject() call. The
following types have their own Java equivalents supplied by the driver:
box, circle, lseg, path, point, polygon
When using the getObject() method on a resultset, it returns a PG_Object,
which holds the postgres type, and its value. This object also supports
methods to retrive these types.
Eg: column 3 contains a point, and rs is the ResultSet:
PG_Object o = (PG_Object)rs.getObject(3);
PGpoint p = o.getPoint();
System.out.println("point returned x="+p.x+", y="+p.y);
Also, when using these classes, their toString() methods return the correct
syntax for writing these to the database.
TODO
----
Currently only host authentication is supported. Password authentication
will be in there in a few days.
Incorporating more features from the other driver (esp. in the MetaData's)
Large Object support will also go in there, although it may not be done as
pure JDBC, but as an extra API.
Producing some documentation with javadoc - not all of the sources have them
yet.
---------------------------------------------------------------------------
Peter T Mount, August 30 1997
home email: pmount@maidast.demon.co.uk http://www.demon.co.uk/finder
work email: peter@maidstone.gov.uk http://www.maidstone.gov.uk
Adrian Hall
email: adrian@hottub.org
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录