📄 implementation
字号:
This short document is provided to help programmers through the internals ofthe PostgreSQL JDBC driver.Makefile--------All compilation must be done by using Make. This is because there are twoversions of the driver, one for JDBC1 (for JDK 1.1.x) and the other for JDBC2(for JDK 1.2 or later). The makefile determines which version to compile byusing a helper class makeVersion. This class is only used by make, and is notstored in the Jar file.Note: It is not sufficient to simply call javac on postgresql/Driver.java as some classes are dynamically loaded, so javac will not compile them.postgresql.jar--------------This jar file is produced by make, and contains the driver for your JDKplatform.Note: It is possible to compile the driver under say JDK1.1.7, then under JDK 1.2. Because make doesn't remove the old classes before compiling, jar will simply package both sets together. When the driver is loaded, the postgresql.Driver class will sort out which set of classes to use.Importing packages------------------In user code, you may have to import one or more packages, if and only if youare using the non jdbc extensions (like FastPath, or LargeObject).DO NOT import the postgresql, postgresql.jdbc1 or postgresql.jdbc2 packages!Internally, some classes will import the packages when there is a link betweenthem and the other packages. However, the above rule still applies. It's therebecause Javac becomes confused between the different places that similar classnames are present.However, there are places where they need to refer to classes in the postgresqlpackage. In this case, import the individual classes, and not the entirepackage.ie: import postgresql.Field NOT import postgresql.*Package Layout--------------The driver is split into several packages:postgresql core classes, common to both JDBC 1 & 2postgresql.jdbc1 classes used only in implementing JDBC 1postgresql.jdbc2 classes used only in implementing JDBC 2postgresql.fastpath FastPath to backend functionspostgresql.geometric 2D Geometric types mapped to Java Objectspostgresql.largeobject Low level Large Object accesspostgresql.util Utility classesPackage postgresql------------------This package holds the core classes.Driver registers the driver when it's loaded, and determines which Connection class (in jdbc1 or jdbc2 packages) to use when connecting to a database.Field Used internally to represent a FieldPG_Stream Used internally to manage the network stream. These classes contains common code that is not dependent to the two JDBC specifications.Connection Common code used in Connections, mainly Network Protocol stuff.ResultSet Common code used in ResultSet'sPackage postgresql.fastpath---------------------------Fastpath Handles executing a function on the PostgreSQL BackendFastpathArg Defines an argument for a function callPackage postgresql.geometric----------------------------PGbox Maps to postgresql type boxPGcircle Maps to postgresql type circlePGline Maps to postgresql type linePGlseg Maps to postgresql type lsegPGpath Maps to postgresql type pathPGpoint Maps to postgresql type pointPGpolygon Maps to postgresql type polygonPackage postgresql.jdbc1------------------------The classes in this package handle the JDBC 1 Specification, for JDK 1.1.xAll interfaces in the java.sql package are present here.Package postgresql.jdbc2------------------------The classes in this package handle the JDBC 2 Specification, for JDK 1.2All interfaces in the java.sql, and javax.sql packages are present here.Package postgresql.largeobject------------------------------LargeObject Represents an open LargeObjectLargeObjectManager Handles the opening and deleting of LargeObjectsPackage postgresql.util-----------------------PGmoney Maps to postgresql type moneyPGobject Used to represent postgresql types that have no Java equivalentPGtokenizer Helper class for the geometric typesSerialize Used to serialise Java objects into tabes, rather than BlobsUnixCrypt Used to handle crypt authentication
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -