[libpostgresql-jdbc-java] 01/13: Reset the upstream sources
Emmanuel Bourg
ebourg-guest at moszumanska.debian.org
Mon Jan 9 15:24:29 UTC 2017
This is an automated email from the git hooks/post-receive script.
ebourg-guest pushed a commit to branch master
in repository libpostgresql-jdbc-java.
commit aa5475e3704ce08685c66c2225437409103c170c
Author: Emmanuel Bourg <ebourg at apache.org>
Date: Mon Jan 9 12:52:35 2017 +0100
Reset the upstream sources
---
.gitignore | 6 -
LICENSE | 26 -
META-INF/services/java.sql.Driver | 1 -
README | 197 -
build.properties | 21 -
build.xml | 668 ---
certdir/README | 57 -
certdir/badclient.crt | 18 -
certdir/badclient.key | 18 -
certdir/badclient.pk8 | Bin 677 -> 0 bytes
certdir/badroot.crt | 18 -
certdir/goodclient.crt | 18 -
certdir/goodclient.key | 18 -
certdir/goodclient.pk8 | Bin 677 -> 0 bytes
certdir/goodroot.crt | 18 -
certdir/server/pg_hba.conf | 80 -
certdir/server/root.crt | 18 -
certdir/server/server.crt | 18 -
certdir/server/server.key | 15 -
doc/pgjdbc.xml | 3383 ---------------
org/postgresql/.gitignore | 1 -
org/postgresql/Driver.java.in | 755 ----
org/postgresql/PGConnection.java | 114 -
org/postgresql/PGNotification.java | 37 -
org/postgresql/PGRefCursorResultSet.java | 25 -
org/postgresql/PGResultSetMetaData.java | 39 -
org/postgresql/PGStatement.java | 85 -
org/postgresql/copy/CopyIn.java | 41 -
org/postgresql/copy/CopyManager.java | 187 -
org/postgresql/copy/CopyOperation.java | 53 -
org/postgresql/copy/CopyOut.java | 14 -
org/postgresql/copy/PGCopyInputStream.java | 151 -
org/postgresql/copy/PGCopyOutputStream.java | 170 -
org/postgresql/core/BaseConnection.java | 157 -
org/postgresql/core/BaseResultSet.java | 28 -
org/postgresql/core/BaseStatement.java | 60 -
org/postgresql/core/ConnectionFactory.java | 89 -
org/postgresql/core/Encoding.java | 291 --
org/postgresql/core/Field.java | 203 -
org/postgresql/core/Logger.java | 95 -
org/postgresql/core/Notification.java | 52 -
org/postgresql/core/Oid.java | 115 -
org/postgresql/core/PGBindException.java | 23 -
org/postgresql/core/PGStream.java | 547 ---
org/postgresql/core/ParameterList.java | 168 -
org/postgresql/core/Parser.java | 301 --
org/postgresql/core/ProtocolConnection.java | 146 -
org/postgresql/core/Query.java | 57 -
org/postgresql/core/QueryExecutor.java | 233 -
org/postgresql/core/ResultCursor.java | 26 -
org/postgresql/core/ResultHandler.java | 82 -
org/postgresql/core/SetupQueryRunner.java | 91 -
org/postgresql/core/TypeInfo.java | 101 -
org/postgresql/core/UTF8Encoding.java | 164 -
org/postgresql/core/Utils.java | 155 -
.../core/VisibleBufferedInputStream.java | 301 --
org/postgresql/core/types/PGBigDecimal.java | 71 -
org/postgresql/core/types/PGBoolean.java | 70 -
org/postgresql/core/types/PGByte.java | 71 -
org/postgresql/core/types/PGDouble.java | 71 -
org/postgresql/core/types/PGFloat.java | 71 -
org/postgresql/core/types/PGInteger.java | 68 -
org/postgresql/core/types/PGLong.java | 69 -
org/postgresql/core/types/PGNumber.java | 70 -
org/postgresql/core/types/PGShort.java | 66 -
org/postgresql/core/types/PGString.java | 81 -
org/postgresql/core/types/PGType.java | 18 -
org/postgresql/core/types/PGUnknown.java | 35 -
org/postgresql/core/v2/ConnectionFactoryImpl.java | 488 ---
org/postgresql/core/v2/FastpathParameterList.java | 162 -
org/postgresql/core/v2/ProtocolConnectionImpl.java | 227 -
org/postgresql/core/v2/QueryExecutorImpl.java | 612 ---
org/postgresql/core/v2/SimpleParameterList.java | 183 -
org/postgresql/core/v2/V2Query.java | 116 -
org/postgresql/core/v3/CompositeParameterList.java | 150 -
org/postgresql/core/v3/CompositeQuery.java | 67 -
org/postgresql/core/v3/ConnectionFactoryImpl.java | 650 ---
org/postgresql/core/v3/CopyInImpl.java | 61 -
org/postgresql/core/v3/CopyOperationImpl.java | 63 -
org/postgresql/core/v3/CopyOutImpl.java | 52 -
org/postgresql/core/v3/Portal.java | 67 -
org/postgresql/core/v3/ProtocolConnectionImpl.java | 247 --
org/postgresql/core/v3/QueryExecutorImpl.java | 2253 ----------
org/postgresql/core/v3/SimpleParameterList.java | 372 --
org/postgresql/core/v3/SimpleQuery.java | 197 -
org/postgresql/core/v3/V3ParameterList.java | 49 -
org/postgresql/core/v3/V3Query.java | 29 -
org/postgresql/ds/.gitignore | 4 -
.../ds/PGConnectionPoolDataSource.java.in | 37 -
org/postgresql/ds/PGPooledConnection.java.in | 44 -
org/postgresql/ds/PGPoolingDataSource.java.in | 50 -
org/postgresql/ds/PGSimpleDataSource.java.in | 24 -
org/postgresql/ds/common/BaseDataSource.java | 684 ---
org/postgresql/ds/common/PGObjectFactory.java | 140 -
.../AbstractJdbc23ConnectionPoolDataSource.java | 105 -
.../ds/jdbc23/AbstractJdbc23PooledConnection.java | 462 --
.../ds/jdbc23/AbstractJdbc23PoolingDataSource.java | 516 ---
.../ds/jdbc23/AbstractJdbc23SimpleDataSource.java | 44 -
.../AbstractJdbc4ConnectionPoolDataSource.java | 17 -
.../ds/jdbc4/AbstractJdbc4PooledConnection.java | 37 -
.../ds/jdbc4/AbstractJdbc4PoolingDataSource.java | 33 -
.../ds/jdbc4/AbstractJdbc4SimpleDataSource.java | 32 -
org/postgresql/fastpath/Fastpath.java | 256 --
org/postgresql/fastpath/FastpathArg.java | 84 -
org/postgresql/geometric/PGbox.java | 171 -
org/postgresql/geometric/PGcircle.java | 130 -
org/postgresql/geometric/PGline.java | 125 -
org/postgresql/geometric/PGlseg.java | 123 -
org/postgresql/geometric/PGpath.java | 174 -
org/postgresql/geometric/PGpoint.java | 203 -
org/postgresql/geometric/PGpolygon.java | 128 -
org/postgresql/gss/GSSCallbackHandler.java | 60 -
org/postgresql/gss/MakeGSS.java | 174 -
org/postgresql/jdbc2/AbstractJdbc2Array.java | 911 ----
org/postgresql/jdbc2/AbstractJdbc2Blob.java | 22 -
org/postgresql/jdbc2/AbstractJdbc2BlobClob.java | 249 --
org/postgresql/jdbc2/AbstractJdbc2Clob.java | 61 -
org/postgresql/jdbc2/AbstractJdbc2Connection.java | 1226 ------
.../jdbc2/AbstractJdbc2DatabaseMetaData.java | 4448 --------------------
org/postgresql/jdbc2/AbstractJdbc2ResultSet.java | 3270 --------------
.../jdbc2/AbstractJdbc2ResultSetMetaData.java | 473 ---
org/postgresql/jdbc2/AbstractJdbc2Statement.java | 3427 ---------------
org/postgresql/jdbc2/EscapedFunctions.java | 596 ---
org/postgresql/jdbc2/ResultWrapper.java | 61 -
org/postgresql/jdbc2/TimestampUtils.java | 917 ----
org/postgresql/jdbc2/TypeInfoCache.java | 690 ---
org/postgresql/jdbc2/optional/ConnectionPool.java | 15 -
.../jdbc2/optional/PoolingDataSource.java | 14 -
.../jdbc2/optional/SimpleDataSource.java | 14 -
org/postgresql/jdbc3/AbstractJdbc3Blob.java | 71 -
org/postgresql/jdbc3/AbstractJdbc3Clob.java | 107 -
org/postgresql/jdbc3/AbstractJdbc3Connection.java | 478 ---
.../jdbc3/AbstractJdbc3DatabaseMetaData.java | 381 --
.../jdbc3/AbstractJdbc3ParameterMetaData.java | 84 -
org/postgresql/jdbc3/AbstractJdbc3ResultSet.java | 213 -
org/postgresql/jdbc3/AbstractJdbc3Statement.java | 1519 -------
org/postgresql/jdbc3/Jdbc3Array.java | 47 -
org/postgresql/jdbc3/Jdbc3Blob.java | 21 -
org/postgresql/jdbc3/Jdbc3CallableStatement.java | 37 -
org/postgresql/jdbc3/Jdbc3Clob.java | 19 -
org/postgresql/jdbc3/Jdbc3Connection.java | 65 -
org/postgresql/jdbc3/Jdbc3ConnectionPool.java | 14 -
org/postgresql/jdbc3/Jdbc3DatabaseMetaData.java | 19 -
org/postgresql/jdbc3/Jdbc3ParameterMetaData.java | 21 -
org/postgresql/jdbc3/Jdbc3PoolingDataSource.java | 14 -
org/postgresql/jdbc3/Jdbc3PreparedStatement.java | 23 -
org/postgresql/jdbc3/Jdbc3ResultSet.java | 65 -
org/postgresql/jdbc3/Jdbc3ResultSetMetaData.java | 21 -
org/postgresql/jdbc3/Jdbc3SimpleDataSource.java | 14 -
org/postgresql/jdbc3/Jdbc3Statement.java | 47 -
org/postgresql/jdbc3/PSQLSavepoint.java | 80 -
.../jdbc3g/AbstractJdbc3gConnection.java | 30 -
org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java | 48 -
org/postgresql/jdbc3g/AbstractJdbc3gStatement.java | 60 -
org/postgresql/jdbc3g/Jdbc3gArray.java | 47 -
org/postgresql/jdbc3g/Jdbc3gBlob.java | 21 -
org/postgresql/jdbc3g/Jdbc3gCallableStatement.java | 36 -
org/postgresql/jdbc3g/Jdbc3gClob.java | 19 -
org/postgresql/jdbc3g/Jdbc3gConnection.java | 65 -
org/postgresql/jdbc3g/Jdbc3gDatabaseMetaData.java | 19 -
org/postgresql/jdbc3g/Jdbc3gParameterMetaData.java | 21 -
org/postgresql/jdbc3g/Jdbc3gPreparedStatement.java | 23 -
org/postgresql/jdbc3g/Jdbc3gResultSet.java | 65 -
org/postgresql/jdbc3g/Jdbc3gResultSetMetaData.java | 21 -
org/postgresql/jdbc3g/Jdbc3gStatement.java | 47 -
org/postgresql/jdbc4/AbstractJdbc4Blob.java | 28 -
org/postgresql/jdbc4/AbstractJdbc4Clob.java | 27 -
org/postgresql/jdbc4/AbstractJdbc4Connection.java | 249 --
.../jdbc4/AbstractJdbc4DatabaseMetaData.java | 120 -
.../jdbc4/AbstractJdbc4ParameterMetaData.java | 32 -
org/postgresql/jdbc4/AbstractJdbc4ResultSet.java | 310 --
.../jdbc4/AbstractJdbc4ResultSetMetaData.java | 34 -
org/postgresql/jdbc4/AbstractJdbc4Statement.java | 400 --
org/postgresql/jdbc4/Jdbc4Array.java | 52 -
org/postgresql/jdbc4/Jdbc4Blob.java | 21 -
org/postgresql/jdbc4/Jdbc4CallableStatement.java | 36 -
org/postgresql/jdbc4/Jdbc4Clob.java | 19 -
org/postgresql/jdbc4/Jdbc4Connection.java | 65 -
org/postgresql/jdbc4/Jdbc4DatabaseMetaData.java | 19 -
org/postgresql/jdbc4/Jdbc4ParameterMetaData.java | 21 -
org/postgresql/jdbc4/Jdbc4PreparedStatement.java | 23 -
org/postgresql/jdbc4/Jdbc4ResultSet.java | 65 -
org/postgresql/jdbc4/Jdbc4ResultSetMetaData.java | 21 -
org/postgresql/jdbc4/Jdbc4SQLXML.java | 297 --
org/postgresql/jdbc4/Jdbc4Statement.java | 47 -
org/postgresql/largeobject/BlobInputStream.java | 203 -
org/postgresql/largeobject/BlobOutputStream.java | 157 -
org/postgresql/largeobject/LargeObject.java | 372 --
org/postgresql/largeobject/LargeObjectManager.java | 373 --
org/postgresql/ssl/.gitignore | 1 -
org/postgresql/ssl/MakeSSL.java.in | 18 -
org/postgresql/ssl/NonValidatingFactory.java | 54 -
org/postgresql/ssl/WrappedFactory.java | 53 -
org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java | 68 -
org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java | 159 -
org/postgresql/ssl/jdbc4/LazyKeyManager.java | 247 --
org/postgresql/ssl/jdbc4/LibPQFactory.java | 291 --
org/postgresql/test/.gitignore | 1 -
org/postgresql/test/README | 310 --
org/postgresql/test/TestUtil.java | 440 --
.../test/extensions/ExtensionsSuite.java | 60 -
org/postgresql/test/extensions/HStoreTest.java | 79 -
org/postgresql/test/jdbc2/ANTTest.java | 36 -
org/postgresql/test/jdbc2/ArrayTest.java | 416 --
org/postgresql/test/jdbc2/BatchExecuteTest.java | 312 --
org/postgresql/test/jdbc2/BlobTest.java | 392 --
org/postgresql/test/jdbc2/CallableStmtTest.java | 288 --
org/postgresql/test/jdbc2/ConnectionTest.java | 301 --
org/postgresql/test/jdbc2/CopyTest.java | 273 --
org/postgresql/test/jdbc2/CursorFetchTest.java | 432 --
.../test/jdbc2/DatabaseEncodingTest.java | 320 --
.../test/jdbc2/DatabaseMetaDataPropertiesTest.java | 230 -
.../test/jdbc2/DatabaseMetaDataTest.java | 1128 -----
org/postgresql/test/jdbc2/DateTest.java | 258 --
org/postgresql/test/jdbc2/DriverTest.java | 101 -
org/postgresql/test/jdbc2/EncodingTest.java | 66 -
org/postgresql/test/jdbc2/GeometricTest.java | 113 -
org/postgresql/test/jdbc2/GetXXXTest.java | 84 -
org/postgresql/test/jdbc2/IntervalTest.java | 230 -
org/postgresql/test/jdbc2/JBuilderTest.java | 68 -
org/postgresql/test/jdbc2/Jdbc2TestSuite.java | 102 -
org/postgresql/test/jdbc2/LoginTimeoutTest.java | 160 -
org/postgresql/test/jdbc2/MiscTest.java | 134 -
org/postgresql/test/jdbc2/NotifyTest.java | 96 -
org/postgresql/test/jdbc2/OID74Test.java | 81 -
.../test/jdbc2/PreparedStatementTest.java | 832 ----
org/postgresql/test/jdbc2/RefCursorTest.java | 143 -
.../test/jdbc2/ResultSetMetaDataTest.java | 226 -
org/postgresql/test/jdbc2/ResultSetTest.java | 727 ----
org/postgresql/test/jdbc2/ServerCursorTest.java | 101 -
.../test/jdbc2/ServerPreparedStmtTest.java | 293 --
org/postgresql/test/jdbc2/StatementTest.java | 514 ---
org/postgresql/test/jdbc2/TestACL.java | 34 -
org/postgresql/test/jdbc2/TimeTest.java | 292 --
org/postgresql/test/jdbc2/TimestampTest.java | 695 ---
org/postgresql/test/jdbc2/TimezoneTest.java | 754 ----
.../test/jdbc2/UpdateableResultTest.java | 503 ---
.../test/jdbc2/optional/BaseDataSourceTest.java | 265 --
.../test/jdbc2/optional/ConnectionPoolTest.java | 551 ---
.../test/jdbc2/optional/OptionalTestSuite.java | 34 -
.../test/jdbc2/optional/PoolingDataSourceTest.java | 153 -
.../test/jdbc2/optional/SimpleDataSourceTest.java | 40 -
.../test/jdbc3/DatabaseMetaDataTest.java | 60 -
org/postgresql/test/jdbc3/GeneratedKeysTest.java | 230 -
org/postgresql/test/jdbc3/Jdbc3BlobTest.java | 340 --
.../test/jdbc3/Jdbc3CallableStatementTest.java | 1116 -----
org/postgresql/test/jdbc3/Jdbc3SavepointTest.java | 233 -
org/postgresql/test/jdbc3/Jdbc3TestSuite.java | 55 -
.../test/jdbc3/ParameterMetaDataTest.java | 107 -
org/postgresql/test/jdbc3/ResultSetTest.java | 59 -
.../test/jdbc3/SendRecvBufferSizeTest.java | 51 -
org/postgresql/test/jdbc3/TypesTest.java | 96 -
org/postgresql/test/jdbc4/ArrayTest.java | 202 -
org/postgresql/test/jdbc4/ConnectionTest.java | 65 -
.../test/jdbc4/DatabaseMetaDataTest.java | 84 -
org/postgresql/test/jdbc4/Jdbc4TestSuite.java | 69 -
org/postgresql/test/jdbc4/LOBTest.java | 52 -
org/postgresql/test/jdbc4/UUIDTest.java | 59 -
org/postgresql/test/jdbc4/XmlTest.java | 308 --
org/postgresql/test/ssl/SslTest.java | 347 --
org/postgresql/test/ssl/SslTestSuite.java | 55 -
org/postgresql/test/util/BrokenInputStream.java | 33 -
org/postgresql/test/util/MiniJndiContext.java | 234 -
.../test/util/MiniJndiContextFactory.java | 28 -
org/postgresql/test/xa/XADataSourceTest.java | 365 --
org/postgresql/test/xa/XATestSuite.java | 46 -
org/postgresql/translation/bg.po | 1519 -------
org/postgresql/translation/cs.po | 1440 -------
org/postgresql/translation/de.po | 1627 -------
org/postgresql/translation/es.po | 1408 -------
org/postgresql/translation/fr.po | 1528 -------
org/postgresql/translation/it.po | 1612 -------
org/postgresql/translation/ja.po | 1561 -------
org/postgresql/translation/messages_bg.class | Bin 39423 -> 0 bytes
org/postgresql/translation/messages_cs.class | Bin 12906 -> 0 bytes
org/postgresql/translation/messages_de.class | Bin 25726 -> 0 bytes
org/postgresql/translation/messages_es.class | Bin 3924 -> 0 bytes
org/postgresql/translation/messages_fr.class | Bin 25363 -> 0 bytes
org/postgresql/translation/messages_it.class | Bin 24487 -> 0 bytes
org/postgresql/translation/messages_ja.class | Bin 34163 -> 0 bytes
org/postgresql/translation/messages_nl.class | Bin 2379 -> 0 bytes
org/postgresql/translation/messages_pl.class | Bin 11385 -> 0 bytes
org/postgresql/translation/messages_pt_BR.class | Bin 27160 -> 0 bytes
org/postgresql/translation/messages_ru.class | Bin 8433 -> 0 bytes
org/postgresql/translation/messages_sr.class | Bin 26366 -> 0 bytes
org/postgresql/translation/messages_tr.class | Bin 26336 -> 0 bytes
org/postgresql/translation/messages_zh_CN.class | Bin 17280 -> 0 bytes
org/postgresql/translation/messages_zh_TW.class | Bin 17281 -> 0 bytes
org/postgresql/translation/nl.po | 1457 -------
org/postgresql/translation/pl.po | 1444 -------
org/postgresql/translation/pt_BR.po | 1494 -------
org/postgresql/translation/ru.po | 1545 -------
org/postgresql/translation/sr.po | 1502 -------
org/postgresql/translation/tr.po | 1489 -------
org/postgresql/translation/zh_CN.po | 1424 -------
org/postgresql/translation/zh_TW.po | 1424 -------
org/postgresql/util/Base64.java | 577 ---
org/postgresql/util/ByteConverter.java | 155 -
org/postgresql/util/GT.java | 88 -
org/postgresql/util/HStoreConverter.java | 140 -
org/postgresql/util/HostSpec.java | 34 -
org/postgresql/util/MD5Digest.java | 88 -
org/postgresql/util/PGBinaryObject.java | 42 -
org/postgresql/util/PGInterval.java | 438 --
org/postgresql/util/PGbytea.java | 174 -
org/postgresql/util/PGmoney.java | 98 -
org/postgresql/util/PGobject.java | 107 -
org/postgresql/util/PGtokenizer.java | 221 -
org/postgresql/util/PSQLDriverVersion.java | 30 -
org/postgresql/util/PSQLException.java | 39 -
org/postgresql/util/PSQLState.java | 102 -
org/postgresql/util/PSQLWarning.java | 41 -
org/postgresql/util/ServerErrorMessage.java | 188 -
org/postgresql/util/StreamWrapper.java | 60 -
org/postgresql/util/UnixCrypt.java | 650 ---
org/postgresql/xa/.gitignore | 1 -
org/postgresql/xa/PGXAConnection.java | 538 ---
org/postgresql/xa/PGXADataSource.java.in | 15 -
org/postgresql/xa/PGXADataSourceFactory.java | 45 -
org/postgresql/xa/PGXAException.java | 37 -
org/postgresql/xa/RecoveredXid.java | 95 -
.../xa/jdbc3/AbstractJdbc3XADataSource.java | 71 -
.../xa/jdbc4/AbstractJdbc4XADataSource.java | 23 -
src/pom/pom.xml | 45 -
ssltest.properties | 55 -
update-translations.sh | 14 -
326 files changed, 88223 deletions(-)
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 9cd9fb3..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.classpath
-.project
-.externalToolBuilders
-build
-jars
-.*.swp
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index fd416d2..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,26 +0,0 @@
-Copyright (c) 1997-2011, PostgreSQL Global Development Group
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-3. Neither the name of the PostgreSQL Global Development Group nor the names
- of its contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
diff --git a/META-INF/services/java.sql.Driver b/META-INF/services/java.sql.Driver
deleted file mode 100644
index 6f03688..0000000
--- a/META-INF/services/java.sql.Driver
+++ /dev/null
@@ -1 +0,0 @@
-org.postgresql.Driver
diff --git a/README b/README
deleted file mode 100644
index 33ee960..0000000
--- a/README
+++ /dev/null
@@ -1,197 +0,0 @@
-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 Oracle's website:
-
- http://www.oracle.com/technetwork/java/javase/jdbc/
-
-and the JDBC tutorial:
-
- http://docs.oracle.com/javase/tutorial/jdbc/
-
-For problems with this driver, refer to driver's home page:
-
- http://jdbc.postgresql.org/
-
-and associated mailing list:
-
- http://archives.postgresql.org/pgsql-jdbc/
-
----------------------------------------------------------------------------
-
-COMPILING
-
-To compile you will need to have a Java 5 or newer JDK and will need to have
-Ant installed. To obtain Ant go to http://ant.apache.org/index.html and
-download the binary. Being pure Java it will run on virtually all Java
-platforms. If you have any problems please email the pgsql-jdbc list.
-
-Once you have Ant, simply run ant in the top level directory. This will
-compile the correct driver for your JVM, and build a .jar file (Java ARchive)
-called postgresql.jar.
-
-REMEMBER: Once you have compiled the driver, it will work on ALL platforms
-that support that version of the API. You don't need to build it for each
-platform.
-
-If you are having problems, prebuilt versions of the driver
-are available at http://jdbc.postgresql.org/
-
----------------------------------------------------------------------------
-
-INSTALLING THE DRIVER
-
-To install the driver, the postgresql.jar file has to be in the classpath.
-
-ie: under LINUX/SOLARIS (the example here is my linux box):
-
- export CLASSPATH=.:/usr/local/pgsql/share/java/postgresql.jar
-
----------------------------------------------------------------------------
-
-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("org.postgresql.Driver");
- } catch(Exception e) {
- // your error handling code goes here
- }
-
- Remember, this method restricts your code to just the postgresql database.
- However, this is how most people load the driver.
-
-2: Parameters
-
- This method specifies the driver from the command line. When running the
- application, you specify the driver using the option:
-
- -Djdbc.drivers=org.postgresql.Driver
-
- eg: This is an example of running one of my other projects with the driver:
-
- java -Djdbc.drivers=org.postgresql.Driver uk.org.retep.finder.Main
-
- 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
-
-Notes:
-
-1) If you are connecting to localhost or 127.0.0.1 you can leave it out of the
- URL. ie: jdbc:postgresql://localhost/mydb can be replaced with
- jdbc:postgresql:mydb
-
-2) The port defaults to 5432 if it's left out.
-
----------------------------------------------------------------------------
-
-That's the basics related to this driver. You'll need to read the JDBC Docs
-on how to use it.
-
----------------------------------------------------------------------------
-
-BUG REPORTS, PATCHES AND DEVELOPMENT
-
-PgJDBC development is carried out on the PgJDBC mailing list:
-
- http://jdbc.postgresql.org/lists.html
-
-and on GitHub:
-
- https://github.com/pgjdbc/pgjdbc
-
-Bug reports
------------
-
-For bug reports please post on pgsql-jdbc or add a GitHub issue. If you include
-additional unit tests demonstrating the issue, or self-contained runnable test
-case including SQL scripts etc that shows the problem, your report is likely to
-get more attention. Make sure you include appropriate details on your
-environment, like your JDK version, container/appserver if any, platform,
-PostgreSQL version, etc. Err on the site of excess detail if in doubt.
-
-Bug fixes and new features
---------------------------
-
-If you've developed a patch you want to propose for inclusion in PgJDBC, feel
-free to send a GitHub pull request or post the patch on the PgJDBC mailing
-list. Make sure your patch includes additional unit tests demonstrating and
-testing any new features. In the case of bug fixes, where possible include a
-new unit test that failed before the fix and passes after it.
-
-For information on working with GitHub, see:
- http://help.github.com/articles/fork-a-repo
- http://learn.github.com/p/intro.html
-
-Testing
--------
-
-Remember to test proposed PgJDBC patches when running against older PostgreSQL
-versions where possible, not just against the PostgreSQL you use yourself.
-
-You also need to test your changes with older JDKs. PgJDBC must support JDK5
-("Java 1.5") and newer, which means you can't use annotations, auto-boxing, for
-(:), and numerous other features added since JDK 5. Code that's JDBC4 specific
-may use JDK6 features, and code that's JDBC4.1 specific may use JDK7 features.
-Common code and JDBC3 code needs to stick to Java 1.5.
-
-Two different versions of PgJDBC can be built, the JDBC 3 and JDBC 4 drivers.
-The former may be built with JDK 5, while building JDBC4 requires JDK 6 or 7.
-The driver to build is auto-selected based on the JDK version used to run the
-build. The best way to test a proposed change with both the JDBC3 and JDBC4
-drivers is to build and test with both JDK5 and JDK6 or 7.
-
-You can get old JDK versions from the Oracle Java Archive:
-
- http://www.oracle.com/technetwork/java/archive-139210.html
-
-Typically you can test against an old JDK with:
-
- export JAVA_HOME=/path/to/jdk_1_5
- export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:
- ant clean test
-
-For information about the unit tests and how to run them, see
- org/postgresql/test/README
-
-Ideas
------
-
-If you have ideas or proposed changes, please post on the mailing list.
-Think about how the change would affect other users, what side effects it
-might have, how practical it is to implement, what implications it would
-have for standards compliance and security, etc.
-
-Few of the PgJDBC developers have much spare time, so it's unlikely that your
-idea will be picked up and implemented for you. The best way to make sure a
-desired feature or improvement happens is to implement it yourself. The PgJDBC
-sources are reasonably clear and they're pure Java, so it's sometimes easier
-than you might expect.
diff --git a/build.properties b/build.properties
deleted file mode 100644
index fa23f8b..0000000
--- a/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-# Default build parameters. These may be overridden by local configuration
-# settings in build.local.properties.
-#
-
-major=9
-minor=2
-fullversion=9.2
-def_pgport=5432
-enable_debug=yes
-
-maven.group.id=org.postgresql
-maven.artifact.id=postgresql
-
-maven.artifact.version=9.2-1004
-maven.artifact.description=The PostgreSQL Driver
-
-# Maven snapshots and staging repository id and url
-maven.snapshots.repository.id=sonatype-nexus-snapshots
-maven.snapshots.repository.url=https://oss.sonatype.org/content/repositories/snapshots
-maven.staging.repository.id=sonatype-nexus-staging
-maven.staging.repository.url=https://oss.sonatype.org/service/local/staging/deploy/maven2
diff --git a/build.xml b/build.xml
deleted file mode 100644
index d526b7b..0000000
--- a/build.xml
+++ /dev/null
@@ -1,668 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
- Copyright (c) 2004-2011, PostgreSQL Global Development Group
-
- Build file to allow ant (http://ant.apache.org/) to be used
- to build the PostgreSQL JDBC Driver.
-
- This file now requires Ant 1.4.1. 2002-04-18
-
-
--->
-
-<!DOCTYPE project [
- <!ENTITY jarfiles "postgresql.jar">
-]>
-
-<project name="postgresqlJDBC" default="all" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
-
- <!-- set global properties for this build -->
- <property name="srcdir" value="." />
- <property name="jardir" value="jars" />
- <property name="builddir" value="build" />
- <property name="package" value="org/postgresql" />
- <property name="debug" value="on" />
-
- <!-- default build parameters are in build.properties, these may be
- overridden by local configuration settings in build.local.properties
- -->
- <property file="build.local.properties" />
- <property file="build.properties"/>
-
- <!-- define artifacts' name, which follows the convention of Maven -->
- <property name="maven.jar" value="${jardir}/${maven.artifact.id}-${maven.artifact.version}.jar"/>
- <property name="maven.javadoc.jar" value="${jardir}/${maven.artifact.id}-${maven.artifact.version}-javadoc.jar"/>
- <property name="maven.sources.jar" value="${jardir}/${maven.artifact.id}-${maven.artifact.version}-sources.jar"/>
-
- <patternset id="jdbc.version.src.pattern">
- <!-- This is the core of the driver. It is common for all versions. -->
- <include name="${package}/*.java" />
- <include name="${package}/core/**" />
- <include name="${package}/copy/**" />
- <include name="${package}/fastpath/**" />
- <include name="${package}/geometric/**" />
- <include name="${package}/largeobject/**" />
- <include name="${package}/util/**" />
-
- <!--
- Each jdbcN subpackage is used only if the driver supports *at least* that
- revision of JDBC. That is, a JDBC2 build uses only jdbc2, a JDBC3 build
- uses both jdbc2 and jdbc3, etc.
-
- Within those subpackages, classes beginning with "JdbcN" are assumed to be
- the concrete implementations for JDBC version N and are built only if the
- driver supports *exactly* that version. For example, jdbc2/Jdbc2Statement.java
- is built only if the driver build is a JDBC2 build.
- -->
-
- <!-- jdbc2 subpackage -->
- <include name="${package}/jdbc2/**"/>
-
- <!-- jdbc3 subpackage -->
- <include name="${package}/jdbc3/Abstract*.java"/>
- <include name="${package}/jdbc3/PSQLSavepoint.java"/>
-
- <include name="${package}/jdbc3/Jdbc3Array.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3Blob.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3CallableStatement.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3Clob.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3Connection.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3DatabaseMetaData.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3PreparedStatement.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3ResultSet.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3ResultSetMetaData.java.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3Statement.java" if="jdbc3"/>
-
- <!-- jdbc3g subpackage -->
- <include name="${package}/jdbc3g/*.java" if="jdbc3g"/>
- <exclude name="${package}/jdbc3g/Jdbc3g*.java" unless="jdbc3g"/>
-
- <!-- jdbc4 subpackage -->
- <include name="${package}/jdbc4/*.java" if="jdbc4any"/>
- <exclude name="${package}/jdcb4/Jdbc4*.java" unless="jdbc4any"/>
-
- <!-- ssl -->
- <include name="${package}/ssl/jdbc4/*.java" if="jdbc4any"/>
- <include name="${package}/ssl/jdbc3/*.java" if="jdbc3any"/>
- <include name="${package}/ssl/*.java" if="jdbc3any"/>
-
- <!-- gss -->
- <include name="${package}/gss/*.java"/>
-
- <!-- datasource stuff -->
- <include name="${package}/jdbc3/Jdbc3ConnectionPool.java" if="jdbc3any"/>
- <include name="${package}/jdbc3/Jdbc3PoolingDataSource.java" if="jdbc3any"/>
- <include name="${package}/jdbc3/Jdbc3SimpleDataSource.java" if="jdbc3any"/>
-
- <include name="${package}/ds/*.java"/>
- <include name="${package}/ds/common/*.java"/>
- <include name="${package}/ds/jdbc23/*.java"/>
- <include name="${package}/ds/jdbc4/*.java" if="jdbc4any"/>
-
- <!-- XA stuff -->
- <include name="${package}/xa/*.java"/>
- <include name="${package}/xa/jdbc3/*.java"/>
- <include name="${package}/xa/jdbc4/*.java" if="jdbc4any"/>
- </patternset>
-
- <target name="check_versions">
- <condition property="jdbc2">
- <or>
- <equals arg1="${java.specification.version}" arg2="1.2"/>
- <equals arg1="${java.specification.version}" arg2="1.3"/>
- </or>
- </condition>
- <condition property="jdbc3">
- <equals arg1="${java.specification.version}" arg2="1.4"/>
- </condition>
- <condition property="jdbc3g">
- <equals arg1="${java.specification.version}" arg2="1.5"/>
- </condition>
- <condition property="jdbc4">
- <equals arg1="${java.specification.version}" arg2="1.6"/>
- </condition>
- <condition property="jdbc41">
- <or>
- <equals arg1="${java.specification.version}" arg2="1.7"/>
- <equals arg1="${java.specification.version}" arg2="1.8"/>
- </or>
- </condition>
- <condition property="jdbc4any">
- <or>
- <isset property="jdbc4" />
- <isset property="jdbc41" />
- </or>
- </condition>
- <condition property="jdbc3any">
- <or>
- <isset property="jdbc3" />
- <isset property="jdbc3g" />
- </or>
- </condition>
- <condition property="jdbc3plus">
- <or>
- <isset property="jdbc3any" />
- <isset property="jdbc4any" />
- </or>
- </condition>
-
- <condition property="unknownjvm">
- <not>
- <or>
- <isset property="jdbc2" />
- <isset property="jdbc3any" />
- <isset property="jdbc4any" />
- </or>
- </not>
- </condition>
-
- <fail if="jdbc2" message="1.4 or higher JDK is required to build the JDBC driver." />
- <fail if="unknownjvm" message="Unknown JDK version." />
-
- <available property="junit" classname="junit.framework.Test"/>
- <available property="junit.task" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
-
- <condition property="jdbc4tests">
- <and>
- <isset property="jdbc4any" />
- <isset property="junit" />
- </and>
- </condition>
-
- <condition property="jdbc.version" value="jdbc3">
- <isset property="jdbc3any" />
- </condition>
-
- <condition property="jdbc.version" value="jdbc4">
- <isset property="jdbc4" />
- </condition>
-
- <condition property="jdbc.version" value="jdbc41">
- <isset property="jdbc41" />
- </condition>
-
- <condition property="jdbc.version.upper" value="JDBC3">
- <isset property="jdbc3any" />
- </condition>
-
- <condition property="jdbc.version.upper" value="JDBC4">
- <isset property="jdbc4" />
- </condition>
-
- <condition property="jdbc.version.upper" value="JDBC41">
- <isset property="jdbc41" />
- </condition>
- </target>
-
-
- <!-- default target -->
- <target name="all">
- <antcall target="jar" />
- </target>
-
-
- <!-- create the jar file -->
- <target name="jar" depends="compile">
- <jar jarfile="${jardir}/postgresql.jar">
- <fileset dir="${builddir}">
- <include name="${package}/**/*.class" />
- </fileset>
-
- <fileset dir="${srcdir}">
- <include name="${package}/translation/*.class" />
- </fileset>
-
- <metainf dir="META-INF">
- </metainf>
- </jar>
- </target>
-
-
- <target name="compile" depends="prepare,check_versions,driver">
-
- <available classname="org.postgresql.Driver" property="old.driver.present" />
- <fail message="Old driver was detected on classpath or in jre/lib/ext, please remove and try again." if="old.driver.present" />
-
- <javac classpath="${srcdir}" srcdir="${srcdir}" destdir="${builddir}" debug="${debug}" source="${java.specification.version}">
- <patternset refid="jdbc.version.src.pattern"/>
- </javac>
- </target>
-
- <target name="check_driver">
- <uptodate targetfile="${package}/Driver.java" property="driver.uptodate">
- <srcfiles dir="${srcdir}">
- <include name="${package}/Driver.java.in"/>
- <include name="${package}/ds/PGSimpleDataSource.java.in"/>
- <include name="${package}/ds/PGPoolingDataSource.java.in"/>
- <include name="${package}/ds/PGPooledConnection.java.in"/>
- <include name="${package}/ds/PGConnectionPoolDataSource.java.in" />
- <include name="${package}/xa/PGXADataSource.java.in" />
- <include name="build.properties"/>
- <include name="build.local.properties" />
- </srcfiles>
- </uptodate>
- </target>
-
- <!--
- This generates Driver.java from Driver.java.in
- It's required for importing the driver version properties
- -->
- <target name="driver" depends="prepare,check_versions,check_driver"
- unless="driver.uptodate">
- <!-- determine the edition text -->
- <condition property="edition" value="JDBC3">
- <equals arg1="${jdbc3}" arg2="true"/>
- </condition>
- <condition property="edition" value="JDBC3g">
- <equals arg1="${jdbc3g}" arg2="true" />
- </condition>
- <condition property="edition" value="JDBC4">
- <equals arg1="${jdbc4}" arg2="true" />
- </condition>
- <condition property="edition" value="JDBC4.1">
- <equals arg1="${jdbc41}" arg2="true" />
- </condition>
-
- <!-- determine the connection class -->
- <condition property="connectclass" value="org.postgresql.jdbc3.Jdbc3Connection">
- <equals arg1="${jdbc3}" arg2="true"/>
- </condition>
- <condition property="connectclass" value="org.postgresql.jdbc3g.Jdbc3gConnection">
- <equals arg1="${jdbc3g}" arg2="true"/>
- </condition>
- <condition property="connectclass" value="org.postgresql.jdbc4.Jdbc4Connection">
- <equals arg1="${jdbc4any}" arg2="true" />
- </condition>
-
- <condition property="notimplementedexception" value="java.sql.SQLException">
- <equals arg1="${jdbc3any}" arg2="true" />
- </condition>
- <condition property="notimplementedexception" value="java.sql.SQLFeatureNotSupportedException">
- <equals arg1="${jdbc4any}" arg2="true" />
- </condition>
-
- <condition property="simpledsclass" value="org.postgresql.ds.jdbc23.AbstractJdbc23SimpleDataSource">
- <equals arg1="${jdbc3any}" arg2="true" />
- </condition>
- <condition property="simpledsclass" value="org.postgresql.ds.jdbc4.AbstractJdbc4SimpleDataSource">
- <equals arg1="${jdbc4any}" arg2="true" />
- </condition>
-
- <condition property="poolingdsclass" value="org.postgresql.ds.jdbc23.AbstractJdbc23PoolingDataSource">
- <equals arg1="${jdbc3any}" arg2="true" />
- </condition>
- <condition property="poolingdsclass" value="org.postgresql.ds.jdbc4.AbstractJdbc4PoolingDataSource">
- <equals arg1="${jdbc4any}" arg2="true" />
-</condition>
-
- <condition property="pooledconnclass" value="org.postgresql.ds.jdbc23.AbstractJdbc23PooledConnection">
- <equals arg1="${jdbc3any}" arg2="true" />
- </condition>
- <condition property="pooledconnclass" value="org.postgresql.ds.jdbc4.AbstractJdbc4PooledConnection">
- <equals arg1="${jdbc4any}" arg2="true" />
- </condition>
-
- <condition property="connpooldsclass" value="org.postgresql.ds.jdbc23.AbstractJdbc23ConnectionPoolDataSource">
- <equals arg1="${jdbc3any}" arg2="true" />
- </condition>
- <condition property="connpooldsclass" value="org.postgresql.ds.jdbc4.AbstractJdbc4ConnectionPoolDataSource">
- <equals arg1="${jdbc4any}" arg2="true" />
- </condition>
-
- <condition property="xadsclass" value="org.postgresql.xa.jdbc3.AbstractJdbc3XADataSource">
- <equals arg1="${jdbc3any}" arg2="true" />
- </condition>
- <condition property="xadsclass" value="org.postgresql.xa.jdbc4.AbstractJdbc4XADataSource">
- <equals arg1="${jdbc4any}" arg2="true" />
- </condition>
- <condition property="makesslclass" value="org.postgresql.ssl.jdbc3.AbstractJdbc3MakeSSL">
- <equals arg1="${jdbc3any}" arg2="true" />
- </condition>
- <condition property="makesslclass" value="org.postgresql.ssl.jdbc4.AbstractJdbc4MakeSSL">
- <equals arg1="${jdbc4any}" arg2="true" />
- </condition>
-
- <!-- Some defaults -->
- <filter token="MAJORVERSION" value="${major}" />
- <filter token="MINORVERSION" value="${minor}" />
- <filter token="VERSION" value="PostgreSQL ${fullversion} ${edition}" />
- <filter token="JDBCCONNECTCLASS" value="${connectclass}" />
- <filter token="NOTIMPLEMENTEDEXCEPTION" value="${notimplementedexception}" />
- <filter token="XA_DS_CLASS" value="${xadsclass}" />
- <filter token="POOLING_DS_CLASS" value="${poolingdsclass}" />
- <filter token="SIMPLE_DS_CLASS" value="${simpledsclass}" />
- <filter token="POOLED_CONN_CLASS" value="${pooledconnclass}" />
- <filter token="CONN_POOL_DS_CLASS" value="${connpooldsclass}" />
- <filter token="DEF_PGPORT" value="${def_pgport}" />
- <filter token="MAKE_SSL_CLASS" value="${makesslclass}"/>
-
- <fail unless="major" message="'major' undefined. Please follow the directions in README."/>
- <fail unless="minor" message="'minor' undefined. Please follow the directions in README."/>
- <fail unless="fullversion" message="'fullversion' undefined. Please follow the directions in README."/>
- <fail unless="def_pgport" message="'def_pgport' undefined. Please follow the directions in README."/>
- <fail unless="enable_debug" message="'enable_debug' undefined. Please follow the directions in README."/>
-
- <!-- Put a check for the current version here -->
-
- <!-- now copy and filter the file -->
- <copy file="${srcdir}/${package}/Driver.java.in"
- overwrite="true"
- tofile="${srcdir}/${package}/Driver.java"
- filtering="yes" />
- <copy file="${srcdir}/${package}/ds/PGPoolingDataSource.java.in"
- overwrite="true"
- tofile="${srcdir}/${package}/ds/PGPoolingDataSource.java"
- filtering="yes" />
- <copy file="${srcdir}/${package}/ds/PGSimpleDataSource.java.in"
- overwrite="true"
- tofile="${srcdir}/${package}/ds/PGSimpleDataSource.java"
- filtering="yes" />
- <copy file="${srcdir}/${package}/ds/PGPooledConnection.java.in"
- overwrite="true"
- tofile="${srcdir}/${package}/ds/PGPooledConnection.java"
- filtering="yes" />
- <copy file="${srcdir}/${package}/ds/PGConnectionPoolDataSource.java.in"
- overwrite="true"
- tofile="${srcdir}/${package}/ds/PGConnectionPoolDataSource.java"
- filtering="yes" />
- <copy file="${srcdir}/${package}/xa/PGXADataSource.java.in"
- overwrite="true"
- tofile="${srcdir}/${package}/xa/PGXADataSource.java"
- filtering="yes" />
- <copy file="${srcdir}/${package}/ssl/MakeSSL.java.in"
- overwrite="true"
- tofile="${srcdir}/${package}/ssl/MakeSSL.java"
- filtering="yes" />
-
- <echo message="Configured build for the ${edition} edition driver." />
- </target>
-
-
- <!-- Prepares the build directory -->
- <target name="prepare">
- <!-- use the enable_debug option from configure -->
- <condition property="debug" value="on">
- <and>
- <equals arg1="${enable_debug}" arg2="yes" />
- </and>
- </condition>
- <mkdir dir="${builddir}" />
- <mkdir dir="${jardir}" />
- </target>
-
-
- <!-- This target removes any class files from the build directory -->
- <target name="clean">
- <delete quiet="true" dir="${builddir}" />
- <delete quiet="true" dir="${jardir}" />
- <delete quiet="true" file="${srcdir}/${package}/Driver.java" />
- <delete quiet="true" file="${srcdir}/${package}/ds/PGPoolingDataSource.java" />
- <delete quiet="true" file="${srcdir}/${package}/ds/PGSimpleDataSource.java" />
- <delete quiet="true" file="${srcdir}/${package}/ds/PGPooledConnection.java" />
- <delete quiet="true" file="${srcdir}/${package}/ds/PGConnectionPoolDataSource.java" />
- <delete quiet="true" file="${srcdir}/${package}/xa/PGXADataSource.java" />
- <delete quiet="true" file="${srcdir}/${package}/ssl/MakeSSL.java" />
- </target>
-
- <!-- This compiles and executes the JUnit tests -->
-
- <!-- defaults for the tests - override these if required -->
- <property name="server" value="localhost" />
- <property name="port" value="${def_pgport}" />
- <property name="database" value="test" />
- <property name="username" value="test" />
- <!-- Password must be something. Doesn't matter if trust is used! -->
- <property name="password" value="test" />
- <property name="preparethreshold" value="5" />
- <property name="loglevel" value="0" />
- <property name="protocolVersion" value="0" />
- <property name="binarytransfer" value="true" />
- <property name="forcebinary" value="true" />
- <property name="ssltest.properties" value="ssltest.properties" />
-
- <!-- The tests now build to a separate directory and jarfile from the
- driver build, to ensure we're really testing against the jar we just
- built, and not whatever happens to be in builddir. -->
-
- <!-- This compiles and builds the test jarfile. -->
- <target name="testjar" depends="jar">
- <fail message="JUnit could not be found in your classpath. You must download and install it from http://junit.org to build and run the test suite." unless="junit" />
- <mkdir dir="${builddir}/tests"/>
- <javac srcdir="${srcdir}" destdir="${builddir}/tests" debug="${debug}" source="${java.specification.version}">
- <include name="${package}/test/**" />
-
- <exclude name="${package}/test/jdbc4/**" unless="jdbc4tests" />
- <exclude name="${package}/test/ssl/**" unless="jdbc4tests" />
-
- <classpath>
- <pathelement location="${jardir}/postgresql.jar"/>
- </classpath>
- </javac>
- <jar jarfile="${jardir}/postgresql-tests.jar" basedir="${builddir}/tests"/>
- </target>
-
- <!-- This actually runs the tests -->
- <target name="runtest" depends="testjar">
- <fail message="Your version of ant doesn't seem to have the junit task available. I looked for org.apache.tools.ant.taskdefs.optional.junit.JUnitTask, but I couldn't find it." unless="junit.task" />
-
- <delete file="postgresql-jdbc-tests.debug.txt"/>
-
- <property name="testResultsDir" value="${builddir}/testresults" />
- <mkdir dir="${testResultsDir}" />
-
- <junit>
- <formatter type="brief" usefile="false"/>
- <formatter type="xml" usefile="true" />
-
- <sysproperty key="server" value="${server}" />
- <sysproperty key="port" value="${port}" />
- <sysproperty key="database" value="${database}" />
- <sysproperty key="username" value="${username}" />
- <sysproperty key="password" value="${password}" />
- <sysproperty key="preparethreshold" value="${preparethreshold}" />
- <sysproperty key="loglevel" value="${loglevel}" />
- <sysproperty key="protocolVersion" value="${protocolVersion}" />
- <sysproperty key="binaryTransfer" value="${binarytransfer}" />
- <sysproperty key="org.postgresql.forcebinary" value="${forcebinary}" />
- <sysproperty key="ssltest.properties" value="${ssltest.properties}" />
-
- <classpath>
- <pathelement location="${jardir}/postgresql.jar" />
- <pathelement location="${jardir}/postgresql-tests.jar" />
- <pathelement path="${java.class.path}" />
- </classpath>
- <test name="org.postgresql.test.jdbc2.Jdbc2TestSuite" outfile="${testResultsDir}/jdbc2"/>
- <test name="org.postgresql.test.jdbc2.optional.OptionalTestSuite" outfile="${testResultsDir}/jdbc2optional"/>
- <test name="org.postgresql.test.jdbc3.Jdbc3TestSuite" outfile="${testResultsDir}/jdbc3"/>
- <test name="org.postgresql.test.xa.XATestSuite" outfile="${testResultsDir}/xa"/>
- <test name="org.postgresql.test.extensions.ExtensionsSuite" outfile="${testResultsDir}/extensions"/>
- <test name="org.postgresql.test.jdbc4.Jdbc4TestSuite" if="jdbc4tests" outfile="${testResultsDir}/jdbc4"/>
- <test name="org.postgresql.test.ssl.SslTestSuite" if="jdbc4tests" outfile="${testResultsDir}/ssl"/>
- </junit>
- </target>
-
- <!-- Build and run the tests. -->
- <target name="test" depends="testjar,runtest"/>
-
- <!-- Build public javadoc -->
- <target name="publicapi" depends="compile">
- <mkdir dir="${builddir}/publicapi" />
- <javadoc destdir="${builddir}/publicapi" charset="utf-8">
- <classpath>
- <pathelement path="${builddir}" />
- <pathelement path="${java.class.path}" />
- </classpath>
- <fileset dir="${srcdir}/${package}">
- <include name="copy/*.java" />
- <include name="geometric/*.java" />
- <include name="largeobject/*.java" />
- <include name="fastpath/*.java" />
- <include name="PG*.java" />
- <include name="util/PGobject.java" />
- <include name="util/PGmoney.java" />
- <include name="util/PGInterval.java" />
- <include name="util/ServerErrorMessage.java" />
- <include name="ssl/WrappedFactory.java" />
- <include name="ssl/NonValidatingFactory.java" />
- <include name="ds/PG*.java" />
- <include name="ds/common/BaseDataSource.java" />
- <include name="xa/PGXADataSource.java" />
- </fileset>
- </javadoc>
- </target>
-
- <!-- Build driver-internal javadoc. NB: needs Ant 1.6 & JDK 1.4 for 'breakiterator'. -->
- <target name="privateapi" depends="compile">
- <javadoc destdir="${builddir}/privateapi" breakiterator="yes" charset="utf-8">
- <classpath>
- <pathelement path="${builddir}" />
- <pathelement path="${java.class.path}" />
- </classpath>
- <fileset dir="${srcdir}/${package}">
- <include name="**/*.java"/>
- <exclude name="jdbc3/Jdbc3*.java" unless="jdbc3" />
- <exclude name="jdbc3g/Jdbc3g*.java" unless="jdbc3g" />
- <exclude name="jdbc4/*.java" unless="jdbc4any" />
- <exclude name="ds/jdbc4/*.java" unless="jdbc4any" />
- <exclude name="test/**/*.java"/>
- </fileset>
- </javadoc>
- </target>
-
- <!-- Build the documentation -->
- <target name="doc" depends="prepare">
- <mkdir dir="${builddir}/doc"/>
- <xslt basedir="doc" destdir="${builddir}/doc" includes="*.xml" force="yes" style="${docbook.stylesheet}">
- <param name="base.dir" expression="${builddir}/doc/"/>
- <param name="use.id.as.filename" expression="1" />
- </xslt>
- </target>
-
- <!-- Blah. Can't reference an external XML catalog until Ant 1.6.
- So instead we copy the contents of ${docbook.dtd}/catalog.xml
- here, in the form that Ant's xmlcatalog element wants. -->
- <xmlcatalog id="docbook-catalog">
- <dtd publicId="-//OASIS//DTD DocBook XML V4.2//EN"
- location="${docbook.dtd}/docbookx.dtd"/>
- <entity publicId="-//OASIS//DTD DocBook CALS Table Model V4.2//EN"
- location="${docbook.dtd}/calstblx.dtd"/>
- <entity publicId="-//OASIS//DTD XML Exchange Table Model 19990315//EN"
- location="${docbook.dtd}/soextblx.dtd"/>
- <entity publicId="-//OASIS//ELEMENTS DocBook Information Pool V4.2//EN"
- location="${docbook.dtd}/dbpoolx.mod"/>
- <entity publicId="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.2//EN"
- location="${docbook.dtd}/dbhierx.mod"/>
- <entity publicId="-//OASIS//ENTITIES DocBook Additional General Entities V4.2//EN"
- location="${docbook.dtd}/dbgenent.mod"/>
- <entity publicId="-//OASIS//ENTITIES DocBook Notations V4.2//EN"
- location="${docbook.dtd}/dbnotnx.mod"/>
- <entity publicId="-//OASIS//ENTITIES DocBook Character Entities V4.2//EN"
- location="${docbook.dtd}/dbcentx.mod"/>
- </xmlcatalog>
-
- <!-- Validate but don't process the documentation.
- This target expects the DocBook XML DTDs, available at
- http://www.docbook.org/xml/4.2/docbook-xml-4.2.zip, to be
- present in ${docbook.dtd}. If they're not present, they will
- be fetched on each validation from www.oasis-open.org.
-
- Note that if the DTD fetch fails, validation fails with a fairly
- useless error message. Run ant with -verbose to get a more useful
- error. You'll need to set the java properties http.proxyHost and
- http.proxyPort if you need to go via a proxy to fetch the DTDs.
- -->
-
- <target name="validate-doc" depends="prepare">
- <xmlvalidate warn="true">
- <fileset dir="doc" includes="*.xml"/>
- <xmlcatalog refid="docbook-catalog"/>
- </xmlvalidate>
- </target>
-
- <target name="snapshot-version" description="Sets the version string to a snapshot version">
- <property name="maven.artifact.version.string" value="${maven.artifact.version}-${jdbc.version}-SNAPSHOT" />
- <echo message="Maven version string: ${maven.artifact.version.string}" />
- </target>
-
- <target name="release-version" description="Sets the version string to a release version">
- <property name="maven.artifact.version.string" value="${maven.artifact.version}-${jdbc.version}" />
- <echo message="Maven version string: ${maven.artifact.version.string}" />
- </target>
-
- <target name="prepare-pom" depends="prepare,check_versions" description="Filters the pom depending on the jdbc version being built">
- <mkdir dir="${builddir}/pom"/>
- <!-- Copy the templated pom.xml with version info -->
- <filter token="maven.group.id" value="${maven.group.id}"/>
- <filter token="maven.artifact.id" value="${maven.artifact.id}"/>
- <filter token="maven.artifact.version.string" value="${maven.artifact.version.string}"/>
- <filter token="maven.artifact.description" value="${maven.artifact.description}"/>
- <filter token="jdbc.version.upper" value="${jdbc.version.upper}"/>
- <copy todir="${builddir}/pom" filtering="true" file="src/pom/pom.xml"/>
- </target>
-
- <target name="snapshot" depends="maven-jar,snapshot-version,prepare-pom" description="deploy snapshot version to Maven snapshot repository">
- <artifact:mvn>
- <artifact:arg value="org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy-file"/>
- <artifact:arg value="-Durl=${maven.snapshots.repository.url}"/>
- <artifact:arg value="-DrepositoryId=${maven.snapshots.repository.id}"/>
- <artifact:arg value="-DpomFile=${builddir}/pom/pom.xml"/>
- <artifact:arg value="-Dfile=${maven.jar}"/>
- </artifact:mvn>
- </target>
-
- <!-- before this, update project version (both build.xml and pom.xml) from SNAPSHOT to RELEASE -->
- <target name="release" depends="maven-jar,release-version,prepare-pom" description="deploy release version to Maven staging repository">
- <!-- sign and deploy the main artifact -->
- <artifact:mvn>
- <artifact:arg value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file" />
- <artifact:arg value="-Durl=${maven.staging.repository.url}" />
- <artifact:arg value="-DrepositoryId=${maven.staging.repository.id}" />
- <artifact:arg value="-DpomFile=${builddir}/pom/pom.xml" />
- <artifact:arg value="-Dfile=${maven.jar}" />
- <artifact:arg value="-Pgpg" />
- </artifact:mvn>
-
- <!-- sign and deploy the sources artifact -->
- <artifact:mvn>
- <artifact:arg value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file" />
- <artifact:arg value="-Durl=${maven.staging.repository.url}" />
- <artifact:arg value="-DrepositoryId=${maven.staging.repository.id}" />
- <artifact:arg value="-DpomFile=${builddir}/pom/pom.xml" />
- <artifact:arg value="-Dfile=${maven.sources.jar}" />
- <artifact:arg value="-Dclassifier=sources" />
- <artifact:arg value="-Pgpg" />
- </artifact:mvn>
-
- <!-- sign and deploy the javadoc artifact -->
- <artifact:mvn>
- <artifact:arg value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file" />
- <artifact:arg value="-Durl=${maven.staging.repository.url}" />
- <artifact:arg value="-DrepositoryId=${maven.staging.repository.id}" />
- <artifact:arg value="-DpomFile=${builddir}/pom/pom.xml" />
- <artifact:arg value="-Dfile=${maven.javadoc.jar}" />
- <artifact:arg value="-Dclassifier=javadoc" />
- <artifact:arg value="-Pgpg" />
- </artifact:mvn>
- </target>
-
- <!-- create jar files for distribution to maven central -->
- <target name="maven-jar" depends="jar, publicapi">
- <!-- Copy the built jar into a maven compatible name -->
- <copy file="${jardir}/postgresql.jar" tofile="${maven.jar}"/>
- <!-- Create a jar of the javadoc public api -->
- <jar jarfile="${maven.javadoc.jar}">
- <fileset dir="${builddir}/publicapi">
- <include name="**/*"/>
- </fileset>
- </jar>
- <!-- Create a jar of the source code -->
- <jar jarfile="${maven.sources.jar}">
- <fileset dir="${srcdir}">
- <patternset refid="jdbc.version.src.pattern"/>
- <include name="META-INF/**/*"/>
- </fileset>
- </jar>
- </target>
-
-</project>
diff --git a/certdir/README b/certdir/README
deleted file mode 100644
index 6139bf9..0000000
--- a/certdir/README
+++ /dev/null
@@ -1,57 +0,0 @@
-
-To run the SSL tests, the following properties are used:
-
-certdir: directory where the certificates and keys are store
-
-ssl<TYPE><gh|bh><8|9>: a connection string to the appropiate database
-TYPE is the TYPE or METHOD field from pg_hba.conf that is: host, hostnossl,
-hostssl and the special types hostsslcert, that corresponds
-to a hostssl type with clientcert=1 and cert that corresponds
-to a hostssl type with cert authentication. 'gh' means, the server certificate
-matches the hostname (good hostname), 'bh' means it is not (bad
-hostname). It can be simulated with a single database, if two names
-can be used i.e. localhost and 127.0.0.1. ssloff points to a database,
-where ssl is off. The last number is the server major version
-
-For each connection, the following files should be placed into certdir:
-goodclient.crt, badclient.crt, goodclient.pk8, badclient.pk8, goodroot.crt, badroot.crt
-optionally prefixed by the value of ssl<TYPE><gh|bh>prefix property, if
-different files are necessary for different connect strings.
-
-This directory contains example certificates generated by the following
-commands:
-
-openssl req -x509 -newkey rsa:1024 -days 3650 -keyout goodclient.key -out goodclient.crt
-#Common name is test, password is sslpwd
-
-openssl req -x509 -newkey rsa:1024 -days 3650 -keyout badclient.key -out badclient.crt
-#Common name is test, password is sslpwd
-
-openssl req -x509 -newkey rsa:1024 -days 3650 -nodes -keyout badroot.key -out badroot.crt
-#Common name is localhost
-rm badroot.key
-
-openssl pkcs8 -topk8 -in goodclient.key -out goodclient.pk8 -outform DER -v1 PBE-MD5-DES
-openssl pkcs8 -topk8 -in badclient.key -out badclient.pk8 -outform DER -v1 PBE-MD5-DES
-cp goodclient.crt server/root.crt
-cd server
-openssl req -x509 -newkey rsa:1024 -nodes -days 3650 -keyout server.key -out server.crt
-cp server.crt ../goodroot.crt
-#Common name is localhost, no password
-
-The subdirectory server contains what should be copied to the PGDATA directory.
-If you do not overwrite the pg_hba.conf then remember to comment out all lines
-starting with "host all".
-
-For the tests the sslinfo module must be installed into every database.
-The ssl=on must be set in postgresql.conf
-
-The following command creates the databases and installs the sslinfo module.
-
-for db in hostssldb hostnossldb certdb hostsslcertdb; do
- createdb $db
- psql $db -c "create extension sslinfo"
-done
-
-The username for connecting to postgres as specified in build.local.properties tests has to be "test".
-
diff --git a/certdir/badclient.crt b/certdir/badclient.crt
deleted file mode 100644
index 4f37a71..0000000
--- a/certdir/badclient.crt
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC3jCCAkegAwIBAgIJAIHg5fMq+z8aMA0GCSqGSIb3DQEBBQUAMFQxCzAJBgNV
-BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX
-aWRnaXRzIFB0eSBMdGQxDTALBgNVBAMTBHRlc3QwHhcNMTExMTEwMjE0MjI3WhcN
-MjExMTA3MjE0MjI3WjBUMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0
-ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQ0wCwYDVQQDEwR0
-ZXN0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDbMINU6XwQ/0OSQ4xYRp0o
-gYzzsaaGgZjBZEpRMCZkB+TPUD/yxDpyfcknsvsBQPQ0bqLLS9yqf5iS26jHGd4U
-/nInOy5rjIKEbJMUgkbNWiuVl5q1K+GFuTEpjpdLI9NH5X+jL1CxH/h8+j8Mr2iX
-s4C2gIFu6povShJiIwBNBQIDAQABo4G3MIG0MB0GA1UdDgQWBBQ6L/fB+7uwDN9q
-T5Do9X4GIbJnxDCBhAYDVR0jBH0we4AUOi/3wfu7sAzfak+Q6PV+BiGyZ8ShWKRW
-MFQxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJ
-bnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxDTALBgNVBAMTBHRlc3SCCQCB4OXzKvs/
-GjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAKq2Q+aE5eC04gW58pAt
-pobnL/2L0JHCeLPsv0k/1vjulzjBuphbwaibZtiYWZSDKWL8Dvsg+khq7rEIY0W6
-xXGw5y2scRlCukQvseIxbHUoyOCAWJnoqr7d8MyxP2GlpqSDXHk9wEywZ/6f89oN
-yudtXjoYuW8157tmvrX3D1yd
------END CERTIFICATE-----
diff --git a/certdir/badclient.key b/certdir/badclient.key
deleted file mode 100644
index efc9b6c..0000000
--- a/certdir/badclient.key
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-Proc-Type: 4,ENCRYPTED
-DEK-Info: DES-EDE3-CBC,95718EE22B89E019
-
-78LEg7uq4krPR3C1sQVCiQsPIXroyoDzPHBFmI+ipEJq7obFACK9KROfUAaMlca8
-ZR1UhtQHCPK4TOG1qKjn8lxeKGLZA25Lcilw6QvZCfNyBa6JUp3cdwzUSv7/qE/Y
-d/wlVAq71JbOmYsbEwunZlq+DO1AaL91N/2ANgSSC85uR0dye0iZ1C0OZzawMXkd
-wXRrXb8c8RCH2gQ6V4aMartTZ/DQznA59+NEUYln5IMP4joRM0TTpcuv6oCq1UUw
-o7xEQcwfBB0tKayxkBfgp8Jvrghzw0usSFt4ad9I4DF/V2izojZgYsnT7yGqsop6
-7jmPR9llYhDQIZd0V4NZziiRF2Dt/lyG0iUPZq5vlhLaI59FzMAxVSAJP6DrUHQD
-L76TeGpQm2LRqWliDc+3AMTCKv0TP1IPbIWJrnLxnNf/C29adO+VSeQEQ0+tBU+/
-DE2GVsQ/xul+QyCwXiOce0pfERLuGjSu/kRa1ylAlrdH4+6vBD0ewuXXHv0eTSxB
-Vi0vde5a9PzPUMUBkg6PS7IDYJmKm04fFPxx3y8GMlzbZYOYjTepkYMbayekybGK
-fHVk9Z3lW5yzegaz8iJu/8le6Kn4Ox21FRG45domu1T+8eJuXPoiBUb290SUVuxh
-VTQWhCA8ElmVCYfrbSnYL3naeqVL+Oc6by3VVhvgiqUuXQTZvKN7mkUOhiNbpz2H
-iGLwlRj6wXEaS0qLb9NQc9H9Vv6ftj7UPa4FkiJjWhUW0WkA5sqtOKMjLzpsIZtR
-dFb26NE65tk0lrywQrzMBFM6fk90VrMYyvwukZIJIKRLCBQaG24PLQ==
------END RSA PRIVATE KEY-----
diff --git a/certdir/badclient.pk8 b/certdir/badclient.pk8
deleted file mode 100644
index cebb2d7..0000000
Binary files a/certdir/badclient.pk8 and /dev/null differ
diff --git a/certdir/badroot.crt b/certdir/badroot.crt
deleted file mode 100644
index 88ffbcf..0000000
--- a/certdir/badroot.crt
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC7zCCAligAwIBAgIJANwlio9cWdoXMA0GCSqGSIb3DQEBBQUAMFkxCzAJBgNV
-BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX
-aWRnaXRzIFB0eSBMdGQxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMTExMTAyMTQy
-NTdaFw0yMTExMDcyMTQyNTdaMFkxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21l
-LVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEjAQBgNV
-BAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA055WKnuQ
-i6RPdI3LEtx8ztXV7BuiYihPXCRYUahLyF4TAzNGfmqsdQhqUlqzr1P+nlqxh8sm
-hZGS4NtGPaEjrbPgsBsTVg0XBKpH5yf2RIhBtvAaDG+cCFBjM+LJGzc4we59JkB6
-n1a/22iSFsCAm+BFBwHk6FqF7u2gGSUOrI0CAwEAAaOBvjCBuzAdBgNVHQ4EFgQU
-rw3IpiBN56GCi44/goVmHlZdmJswgYsGA1UdIwSBgzCBgIAUrw3IpiBN56GCi44/
-goVmHlZdmJuhXaRbMFkxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRl
-MSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEjAQBgNVBAMTCWxv
-Y2FsaG9zdIIJANwlio9cWdoXMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD
-gYEAa08IbYDJsgc45mYG/mviionvhBGs9BS2YapZDIREc/vd0W4FIzHXh5oTJAdF
-fkPjvHoczPuzGX8EKMBjANPs7h4Cd5xKSSE2Su+QwmZOxVg6eIeQwVZsY7SZFmkC
-Y2XwdxWvk3VzLdjgj/McmSBp4/aJUGRP6f5ehnR4B1ykVss=
------END CERTIFICATE-----
diff --git a/certdir/goodclient.crt b/certdir/goodclient.crt
deleted file mode 100644
index a45ae6c..0000000
--- a/certdir/goodclient.crt
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC3jCCAkegAwIBAgIJAM9GGWA8iSiIMA0GCSqGSIb3DQEBBQUAMFQxCzAJBgNV
-BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX
-aWRnaXRzIFB0eSBMdGQxDTALBgNVBAMTBHRlc3QwHhcNMTExMTEwMjE0MTQ3WhcN
-MjExMTA3MjE0MTQ3WjBUMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0
-ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQ0wCwYDVQQDEwR0
-ZXN0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCns68NbjKQAnHCpmN6amR1
-GdtliqiXDaCjoeBPpVXNQ/ZhqinP9gnDyRPXC5kPqw5/6GqNHcYJqg+IIS8G85Rq
-t3Cs5ZL+JlEDAwd0CkD0Ey5h0oJNfN1bDhV2e/yqc831ElBGK6VItGqKopSUV2y/
-pNijOOdeMZ8GuktT+9mbAQIDAQABo4G3MIG0MB0GA1UdDgQWBBTE93pAIzHiFRFw
-IU38WhnwXm03GzCBhAYDVR0jBH0we4AUxPd6QCMx4hURcCFN/FoZ8F5tNxuhWKRW
-MFQxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJ
-bnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxDTALBgNVBAMTBHRlc3SCCQDPRhlgPIko
-iDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAKUsXLsp3i9Tsj1wp46R
-4IkIjwWT1bN3+JOjmA9aqwEVcxTRSStAa5kfTQwc4QSAgHK1oFPsA8gsv3sftYmZ
-MtvYrvba8cOPonuaCrvtJQMvKgv3d10S6esUGlW+5o3PVPUq5yQ7OaN5JHCDTZGS
-phuxlq7//rNjvypX2hbKUj6z
------END CERTIFICATE-----
diff --git a/certdir/goodclient.key b/certdir/goodclient.key
deleted file mode 100644
index 37d2ac5..0000000
--- a/certdir/goodclient.key
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-Proc-Type: 4,ENCRYPTED
-DEK-Info: DES-EDE3-CBC,D2A0607D6E4CE1FD
-
-/RMZp/vNTiHiAqVGyByL9Zms7sFWECqpDof6X1jzex7JWi7cjTzKDZiVyqmDfUU3
-A2v8dbMFQfak4tfpeWqx+HPkVX/GNTFhTI/Ic48+d/9iETwu4d0uMHyrX97GDzWt
-72NbBdby16s+Lwp7Gu5WQ2fUwJVagHAD4nrHBP5yjOStf6l8CWSiCUTJCfSYxtR4
-eH3NtnmNE6/E8yodoUJhkNQDcPhP+cbXv5waEYWpoOJQ9G78JeQ+MKI8AEz+19UA
-vAJDrWBjEgxrKK17qqL8+gxm09RzOt5z4QACt8nsJUV80FCENwIxHOlF8ZXc3Nfz
-7wX6+F8LEvDL2Tf4fEELcigHnlf3N5/8iRd0MmAiB+4lRW8tYY3TnSS7fVLTJ/RJ
-C5xdTr80zrM2sgqKbWtPKMSiXWCZGT81FpJ+bne4KAC868sZ71SzG3QiEt72z+On
-fIN0qB31V0wZB+ZCAU0Me138F9BH7rQALVM619f7OUDMEA2Mbnhej4eblqHnc1MY
-/JS4HRa6OnSaQJs2KR2+zqadAa9Z1d3dJhVAZ0bPBJ43xCZDuv+33POv1fXJ21us
-wcy+OrDyEWR27QpWWkOfwvc4txLqxQ4QlNqApIQYV4nWD220ZM9L49KSCqfG2VHN
-vFhjLKTj/oMKJZll/V58Qc3JPj14FKJD5ODfg2LOFst/vA7UhkV1MRar8rlqzIBa
-LGl4zgZCDlFlUmiymXmCSC6LrxD78oHT4EMJFk2fK/lAgW5i4E/qFGHUl8rCqNR3
-Lpo0YYC4hu5hh1aWuxUyMiXQrnCXTbrXj1svTksD/cTCwjRHQ8hpzA==
------END RSA PRIVATE KEY-----
diff --git a/certdir/goodclient.pk8 b/certdir/goodclient.pk8
deleted file mode 100644
index 50af771..0000000
Binary files a/certdir/goodclient.pk8 and /dev/null differ
diff --git a/certdir/goodroot.crt b/certdir/goodroot.crt
deleted file mode 100644
index 09c853d..0000000
--- a/certdir/goodroot.crt
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC7zCCAligAwIBAgIJAOjCfnzSGkPLMA0GCSqGSIb3DQEBBQUAMFkxCzAJBgNV
-BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX
-aWRnaXRzIFB0eSBMdGQxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMTExMTAyMTQz
-NTdaFw0yMTExMDcyMTQzNTdaMFkxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21l
-LVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEjAQBgNV
-BAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApE4i3cM5
-zVAgfw8juoNN9kh/jiqZexQTUgQUrjQAMStSBVvPeoPcShbXYAZFCkICZlPdRrjY
-rCyJfdFkII5W+CRh5uNPuv30NDMkCdDYvre02EsOhpmuXaJcUPL24vlTe+9+su4U
-Hjy7FxOrQLe4S4kB7CNEE0lqLVDr5gXOKGkCAwEAAaOBvjCBuzAdBgNVHQ4EFgQU
-0Cs8cRK/hNU0+IkSJO+rxuebtmcwgYsGA1UdIwSBgzCBgIAU0Cs8cRK/hNU0+IkS
-JO+rxuebtmehXaRbMFkxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRl
-MSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEjAQBgNVBAMTCWxv
-Y2FsaG9zdIIJAOjCfnzSGkPLMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD
-gYEATKWuep0dRQdOwO3QSOYZX3bmbgbMX5rIMn8RT3a/SX4ZD5MSZSqgVOjdmj/I
-kRnlGTyexXIXgKxps4WefCuU8uFqEfGE/yKRD1Lxy4AVve9soPddKtxTAbq1TNXr
-A/5bu1Qqf4tSx48qlQkWbj3Okz2yDbWEjYXWoG3ky4CCtfc=
------END CERTIFICATE-----
diff --git a/certdir/server/pg_hba.conf b/certdir/server/pg_hba.conf
deleted file mode 100644
index 9ce9fec..0000000
--- a/certdir/server/pg_hba.conf
+++ /dev/null
@@ -1,80 +0,0 @@
-# PostgreSQL Client Authentication Configuration File
-# ===================================================
-#
-# Refer to the "Client Authentication" section in the
-# PostgreSQL documentation for a complete description
-# of this file. A short synopsis follows.
-#
-# This file controls: which hosts are allowed to connect, how clients
-# are authenticated, which PostgreSQL user names they can use, which
-# databases they can access. Records take one of these forms:
-#
-# local DATABASE USER METHOD [OPTIONS]
-# host DATABASE USER CIDR-ADDRESS METHOD [OPTIONS]
-# hostssl DATABASE USER CIDR-ADDRESS METHOD [OPTIONS]
-# hostnossl DATABASE USER CIDR-ADDRESS METHOD [OPTIONS]
-#
-# (The uppercase items must be replaced by actual values.)
-#
-# The first field is the connection type: "local" is a Unix-domain socket,
-# "host" is either a plain or SSL-encrypted TCP/IP socket, "hostssl" is an
-# SSL-encrypted TCP/IP socket, and "hostnossl" is a plain TCP/IP socket.
-#
-# DATABASE can be "all", "sameuser", "samerole", a database name, or
-# a comma-separated list thereof.
-#
-# USER can be "all", a user name, a group name prefixed with "+", or
-# a comma-separated list thereof. In both the DATABASE and USER fields
-# you can also write a file name prefixed with "@" to include names from
-# a separate file.
-#
-# CIDR-ADDRESS specifies the set of hosts the record matches.
-# It is made up of an IP address and a CIDR mask that is an integer
-# (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that specifies
-# the number of significant bits in the mask. Alternatively, you can write
-# an IP address and netmask in separate columns to specify the set of hosts.
-#
-# METHOD can be "trust", "reject", "md5", "password", "gss", "sspi", "krb5",
-# "ident", "pam", "ldap" or "cert". Note that "password" sends passwords
-# in clear text; "md5" is preferred since it sends encrypted passwords.
-#
-# OPTIONS are a set of options for the authentication in the format
-# NAME=VALUE. The available options depend on the different authentication
-# methods - refer to the "Client Authentication" section in the documentation
-# for a list of which options are available for which authentication methods.
-#
-# Database and user names containing spaces, commas, quotes and other special
-# characters must be quoted. Quoting one of the keywords "all", "sameuser" or
-# "samerole" makes the name lose its special character, and just match a
-# database or username with that name.
-#
-# This file is read on server startup and when the postmaster receives
-# a SIGHUP signal. If you edit the file on a running system, you have
-# to SIGHUP the postmaster for the changes to take effect. You can use
-# "pg_ctl reload" to do that.
-
-# Put your actual configuration here
-# ----------------------------------
-#
-# If you want to allow non-local connections, you need to add more
-# "host" records. In that case you will also need to make PostgreSQL listen
-# on a non-local interface via the listen_addresses configuration parameter,
-# or via the -i or -h command line switches.
-#
-
-# CAUTION: Configuring the system for local "trust" authentication allows
-# any local user to connect as any PostgreSQL user, including the database
-# superuser. If you do not trust all your local users, use another
-# authentication method.
-
-
-# TYPE DATABASE USER CIDR-ADDRESS METHOD
-
-# "local" is for Unix domain socket connections only
-local all all ident
-# IPv4 local connections:
-host hostdb all 127.0.0.1/32 md5
-hostnossl hostnossldb all 127.0.0.1/32 md5
-hostssl hostssldb all 127.0.0.1/32 md5 clientcert=0
-hostssl hostsslcertdb all 127.0.0.1/32 md5 clientcert=1
-hostssl certdb all 127.0.0.1/32 cert
diff --git a/certdir/server/root.crt b/certdir/server/root.crt
deleted file mode 100644
index a45ae6c..0000000
--- a/certdir/server/root.crt
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC3jCCAkegAwIBAgIJAM9GGWA8iSiIMA0GCSqGSIb3DQEBBQUAMFQxCzAJBgNV
-BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX
-aWRnaXRzIFB0eSBMdGQxDTALBgNVBAMTBHRlc3QwHhcNMTExMTEwMjE0MTQ3WhcN
-MjExMTA3MjE0MTQ3WjBUMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0
-ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQ0wCwYDVQQDEwR0
-ZXN0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCns68NbjKQAnHCpmN6amR1
-GdtliqiXDaCjoeBPpVXNQ/ZhqinP9gnDyRPXC5kPqw5/6GqNHcYJqg+IIS8G85Rq
-t3Cs5ZL+JlEDAwd0CkD0Ey5h0oJNfN1bDhV2e/yqc831ElBGK6VItGqKopSUV2y/
-pNijOOdeMZ8GuktT+9mbAQIDAQABo4G3MIG0MB0GA1UdDgQWBBTE93pAIzHiFRFw
-IU38WhnwXm03GzCBhAYDVR0jBH0we4AUxPd6QCMx4hURcCFN/FoZ8F5tNxuhWKRW
-MFQxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJ
-bnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxDTALBgNVBAMTBHRlc3SCCQDPRhlgPIko
-iDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAKUsXLsp3i9Tsj1wp46R
-4IkIjwWT1bN3+JOjmA9aqwEVcxTRSStAa5kfTQwc4QSAgHK1oFPsA8gsv3sftYmZ
-MtvYrvba8cOPonuaCrvtJQMvKgv3d10S6esUGlW+5o3PVPUq5yQ7OaN5JHCDTZGS
-phuxlq7//rNjvypX2hbKUj6z
------END CERTIFICATE-----
diff --git a/certdir/server/server.crt b/certdir/server/server.crt
deleted file mode 100644
index 09c853d..0000000
--- a/certdir/server/server.crt
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC7zCCAligAwIBAgIJAOjCfnzSGkPLMA0GCSqGSIb3DQEBBQUAMFkxCzAJBgNV
-BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX
-aWRnaXRzIFB0eSBMdGQxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMTExMTAyMTQz
-NTdaFw0yMTExMDcyMTQzNTdaMFkxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21l
-LVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEjAQBgNV
-BAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApE4i3cM5
-zVAgfw8juoNN9kh/jiqZexQTUgQUrjQAMStSBVvPeoPcShbXYAZFCkICZlPdRrjY
-rCyJfdFkII5W+CRh5uNPuv30NDMkCdDYvre02EsOhpmuXaJcUPL24vlTe+9+su4U
-Hjy7FxOrQLe4S4kB7CNEE0lqLVDr5gXOKGkCAwEAAaOBvjCBuzAdBgNVHQ4EFgQU
-0Cs8cRK/hNU0+IkSJO+rxuebtmcwgYsGA1UdIwSBgzCBgIAU0Cs8cRK/hNU0+IkS
-JO+rxuebtmehXaRbMFkxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRl
-MSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEjAQBgNVBAMTCWxv
-Y2FsaG9zdIIJAOjCfnzSGkPLMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD
-gYEATKWuep0dRQdOwO3QSOYZX3bmbgbMX5rIMn8RT3a/SX4ZD5MSZSqgVOjdmj/I
-kRnlGTyexXIXgKxps4WefCuU8uFqEfGE/yKRD1Lxy4AVve9soPddKtxTAbq1TNXr
-A/5bu1Qqf4tSx48qlQkWbj3Okz2yDbWEjYXWoG3ky4CCtfc=
------END CERTIFICATE-----
diff --git a/certdir/server/server.key b/certdir/server/server.key
deleted file mode 100644
index f3db7c5..0000000
--- a/certdir/server/server.key
+++ /dev/null
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXAIBAAKBgQCkTiLdwznNUCB/DyO6g032SH+OKpl7FBNSBBSuNAAxK1IFW896
-g9xKFtdgBkUKQgJmU91GuNisLIl90WQgjlb4JGHm40+6/fQ0MyQJ0Ni+t7TYSw6G
-ma5dolxQ8vbi+VN7736y7hQePLsXE6tAt7hLiQHsI0QTSWotUOvmBc4oaQIDAQAB
-AoGAXkP1/QVkxEaUXlFxTjDHKeWuSQJnzBVYgFWXB9sNwSf5htmFz+SXHmq8Znsy
-YRA+EDdNXKXwqddjiqv3pjYD7q6TgzF4D32/NwZGfF7VzBDj2fXpVxjSMZpsHixq
-7GIMUTZxzqTlUMmozEFCgHycN84Pw9dmPpJ6FerqsxhPA4ECQQDQfIZuhBhBqinP
-qHs1ttZQ1VIgJvCnjXXovyQF0fo53xhCqBIHAPQk/zbFDEjdH54e2gSYekBSvtwD
-Dy9KmjbjAkEAyb//56WAYY3gFYBVDSyCZF5Afax0KS/eDYKlPiF45BtdxhdNTY6M
-56C1+K3FiAuTMzNUbfXnDq9mZ1lZreX5QwJBAMx1gqS5WMx044Ip2YMI5s7pFRxA
-8/ttiHeTk/E9RmcgubsM9nj133i07PJ7pK1uR3Q8HQunwJMlZ8B8UMWZzT8CQBD7
-zcIlZ4pO1DdbJ03FmnByksFBnEG/WtUOU3TIgpHJT/qWCZbm0ivJlqgJkOBkAQ9F
-We0rzzioQVmf5vHBs1sCQDCEzTU8Ge/BrWtd1EP9JVx7aFY8c5bRvj+3FPp+43Ep
-5kc1lJK8EINevxykfJ4f94S6GPLuSFfIWEys//WrH14=
------END RSA PRIVATE KEY-----
diff --git a/doc/pgjdbc.xml b/doc/pgjdbc.xml
deleted file mode 100644
index 5f6f04e..0000000
--- a/doc/pgjdbc.xml
+++ /dev/null
@@ -1,3383 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Copyright (c) 2004-2011, PostgreSQL Global Development Group
--->
-
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
-
-<book id="jdbc">
- <title>The <productname>PostgreSQL</productname> <acronym>JDBC</acronym> Interface</title>
-
- <chapter id="intro">
- <title>Introduction</title>
-
- <para>
- <acronym>JDBC</acronym> is a core <acronym>API</acronym> of Java 1.1 and later.
- It provides a standard set of
- interfaces to <acronym>SQL</acronym>-compliant databases.
- </para>
-
- <para>
- <productname>PostgreSQL</productname> provides a <firstterm>type
- 4</firstterm> <acronym>JDBC</acronym> driver. Type 4 indicates
- that the driver is written in Pure Java, and communicates in the
- database system's own network protocol. Because of this, the driver
- is platform independent; once compiled, the driver can be used on
- any system.
- </para>
-
- <para>
- This manual is not intended as a complete guide to
- <acronym>JDBC</acronym> programming, but should help to get you
- started. For more information refer to the standard
- <acronym>JDBC</acronym> <acronym>API</acronym> documentation.
- Also, take a look at the examples included with the source.
- </para>
- </chapter>
-
- <chapter id="setup">
- <title>Setting up the <acronym>JDBC</acronym> Driver</title>
-
- <para>
- This section describes the steps you need to take before you can
- write or run programs that use the <acronym>JDBC</acronym> interface.
- </para>
-
- <sect1 id="build">
- <title>Getting the Driver</title>
-
- <para>
- Precompiled versions of the driver can be downloaded from
- the <ulink
- url="http://jdbc.postgresql.org"><productname>PostgreSQL</productname>
- <acronym>JDBC</acronym> web site</ulink>.
- </para>
-
- <para>
- Alternatively you can build the driver from source, but you should
- only need to do this if you are making changes to the source code.
- To build the <acronym>JDBC</acronym> driver, you need
- <application>Ant</application> 1.5 or higher and a <acronym>JDK</acronym>.
- <application>Ant</application> is a special tool for building
- Java-based packages. It can be downloaded from the <ulink
- url="http://ant.apache.org/index.html"><application>Ant</application>
- web site</ulink>.
- </para>
-
- <para>
- If you have several Java compilers installed, it depends on the
- Ant configuration which one gets used. Precompiled
- <application>Ant</application> distributions are typically set up
- to read a file <filename>.antrc</filename> in the current user's
- home directory for configuration. For example, to use a different
- <acronym>JDK</acronym> than the default, this may work:
-<programlisting>
-JAVA_HOME=/usr/local/jdk1.6.0_07
-JAVACMD=$JAVA_HOME/bin/java
-</programlisting>
- </para>
-
- <para>
- To compile the driver simply run <command>ant</command> in the top level
- directory. The compiled driver will be placed in <filename>jars/postgresql.jar</filename>.
- The resulting driver will be built for the version of Java you are
- running. If you build with a 1.4 or 1.5
- <acronym>JDK</acronym> you will build a version that supports the
- <acronym>JDBC</acronym> 3 specification and if you build
- with a 1.6 or higher <acronym>JDK</acronym> you will build a version that
- supports the <acronym>JDBC</acronym> 4 specification.
- </para>
- </sect1>
-
- <sect1 id="classpath">
- <title>Setting up the Class Path</title>
-
- <indexterm zone="classpath">
- <primary>class path</primary>
- </indexterm>
-
- <indexterm zone="classpath">
- <primary>CLASSPATH</primary>
- </indexterm>
-
- <para>
- To use the driver, the JAR archive (named
- <filename>postgresql.jar</filename> if you built from source, otherwise
- it will likely be named with the following convention:
- <filename>postgresql-<replaceable>[server version]</replaceable>.<replaceable>[buildnumber]</replaceable>.jdbc<replaceable>[JDBC version]</replaceable>.jar</filename>,
- for example <filename>postgresql-8.0-310.jdbc3.jar</filename>)
- needs to be included in the class path, either by putting it in the
- <envar>CLASSPATH</envar> environment variable, or by using flags on the
- <command>java</command> command line.
- </para>
-
- <para>
- For instance, assume we have an application that uses the
- <acronym>JDBC</acronym> driver to access a database, and that
- application is installed as
- <filename>/usr/local/lib/myapp.jar</filename>. The
- <productname>PostgreSQL</productname> <acronym>JDBC</acronym> driver installed as
- <filename>/usr/local/pgsql/share/java/postgresql.jar</filename>. To run
- the application, we would use:
-<programlisting>
-export CLASSPATH=/usr/local/lib/myapp.jar:/usr/local/pgsql/share/java/postgresql.jar:.
-java MyApp
-</programlisting>
- </para>
-
- <para>
- Loading the driver from within the application is covered in
- <xref linkend="use"/>.
- </para>
- </sect1>
-
- <sect1 id="prepare">
- <title>Preparing the Database Server for <acronym>JDBC</acronym></title>
-
- <para>
- Because Java does not support using unix sockets the
- <productname>PostgreSQL</productname> server must be configured to
- allow <acronym>TCP/IP</acronym> connections. Starting with server
- version 8.0 <acronym>TCP/IP</acronym> connections are allowed from
- <literal>localhost</literal>. To allow connections to other interfaces
- than the loopback interface, you must modify the
- <filename>postgresql.conf</filename> file's
- <literal>listen_addresses</literal> setting.
- </para>
-
- <para>
- For server versions prior to 8.0 the server does not listen on any
- interface by default, and you must set
- <literal>tcpip_socket = true</literal> in the
- <filename>postgresql.conf</filename> file.
- </para>
-
- <para>
- Once you have made sure the server is correctly listening for
- <acronym>TCP/IP</acronym> connections the next step is to verify
- that users are allowed to connect to the server. Client authentication
- is setup in <filename>pg_hba.conf</filename>.
- Refer to the main <productname>PostgreSQL</productname> documentation for
- details. The <acronym>JDBC</acronym> driver supports the
- <literal>trust</literal>, <literal>ident</literal>,
- <literal>password</literal>, <literal>md5</literal>, and
- <literal>crypt</literal> authentication methods.
- </para>
- </sect1>
-
- <sect1 id="your-database">
- <title>Creating a Database</title>
-
- <para>
- When creating a database to be accessed via <acronym>JDBC</acronym>
- it is important to select an appropriate encoding for your data. Many
- other client interfaces do not care what data you send back and forth,
- and will allow you to do inappropriate things, but Java makes sure that
- your data is correctly encoded. Do not use a database that uses the
- <literal>SQL_ASCII</literal> encoding. This is not a real
- encoding and you will have problems the moment you store data in it that
- does not fit in the seven bit <acronym>ASCII</acronym> character set.
- If you do not know what your encoding will be or are otherwise unsure
- about what you will be storing the <literal>UTF8</literal> encoding
- is a reasonable default to use.
- </para>
- </sect1>
- </chapter>
-
- <chapter id="use">
- <title>Initializing the Driver</title>
-
- <para>
- This section describes how to load and initialize the <acronym>JDBC</acronym>
- driver in your programs.
- </para>
-
- <sect1 id="import">
- <title>Importing <acronym>JDBC</acronym></title>
-
- <para>
- Any source that uses <acronym>JDBC</acronym> needs to import the
- <literal>java.sql</literal> package, using:
-
-<programlisting>
-import java.sql.*;
-</programlisting>
- </para>
-
- <note>
- <para>
- You should not import the <literal>org.postgresql</literal> package
- unless you are using not standard <productname>PostgreSQL</productname>
- extensions to the <acronym>JDBC</acronym> <acronym>API</acronym>.
- </para>
- </note>
- </sect1>
-
- <sect1 id="load">
- <title>Loading the Driver</title>
-
- <note>
- <para>
- Starting from Java 6.0 it is enough to add the postgresql driver to the class path
- because the <productname>PostgreSQL</productname> <acronym>JDBC</acronym>
- driver supports the new auto-loading feature. You can safely ignore rest of the section.
- </para>
- </note>
-
- <para>
- In Java 5.0 or older, before you can connect to a database, you need to load the
- driver. There are two methods available, and it depends on your
- code which is the best one to use.
- </para>
-
- <para>
- In the first method, your code implicitly loads the driver using the
- <function>Class.forName()</function> method.
- For <productname>PostgreSQL</productname>, you would use:
-
-<programlisting>
-Class.forName("org.postgresql.Driver");
-</programlisting>
-
- This will load the driver, and while loading, the driver will automatically
- register itself with <acronym>JDBC</acronym>.
- </para>
-
- <note>
- <para>
- The <function>forName()</function> method can throw a
- <classname>ClassNotFoundException</classname> if the driver is
- not available.
- </para>
- </note>
-
- <para>
- This is the most common method to use, but restricts your code to
- use just <productname>PostgreSQL</productname>. If your code may
- access another database system in the future, and you do not use
- any <productname>PostgreSQL</productname>-specific extensions, then
- the second method is advisable.
- </para>
-
- <para>
- The second method passes the driver as a parameter to the
- <acronym>JVM</acronym> as it starts, using the <option>-D</option>
- argument. Example:
-<programlisting>
-java -Djdbc.drivers=org.postgresql.Driver example.ImageViewer
-</programlisting>
- In this example, the <acronym>JVM</acronym> will attempt to load
- the driver as part of its initialization. Once done, the
- <classname>ImageViewer</classname> is started.
- </para>
-
- <para>
- Now, this method is the better one to use because it allows your
- code to be used with other database packages without recompiling
- the code. The only thing that would also change is the connection
- <acronym>URL</acronym>, which is covered next.
- </para>
-
- <para>
- One last thing: When your code then tries to open a
- <classname>Connection</classname>, and you get a <errorname>No
- driver available</errorname> <classname>SQLException</classname>
- being thrown, this is probably caused by the driver not being in
- the class path, or the value in the parameter not being correct.
- </para>
- </sect1>
-
- <sect1 id="connect">
- <title>Connecting to the Database</title>
-
- <para>
- With <acronym>JDBC</acronym>, a database is represented by a
- <acronym>URL</acronym> (Uniform Resource Locator). With
- <productname>PostgreSQL</productname>, this takes one of the
- following forms:
-
- <itemizedlist>
- <listitem>
-<synopsis>
-jdbc:postgresql:<replaceable class="parameter">database</replaceable>
-</synopsis>
- </listitem>
-
- <listitem>
-<synopsis>
-jdbc:postgresql://<replaceable class="parameter">host</replaceable>/<replaceable class="parameter">database</replaceable>
-</synopsis>
- </listitem>
-
- <listitem>
-<synopsis>
-jdbc:postgresql://<replaceable class="parameter">host</replaceable>:<replaceable class="parameter">port</replaceable>/<replaceable class="parameter">database</replaceable>
-</synopsis>
- </listitem>
- </itemizedlist>
-
- The parameters have the following meanings:
-
- <variablelist>
- <varlistentry>
- <term>
- <replaceable class="parameter">host</replaceable>
- </term>
- <listitem>
- <para>
- The host name of the server. Defaults to <literal>localhost</literal>.
- To specify an IPv6 address your must enclose the
- <replaceable class="parameter">host</replaceable> parameter
- with square brackets, for example:
-<programlisting>
-jdbc:postgresql://[::1]:5740/accounting
-</programlisting>
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>
- <replaceable class="parameter">port</replaceable>
- </term>
- <listitem>
- <para>
- The port number the server is listening on. Defaults to the
- <productname>PostgreSQL</productname> standard port number (5432).
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>
- <replaceable class="parameter">database</replaceable>
- </term>
- <listitem>
- <para>
- The database name.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
-
- <para>
- To connect, you need to get a <classname>Connection</classname> instance from
- <acronym>JDBC</acronym>. To do this,
- you use the <function>DriverManager.getConnection()</function> method:
-
-<programlisting>
-Connection db = DriverManager.getConnection(url, username, password);
-</programlisting>
- </para>
-
- <sect2 id="connection-parameters">
- <title>Connection Parameters</title>
-
- <para>
- In addition to the standard connection parameters the driver supports a
- number of additional properties which can be used to specify additional
- driver behavior specific to <productname>PostgreSQL</productname>. These
- properties may be specified in either the connection
- <acronym>URL</acronym> or an additional
- <classname>Properties</classname> object parameter to
- <function>DriverManager.getConnection</function>. The following
- examples illustrate the use of both methods to establish a SSL
- connection.
-
-<programlisting>
-String url = "jdbc:postgresql://localhost/test";
-Properties props = new Properties();
-props.setProperty("user","fred");
-props.setProperty("password","secret");
-props.setProperty("ssl","true");
-Connection conn = DriverManager.getConnection(url, props);
-</programlisting>
-
-<programlisting>
-String url = "jdbc:postgresql://localhost/test?user=fred&password=secret&ssl=true";
-Connection conn = DriverManager.getConnection(url);
-</programlisting>
-
- <variablelist>
-
- <varlistentry>
- <term><varname>user</varname> = <type>String</type></term>
- <listitem>
- <para>
- The database user on whose behalf the connection is being made.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>password</varname> = <type>String</type></term>
- <listitem>
- <para>
- The database user's password.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>ssl</varname></term>
- <listitem>
- <para>
- Connect using <acronym>SSL</acronym>. The driver must have been
- compiled with <acronym>SSL</acronym> support. This property does
- not need a value associated with it. The mere presence of it
- specifies a <acronym>SSL</acronym> connection. However, for
- compatibility with future versions, the value "true" is
- preferred. For more information see <xref linkend="ssl" />.
- </para>
- <para>Alternatively <literal>sslmode</literal> can be used.</para>
- </listitem>
- </varlistentry>
-
-
-
- <varlistentry>
- <term><varname>sslmode</varname></term>
- <listitem>
- <para>
- Parameter governing the use of <acronym>SSL</acronym>. Similar to the
- libpq parameter, the allowed values are disable, require, verify-ca,
- verify-full. (allow and require are not implemented.)
- The use of parameter <literal>ssl</literal> is discouraged, as sslmode
- can cover all the possibilities, however, if sslmode is not
- set, the driver's behaviour is backward compatible.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>sslcert</varname></term>
- <listitem>
- <para>
- The location of the client's <acronym>SSL</acronym> certificate.
- The file format is compatible with libpq. If missing, the default
- locations are looked up (in $HOME/.postgresql under Linux).
- In some cases it is desirable
- to supress loading the default client certificate (and any other one),
- in this case specify sslcert with an empty argument.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>sslrootcert</varname></term>
- <listitem>
- <para>
- The location of the root certificate for authenticating the server.
- The file format is compatible with libpq. If missing, the default
- locations are looked up (in $HOME/.postgresql under Linux).
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>sslkey</varname></term>
- <listitem>
- <para>
- The location of the client's <acronym>SSL</acronym> key.
- The file must be in PKCS#8 format.
- The conversion can be made
- by the following openssl command:
-<programlisting>
-openssl pkcs8 -topk8 -in client.key -out client.pk8 -outform DER -v1 PBE-SHA1-3DES
-</programlisting>
- the ciphers, recognized by java are PBE-MD5-DES, PBE-SHA1-3DES,
- PBE-SHA1-RC2-40,
- or with the -nocrypt switch, it can be unencrypted.
- If missing, the default
- locations are looked up (in $HOME/.postgresql under Linux).
- The default filename for the key is postgresql.pk8
- instead of postgresql.key to allow simultaneous use of the jdbc driver
- and other libpq compatible applications.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>sslpassword</varname></term>
- <listitem>
- <para>
- The password for the client's ssl key (different from the database password).
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>sslpasswordcallback</varname></term>
- <listitem>
- <para>
- A class, implementing
- <classname>javax.security.auth.callback.CallbackHandler</classname>
- that can handle PassworCallback for the ssl password. If set,
- sslpassword is ignored.
- The supplied class must have either a constructor with a Properties
- argument where
- the connection info properties are given, or a zero argument constructor
- If neither sslpassword nor sslpasswordcallback is set, and the key is
- protected,
- the user is prompted at the console for a password
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>sslhostnameverifier</varname></term>
- <listitem>
- <para>
- A class, <classname>implementing javax.net.ssl.HostnameVerifier</classname>
- that can verify the server. The supplied class must have either a
- constructor
- with a Properties argument where the connection info properties are given,
- or a zero argument constructor. If set the server hostname is verified
- irrespective
- of the value of sslmode.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>sslfactory</varname> = <type>String</type></term>
- <listitem>
- <para>
- The provided value is a class name to use as the
- <classname>SSLSocketFactory</classname> when establishing a
- <acronym>SSL</acronym> connection.
- For more information see <xref linkend="ssl-factory"/>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>sslfactoryarg</varname> = <type>String</type></term>
- <listitem>
- <para>
- This value is an optional argument to the constructor of the
- <literal>sslfactory</literal> class provided above.
- For more information see <xref linkend="ssl-factory"/>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>compatible</varname> = <type>String</type></term>
- <listitem>
- <para>
- Act like an older version of the driver to retain compatibility with
- older applications. At the moment this controls two driver behaviours:
- the handling of binary data fields, and the handling of parameters set
- via <function>setString()</function>
- </para>
- <para>
- Older versions of the driver used this property to also control the
- protocol used to connect to the backend. This is now controlled by the
- <varname>protocolVersion</varname> property.
- </para>
- <para>
- Information on binary data handling is detailed in
- <xref linkend="binary-data" />. To force the use of
- Large Objects set the compatible property to 7.1.
- </para>
- <para>
- When <varname>compatible</varname> is set to <literal>7.4</literal> or
- below, the default for the <varname>stringtype</varname> parameter is
- changed to <literal>unspecified</literal>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>protocolVersion</varname> = <type>String</type></term>
- <listitem>
- <para>
- The driver supports both the V2 and V3 frontend/backend protocols.
- The V3 protocol was introduced in 7.4 and the driver will by default
- try to connect using the V3 protocol, if that fails it will fall
- back to the V2 protocol. If the protocolVersion property is
- specified, the driver will try only the specified protocol (which
- should be either "2" or "3"). Setting protocolVersion to "2" may
- be used to avoid the failed attempt to use the V3 protocol when
- connecting to a version 7.3 or earlier server, or to force the
- driver to use the V2 protocol despite connecting to a 7.4 or greater
- server.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>loglevel</varname> = <type>int</type></term>
- <listitem>
- <para>
- Set the amount of logging information printed to the DriverManager's
- current value for LogStream or LogWriter. It currently supports
- values of <literal>org.postgresql.Driver.DEBUG</literal> (2) and
- <literal>org.postgresql.Driver.INFO</literal> (1).
- <literal>INFO</literal> will log very little information while
- <literal>DEBUG</literal> will produce significant detail. This
- property is only really useful if you are a developer or are
- having problems with the driver.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>charSet</varname> = <type>String</type></term>
- <listitem>
- <para>
- The character set to use for data sent to the database or recieved
- from the database. This property is only relevent for server
- versions less than or equal to 7.2. The 7.3 release was the first
- with multibyte support compiled by default and the driver uses
- its character set translation facilities instead of trying to do
- it itself.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>allowEncodingChanges</varname> = <type>boolean</type></term>
- <listitem>
- <para>
- When using the V3 protocol the driver monitors changes in certain
- server configuration parameters that should not be touched by
- end users. The <literal>client_encoding</literal> setting is set
- by the driver and should not be altered. If the driver detects
- a change it will abort the connection. There is one legitimate
- exception to this behavior though, using the <literal>COPY</literal>
- command on a file residing on the server's filesystem. The only
- means of specifying the encoding of this file is by altering the
- <literal>client_encoding</literal> setting. The
- <acronym>JDBC</acronym> team considers this a failing of the
- <literal>COPY</literal> command and hopes to provide an alternate
- means of specifying the encoding in the future, but for now there
- is this <acronym>URL</acronym> parameter. Enable this only if
- you need to override the client encoding when doing a copy.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>logUnclosedConnections</varname> = <type>boolean</type></term>
- <listitem>
- <para>
- Clients may leak <classname>Connection</classname> objects by
- failing to call its <function>close()</function> method.
- Eventually these objects will be garbage collected and the
- <function>finalize()</function> method will be called which will
- close the <classname>Connection</classname> if caller has
- neglected to do this himself. The usage of a finalizer is just
- a stopgap solution. To help developers detect and correct the
- source of these leaks the <literal>logUnclosedConnections</literal>
- <acronym>URL</acronym> parameter has been added. It captures
- a stacktrace at each <classname>Connection</classname> opening
- and if the <function>finalize()</function> method is reached without
- having been closed the stacktrace is printed to the log.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>binaryTransfer</varname> = <type>boolean</type></term>
- <listitem>
- <para>
- The postgresql protocol v3 supports both binary and text transfer
- of fields. When binaryTransfer is enabled the driver
- requests binary transfer for all supported types. Using the binary
- transfer is more optimal for both the server and the client.
-
- Previously driver versions supported only text transfers. The old
- functionality can be obtained by setting this field to false.
-
- Currently the following column types currently support binary encoding:
- <literal>BYTEA</literal>, <literal>TIMEx</literal>,
- <literal>TIMESTAMP*</literal>, <literal>DATE</literal>,
- <literal>INT*</literal> and <literal>FLOAT*</literal>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>prepareThreshold</varname> = <type>int</type></term>
- <listitem>
- <para>
- Determine the number of <classname>PreparedStatement</classname>
- executions required before switching over to use server side prepared
- statements. The default is five, meaning start using server side
- prepared statements on the fifth execution of the same
- <classname>PreparedStatement</classname> object. More
- information on server side prepared
- statements is available in <xref linkend="server-prepare" />.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>loginTimeout</varname> = <type>int</type></term>
- <listitem>
- <para>
- Specify how long to wait for establishment of a database connection.
- The timeout is specified in seconds.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>socketTimeout</varname> = <type>int</type></term>
- <listitem>
- <para>
- The timeout value used for socket read operations. If reading
- from the server takes longer than this value, the connection is
- closed. This can be used as both a brute force global query
- timeout and a method of detecting network problems. The timeout
- is specified in seconds and a value of zero means that it is disabled.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>tcpKeepAlive</varname> = <type>boolean</type></term>
- <listitem>
- <para>
- Enable or disable TCP keep-alive probe. The default is
- <literal>false</literal>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>unknownLength</varname> = <type>int</type></term>
- <listitem>
- <para>
- Certain postgresql types such as <type>text</type> do not
- have a well defined length. When returning meta-data about
- these types through functions like
- <function>ResultSetMetaData.getColumnDisplaySize</function>
- and <function>ResultSetMetaData.getPrecision</function>
- we must provide a value and various client tools have
- different ideas about what they would like to see. This
- parameter specifies the length to return for types of
- unknown length.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>stringtype</varname> = <type>String</type></term>
- <listitem>
- <para>
- Specify the type to use when binding <classname>PreparedStatement</classname> parameters
- set via <function>setString()</function>. If <varname>stringtype</varname> is set to
- <literal>varchar</literal> (the default), such parameters will be sent to the server as
- <type>varchar</type> parameters. If <varname>stringtype</varname> is set to
- <literal>unspecified</literal>, parameters will be sent to the server as untyped values,
- and the server will attempt to infer an appropriate type. This is useful if you have an
- existing application that uses <function>setString()</function> to set parameters that
- are actually some other type, such as integers, and you are unable to change the
- application to use an appropriate method such as <function>setInt()</function>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>kerberosServerName</varname> = <type>String</type></term>
- <listitem>
- <para>
- The Kerberos service name to use when authenticating with GSSAPI. This is
- equivalent to libpq's PGKRBSRVNAME environment variable and defaults to
- "postgres".
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>jaasApplicationName</varname> = <type>String</type></term>
- <listitem>
- <para>
- Specifies the name of the <acronym>JAAS</acronym> system or application
- login configuration.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>ApplicationName</varname> = <type>String</type></term>
- <listitem>
- <para>
- Specifies the name of the application that is using the connection.
- This allows a database administrator to see what applications are
- connected to the server and what resources they are using through
- views like pg_stat_activity.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><varname>sendBufferSize</varname> = <type>int</type></term>
- <listitem>
- <para>
- Sets SO_SNDBUF on the connection stream
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><varname>recvBufferSize</varname> = <type>int</type></term>
- <listitem>
- <para>
- Sets SO_RCVBUF on the connection stream
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
-
- </sect2>
-
- </sect1>
-
- </chapter>
-
- <chapter id="ssl">
- <title>Using <acronym>SSL</acronym></title>
-
- <sect1 id="ssl-server">
- <title>Configuring the Server</title>
-
- <para>
- Configuring the <productname>PostgreSQL</productname> server for
- <acronym>SSL</acronym> is covered in the
- <ulink url="http://www.postgresql.org/docs/current/static/ssl-tcp.html">main documentation</ulink>,
- so it will not be repeated here. Before trying to access your
- <acronym>SSL</acronym> enabled server from Java, make sure you
- can get to it via <command>psql</command>. You should see output
- like the following if you have established a <acronym>SSL</acronym>
- connnection.
- </para>
-
-<programlisting>
-$ ./bin/psql -h localhost
-Welcome to psql 8.0.0rc5, the PostgreSQL interactive terminal.
-
-Type: \copyright for distribution terms
- \h for help with SQL commands
- \? for help with psql commands
- \g or terminate with semicolon to execute query
- \q to quit
-
-SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
-
-jurka=#
-</programlisting>
- </sect1>
-
- <sect1 id="ssl-client">
- <title>Configuring the Client</title>
-
- <para>
- If <acronym>SSL</acronym> is initiated by setting the <literal>ssl</literal>
- connection parameter, then unlike <application>psql</application> and other
- <application>libpq</application> based programs the
- <acronym>JDBC</acronym> driver does server certificate
- validation by default. This means that when establishing a
- <acronym>SSL</acronym> connection the <acronym>JDBC</acronym>
- driver will validate the server's identity preventing
- "man in the middle" attacks. It does this by checking that
- the server certificate is signed by a trusted authority. If
- you have a certificate signed by a global certificate authority
- (<acronym>CA</acronym>), there is nothing further to do
- because Java comes with copies of the most common CA's certificates.
- If you are dealing with a self-signed certificate though, you
- need to make this available to the Java client to enable it
- to validate the server's certificate.
-
- <note>
- <para>
- Only the <acronym>JDBC</acronym> 3 driver supports
- <acronym>SSL</acronym>. The 1.4 <acronym>JDK</acronym>
- was the first version to come bundled with <acronym>SSL</acronym>
- support. Previous <acronym>JDK</acronym> versions that wanted
- to use <acronym>SSL</acronym> could make use of the additional
- <acronym>JSSE</acronym> library, but it does not support the
- full range of features utilized by the
- <productname>PostgreSQL</productname> <acronym>JDBC</acronym>
- driver.
- </para>
- </note>
- </para>
-
-
- <para>
- To make the server certificate available to Java, the first step
- is to convert it to a form Java understands.
-
-<programlisting>
-openssl x509 -in server.crt -out server.crt.der -outform der
-</programlisting>
-
- From here the easiest thing to do is import this certificate into Java's
- system truststore.
-
-<programlisting>
-keytool -keystore $JAVA_HOME/lib/security/cacerts -alias postgresql -import -file server.crt.der
-</programlisting>
-
- The default password for the cacerts keystore is <literal>changeit</literal>. The alias to postgesql is not important and you may select any name you desire.
- </para>
-
- <para>
- If you do not have access to the system cacerts truststore you can create your own truststore.
-
-<programlisting>
-keytool -keystore mystore -alias postgresql -import -file server.crt.der
-</programlisting>
-
- When starting your Java application you must specify this keystore and
- password to use.
-
-<programlisting>
-java -Djavax.net.ssl.trustStore=mystore -Djavax.net.ssl.trustStorePassword=mypassword com.mycompany.MyApp
-</programlisting>
-
- In the event of problems extra debugging information is available
- by adding <literal>-Djavax.net.debug=ssl</literal> to your command
- line.
- </para>
-
- <para>
- To instruct the <acronym>JDBC</acronym> driver to try and establish
- a <acronym>SSL</acronym> connection you must add the connection
- <acronym>URL</acronym> parameter <literal>ssl=true</literal>.
- </para>
-
- <sect2 id="nonvalidating">
- <title>Using SSL without Certificate Validation</title>
-
- <para>
- In some situations it may not be possible to configure your Java
- environment to make the server certificate available, for example
- in an applet. For a large scale deployment it would be best to
- get a certificate signed by recognized certificate authority, but
- that is not always an option. The <acronym>JDBC</acronym> driver
- provides an option to establish a <acronym>SSL</acronym> connection
- without doing any validation, but please understand the risk
- involved before enabling this option.
- </para>
-
- <para>
- A non-validating connection is established via a custom
- <classname>SSLSocketFactory</classname> class that is provided with
- the driver. Setting the connection <acronym>URL</acronym>
- parameter
- <literal>sslfactory=org.postgresql.ssl.NonValidatingFactory</literal>
- will turn off all <acronym>SSL</acronym> validation.
- </para>
- </sect2>
-
- </sect1>
-
- <sect1 id="ssl-factory">
- <title>Custom SSLSocketFactory</title>
-
- <para>
- <productname>PostgreSQL</productname> provides a way for developers
- to customize how a <acronym>SSL</acronym> connection is established.
- This may be used to provide a custom certificate source or other
- extensions by allowing the developer to create their own
- <classname>SSLContext</classname> instance. The connection
- <acronym>URL</acronym> parameters
- <literal>sslfactory</literal> and <literal>sslfactoryarg</literal>
- allow the user to specify which custom class to use for creating
- the <classname>SSLSocketFactory</classname>. The class name specified
- by <literal>sslfactory</literal> must extend
- <classname>javax.net.ssl.SSLSocketFactory</classname> and be available
- to the driver's classloader. This class
- must have a zero argument constructor or a single argument
- constructor taking a <type>Properies</type> argument where the connection
- properties are passed or a single argument constructor taking a
- <type>String</type> argument. This argument
- may optionally be supplied by <literal>sslfactoryarg</literal>.
- </para>
-
- <para>
- The sslfactory must not initiate a handshake in it's
- createSocket method, because a second startHandsake invocation
- in the <acronym>JDBC</acronym> driver will break the connection.
- If an <literal>sslhostnameverifier</literal> class is supplied,
- it is still responsible for handling the hostname verification.
- </para>
-
- <para>
- Information on how to actually implement such a class is beyond
- the scope of this documentation. Places to look for help are the
- <ulink url="http://docs.oracle.com/javase/1.5.0/docs/guide/security/jsse/JSSERefGuide.html">
- <acronym>JSSE</acronym> Reference Guide</ulink> and the source to the
- <classname>NonValidatingFactory</classname> provided by the
- <acronym>JDBC</acronym> driver.
- </para>
-
- <para>
- The Java <acronym>SSL</acronym> <acronym>API</acronym> is not very
- well known to the <acronym>JDBC</acronym> driver developers and we
- would be interested in any interesting and generally useful
- extensions that you have implemented using this mechanism.
- Specifically it would be nice to be able to provide client certificates
- to be validated by the server.
- </para>
- </sect1>
-
- </chapter>
-
-
- <chapter id="query">
- <title>Issuing a Query and Processing the Result</title>
-
- <indexterm zone="query">
- <primary>Statement</primary>
- </indexterm>
-
- <indexterm zone="query">
- <primary>PreparedStatement</primary>
- </indexterm>
-
- <indexterm zone="query">
- <primary>ResultSet</primary>
- </indexterm>
-
- <para>
- Any time you want to issue <acronym>SQL</acronym> statements to
- the database, you require a <classname>Statement</classname> or
- <classname>PreparedStatement</classname> instance. Once you have
- a <classname>Statement</classname> or
- <classname>PreparedStatement</classname>, you can use issue a
- query. This will return a <classname>ResultSet</classname>
- instance, which contains the entire result (see <xref linkend="query-with-cursor"/>
- here for how to alter this behaviour).
- <xref linkend="query-example"/> illustrates this process.
- </para>
-
- <example id="query-example">
- <title>Processing a Simple Query in <acronym>JDBC</acronym></title>
-
- <para>
- This example will issue a simple query and print out the first
- column of each row using a <classname>Statement</classname>.
-<programlisting>
-Statement st = conn.createStatement();
-ResultSet rs = st.executeQuery("SELECT * FROM mytable WHERE columnfoo = 500");
-while (rs.next()) {
- System.out.print("Column 1 returned ");
- System.out.println(rs.getString(1));
-}
-rs.close();
-st.close();
-</programlisting>
- </para>
-
- <para>
- This example issues the same query as before but uses
- a <classname>PreparedStatement</classname>
- and a bind value in the query.
-<programlisting>
-int foovalue = 500;
-PreparedStatement st = conn.prepareStatement("SELECT * FROM mytable WHERE columnfoo = ?");
-st.setInt(1, foovalue);
-ResultSet rs = st.executeQuery();
-while (rs.next()) {
- System.out.print("Column 1 returned ");
- System.out.println(rs.getString(1));
-}
-rs.close();
-st.close();
-</programlisting>
- </para>
- </example>
-
- <sect1 id="query-with-cursor">
- <title>Getting results based on a cursor</title>
-
- <para>By default the driver collects all the results for the
- query at once. This can be inconvenient for large data sets so
- the <acronym>JDBC</acronym> driver provides a means of basing
- a <classname>ResultSet</classname> on a database cursor and
- only fetching a small number of rows.</para>
-
- <para>A small number of rows are cached on the
- client side of the connection and when exhausted the next
- block of rows is retrieved by repositioning the cursor.
- </para>
-
- <note>
- <para>
- Cursor based <classname>ResultSets</classname> cannot be used in all
- situations. There a number of restrictions which will make the driver
- silently fall back to fetching the whole <classname>ResultSet</classname>
- at once.
- <itemizedlist>
- <listitem>
- <para>
- The connection to the server must be using the V3 protocol. This is the
- default for (and is only supported by) server versions 7.4 and later.
- </para>
- </listitem>
- <listitem>
- <para>
- The <classname>Connection</classname> must not be in autocommit
- mode. The backend closes cursors at the end of transactions, so in
- autocommit mode the backend will have closed the cursor before anything
- can be fetched from it.
- </para>
- </listitem>
- <listitem>
- <para>
- The <classname>Statement</classname> must be created with
- a <classname>ResultSet</classname> type of
- <literal>ResultSet.TYPE_FORWARD_ONLY</literal>.
- This is the default, so no code will need to be rewritten to take
- advantage of this, but it also means that you cannot scroll
- backwards or otherwise jump around in the
- <classname>ResultSet</classname>.
- </para>
- </listitem>
- <listitem>
- <para>
- The query given must be a single statement, not multiple statements
- strung together with semicolons.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </note>
-
- <example id="fetchsize-example">
- <title>Setting fetch size to turn cursors on and off.</title>
-
- <para>Changing code to cursor mode is as simple as setting the
- fetch size of the <classname>Statement</classname> to the
- appropriate size. Setting the fetch size back to 0 will cause
- all rows to be cached (the default behaviour).
-
-<programlisting>
-// make sure autocommit is off
-conn.setAutoCommit(false);
-Statement st = conn.createStatement();
-
-// Turn use of the cursor on.
-st.setFetchSize(50);
-ResultSet rs = st.executeQuery("SELECT * FROM mytable");
-while (rs.next()) {
- System.out.print("a row was returned.");
-}
-rs.close();
-
-// Turn the cursor off.
-st.setFetchSize(0);
-rs = st.executeQuery("SELECT * FROM mytable");
-while (rs.next()) {
- System.out.print("many rows were returned.");
-}
-rs.close();
-
-// Close the statement.
-st.close();
-</programlisting>
- </para>
- </example>
- </sect1>
-
- <sect1 id="statement">
- <title>Using the <classname>Statement</classname> or <classname>PreparedStatement</classname> Interface</title>
-
- <para>
- The following must be considered when using the
- <classname>Statement</classname> or
- <classname>PreparedStatement</classname> interface:
-
- <itemizedlist>
- <listitem>
- <para>
- You can use a single <classname>Statement</classname> instance
- as many times as you want. You could create one as soon as you
- open the connection and use it for the connection's
- lifetime. But you have to remember that only one
- <classname>ResultSet</classname> can exist per
- <classname>Statement</classname> or
- <classname>PreparedStatement</classname> at a given time.
- </para>
- </listitem>
-
- <listitem>
- <para>
- If you need to perform a query while processing a
- <classname>ResultSet</classname>, you can simply create and
- use another <classname>Statement</classname>.
- </para>
- </listitem>
-
- <listitem>
- <para>
- If you are using threads, and several are using the database,
- you must use a separate <classname>Statement</classname> for
- each thread. Refer to <xref linkend="thread"/> if you are
- thinking of using threads, as it covers some important points.
- </para>
- </listitem>
-
- <listitem>
- <para>
- When you are done using the <classname>Statement</classname>
- or <classname>PreparedStatement</classname>
- you should close it.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </sect1>
-
- <sect1 id="resultset">
- <title>Using the <classname>ResultSet</classname> Interface</title>
-
- <para>
- The following must be considered when using the
- <classname>ResultSet</classname> interface:
-
- <itemizedlist>
- <listitem>
- <para>
- Before reading any values, you must call
- <function>next()</function>. This returns true if there is a
- result, but more importantly, it prepares the row for
- processing.
- </para>
- </listitem>
-
- <listitem>
- <para>
- You must close a <classname>ResultSet</classname> by calling
- <function>close()</function> once you have finished using it.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Once you make another query with the
- <classname>Statement</classname> used to create a
- <classname>ResultSet</classname>, the currently open
- <classname>ResultSet</classname> instance is closed
- automatically.
- </para>
- </listitem>
-
- </itemizedlist>
- </para>
- </sect1>
-
- <sect1 id="update">
- <title>Performing Updates</title>
-
- <para>
- To change data (perform an <literal>INSERT</literal>,
- <literal>UPDATE</literal>, or <literal>DELETE</literal>) you use
- the <function>executeUpdate()</function> method. This method is
- similar to the method <function>executeQuery()</function> used to
- issue a <literal>SELECT</literal> statement, but it doesn't return
- a <classname>ResultSet</classname>; instead it returns the number
- of rows affected by the <literal>INSERT</literal>,
- <literal>UPDATE</literal>, or <literal>DELETE</literal> statement.
- <xref linkend="delete-example"/> illustrates the usage.
- </para>
-
- <example id="delete-example">
- <title>Deleting Rows in <acronym>JDBC</acronym></title>
- <para>
- This example will issue a simple <literal>DELETE</literal>
- statement and print out the number of rows deleted.
-<programlisting>
-int foovalue = 500;
-PreparedStatement st = conn.prepareStatement("DELETE FROM mytable WHERE columnfoo = ?");
-st.setInt(1, foovalue);
-int rowsDeleted = st.executeUpdate();
-System.out.println(rowsDeleted + " rows deleted");
-st.close();
-</programlisting>
- </para>
- </example>
-
- </sect1>
- <sect1 id="ddl">
- <title>Creating and Modifying Database Objects</title>
-
- <para>
- To create, modify or drop a database object like a table or view
- you use the <function>execute()</function> method. This method is
- similar to the method <function>executeQuery()</function>, but it
- doesn't return a result. <xref linkend="drop-table-example"/>
- illustrates the usage.
- </para>
-
- <example id="drop-table-example">
- <title>Dropping a Table in <acronym>JDBC</acronym></title>
- <para>
- This example will drop a table.
-<programlisting>
-Statement st = conn.createStatement();
-st.execute("DROP TABLE mytable");
-st.close();
-</programlisting>
- </para>
- </example>
- </sect1>
-
- </chapter>
-
-
- <chapter id="callproc">
- <title>Calling Stored Functions</title>
-
- <example id="call-function-example">
- <title>Calling a built in stored function</title>
-
- <para>This example shows how to call
- a <productname>PostgreSQL</productname> built in
- function, <function>upper</function>, which simply converts the
- supplied string argument to uppercase.
-
-<programlisting>
-CallableStatement upperProc = conn.prepareCall("{ ? = call upper( ? ) }");
-upperProc.registerOutParameter(1, Types.VARCHAR);
-upperProc.setString(2, "lowercase to uppercase");
-upperProc.execute();
-String upperCased = upperProc.getString(1);
-upperProc.close();
-</programlisting>
- </para>
- </example>
-
- <sect1 id="callproc-resultset">
- <title>Obtaining a <classname>ResultSet</classname> from a stored function</title>
-
- <para><productname>PostgreSQL's</productname> stored functions
- can return results in two different ways. The function may return
- either a <type>refcursor</type> value or a <literal>SETOF</literal>
- some datatype. Depending on which of these return methods are used
- determines how the function should be called.
- </para>
-
- <sect2 id="callproc-resultset-setof">
- <title>From a Function Returing <literal>SETOF</literal> type</title>
-
- <para>
- Functions that return data as a set should not be called via the
- <classname>CallableStatement</classname> interface, but instead should
- use the normal <classname>Statement</classname> or
- <classname>PreparedStatement</classname> interfaces.
- </para>
-
- <example id="setof-resultset">
- <title>
- Getting <literal>SETOF</literal> type values from a function
- </title>
-
-<programlisting>
-Statement stmt = conn.createStatement();
-stmt.execute("CREATE OR REPLACE FUNCTION setoffunc() RETURNS SETOF int AS "
- + "' SELECT 1 UNION SELECT 2;' LANGUAGE sql");
-ResultSet rs = stmt.executeQuery("SELECT * FROM setoffunc()");
-while (rs.next()) {
- // do something
-}
-rs.close();
-stmt.close();
-</programlisting>
-
- </example>
- </sect2>
-
- <sect2 id="callproc-resultset-refcursor">
- <title>From a Function Returing a <type>refcursor</type></title>
-
- <para>
- When calling a function that returns
- a <type>refcursor</type> you must cast the return type
- of <function>getObject</function> to
- a <classname>ResultSet</classname>
-
- <note>
- <para>
- One notable limitation of the current support for a
- <classname>ResultSet</classname> created from a
- <type>refcursor</type> is that even though it is a cursor
- backed <classname>ResultSet</classname>, all data will be retrieved
- and cached on the client. The <classname>Statement</classname>
- fetch size parameter described in
- <xref linkend="query-with-cursor" /> is ignored. This limitation
- is a deficiency of the <acronym>JDBC</acronym> driver,
- not the server, and it is technically possible to remove it,
- we just haven't found the time.
- </para>
- </note>
- </para>
-
- <example id="get-refcursor-from-function-call">
- <title>
- Getting <type>refcursor</type> Value From a Function
- </title>
-
-<programlisting>
-// Setup function to call.
-Statement stmt = conn.createStatement();
-stmt.execute("CREATE OR REPLACE FUNCTION refcursorfunc() RETURNS refcursor AS '"
- + " DECLARE "
- + " mycurs refcursor; "
- + " BEGIN "
- + " OPEN mycurs FOR SELECT 1 UNION SELECT 2; "
- + " RETURN mycurs; "
- + " END;' language plpgsql");
-stmt.close();
-
-// We must be inside a transaction for cursors to work.
-conn.setAutoCommit(false);
-
-// Procedure call.
-CallableStatement proc = conn.prepareCall("{ ? = call refcursorfunc() }");
-proc.registerOutParameter(1, Types.OTHER);
-proc.execute();
-ResultSet results = (ResultSet) proc.getObject(1);
-while (results.next()) {
- // do something with the results...
-}
-results.close();
-proc.close();
-</programlisting>
- </example>
-
- <para>It is also possible to treat the <type>refcursor</type>
- return value as a cursor name directly. To do this, use the
- <function>getString</function> of <classname>ResultSet</classname>.
- With the underlying cursor name, you are free to directly use cursor
- commands on it, such as <literal>FETCH</literal> and
- <literal>MOVE</literal>.
- </para>
-
- <example id="refcursor-string-example">
- <title>Treating <type>refcursor</type> as a cursor name</title>
-
-<programlisting>
-conn.setAutoCommit(false);
-CallableStatement proc = conn.prepareCall("{ ? = call refcursorfunc() }");
-proc.registerOutParameter(1, Types.OTHER);
-proc.execute();
-String cursorName = proc.getString(1);
-proc.close();
-</programlisting>
- </example>
- </sect2>
- </sect1>
-
- </chapter>
-
-
- <chapter id="binary-data">
- <title>Storing Binary Data</title>
-
- <indexterm zone="binary-data">
- <primary>bytea</primary>
- <secondary sortas="JDBC">in JDBC</secondary>
- </indexterm>
-
- <indexterm zone="binary-data">
- <primary>large object</primary>
- <secondary sortas="JDBC">in JDBC</secondary>
- </indexterm>
-
- <para>
- <productname>PostgreSQL</productname> provides two distinct ways to
- store binary data. Binary data can be stored in a table using
- the data type <type>bytea</type> or by using the Large Object
- feature which stores the binary data in a separate table in a special
- format and refers to that table by storing a value of type
- <type>oid</type> in your table.
- </para>
-
- <para>
- In order to determine which method is appropriate you
- need to understand the limitations of each method. The
- <type>bytea</type> data type is not well suited for storing very
- large amounts of binary data. While a column of type
- <type>bytea</type> can hold up to 1 GB of binary data, it would
- require a huge amount of memory to
- process such a large value. The Large Object method for
- storing binary data is better suited to storing very large values,
- but it has its own limitations. Specifically deleting a row
- that contains a Large Object reference does not delete the Large Object.
- Deleting the Large Object is a separate operation that needs to
- be performed. Large Objects also have some security
- issues since anyone connected to the database can view
- and/or modify any Large Object, even if they don't have
- permissions to view/update the row containing the Large Object reference.
- </para>
-
- <para>
- Version 7.2 was the first release of the <acronym>JDBC</acronym> driver
- that supports the <type>bytea</type> data type. The introduction of
- this functionality in 7.2 has introduced a change in behavior
- as compared to previous releases. Since 7.2, the methods
- <function>getBytes()</function>, <function>setBytes()</function>,
- <function>getBinaryStream()</function>, and
- <function>setBinaryStream()</function> operate on
- the <type>bytea</type> data type. In 7.1 and earlier, these methods operated
- on the <type>oid</type> data type associated with Large Objects.
- It is possible to revert the driver back to the old 7.1 behavior
- by setting the property <literal>compatible</literal> on
- the <classname>Connection</classname> object to the value
- <literal>7.1</literal>. More details on connection properties are
- available in <xref linkend="connection-parameters" />.
- </para>
-
- <para>
- To use the <type>bytea</type> data type you should simply use
- the <function>getBytes()</function>, <function>setBytes()</function>,
- <function>getBinaryStream()</function>, or
- <function>setBinaryStream()</function> methods.
- </para>
-
- <para>
- To use the Large Object functionality you can use either the
- <classname>LargeObject</classname> class provided by the
- <productname>PostgreSQL</productname> <acronym>JDBC</acronym> driver, or by
- using the <function>getBLOB()</function> and
- <function>setBLOB()</function> methods.
- </para>
-
- <important>
- <para>
- You must access Large Objects within an <acronym>SQL</acronym>
- transaction block. You can start a transaction block by calling
- <function>setAutoCommit(false)</function>.
- </para>
- </important>
-
- <para>
- <xref linkend="binary-data-example"/> contains some examples on
- how to process binary data using the <productname>PostgreSQL</productname>
- <acronym>JDBC</acronym> driver.
- </para>
-
- <example id="binary-data-example">
- <title>Processing Binary Data in <acronym>JDBC</acronym></title>
-
- <para>
- For example, suppose you have a table containing the file names of
- images and you also want to store the image in a <type>bytea</type>
- column:
-<programlisting>
-CREATE TABLE images (imgname text, img bytea);
-</programlisting>
- </para>
-
- <para>
- To insert an image, you would use:
-<programlisting>
-File file = new File("myimage.gif");
-FileInputStream fis = new FileInputStream(file);
-PreparedStatement ps = conn.prepareStatement("INSERT INTO images VALUES (?, ?)");
-ps.setString(1, file.getName());
-ps.setBinaryStream(2, fis, (int)file.length());
-ps.executeUpdate();
-ps.close();
-fis.close();
-</programlisting>
-
- Here, <function>setBinaryStream()</function> transfers a set number
- of bytes from a stream into the column of type <type>bytea</type>.
- This also could have been done using the <function>setBytes()</function>
- method if the contents of the image was already in a
- <classname>byte[]</classname>.
-
- <note>
- <para>
- The length parameter to <function>setBinaryStream</function> must be
- correct. There is no way to indicate that the stream is of unknown
- length. If you are in this situation, you must read the stream yourself
- into temporary storage and determine the length. Now with the correct
- length you may send the data from temporary storage on to the driver.
- </para>
- </note>
- </para>
-
- <para>
- Retrieving an image is even easier. (We use
- <classname>PreparedStatement</classname> here, but the
- <classname>Statement</classname> class can equally be used.)
-
-<programlisting>
-PreparedStatement ps = conn.prepareStatement("SELECT img FROM images WHERE imgname = ?");
-ps.setString(1, "myimage.gif");
-ResultSet rs = ps.executeQuery();
-while (rs.next()) {
- byte[] imgBytes = rs.getBytes(1);
- // use the data in some way here
-}
-rs.close();
-ps.close();
-</programlisting>
- </para>
-
- <para>
- Here the binary data was retrieved as an
- <classname>byte[]</classname>. You could have used a
- <classname>InputStream</classname> object instead.
- </para>
-
- <para>
- Alternatively you could be storing a very large file and want to use
- the <classname>LargeObject</classname> <acronym>API</acronym> to
- store the file:
-<programlisting>
-CREATE TABLE imageslo (imgname text, imgoid oid);
-</programlisting>
- </para>
-
- <para>
- To insert an image, you would use:
-<programlisting>
-// All LargeObject API calls must be within a transaction block
-conn.setAutoCommit(false);
-
-// Get the Large Object Manager to perform operations with
-LargeObjectManager lobj = ((org.postgresql.PGConnection)conn).getLargeObjectAPI();
-
-// Create a new large object
-long oid = lobj.createLO(LargeObjectManager.READ | LargeObjectManager.WRITE);
-
-// Open the large object for writing
-LargeObject obj = lobj.open(oid, LargeObjectManager.WRITE);
-
-// Now open the file
-File file = new File("myimage.gif");
-FileInputStream fis = new FileInputStream(file);
-
-// Copy the data from the file to the large object
-byte buf[] = new byte[2048];
-int s, tl = 0;
-while ((s = fis.read(buf, 0, 2048)) > 0) {
- obj.write(buf, 0, s);
- tl += s;
-}
-
-// Close the large object
-obj.close();
-
-// Now insert the row into imageslo
-PreparedStatement ps = conn.prepareStatement("INSERT INTO imageslo VALUES (?, ?)");
-ps.setString(1, file.getName());
-ps.setLong(2, oid);
-ps.executeUpdate();
-ps.close();
-fis.close();
-
-// Finally, commit the transaction.
-conn.commit();
-</programlisting>
- </para>
-
- <para>
- Retrieving the image from the Large Object:
-
-<programlisting>
-// All LargeObject API calls must be within a transaction block
-conn.setAutoCommit(false);
-
-// Get the Large Object Manager to perform operations with
-LargeObjectManager lobj = ((org.postgresql.PGConnection)conn).getLargeObjectAPI();
-
-PreparedStatement ps = conn.prepareStatement("SELECT imgoid FROM imageslo WHERE imgname = ?");
-ps.setString(1, "myimage.gif");
-ResultSet rs = ps.executeQuery();
-while (rs.next()) {
- // Open the large object for reading
- long oid = rs.getLong(1);
- LargeObject obj = lobj.open(oid, LargeObjectManager.READ);
-
- // Read the data
- byte buf[] = new byte[obj.size()];
- obj.read(buf, 0, obj.size());
- // Do something with the data read here
-
- // Close the object
- obj.close();
-}
-rs.close();
-ps.close();
-
-// Finally, commit the transaction.
-conn.commit();
-</programlisting>
- </para>
-
- </example>
- </chapter>
-
-<chapter id="escapes">
- <title><acronym>JDBC</acronym> escapes</title>
-
- <para>
- The <acronym>JDBC</acronym> specification (like the <acronym>ODBC</acronym>
- specification) acknowledges the fact that some vendor specific
- <acronym>SQL</acronym> may be required for certain <acronym>RDBMS</acronym>
- features. To aid developers in writing portable <acronym>JDBC</acronym>
- applications across multiple database products, a special escape syntax is
- used to specify the generic commands the developer wants to be run. The
- <acronym>JDBC</acronym> driver translates these escape sequences into
- native syntax for its specific database.
- For more information consult the section 4.1.5 from the
- <ulink url="http://docs.oracle.com/javase/1.5.0/docs/guide/jdbc/getstart/statement.html#17215"><acronym>JDBC</acronym> Technology Guide</ulink>
- (bundled with the <productname>Oracle</productname> <acronym>JRE</acronym>
- documentation) and the section 13.4 from the
- <ulink url="http://www.oracle.com/technetwork/java/download-141179.html#corespec40"><acronym>JDBC</acronym> 4.0 specification</ulink>.
- </para>
-
- <para>
- The parsing of the sql statements for these escapes can be disabled using <literal>Statement.setEscapeProcessing(false)</literal>.
- </para>
-
- <para>
- <literal>Connection.nativeSQL(String sql)</literal> provides another way to have escapes processed.
- It translates the given <acronym>SQL</acronym> to a <acronym>SQL</acronym> suitable for the <productname>PostgreSQL</productname> backend.
- </para>
-
- <example id="escape-use-example">
- <title>Using jdbc escapes</title>
- <para>
- To use the <acronym>JDBC</acronym> escapes, you simply write your <acronym>SQL</acronym> replacing date/time literal
- values, outer join and functions by the <acronym>JDBC</acronym> escape syntax.
- For example :
-<programlisting>
-ResultSet rs = st.executeQuery("SELECT {fn week({d '2005-01-24'})}");
-</programlisting>
-is the portable version for
-<programlisting>
-ResultSet rs = st.executeQuery("SELECT extract(week from DATE '2005-01-24')");
-</programlisting>
- </para>
- </example>
-
- <sect1 id="like-escape">
- <title>Escape for like escape character</title>
- <para>
- You can specify which escape character to use in strings comparison (with <literal>LIKE</literal>) to protect wildcards
- characters ('%' and '_') by adding the following escape : <literal>{escape 'escape-character'}</literal>.
- The driver supports this only at the end of the comparison expression.
- </para>
-
- <para>
- For example, you can compare string values using '|' as escape character to protect '_' :
-<programlisting>
-rs = stmt.executeQuery("select str2 from comparisontest where str1 like '|_abcd' {escape '|'} ");
-</programlisting>
- </para>
- </sect1>
-
- <sect1 id="outer-joins-escape">
- <title>Escape for outer joins</title>
- <para>
- You can specify outer joins using the following syntax:
- <literal>{oj table (LEFT|RIGHT|FULL) OUTER JOIN (table | outer-join)
- ON search-condition }</literal>
- </para>
-
- <para>
- For example :
-<programlisting>
-rs = stmt.executeQuery( "select * from {oj a left outer join b on (a.i=b.i)} ");
-</programlisting>
- </para>
- </sect1>
-
- <sect1 id="escapes-datetime">
- <title>Date-time escapes</title>
- <para>
- The <acronym>JDBC</acronym> specification defines escapes for specifying date, time and timestamp values which are supported by the
- driver.
- </para>
-
- <variablelist>
- <varlistentry>
- <term>date</term>
- <listitem>
- <para>
- <literal>{d 'yyyy-mm-dd'}</literal> which is translated to <literal>DATE 'yyyy-mm-dd'</literal>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>time</term>
- <listitem>
- <para><literal>{t 'hh:mm:ss'}</literal> which is translated to <literal>TIME 'hh:mm:ss'</literal></para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>timestamp</term>
- <listitem><para>
- <literal>{ts 'yyyy-mm-dd hh:mm:ss.f...'}</literal> which is translated to <literal>TIMESTAMP 'yyyy-mm-dd hh:mm:ss.f'</literal>
-
- The fractional seconds (.f...) portion of the TIMESTAMP can be omitted. </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </sect1>
-
- <sect1 id="escaped-functions">
- <title>Escaped scalar functions</title>
-
- <para>
- The <acronym>JDBC</acronym> specification defines functions with an escape call syntax : <literal>{fn function_name(arguments)}</literal>.
- The following tables show which functions are supported by the <productname>Postgres<acronym>SQL</acronym></productname> driver.
- The driver supports the nesting and the mixing of escaped functions and escaped values.
- The appendix C of the <acronym>JDBC</acronym> specification describes the functions.
- </para>
-
- <para>
- Some functions in the following tables are translated but not reported as supported because they are
- duplicating or changing ther order of the arguments. While this is harmless for literal values or
- columns, it will cause problems when using prepared statements.
- For example "<literal>{fn right(?,?)}</literal>" will be translated to "<literal>substring(? from (length(?)+1-?))</literal>".
- As you can see the translated <acronym>SQL</acronym> requires more parameters than before the translation but the
- driver will not automatically handle this.
- </para>
-
- <table id="escape-numeric-functions-table">
- <title>Supported escaped numeric functions</title>
-
- <tgroup cols="4">
- <thead>
- <row>
- <entry>function</entry>
- <entry>reported as supported</entry>
- <entry>translation</entry>
- <entry>comments</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>abs(arg1)</entry>
- <entry>yes</entry>
- <entry>abs(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>acos(arg1)</entry>
- <entry>yes</entry>
- <entry>acos(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>asin(arg1)</entry>
- <entry>yes</entry>
- <entry>asin(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>atan(arg1)</entry>
- <entry>yes</entry>
- <entry>atan(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>atan2(arg1,arg2)</entry>
- <entry>yes</entry>
- <entry>atan2(arg1,arg2)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>ceiling(arg1)</entry>
- <entry>yes</entry>
- <entry>ceil(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>cos(arg1)</entry>
- <entry>yes</entry>
- <entry>cos(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>cot(arg1)</entry>
- <entry>yes</entry>
- <entry>cot(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>degrees(arg1)</entry>
- <entry>yes</entry>
- <entry>degrees(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>exp(arg1)</entry>
- <entry>yes</entry>
- <entry>exp(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>floor(arg1)</entry>
- <entry>yes</entry>
- <entry>floor(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>log(arg1)</entry>
- <entry>yes</entry>
- <entry>ln(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>log10(arg1)</entry>
- <entry>yes</entry>
- <entry>log(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>mod(arg1,arg2)</entry>
- <entry>yes</entry>
- <entry>mod(arg1,arg2)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>pi(arg1)</entry>
- <entry>yes</entry>
- <entry>pi(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>power(arg1,arg2)</entry>
- <entry>yes</entry>
- <entry>pow(arg1,arg2)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>radians(arg1)</entry>
- <entry>yes</entry>
- <entry>radians(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>rand()</entry>
- <entry>yes</entry>
- <entry>random()</entry>
- <entry></entry>
- </row>
- <row>
- <entry>rand(arg1)</entry>
- <entry>yes</entry>
- <entry>setseed(arg1)*0+random()</entry>
- <entry>The seed is initialized with the given argument and a new randow value is returned.</entry>
- </row>
- <row>
- <entry>round(arg1,arg2)</entry>
- <entry>yes</entry>
- <entry>round(arg1,arg2)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>sign(arg1)</entry>
- <entry>yes</entry>
- <entry>sign(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>sin(arg1)</entry>
- <entry>yes</entry>
- <entry>sin(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>sqrt(arg1)</entry>
- <entry>yes</entry>
- <entry>sqrt(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>tan(arg1)</entry>
- <entry>yes</entry>
- <entry>tan(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>truncate(arg1,arg2)</entry>
- <entry>yes</entry>
- <entry>trunc(arg1,arg2)</entry>
- <entry></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
-
- <table id="escape-string-functions-table">
- <title>Supported escaped string functions</title>
-
- <tgroup cols="4">
- <thead>
- <row>
- <entry>function</entry>
- <entry>reported as supported</entry>
- <entry>translation</entry>
- <entry>comments</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>ascii(arg1)</entry>
- <entry>yes</entry>
- <entry>ascii(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>char(arg1)</entry>
- <entry>yes</entry>
- <entry>chr(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>concat(arg1,arg2...)</entry>
- <entry>yes</entry>
- <entry>(arg1||arg2...)</entry>
- <entry>The <acronym>JDBC</acronym> specification only require the two arguments version, but supporting more arguments was so easy...</entry>
- </row>
- <row>
- <entry>insert(arg1,arg2,arg3,arg4)</entry>
- <entry>no</entry>
- <entry>overlay(arg1 placing arg4 from arg2 for arg3)</entry>
- <entry>This function is not reported as supported since it changes the order of the arguments which can be a problem (for prepared statements by example).</entry>
- </row>
- <row>
- <entry>lcase(arg1)</entry>
- <entry>yes</entry>
- <entry>lower(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>left(arg1,arg2)</entry>
- <entry>yes</entry>
- <entry>substring(arg1 for arg2)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>length(arg1)</entry>
- <entry>yes</entry>
- <entry>length(trim(trailing from arg1))</entry>
- <entry></entry>
- </row>
- <row>
- <entry>locate(arg1,arg2)</entry>
- <entry>no</entry>
- <entry>position(arg1 in arg2)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>locate(arg1,arg2,arg3)</entry>
- <entry>no</entry>
- <entry>(arg2*sign(position(arg1 in substring(arg2 from arg3)+position(arg1 in substring(arg2 from arg3))</entry>
- <entry>Not reported as supported since the three arguments version duplicate and change the order of the arguments.</entry>
- </row>
- <row>
- <entry>ltrim(arg1)</entry>
- <entry>yes</entry>
- <entry>trim(leading from arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>repeat(arg1,arg2)</entry>
- <entry>yes</entry>
- <entry>repeat(arg1,arg2)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>replace(arg1,arg2,arg3)</entry>
- <entry>yes</entry>
- <entry>replace(arg1,arg2,arg3)</entry>
- <entry>Only reported as supported by 7.3 and above servers.</entry>
- </row>
- <row>
- <entry>right(arg1,arg2)</entry>
- <entry>no</entry>
- <entry>substring(arg1 from (length(arg1)+1-arg2))</entry>
- <entry>Not reported as supported since arg2 is duplicated.</entry>
- </row>
- <row>
- <entry>rtrim(arg1)</entry>
- <entry>yes</entry>
- <entry>trim(trailing from arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>space(arg1)</entry>
- <entry>yes</entry>
- <entry>repeat(' ',arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>substring(arg1,arg2)</entry>
- <entry>yes</entry>
- <entry>substr(arg1,arg2)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>substring(arg1,arg2,arg3)</entry>
- <entry>yes</entry>
- <entry>substr(arg1,arg2,arg3)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>ucase(arg1)</entry>
- <entry>yes</entry>
- <entry>upper(arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>soundex(arg1)</entry>
- <entry>no</entry>
- <entry>soundex(arg1)</entry>
- <entry>Not reported as supported since it requires the fuzzystrmatch contrib module.</entry>
- </row>
- <row>
- <entry>difference(arg1,arg2)</entry>
- <entry>no</entry>
- <entry>difference(arg1,arg2)</entry>
- <entry>Not reported as supported since it requires the fuzzystrmatch contrib module.</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
-
- <table id="escape-datetime-functions-table">
- <title>Supported escaped date/time functions</title>
-
- <tgroup cols="4">
- <thead>
- <row>
- <entry>function</entry>
- <entry>reported as supported</entry>
- <entry>translation</entry>
- <entry>comments</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>curdate()</entry>
- <entry>yes</entry>
- <entry>current_date</entry>
- <entry></entry>
- </row>
- <row>
- <entry>curtime()</entry>
- <entry>yes</entry>
- <entry>current_time</entry>
- <entry></entry>
- </row>
- <row>
- <entry>dayname(arg1)</entry>
- <entry>yes</entry>
- <entry>to_char(arg1,'Day')</entry>
- <entry></entry>
- </row>
- <row>
- <entry>dayofmonth(arg1)</entry>
- <entry>yes</entry>
- <entry>extract(day from arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>dayofweek(arg1)</entry>
- <entry>yes</entry>
- <entry>extract(dow from arg1)+1</entry>
- <entry>We must add 1 to be in the expected 1-7 range.</entry>
- </row>
- <row>
- <entry>dayofyear(arg1)</entry>
- <entry>yes</entry>
- <entry>extract(doy from arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>hour(arg1)</entry>
- <entry>yes</entry>
- <entry>extract(hour from arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>minute(arg1)</entry>
- <entry>yes</entry>
- <entry>extract(minute from arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>month(arg1)</entry>
- <entry>yes</entry>
- <entry>extract(month from arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>monthname(arg1)</entry>
- <entry>yes</entry>
- <entry>to_char(arg1,'Month')</entry>
- <entry></entry>
- </row>
- <row>
- <entry>now()</entry>
- <entry>yes</entry>
- <entry>now()</entry>
- <entry></entry>
- </row>
- <row>
- <entry>quarter(arg1)</entry>
- <entry>yes</entry>
- <entry>extract(quarter from arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>second(arg1)</entry>
- <entry>yes</entry>
- <entry>extract(second from arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>week(arg1)</entry>
- <entry>yes</entry>
- <entry>extract(week from arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>year(arg1)</entry>
- <entry>yes</entry>
- <entry>extract(year from arg1)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>timestampadd(argIntervalType,argCount,argTimeStamp)</entry>
- <entry>yes</entry>
- <entry>('(interval according to argIntervalType and argCount)'+argTimeStamp)</entry>
- <entry>an argIntervalType value of <classname>SQL_TSI_FRAC_SECOND</classname> is not implemented since backend does not support it</entry>
- </row>
- <row>
- <entry>timestampdiff(argIntervalType,argTimeStamp1,argTimeStamp2)</entry>
- <entry>not</entry>
- <entry>extract((interval according to argIntervalType) from argTimeStamp2-argTimeStamp1 )</entry>
- <entry>only an argIntervalType value of <classname>SQL_TSI_FRAC_SECOND</classname>,<classname>SQL_TSI_FRAC_MINUTE</classname>,<classname>SQL_TSI_FRAC_HOUR</classname> or <classname>SQL_TSI_FRAC_DAY</classname> is supported </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
-
- <table id="escape-misc-functions-table">
- <title>Supported escaped misc functions</title>
-
- <tgroup cols="4">
- <thead>
- <row>
- <entry>function</entry>
- <entry>reported as supported</entry>
- <entry>translation</entry>
- <entry>comments</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>database()</entry>
- <entry>yes</entry>
- <entry>current_database()</entry>
- <entry>Only reported as supported by 7.3 and above servers.</entry>
- </row>
- <row>
- <entry>ifnull(arg1,arg2)</entry>
- <entry>yes</entry>
- <entry>coalesce(arg1,arg2)</entry>
- <entry></entry>
- </row>
- <row>
- <entry>user()</entry>
- <entry>yes</entry>
- <entry>user</entry>
- <entry></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
-
- </sect1>
- </chapter>
-
- <chapter id="ext">
- <title><productname>PostgreSQL</productname> Extensions to the
- <acronym>JDBC</acronym> <acronym>API</acronym></title>
-
- <para>
- <productname>PostgreSQL</productname> is an extensible database
- system. You can add your own functions to the server, which can
- then be called from queries, or even add your own data types. As
- these are facilities unique to <productname>PostgreSQL</productname>,
- we support them from Java, with a set of extension
- <acronym>APIs</acronym>. Some features within the core of the
- standard driver actually use these extensions to implement Large
- Objects, etc.
- </para>
-
- <sect1 id="extensions">
- <title>Accessing the Extensions</title>
-
- <para>
- To access some of the extensions, you need to use some extra
- methods in the <classname>org.postgresql.PGConnection</classname>
- class. In this case, you would need to case the return value of
- <function>Driver.getConnection()</function>. For example:
-<programlisting>
-Connection db = Driver.getConnection(url, username, password);
-// ...
-// later on
-Fastpath fp = ((org.postgresql.PGConnection)db).getFastpathAPI();
-</programlisting>
- </para>
- </sect1>
-
-
- <sect1 id="geometric">
- <title>Geometric Data Types</title>
-
- <para>
- <productname>PostgreSQL</productname> has a set of data types that
- can store geometric features into a table. These include single
- points, lines, and polygons. We support these types in Java with
- the org.postgresql.geometric package. Please consult the Javadoc
- for the details of available classes and features metioned in
- <xref linkend="reading" />.
- </para>
-
- <example id="geometric-circle-example">
- <title>Using the circle datatype from <acronym>JDBC</acronym></title>
-
-<programlisting>
-
-import java.sql.*;
-
-import org.postgresql.geometric.PGpoint;
-import org.postgresql.geometric.PGcircle;
-
-public class GeometricTest {
-
- public static void main(String args[]) throws Exception {
- Class.forName("org.postgresql.Driver");
- String url = "jdbc:postgresql://localhost:5432/test";
-
- Connection conn = DriverManager.getConnection(url,"test","");
-
- Statement stmt = conn.createStatement();
- stmt.execute("CREATE TEMP TABLE geomtest(mycirc circle)");
- stmt.close();
-
- insertCircle(conn);
- retrieveCircle(conn);
- conn.close();
- }
-
- private static void insertCircle(Connection conn) throws SQLException {
-
- PGpoint center = new PGpoint(1, 2.5);
- double radius = 4;
- PGcircle circle = new PGcircle(center, radius);
-
- PreparedStatement ps = conn.prepareStatement("INSERT INTO geomtest(mycirc) VALUES (?)");
- ps.setObject(1, circle);
- ps.executeUpdate();
- ps.close();
- }
-
- private static void retrieveCircle(Connection conn) throws SQLException {
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT mycirc, area(mycirc) FROM geomtest");
- rs.next();
- PGcircle circle = (PGcircle)rs.getObject(1);
- double area = rs.getDouble(2);
-
- PGpoint center = circle.center;
- double radius = circle.radius;
-
- System.out.println("Center (X, Y) = (" + center.x + ", " + center.y + ")");
- System.out.println("Radius = " + radius);
- System.out.println("Area = " + area);
- }
-}
-</programlisting>
- </example>
- </sect1>
-
-
- <sect1 id="largeobjects">
- <title>Large Objects</title>
-
- <para>
- Large objects are supported in the standard
- <acronym>JDBC</acronym> specification. However, that interface is
- limited, and the <acronym>API</acronym> provided by <productname>PostgreSQL</productname> allows for random
- access to the objects contents, as if it was a local file.
- </para>
-
- <para>
- The org.postgresql.largeobject package provides to Java the <application>libpq</application>
- C interface's large object <acronym>API</acronym>. It consists of
- two classes, <classname>LargeObjectManager</classname>, which deals with creating,
- opening and deleting large objects, and <classname>LargeObject</classname> which deals
- with an individual object. For an example usage of this <acronym>API</acronym>,
- please see <xref linkend="binary-data-example"/>.
- </para>
- </sect1>
-
- <sect1 id="listennotify">
- <title>Listen / Notify</title>
-
- <para>
- Listen and Notify provide a simple form of signal or interprocess
- communication mechanism for a collection of processes accessing
- the same <productname>PostgreSQL</productname> database. For more
- information on notifications consult the main server documentation.
- This section only deals with the <acronym>JDBC</acronym> specific
- aspects of notifications.
- </para>
-
- <para>
- Standard <literal>LISTEN</literal>, <literal>NOTIFY</literal>, and
- <literal>UNLISTEN</literal> commands are issued via the
- standard <classname>Statement</classname> interface. To retrieve
- and process retrieved notifications the
- <classname>Connection</classname> must be cast to the
- <productname>PostgreSQL</productname> specific extension interface
- <classname>PGConnection</classname>. From there the
- <function>getNotifications()</function> method can be used to retrieve
- any outstanding notifications.
- </para>
-
- <note>
- <para>
- A key limitation of the <acronym>JDBC</acronym> driver is that it
- cannot receive asynchronous notifications and must poll the
- backend to check if any notifications were issued.
- </para>
- </note>
-
- <example id="listen-notify-example">
- <title>Receiving Notifications</title>
-
-<programlisting>
-import java.sql.*;
-
-public class NotificationTest {
-
- public static void main(String args[]) throws Exception {
- Class.forName("org.postgresql.Driver");
- String url = "jdbc:postgresql://localhost:5432/test";
-
- // Create two distinct connections, one for the notifier
- // and another for the listener to show the communication
- // works across connections although this example would
- // work fine with just one connection.
- Connection lConn = DriverManager.getConnection(url,"test","");
- Connection nConn = DriverManager.getConnection(url,"test","");
-
- // Create two threads, one to issue notifications and
- // the other to receive them.
- Listener listener = new Listener(lConn);
- Notifier notifier = new Notifier(nConn);
- listener.start();
- notifier.start();
- }
-
-}
-
-class Listener extends Thread {
-
- private Connection conn;
- private org.postgresql.PGConnection pgconn;
-
- Listener(Connection conn) throws SQLException {
- this.conn = conn;
- this.pgconn = (org.postgresql.PGConnection)conn;
- Statement stmt = conn.createStatement();
- stmt.execute("LISTEN mymessage");
- stmt.close();
- }
-
- public void run() {
- while (true) {
- try {
- // issue a dummy query to contact the backend
- // and receive any pending notifications.
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT 1");
- rs.close();
- stmt.close();
-
- org.postgresql.PGNotification notifications[] = pgconn.getNotifications();
- if (notifications != null) {
- for (int i=0; i<notifications.length; i++) {
- System.out.println("Got notification: " + notifications[i].getName());
- }
- }
-
- // wait a while before checking again for new
- // notifications
- Thread.sleep(500);
- } catch (SQLException sqle) {
- sqle.printStackTrace();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
- }
-
-}
-
-class Notifier extends Thread {
-
- private Connection conn;
-
- public Notifier(Connection conn) {
- this.conn = conn;
- }
-
- public void run() {
- while (true) {
- try {
- Statement stmt = conn.createStatement();
- stmt.execute("NOTIFY mymessage");
- stmt.close();
- Thread.sleep(2000);
- } catch (SQLException sqle) {
- sqle.printStackTrace();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
- }
-
-}
-</programlisting>
- </example>
- </sect1>
-
- <sect1 id="server-prepare">
- <title>Server Prepared Statements</title>
-
- <para>
- The <productname>PostgreSQL</productname> server allows clients
- to compile sql statements that are expected to be reused to avoid the
- overhead of parsing and planning the statement for every execution.
- This functionality is available at the <acronym>SQL</acronym> level
- via PREPARE and EXECUTE beginning with server version 7.3, and at the
- protocol level beginning with server version 7.4, but as Java
- developers we really just want to use the standard
- <classname>PreparedStatement</classname> interface.
- </para>
-
- <note>
- <para>
- Previous versions of the driver used PREPARE and EXECUTE to
- implement server-prepared statements. This is supported on all server
- versions beginning with 7.3, but produced application-visible changes
- in query results, such as missing ResultSet metadata and row update
- counts. The current driver uses the V3 protocol-level equivalents which
- avoid these changes in query results, but the V3 protocol is only
- available beginning with server version 7.4. Enabling server-prepared
- statements will have no affect when connected to a 7.3 server or when
- explicitly using the V2 protocol to connect to a 7.4 server.
- </para>
- </note>
-
- <para>
- There are a number of ways to enable server side prepared statements
- depending on your application's needs. The general method is to
- set a threshold for a <classname>PreparedStatement</classname>.
- An internal counter keeps track of how many times the statement has
- been executed and when it reaches the threshold it will start to
- use server side prepared statements.
- </para>
-
- <note>
- <para>
- Server side prepared statements are planned only once by the server.
- This avoids the cost of replanning the query every time, but also
- means that the planner cannot take advantage of the particular
- parameter values used in a particular execution of the query.
- You should be cautious about enabling the use of server side prepared
- statements globally.
- </para>
- </note>
-
- <example id="server-prepared-statement-example">
- <title>Using server side prepared statements</title>
-
-<programlisting>
-import java.sql.*;
-
-public class ServerSidePreparedStatement
-{
-
- public static void main(String args[]) throws Exception
- {
- Class.forName("org.postgresql.Driver");
- String url = "jdbc:postgresql://localhost:5432/test";
- Connection conn = DriverManager.getConnection(url,"test","");
-
- PreparedStatement pstmt = conn.prepareStatement("SELECT ?");
-
- // cast to the pg extension interface
- org.postgresql.PGStatement pgstmt = (org.postgresql.PGStatement)pstmt;
-
- // on the third execution start using server side statements
- pgstmt.setPrepareThreshold(3);
-
- for (int i=1; i<=5; i++)
- {
- pstmt.setInt(1,i);
- boolean usingServerPrepare = pgstmt.isUseServerPrepare();
- ResultSet rs = pstmt.executeQuery();
- rs.next();
- System.out.println("Execution: "+i+", Used server side: " + usingServerPrepare + ", Result: "+rs.getInt(1));
- rs.close();
- }
-
- pstmt.close();
- conn.close();
- }
-}
-</programlisting>
-
-<para>Which produces the expected result of using server side prepared statements upon the third execution.</para>
-
-<programlisting>
-Execution: 1, Used server side: false, Result: 1
-Execution: 2, Used server side: false, Result: 2
-Execution: 3, Used server side: true, Result: 3
-Execution: 4, Used server side: true, Result: 4
-Execution: 5, Used server side: true, Result: 5
-</programlisting>
-
- </example>
-
- <para>
- The example shown above requires the programmer to use
- <productname>PostgreSQL</productname> specific code in a
- supposedly portable API which is not ideal. Also it sets the
- threshold only for that particular statement which is some extra
- typing if we wanted to use that threshold for every statement.
- Let's take a look at the other ways to set the threshold to enable
- server side prepared statements. There is already a hierarchy in
- place above a <classname>PreparedStatement</classname>, the
- <classname>Connection</classname> it was created from, and above that
- the source of the connection be it a <classname>Datasource</classname>
- or a <acronym>URL</acronym>. The server side prepared statement
- threshold can be set at any of these levels such that the value
- will be the default for all of it's children.
- </para>
-
-<programlisting>
-// pg extension interfaces
-org.postgresql.PGConnection pgconn;
-org.postgresql.PGStatement pgstmt;
-
-// set a prepared statement threshold for connections created from this url
-String url = "jdbc:postgresql://localhost:5432/test?prepareThreshold=3";
-
-// see that the connection has picked up the correct threshold from the url
-Connection conn = DriverManager.getConnection(url,"test","");
-pgconn = (org.postgresql.PGConnection)conn;
-System.out.println(pgconn.getPrepareThreshold()); // Should be 3
-
-// see that the statement has picked up the correct threshold from the connection
-PreparedStatement pstmt = conn.prepareStatement("SELECT ?");
-pgstmt = (org.postgresql.PGStatement)pstmt;
-System.out.println(pgstmt.getPrepareThreshold()); // Should be 3
-
-// change the connection's threshold and ensure that new statements pick it up
-pgconn.setPrepareThreshold(5);
-PreparedStatement pstmt = conn.prepareStatement("SELECT ?");
-pgstmt = (org.postgresql.PGStatement)pstmt;
-System.out.println(pgstmt.getPrepareThreshold()); // Should be 5
-</programlisting>
-
- </sect1>
-
- </chapter>
-
-
- <chapter id="thread">
- <title>Using the Driver in a Multithreaded or a Servlet Environment</title>
-
- <indexterm zone="thread">
- <primary>threads</primary>
- <secondary sortas="JDBC">with JDBC</secondary>
- </indexterm>
-
- <para>
- A problem with many <acronym>JDBC</acronym> drivers is that only
- one thread can use a <classname>Connection</classname> at any one
- time --- otherwise a thread could send a query while another one is
- receiving results, and this could cause severe confusion.
- </para>
-
- <para>
- The <productname>PostgreSQL</productname> <acronym>JDBC</acronym> driver
- is thread safe.
- Consequently, if your application uses multiple threads then you do
- not have to worry about complex algorithms to ensure that only one thread
- uses the database at a time.
- </para>
-
- <para>
- If a thread attempts to use the connection while another one is
- using it, it will wait until the other thread has finished its
- current operation. If the operation is a regular <acronym>SQL</acronym>
- statement, then the operation consists of sending the statement and
- retrieving any <classname>ResultSet</classname> (in full). If it
- is a fast-path call (e.g., reading a block
- from a large object) then it consists of
- sending and retrieving the respective data.
- </para>
-
- <para>
- This is fine for applications and applets but can cause a
- performance problem with servlets. If you have several threads
- performing queries then each but one will pause.
- To solve this, you are advised to create a pool of connections.
- When ever a thread needs to use the database, it asks a manager
- class for a <classname>Connection</classname> object. The manager
- hands a free connection to the thread and marks it as busy. If a
- free connection is not available, it opens one. Once the thread
- has finished using the connection, it returns it to the manager
- which can then either close it or add it to the pool. The manager
- would also check that the connection is still alive and remove it
- from the pool if it is dead. The down side of a connection pool is
- that it increases the load on the server because a new session is
- created for each <classname>Connection</classname> object. It is
- up to you and your applications' requirements.
- </para>
- </chapter>
-
- <chapter id="datasource">
- <title>Connection Pools and Data Sources</title>
-
- <indexterm zone="datasource">
- <primary>connection pool</primary>
- <secondary sortas="JDBC">in JDBC</secondary>
- </indexterm>
-
- <indexterm zone="datasource">
- <primary>DataSource</primary>
- </indexterm>
-
- <para>
- <acronym>JDBC</acronym> 2 introduced standard connection pooling features in an
- add-on <acronym>API</acronym> known as the <acronym>JDBC</acronym> 2.0 Optional
- Package (also known as the <acronym>JDBC</acronym> 2.0
- Standard Extension). These features have since been included in
- the core <acronym>JDBC</acronym> 3 <acronym>API</acronym>.
- </para>
-
- <sect1 id="ds-intro">
- <title>Overview</title>
-
- <para>
- The <acronym>JDBC</acronym> <acronym>API</acronym> provides a client
- and a server interface for connection pooling. The client
- interface is <literal>javax.sql.DataSource</literal>,
- which is what application code will typically use to
- acquire a pooled database connection. The server interface
- is <literal>javax.sql.ConnectionPoolDataSource</literal>,
- which is how most application servers will interface with
- the <productname>PostgreSQL</productname> <acronym>JDBC</acronym>
- driver.
- </para>
-
- <para>
- In an application server environment, the
- application server configuration will typically refer to
- the <productname>PostgreSQL</productname>
- <literal>ConnectionPoolDataSource</literal> implementation,
- while the application component code will typically acquire a
- <literal>DataSource</literal> implementation provided by
- the application server (not by
- <productname>PostgreSQL</productname>).
- </para>
-
- <para>
- For an environment without an application server,
- <productname>PostgreSQL</productname> provides two implementations
- of <literal>DataSource</literal> which an application can use
- directly. One implementation performs connection pooling,
- while the other simply provides access to database connections
- through the <literal>DataSource</literal> interface without
- any pooling. Again, these implementations should not be used
- in an application server environment unless the application
- server does not support the
- <literal>ConnectionPoolDataSource</literal> interface.
- </para>
- </sect1>
-
- <sect1 id="ds-cpds">
- <title>Application Servers: <classname>ConnectionPoolDataSource</classname></title>
-
- <para>
- <productname>PostgreSQL</productname> includes one implementation
- of <classname>ConnectionPoolDataSource</classname> named
- <classname>org.postgresql.ds.PGConnectionPoolDataSource</classname>.
- </para>
-
- <para>
- <acronym>JDBC</acronym> requires that a
- <classname>ConnectionPoolDataSource</classname> be configured via
- JavaBean properties, shown in <xref linkend="ds-cpds-props"/>,
- so there are get and set methods for each of these properties.
- </para>
-
- <table id="ds-cpds-props">
- <title><classname>ConnectionPoolDataSource</classname> Configuration Properties</title>
-
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Property</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry><literal>serverName</literal></entry>
- <entry><type>String</type></entry>
- <entry><productname>PostgreSQL</productname> database server
- host name</entry>
- </row>
-
- <row>
- <entry><literal>databaseName</literal></entry>
- <entry><type>String</type></entry>
- <entry><productname>PostgreSQL</productname> database name</entry>
- </row>
-
- <row>
- <entry><literal>portNumber</literal></entry>
- <entry><type>int</type></entry>
- <entry>
- TCP port which the <productname>PostgreSQL</productname>
- database server is listening on (or 0 to use the default port)
- </entry>
- </row>
-
- <row>
- <entry><literal>user</literal></entry>
- <entry><type>String</type></entry>
- <entry>User used to make database connections</entry>
- </row>
-
- <row>
- <entry><literal>password</literal></entry>
- <entry><type>String</type></entry>
- <entry>Password used to make database connections</entry>
- </row>
-
- <row>
- <entry><literal>ssl</literal></entry>
- <entry><type>boolean</type></entry>
- <entry>
- If <literal>true</literal>, use SSL encrypted connections
- (default <literal>false</literal>)
- </entry>
- </row>
-
- <row>
- <entry><literal>sslfactory</literal></entry>
- <entry><type>String</type></entry>
- <entry>
- Custom <classname>javax.net.ssl.SSLSocketFactory</classname>
- class name (see <xref linkend="ssl-factory"/>)
- </entry>
- </row>
-
- <row>
- <entry><literal>defaultAutoCommit</literal></entry>
- <entry><type>boolean</type></entry>
- <entry>
- Whether connections should have autocommit enabled or disabled
- when they are supplied to the caller. The default is
- <literal>false</literal>, to disable autocommit.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <para>
- Many application servers use a properties-style syntax to
- configure these properties, so it would not be unusual to enter
- properties as a block of text. If the application server provides
- a single area to enter all the properties, they might be listed
- like this:
-<programlisting>
-serverName=localhost
-databaseName=test
-user=testuser
-password=testpassword
-</programlisting>
- Or, if semicolons are used as separators instead of newlines, it
- could look like this:
-<programlisting>
-serverName=localhost;databaseName=test;user=testuser;password=testpassword
-</programlisting>
- </para>
-
- </sect1>
-
- <sect1 id="ds-ds">
- <title>Applications: <classname>DataSource</classname></title>
-
- <para><productname>PostgreSQL</productname> includes two
- implementations of <literal>DataSource</literal>
- , as shown in <xref linkend="ds-ds-imp"/>. One that does
- pooling and the other that does not.
- The pooling implementation does not actually close connections
- when the client calls the <literal>close</literal> method, but
- instead returns the connections to a pool of available connections
- for other clients to use. This avoids any overhead of repeatedly
- opening and closing connections, and allows a large number of
- clients to share a small number of database connections.</para>
-
- <para>The pooling data-source implementation provided here is not
- the most feature-rich in the world. Among other things,
- connections are never closed until the pool itself is closed;
- there is no way to shrink the pool. As well, connections
- requested for users other than the default configured user are
- not pooled. Its error handling sometimes cannot remove a broken
- connection from the pool. In general it is not recommended to
- use the <productname>PostgreSQL</productname> provided connection
- pool. Check your application server or check out the excellent
- <ulink url="http://commons.apache.org/dbcp/">
- jakarta commons DBCP</ulink> project.
- </para>
-
- <table id="ds-ds-imp">
- <title><classname>DataSource</classname> Implementations</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Pooling</entry>
- <entry>Implementation Class</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>No</entry>
- <entry><classname>org.postgresql.ds.PGSimpleDataSource</classname></entry>
- </row>
-
- <row>
- <entry>Yes</entry>
- <entry><classname>org.postgresql.ds.PGPoolingDataSource</classname></entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
-
- <para>
- Both implementations use the same configuration scheme.
- <acronym>JDBC</acronym> requires that a
- <literal>DataSource</literal> be configured via JavaBean
- properties, shown in <xref linkend="ds-ds-props"/>, so there
- are get and set methods for each of these properties.
- </para>
-
- <table id="ds-ds-props">
- <title><classname>DataSource</classname> Configuration Properties</title>
-
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Property</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry><literal>serverName</literal></entry>
- <entry><type>String</type></entry>
- <entry><productname>PostgreSQL</productname> database server
- host name</entry>
- </row>
-
- <row>
- <entry><literal>databaseName</literal></entry>
- <entry><type>String</type></entry>
- <entry><productname>PostgreSQL</productname> database name</entry>
- </row>
-
- <row>
- <entry><literal>portNumber</literal></entry>
- <entry><type>int</type></entry>
- <entry>TCP port which the
- <productname>PostgreSQL</productname> database server is
- listening on (or 0 to use the default port)</entry>
- </row>
-
- <row>
- <entry><literal>user</literal></entry>
- <entry><type>String</type></entry>
- <entry>User used to make database connections</entry>
- </row>
-
- <row>
- <entry><literal>password</literal></entry>
- <entry><type>String</type></entry>
- <entry>Password used to make database connections</entry>
- </row>
-
- <row>
- <entry><literal>ssl</literal></entry>
- <entry><type>boolean</type></entry>
- <entry>
- If <literal>true</literal>, use SSL encrypted connections
- (default <literal>false</literal>)
- </entry>
- </row>
-
- <row>
- <entry><literal>sslfactory</literal></entry>
- <entry><type>String</type></entry>
- <entry>
- Custom <classname>javax.net.ssl.SSLSocketFactory</classname>
- class name (see <xref linkend="ssl-factory"/>)
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <para>The pooling implementation requires some additional
- configuration properties, which are shown in <xref linkend="ds-ds-xprops"/>.</para>
-
- <table id="ds-ds-xprops">
- <title>Additional Pooling <classname>DataSource</classname> Configuration Properties</title>
-
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Property</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry><literal>dataSourceName</literal></entry>
- <entry><type>String</type></entry>
- <entry>Every pooling <literal>DataSource</literal> must have a
- unique name.</entry>
- </row>
-
- <row>
- <entry><literal>initialConnections</literal></entry>
- <entry><type>int</type></entry>
- <entry>The number of database connections to be created
- when the pool is initialized.</entry>
- </row>
-
- <row>
- <entry><literal>maxConnections</literal></entry>
- <entry><type>int</type></entry>
- <entry>The maximum number of open database connections to
- allow. When more connections are requested, the caller
- will hang until a connection is returned to the pool.</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <para><xref linkend="ds-example"/> shows an example of typical application code using a
- pooling <literal>DataSource</literal>.</para>
-
- <example id="ds-example">
- <title><literal>DataSource</literal> Code Example</title>
-
- <para>
- Code to initialize a pooling <classname>DataSource</classname> might look like this:
-<programlisting>
-PGPoolingDataSource source = new PGPoolingDataSource();
-source.setDataSourceName("A Data Source");
-source.setServerName("localhost");
-source.setDatabaseName("test");
-source.setUser("testuser");
-source.setPassword("testpassword");
-source.setMaxConnections(10);
-</programlisting>
- Then code to use a connection from the pool might look
- like this. Note that it is critical that the connections
- are eventually closed. Else the pool will <quote>leak</quote> connections and
- will eventually lock all the clients out.
-<programlisting>
-Connection conn = null;
-try {
- conn = source.getConnection();
- // use connection
-} catch (SQLException e) {
- // log error
-} finally {
- if (con != null) {
- try { conn.close(); } catch (SQLException e) {}
- }
-}
-</programlisting>
- </para>
- </example>
- </sect1>
- <sect1 id="tomcat">
- <title>Tomcat setup</title>
- <indexterm zone="tomcat">
- <primary>tomcat</primary>
- </indexterm>
-
- <note>
- <para>
- The postgresql.jar file must be placed in $CATALINA_HOME/common/lib
- in both Tomcat 4 and 5.
- </para>
- </note>
-
- <para>
- The absolute easiest way to set this up in either tomcat instance
- is to use the admin web application that comes with Tomcat, simply
- add the datasource to the context you want to use it in.
- </para>
-
- <para>
- Setup for Tomcat 4 place the following inside the <Context> tag
- inside conf/server.xml
- <programlisting lang="xml">
- <![CDATA[
-<Resource name="jdbc/postgres" scope="Shareable" type="javax.sql.DataSource"/>
-<ResourceParams name="jdbc/postgres">
- <parameter>
- <name>validationQuery</name>
- <value>select version();</value>
- </parameter>
- <parameter>
- <name>url</name>
- <value>jdbc:postgresql://localhost/davec</value>
- </parameter>
- <parameter>
- <name>password</name>
- <value>davec</value>
- </parameter>
- <parameter>
- <name>maxActive</name>
- <value>4</value>
- </parameter>
- <parameter>
- <name>maxWait</name>
- <value>5000</value>
- </parameter>
- <parameter>
- <name>driverClassName</name>
- <value>org.postgresql.Driver</value>
- </parameter>
- <parameter>
- <name>username</name>
- <value>davec</value>
- </parameter>
- <parameter>
- <name>maxIdle</name>
- <value>2</value>
- </parameter>
-</ResourceParams>]]>
- </programlisting>
- </para>
-
- <para>
- Setup for Tomcat 5, you can use the above method, except that it
- goes inside the <DefaultContext> tag inside the <Host>
- tag. eg. <Host> ... <DefaultContext> ...
- </para>
- <para>
- Alternatively there is a conf/Catalina/hostname/context.xml file.
- For example http://localhost:8080/servlet-example has a directory
- $CATALINA_HOME/conf/Catalina/localhost/servlet-example.xml file.
- Inside this file place the above xml inside the <Context> tag
- </para>
-
- <para>
- Then you can use the following code to access the connection.
-<programlisting lang="java">
-import javax.naming.*;
-import javax.sql.*;
-import java.sql.*;
-public class DBTest
-{
-
- String foo = "Not Connected";
- int bar = -1;
-
- public void init()
- {
-
- try
- {
- Context ctx = new InitialContext();
- if(ctx == null )
- throw new Exception("Boom - No Context");
-
- // /jdbc/postgres is the name of the resource above
- DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/postgres");
-
- if (ds != null)
- {
- Connection conn = ds.getConnection();
-
- if(conn != null)
- {
- foo = "Got Connection "+conn.toString();
- Statement stmt = conn.createStatement();
- ResultSet rst = stmt.executeQuery("select id, foo, bar from testdata");
- if(rst.next()) {
- foo=rst.getString(2);
- bar=rst.getInt(3);
- }
- conn.close();
- }
- }
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- }
-
- public String getFoo() { return foo; }
-
- public int getBar() { return bar;}
-}
-
-</programlisting>
- </para>
- </sect1>
-
- <sect1 id="jndi">
- <title>Data Sources and <acronym>JNDI</acronym></title>
-
- <indexterm zone="jndi">
- <primary>JNDI</primary>
- </indexterm>
-
- <para>
- All the <literal>ConnectionPoolDataSource</literal> and
- <literal>DataSource</literal> implementations can be stored
- in <acronym>JNDI</acronym>. In the case of the nonpooling
- implementations, a new instance will be created every time the
- object is retrieved from <acronym>JNDI</acronym>, with the
- same settings as the instance that was stored. For the
- pooling implementations, the same instance will be retrieved
- as long as it is available (e.g., not a different
- <acronym>JVM</acronym> retrieving the pool from
- <acronym>JNDI</acronym>), or a new instance with the same
- settings created otherwise.
- </para>
-
- <para>
- In the application server environment, typically the
- application server's <literal>DataSource</literal> instance
- will be stored in <acronym>JNDI</acronym>, instead of the
- <productname>PostgreSQL</productname>
- <literal>ConnectionPoolDataSource</literal> implementation.
- </para>
-
- <para>
- In an application environment, the application may store
- the <literal>DataSource</literal> in <acronym>JNDI</acronym>
- so that it doesn't have to make a reference to the
- <literal>DataSource</literal> available to all application
- components that may need to use it. An example of this is
- shown in <xref linkend="ds-jndi"/>.
- </para>
-
- <example id="ds-jndi">
- <title><classname>DataSource</classname> <acronym>JNDI</acronym> Code Example</title>
-
- <para>
- Application code to initialize a pooling <classname>DataSource</classname> and add
- it to <acronym>JNDI</acronym> might look like this:
-<programlisting>
-PGPoolingDataSource source = new PGPoolingDataSource();
-source.setDataSourceName("A Data Source");
-source.setServerName("localhost");
-source.setDatabaseName("test");
-source.setUser("testuser");
-source.setPassword("testpassword");
-source.setMaxConnections(10);
-new InitialContext().rebind("DataSource", source);
-</programlisting>
- Then code to use a connection from the pool might look
- like this:
-<programlisting>
-Connection conn = null;
-try {
- DataSource source = (DataSource)new InitialContext().lookup("DataSource");
- conn = source.getConnection();
- // use connection
-} catch (SQLException e) {
- // log error
-} catch (NamingException e) {
- // DataSource wasn't found in JNDI
-} finally {
- if (con != null) {
- try { conn.close(); } catch (SQLException e) {}
- }
-}
-</programlisting>
- </para>
- </example>
- </sect1>
-
- </chapter>
-
- <chapter id="reading">
- <title>Further Reading</title>
-
- <para>
- If you have not yet read it, you are advised you read the
- <acronym>JDBC</acronym> <acronym>API</acronym> Documentation
- (supplied with Oracle's <acronym>JDK</acronym>) and the
- <acronym>JDBC</acronym> Specification. Both are available from
- <ulink
- url="http://www.oracle.com/technetwork/java/javase/jdbc/index.html"></ulink>.
- </para>
-
- <para>
- <ulink
- url="http://jdbc.postgresql.org/index.html"></ulink>
- contains updated information not included in this manual including
- Javadoc class documentation and a FAQ. Additionally it
- offers precompiled drivers.
- </para>
- </chapter>
-</book>
diff --git a/org/postgresql/.gitignore b/org/postgresql/.gitignore
deleted file mode 100644
index 3e0ef3d..0000000
--- a/org/postgresql/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-Driver.java
diff --git a/org/postgresql/Driver.java.in b/org/postgresql/Driver.java.in
deleted file mode 100644
index 9ae9223..0000000
--- a/org/postgresql/Driver.java.in
+++ /dev/null
@@ -1,755 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql;
-
-import java.io.*;
-import java.sql.*;
-import java.util.*;
-import java.net.URL;
-
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.PSQLDriverVersion;
-import org.postgresql.util.GT;
-import org.postgresql.util.HostSpec;
-
-import org.postgresql.core.Logger;
-
-/**
- * The Java SQL framework allows for multiple database drivers. Each
- * driver should supply a class that implements the Driver interface
- *
- * <p>The DriverManager will try to load as many drivers as it can find and
- * then for any given connection request, it will ask each driver in turn
- * to try to connect to the target URL.
- *
- * <p>It is strongly recommended that each Driver class should be small and
- * standalone so that the Driver class can be loaded and queried without
- * bringing in vast quantities of supporting code.
- *
- * <p>When a Driver class is loaded, it should create an instance of itself
- * and register it with the DriverManager. This means that a user can load
- * and register a driver by doing Class.forName("foo.bah.Driver")
- *
- * @see org.postgresql.PGConnection
- * @see java.sql.Driver
- */
-public class Driver implements java.sql.Driver
-{
-
- // make these public so they can be used in setLogLevel below
-
- public static final int DEBUG = 2;
- public static final int INFO = 1;
-
- private static final Logger logger = new Logger();
- private static boolean logLevelSet = false;
- private static Timer cancelTimer=null;
-
- static
- {
- try
- {
- // moved the registerDriver from the constructor to here
- // because some clients call the driver themselves (I know, as
- // my early jdbc work did - and that was based on other examples).
- // Placing it here, means that the driver is registered once only.
- java.sql.DriverManager.registerDriver(new Driver());
- }
- catch (SQLException e)
- {
- e.printStackTrace();
- }
- }
-
- // Helper to retrieve default properties from classloader resource
- // properties files.
- private Properties defaultProperties;
- private synchronized Properties getDefaultProperties() throws IOException {
- if (defaultProperties != null)
- return defaultProperties;
-
- // Make sure we load properties with the maximum possible
- // privileges.
- try
- {
- defaultProperties = (Properties)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws IOException {
- return loadDefaultProperties();
- }
- });
- }
- catch (PrivilegedActionException e)
- {
- throw (IOException)e.getException();
- }
-
- // Use the loglevel from the default properties (if any)
- // as the driver-wide default unless someone explicitly called
- // setLogLevel() already.
- synchronized (Driver.class) {
- if (!logLevelSet) {
- String driverLogLevel = defaultProperties.getProperty("loglevel");
- if (driverLogLevel != null) {
- try {
- setLogLevel(Integer.parseInt(driverLogLevel));
- } catch (Exception l_e) {
- // XXX revisit
- // invalid value for loglevel; ignore it
- }
- }
- }
- }
-
- return defaultProperties;
- }
-
- private Properties loadDefaultProperties() throws IOException {
- Properties merged = new Properties();
-
- try {
- merged.setProperty("user", System.getProperty("user.name"));
- } catch (java.lang.SecurityException se) {
- // We're just trying to set a default, so if we can't
- // it's not a big deal.
- }
-
- // If we are loaded by the bootstrap classloader, getClassLoader()
- // may return null. In that case, try to fall back to the system
- // classloader.
- //
- // We should not need to catch SecurityException here as we are
- // accessing either our own classloader, or the system classloader
- // when our classloader is null. The ClassLoader javadoc claims
- // neither case can throw SecurityException.
- ClassLoader cl = getClass().getClassLoader();
- if (cl == null)
- cl = ClassLoader.getSystemClassLoader();
-
- if (cl == null) {
- logger.debug("Can't find a classloader for the Driver; not loading driver configuration");
- return merged; // Give up on finding defaults.
- }
-
- logger.debug("Loading driver configuration via classloader " + cl);
-
- // When loading the driver config files we don't want settings found
- // in later files in the classpath to override settings specified in
- // earlier files. To do this we've got to read the returned
- // Enumeration into temporary storage.
- ArrayList urls = new ArrayList();
- Enumeration urlEnum = cl.getResources("org/postgresql/driverconfig.properties");
- while (urlEnum.hasMoreElements())
- {
- urls.add(urlEnum.nextElement());
- }
-
- for (int i=urls.size()-1; i>=0; i--) {
- URL url = (URL)urls.get(i);
- logger.debug("Loading driver configuration from: " + url);
- InputStream is = url.openStream();
- merged.load(is);
- is.close();
- }
-
- return merged;
- }
-
- /**
- * Try to make a database connection to the given URL. The driver
- * should return "null" if it realizes it is the wrong kind of
- * driver to connect to the given URL. This will be common, as
- * when the JDBC driverManager is asked to connect to a given URL,
- * it passes the URL to each loaded driver in turn.
- *
- * <p>The driver should raise an SQLException if it is the right driver
- * to connect to the given URL, but has trouble connecting to the
- * database.
- *
- * <p>The java.util.Properties argument can be used to pass arbitrary
- * string tag/value pairs as connection arguments.
- *
- * user - (required) The user to connect as
- * password - (optional) The password for the user
- * ssl - (optional) Use SSL when connecting to the server
- * charSet - (optional) The character set to be used for converting
- * to/from the database to unicode. If multibyte is enabled on the
- * server then the character set of the database is used as the default,
- * otherwise the jvm character encoding is used as the default.
- * This value is only used when connecting to a 7.2 or older server.
- * loglevel - (optional) Enable logging of messages from the driver.
- * The value is an integer from 1 to 2 where:
- * INFO = 1, DEBUG = 2
- * The output is sent to DriverManager.getPrintWriter() if set,
- * otherwise it is sent to System.out.
- * compatible - (optional) This is used to toggle
- * between different functionality as it changes across different releases
- * of the jdbc driver code. The values here are versions of the jdbc
- * client and not server versions. For example in 7.1 get/setBytes
- * worked on LargeObject values, in 7.2 these methods were changed
- * to work on bytea values. This change in functionality could
- * be disabled by setting the compatible level to be "7.1", in
- * which case the driver will revert to the 7.1 functionality.
- *
- * <p>Normally, at least
- * "user" and "password" properties should be included in the
- * properties. For a list of supported
- * character encoding , see
- * http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html
- * Note that you will probably want to have set up the Postgres database
- * itself to use the same encoding, with the "-E <encoding>" argument
- * to createdb.
- *
- * Our protocol takes the forms:
- * <PRE>
- * jdbc:postgresql://host:port/database?param1=val1&...
- * </PRE>
- *
- * @param url the URL of the database to connect to
- * @param info a list of arbitrary tag/value pairs as connection
- * arguments
- * @return a connection to the URL or null if it isnt us
- * @exception SQLException if a database access error occurs
- * @see java.sql.Driver#connect
- */
- public java.sql.Connection connect(String url, Properties info) throws SQLException
- {
- // get defaults
- Properties defaults;
- try
- {
- defaults = getDefaultProperties();
- }
- catch (IOException ioe)
- {
- throw new PSQLException(GT.tr("Error loading default settings from driverconfig.properties"),
- PSQLState.UNEXPECTED_ERROR, ioe);
- }
-
- // override defaults with provided properties
- Properties props = new Properties(defaults);
- for (Enumeration e = info.propertyNames(); e.hasMoreElements(); )
- {
- String propName = (String)e.nextElement();
- props.setProperty(propName, info.getProperty(propName));
- }
-
- // parse URL and add more properties
- if ((props = parseURL(url, props)) == null)
- {
- logger.debug("Error in url: " + url);
- return null;
- }
- try
- {
- logger.debug("Connecting with URL: " + url);
-
- // Enforce login timeout, if specified, by running the connection
- // attempt in a separate thread. If we hit the timeout without the
- // connection completing, we abandon the connection attempt in
- // the calling thread, but the separate thread will keep trying.
- // Eventually, the separate thread will either fail or complete
- // the connection; at that point we clean up the connection if
- // we managed to establish one after all. See ConnectThread for
- // more details.
- long timeout = timeout(props);
- if (timeout <= 0)
- return makeConnection(url, props);
-
- ConnectThread ct = new ConnectThread(url, props);
- new Thread(ct, "PostgreSQL JDBC driver connection thread").start();
- return ct.getResult(timeout);
- }
- catch (PSQLException ex1)
- {
- logger.debug("Connection error:", ex1);
- // re-throw the exception, otherwise it will be caught next, and a
- // org.postgresql.unusual error will be returned instead.
- throw ex1;
- }
- catch (java.security.AccessControlException ace)
- {
- throw new PSQLException(GT.tr("Your security policy has prevented the connection from being attempted. You probably need to grant the connect java.net.SocketPermission to the database server host and port that you wish to connect to."), PSQLState.UNEXPECTED_ERROR, ace);
- }
- catch (Exception ex2)
- {
- logger.debug("Unexpected connection error:", ex2);
- throw new PSQLException(GT.tr("Something unusual has occurred to cause the driver to fail. Please report this exception."),
- PSQLState.UNEXPECTED_ERROR, ex2);
- }
- }
-
- /**
- * Perform a connect in a separate thread; supports
- * getting the results from the original thread while enforcing
- * a login timout.
- */
- private static class ConnectThread implements Runnable {
- ConnectThread(String url, Properties props) {
- this.url = url;
- this.props = props;
- }
-
- public void run() {
- Connection conn;
- Throwable error;
-
- try {
- conn = makeConnection(url, props);
- error = null;
- } catch (Throwable t) {
- conn = null;
- error = t;
- }
-
- synchronized (this) {
- if (abandoned) {
- if (conn != null) {
- try {
- conn.close();
- } catch (SQLException e) {}
- }
- } else {
- result = conn;
- resultException = error;
- notify();
- }
- }
- }
-
- /**
- * Get the connection result from this (assumed running) thread.
- * If the timeout is reached without a result being available,
- * a SQLException is thrown.
- *
- * @param timeout timeout in milliseconds
- * @return the new connection, if successful
- * @throws SQLException if a connection error occurs or the timeout is reached
- */
- public Connection getResult(long timeout) throws SQLException {
- long expiry = System.currentTimeMillis() + timeout;
- synchronized (this) {
- while (true) {
- if (result != null)
- return result;
-
- if (resultException != null) {
- if (resultException instanceof SQLException) {
- resultException.fillInStackTrace();
- throw (SQLException)resultException;
- } else {
- throw new PSQLException(GT.tr("Something unusual has occurred to cause the driver to fail. Please report this exception."),
- PSQLState.UNEXPECTED_ERROR, resultException);
- }
- }
-
- long delay = expiry - System.currentTimeMillis();
- if (delay <= 0) {
- abandoned = true;
- throw new PSQLException(GT.tr("Connection attempt timed out."),
- PSQLState.CONNECTION_UNABLE_TO_CONNECT);
- }
-
- try {
- wait(delay);
- } catch (InterruptedException ie) {
-
- // reset the interrupt flag
- Thread.currentThread().interrupt();
- abandoned = true;
-
- // throw an unchecked exception which will hopefully not be ignored by the calling code
- throw new RuntimeException(GT.tr("Interrupted while attempting to connect."));
- }
- }
- }
- }
-
- private final String url;
- private final Properties props;
- private Connection result;
- private Throwable resultException;
- private boolean abandoned;
- }
-
- /**
- * Create a connection from URL and properties. Always
- * does the connection work in the current thread without
- * enforcing a timeout, regardless of any timeout specified
- * in the properties.
- *
- * @param url the original URL
- * @param props the parsed/defaulted connection properties
- * @return a new connection
- * @throws SQLException if the connection could not be made
- */
- private static Connection makeConnection(String url, Properties props) throws SQLException {
- return new @JDBCCONNECTCLASS@(hostSpecs(props),
- user(props), database(props),
- props, url);
- }
-
- /**
- * Returns true if the driver thinks it can open a connection to the
- * given URL. Typically, drivers will return true if they understand
- * the subprotocol specified in the URL and false if they don't. Our
- * protocols start with jdbc:postgresql:
- *
- * @see java.sql.Driver#acceptsURL
- * @param url the URL of the driver
- * @return true if this driver accepts the given URL
- * @exception SQLException if a database-access error occurs
- * (Dont know why it would *shrug*)
- */
- public boolean acceptsURL(String url) throws SQLException
- {
- if (parseURL(url, null) == null)
- return false;
- return true;
- }
-
- private static final Object[][] knownProperties = {
- { "PGDBNAME", Boolean.TRUE,
- "Database name to connect to; may be specified directly in the JDBC URL." },
- { "user", Boolean.TRUE,
- "Username to connect to the database as.", null },
- { "PGHOST", Boolean.FALSE,
- "Hostname of the PostgreSQL server; may be specified directly in the JDBC URL." },
- { "PGPORT", Boolean.FALSE,
- "Port number to connect to the PostgreSQL server on; may be specified directly in the JDBC URL.", },
- { "password", Boolean.FALSE,
- "Password to use when authenticating.", },
- { "protocolVersion", Boolean.FALSE,
- "Force use of a particular protocol version when connecting; if set, disables protocol version fallback.", },
- { "ssl", Boolean.FALSE,
- "Control use of SSL; any nonnull value causes SSL to be required." },
- { "sslfactory", Boolean.FALSE,
- "Provide a SSLSocketFactory class when using SSL." },
- { "sslfactoryarg", Boolean.FALSE,
- "Argument forwarded to constructor of SSLSocketFactory class." },
- { "loglevel", Boolean.FALSE,
- "Control the driver's log verbosity: 0 is off, 1 is INFO, 2 is DEBUG.",
- new String[] { "0", "1", "2" } },
- { "allowEncodingChanges", Boolean.FALSE,
- "Allow the user to change the client_encoding variable." },
- { "logUnclosedConnections", Boolean.FALSE,
- "When connections that are not explicitly closed are garbage collected, log the stacktrace from the opening of the connection to trace the leak source."},
- { "prepareThreshold", Boolean.FALSE,
- "Default statement prepare threshold (numeric)." },
- { "binaryTransfer", Boolean.FALSE,
- "Use binary format for sending and receiving data if possible." },
- { "binaryTransferEnable", Boolean.FALSE,
- "Comma separated list of types to enable binary transfer. Either OID numbers or names." },
- { "binaryTransferDisable", Boolean.FALSE,
- "Comma separated list of types to disable binary transfer. Either OID numbers or names. Overrides values in the driver default set and values set with binaryTransferEnable." },
- { "charSet", Boolean.FALSE,
- "When connecting to a pre-7.3 server, the database encoding to assume is in use." },
- { "compatible", Boolean.FALSE,
- "Force compatibility of some features with an older version of the driver.",
- new String[] { "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2" } },
- { "loginTimeout", Boolean.FALSE,
- "The login timeout, in seconds; 0 means no timeout beyond the normal TCP connection timout." },
- { "socketTimeout", Boolean.FALSE,
- "The timeout value for socket read operations, in seconds; 0 means no timeout." },
- { "tcpKeepAlive", Boolean.FALSE,
- "Enable or disable TCP keep-alive probe." },
- { "stringtype", Boolean.FALSE,
- "The type to bind String parameters as (usually 'varchar'; 'unspecified' allows implicit casting to other types)",
- new String[] { "varchar", "unspecified" } },
- { "kerberosServerName", Boolean.FALSE,
- "The Kerberos service name to use when authenticating with GSSAPI. This is equivalent to libpq's PGKRBSRVNAME environment variable." },
- { "jaasApplicationName", Boolean.FALSE,
- "Specifies the name of the JAAS system or application login configuration." }
- };
-
- /**
- * The getPropertyInfo method is intended to allow a generic GUI
- * tool to discover what properties it should prompt a human for
- * in order to get enough information to connect to a database.
- *
- * <p>Note that depending on the values the human has supplied so
- * far, additional values may become necessary, so it may be necessary
- * to iterate through several calls to getPropertyInfo
- *
- * @param url the Url of the database to connect to
- * @param info a proposed list of tag/value pairs that will be sent on
- * connect open.
- * @return An array of DriverPropertyInfo objects describing
- * possible properties. This array may be an empty array if
- * no properties are required
- * @exception SQLException if a database-access error occurs
- * @see java.sql.Driver#getPropertyInfo
- */
- public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
- {
- Properties copy = new Properties(info);
- parseURL(url, copy);
-
- DriverPropertyInfo[] props = new DriverPropertyInfo[knownProperties.length];
- for (int i = 0; i < knownProperties.length; ++i)
- {
- String name = (String) knownProperties[i][0];
- props[i] = new DriverPropertyInfo(name, copy.getProperty(name));
- props[i].required = ((Boolean) knownProperties[i][1]).booleanValue();
- props[i].description = (String) knownProperties[i][2];
- if (knownProperties[i].length > 3)
- props[i].choices = (String[]) knownProperties[i][3];
- }
-
- return props;
- }
-
- public static final int MAJORVERSION = @MAJORVERSION@;
- /**
- * Gets the drivers major version number
- *
- * @return the drivers major version number
- */
- public int getMajorVersion()
- {
- return MAJORVERSION;
- }
-
-
- public static final int MINORVERSION = @MINORVERSION@;
- /**
- * Get the drivers minor version number
- *
- * @return the drivers minor version number
- */
- public int getMinorVersion()
- {
- return MINORVERSION;
- }
-
- /**
- * Returns the server version series of this driver and the
- * specific build number.
- */
- public static String getVersion()
- {
- return "@VERSION@ (build " + PSQLDriverVersion.buildNumber + ")";
- }
-
- /**
- * Report whether the driver is a genuine JDBC compliant driver. A
- * driver may only report "true" here if it passes the JDBC compliance
- * tests, otherwise it is required to return false. JDBC compliance
- * requires full support for the JDBC API and full support for SQL 92
- * Entry Level.
- *
- * <p>For PostgreSQL, this is not yet possible, as we are not SQL92
- * compliant (yet).
- */
- public boolean jdbcCompliant()
- {
- return false;
- }
-
- static private String[] protocols = { "jdbc", "postgresql" };
-
- /**
- * Constructs a new DriverURL, splitting the specified URL into its
- * component parts
- * @param url JDBC URL to parse
- * @param defaults Default properties
- * @return Properties with elements added from the url
- * @exception SQLException
- */
- Properties parseURL(String url, Properties defaults) throws SQLException
- {
- Properties urlProps = new Properties(defaults);
-
- String l_urlServer = url;
- String l_urlArgs = "";
-
- int l_qPos = url.indexOf('?');
- if (l_qPos != -1)
- {
- l_urlServer = url.substring(0, l_qPos);
- l_urlArgs = url.substring(l_qPos + 1);
- }
-
- if (!l_urlServer.startsWith("jdbc:postgresql:")) {
- return null;
- }
- l_urlServer = l_urlServer.substring("jdbc:postgresql:".length());
-
- if (l_urlServer.startsWith("//")) {
- l_urlServer = l_urlServer.substring(2);
- int slash = l_urlServer.indexOf('/');
- if (slash == -1) {
- return null;
- }
- urlProps.setProperty("PGDBNAME", l_urlServer.substring(slash + 1));
-
- String[] addresses = l_urlServer.substring(0, slash).split(",");
- StringBuffer hosts = new StringBuffer();
- StringBuffer ports = new StringBuffer();
- for (int addr = 0; addr < addresses.length; ++addr) {
- String address = addresses[addr];
-
- int portIdx = address.lastIndexOf(':');
- if (portIdx != -1 && address.lastIndexOf(']') < portIdx) {
- String portStr = address.substring(portIdx + 1);
- try {
- Integer.parseInt(portStr);
- } catch (NumberFormatException ex) {
- return null;
- }
- ports.append(portStr);
- hosts.append(address.subSequence(0, portIdx));
- } else {
- ports.append("@DEF_PGPORT@");
- hosts.append(address);
- }
- ports.append(',');
- hosts.append(',');
- }
- ports.setLength(ports.length() - 1);
- hosts.setLength(hosts.length() - 1);
- urlProps.setProperty("PGPORT", ports.toString());
- urlProps.setProperty("PGHOST", hosts.toString());
- } else {
- urlProps.setProperty("PGPORT", "@DEF_PGPORT@");
- urlProps.setProperty("PGHOST", "localhost");
- urlProps.setProperty("PGDBNAME", l_urlServer);
- }
-
- //parse the args part of the url
- String[] args = l_urlArgs.split("&");
- for (int i = 0; i < args.length; ++i)
- {
- String token = args[i];
- if (token.length() == 0) {
- continue;
- }
- int l_pos = token.indexOf('=');
- if (l_pos == -1)
- {
- urlProps.setProperty(token, "");
- }
- else
- {
- urlProps.setProperty(token.substring(0, l_pos), token.substring(l_pos + 1));
- }
- }
-
- return urlProps;
- }
-
- /**
- * @return the address portion of the URL
- */
- private static HostSpec[] hostSpecs(Properties props)
- {
- String[] hosts = props.getProperty("PGHOST").split(",");
- String[] ports = props.getProperty("PGPORT").split(",");
- HostSpec[] hostSpecs = new HostSpec[hosts.length];
- for (int i = 0; i < hostSpecs.length; ++i) {
- hostSpecs[i] = new HostSpec(hosts[i], Integer.parseInt(ports[i]));
- }
- return hostSpecs;
- }
-
- /**
- * @return the username of the URL
- */
- private static String user(Properties props)
- {
- return props.getProperty("user", "");
- }
-
- /**
- * @return the database name of the URL
- */
- private static String database(Properties props)
- {
- return props.getProperty("PGDBNAME", "");
- }
-
- /**
- * @return the timeout from the URL, in milliseconds
- */
- private static long timeout(Properties props)
- {
- String timeout = props.getProperty("loginTimeout");
- if (timeout != null) {
- try {
- return (long) (Float.parseFloat(timeout) * 1000);
- } catch (NumberFormatException e) {
- // Log level isn't set yet, so this doesn't actually
- // get printed.
- logger.debug("Couldn't parse loginTimeout value: " + timeout);
- }
- }
- return DriverManager.getLoginTimeout() * 1000;
- }
-
- /*
- * This method was added in v6.5, and simply throws an SQLException
- * for an unimplemented method. I decided to do it this way while
- * implementing the JDBC2 extensions to JDBC, as it should help keep the
- * overall driver size down.
- * It now requires the call Class and the function name to help when the
- * driver is used with closed software that don't report the stack strace
- * @param callClass the call Class
- * @param functionName the name of the unimplemented function with the type
- * of its arguments
- * @return PSQLException with a localized message giving the complete
- * description of the unimplemeted function
- */
- public static @NOTIMPLEMENTEDEXCEPTION@ notImplemented(Class callClass, String functionName)
- {
- return new @NOTIMPLEMENTEDEXCEPTION@(GT.tr("Method {0} is not yet implemented.", callClass.getName() + "." + functionName),
- PSQLState.NOT_IMPLEMENTED.getState());
- }
-
- /**
- * used to turn logging on to a certain level, can be called
- * by specifying fully qualified class ie org.postgresql.Driver.setLogLevel()
- * @param logLevel sets the level which logging will respond to
- * INFO being almost no messages
- * DEBUG most verbose
- */
- public static void setLogLevel(int logLevel)
- {
- synchronized (Driver.class) {
- logger.setLogLevel(logLevel);
- logLevelSet = true;
- }
- }
-
- public static int getLogLevel()
- {
- synchronized (Driver.class) {
- return logger.getLogLevel();
- }
- }
-
- public java.util.logging.Logger getParentLogger() throws @NOTIMPLEMENTEDEXCEPTION@
- {
- throw notImplemented(this.getClass(), "getParentLogger()");
- }
-
- public synchronized static void addTimerTask(TimerTask timerTask, long milliSeconds)
- {
-
- if ( cancelTimer == null )
- {
- cancelTimer = new Timer(true);
- }
- cancelTimer.schedule( timerTask, milliSeconds );
- }
-
-}
diff --git a/org/postgresql/PGConnection.java b/org/postgresql/PGConnection.java
deleted file mode 100644
index 6e98361..0000000
--- a/org/postgresql/PGConnection.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql;
-
-import java.sql.*;
-import org.postgresql.copy.CopyManager;
-import org.postgresql.fastpath.Fastpath;
-import org.postgresql.largeobject.LargeObjectManager;
-
-/**
- * This interface defines the public PostgreSQL extensions to
- * java.sql.Connection. All Connections returned by the PostgreSQL driver
- * implement PGConnection.
- */
-public interface PGConnection
-{
- /**
- * This method returns any notifications that have been received
- * since the last call to this method.
- * Returns null if there have been no notifications.
- * @since 7.3
- */
- public PGNotification[] getNotifications() throws SQLException;
-
- /**
- * This returns the COPY API for the current connection.
- * @since 8.4
- */
- public CopyManager getCopyAPI() throws SQLException;
-
- /**
- * This returns the LargeObject API for the current connection.
- * @since 7.3
- */
- public LargeObjectManager getLargeObjectAPI() throws SQLException;
-
- /**
- * This returns the Fastpath API for the current connection.
- * @since 7.3
- */
- public Fastpath getFastpathAPI() throws SQLException;
-
- /**
- * This allows client code to add a handler for one of org.postgresql's
- * more unique data types. It is approximately equivalent to
- * <code>addDataType(type, Class.forName(name))</code>.
- *
- * @deprecated As of 8.0, replaced by
- * {@link #addDataType(String,Class)}. This deprecated method does not
- * work correctly for registering classes that cannot be directly loaded
- * by the JDBC driver's classloader.
- * @throws RuntimeException if the type cannot be registered (class not
- * found, etc).
- */
- public void addDataType(String type, String name);
-
- /**
- * This allows client code to add a handler for one of org.postgresql's
- * more unique data types.
- *
- * <p><b>NOTE:</b> This is not part of JDBC, but an extension.
- *
- * <p>The best way to use this is as follows:
- *
- * <p><pre>
- * ...
- * ((org.postgresql.PGConnection)myconn).addDataType("mytype", my.class.name.class);
- * ...
- * </pre>
- *
- * <p>where myconn is an open Connection to org.postgresql.
- *
- * <p>The handling class must extend org.postgresql.util.PGobject
- *
- * @since 8.0
- *
- * @param type the PostgreSQL type to register
- * @param klass the class implementing the Java representation of the type;
- * this class must implement {@link org.postgresql.util.PGobject}).
- *
- * @throws SQLException if <code>klass</code> does not implement
- * {@link org.postgresql.util.PGobject}).
- *
- * @see org.postgresql.util.PGobject
- */
- public void addDataType(String type, Class klass)
- throws SQLException;
-
- /**
- * Set the default statement reuse threshold before enabling server-side
- * prepare. See {@link org.postgresql.PGStatement#setPrepareThreshold(int)} for
- * details.
- *
- * @since build 302
- * @param threshold the new threshold
- */
- public void setPrepareThreshold(int threshold);
-
- /**
- * Get the default server-side prepare reuse threshold for statements created
- * from this connection.
- *
- * @since build 302
- * @return the current threshold
- */
- public int getPrepareThreshold();
-
-}
-
diff --git a/org/postgresql/PGNotification.java b/org/postgresql/PGNotification.java
deleted file mode 100644
index d37eb80..0000000
--- a/org/postgresql/PGNotification.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql;
-
-/**
- * This interface defines the public PostgreSQL extension for Notifications
- */
-public interface PGNotification
-{
- /**
- * Returns name of this notification
- * @since 7.3
- */
- public String getName();
-
- /**
- * Returns the process id of the backend process making this notification
- * @since 7.3
- */
- public int getPID();
-
- /**
- * Returns additional information from the notifying process.
- * This feature has only been implemented in server versions 9.0
- * and later, so previous versions will always return an empty String.
- *
- * @since 8.0
- */
- public String getParameter();
-
-}
-
diff --git a/org/postgresql/PGRefCursorResultSet.java b/org/postgresql/PGRefCursorResultSet.java
deleted file mode 100644
index c80b734..0000000
--- a/org/postgresql/PGRefCursorResultSet.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql;
-
-/**
- * A ref cursor based result set.
- *
- * @deprecated As of 8.0, this interface is only present for backwards-
- * compatibility purposes. New code should call getString() on the ResultSet
- * that contains the refcursor to obtain the underlying cursor name.
- */
-public interface PGRefCursorResultSet
-{
-
- /** @return the name of the cursor.
- * @deprecated As of 8.0, replaced with calling getString() on
- * the ResultSet that this ResultSet was obtained from.
- */
- public String getRefCursor ();
-}
diff --git a/org/postgresql/PGResultSetMetaData.java b/org/postgresql/PGResultSetMetaData.java
deleted file mode 100644
index 56dc1c9..0000000
--- a/org/postgresql/PGResultSetMetaData.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql;
-
-import java.sql.SQLException;
-
-public interface PGResultSetMetaData
-{
-
- /**
- * Returns the underlying column name of a query result, or ""
- * if it is unable to be determined.
- *
- * @since 8.0
- */
- public String getBaseColumnName(int column) throws SQLException;
-
- /**
- * Returns the underlying table name of query result, or ""
- * if it is unable to be determined.
- *
- * @since 8.0
- */
- public String getBaseTableName(int column) throws SQLException;
-
- /**
- * Returns the underlying table name of query result, or ""
- * if it is unable to be determined.
- *
- * @since 8.0
- */
- public String getBaseSchemaName(int column) throws SQLException;
-
-}
diff --git a/org/postgresql/PGStatement.java b/org/postgresql/PGStatement.java
deleted file mode 100644
index acfa345..0000000
--- a/org/postgresql/PGStatement.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql;
-
-import java.sql.*;
-
-/**
- * This interface defines the public PostgreSQL extensions to
- * java.sql.Statement. All Statements constructed by the PostgreSQL
- * driver implement PGStatement.
- */
-public interface PGStatement
-{
- // We can't use Long.MAX_VALUE or Long.MIN_VALUE for java.sql.date
- // because this would break the 'normalization contract' of the
- // java.sql.Date API.
- // The follow values are the nearest MAX/MIN values with hour,
- // minute, second, millisecond set to 0 - this is used for
- // -infinity / infinity representation in Java
- public static final long DATE_POSITIVE_INFINITY = 9223372036825200000l;
- public static final long DATE_NEGATIVE_INFINITY = -9223372036832400000l;
- public static final long DATE_POSITIVE_SMALLER_INFINITY = 185543533774800000l;
- public static final long DATE_NEGATIVE_SMALLER_INFINITY = -185543533774800000l;
-
-
- /**
- * Returns the Last inserted/updated oid.
- * @return OID of last insert
- * @since 7.3
- */
- public long getLastOID() throws SQLException;
-
- /**
- * Turn on the use of prepared statements in the server (server side
- * prepared statements are unrelated to jdbc PreparedStatements)
- * As of build 302, this method is equivalent to
- * <code>setPrepareThreshold(1)</code>.
- *
- * @deprecated As of build 302, replaced by {@link #setPrepareThreshold(int)}
- * @since 7.3
- */
- public void setUseServerPrepare(boolean flag) throws SQLException;
-
- /**
- * Checks if this statement will be executed as a server-prepared
- * statement. A return value of <code>true</code> indicates that the next
- * execution of the statement will be done as a server-prepared statement,
- * assuming the underlying protocol supports it.
- *
- * @return true if the next reuse of this statement will use a
- * server-prepared statement
- */
- public boolean isUseServerPrepare();
-
- /**
- * Sets the reuse threshold for using server-prepared statements.
- *<p>
- * If <code>threshold</code> is a non-zero value N, the Nth and subsequent
- * reuses of a PreparedStatement will use server-side prepare.
- *<p>
- * If <code>threshold</code> is zero, server-side prepare will not be used.
- *<p>
- * The reuse threshold is only used by PreparedStatement and
- * CallableStatement objects; it is ignored for plain Statements.
- *
- * @since build 302
- * @param threshold the new threshold for this statement
- * @throws SQLException if an exception occurs while changing the threshold
- */
- public void setPrepareThreshold(int threshold) throws SQLException;
-
- /**
- * Gets the server-side prepare reuse threshold in use for this statement.
- *
- * @since build 302
- * @return the current threshold
- * @see #setPrepareThreshold(int)
- */
- public int getPrepareThreshold();
-}
diff --git a/org/postgresql/copy/CopyIn.java b/org/postgresql/copy/CopyIn.java
deleted file mode 100644
index 2801237..0000000
--- a/org/postgresql/copy/CopyIn.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2009-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.copy;
-
-import java.sql.SQLException;
-
-/**
- * Copy bulk data from client into a PostgreSQL table very fast.
- */
-public interface CopyIn extends CopyOperation {
-
- /**
- * Writes specified part of given byte array to an open and writable copy operation.
- * @param buf array of bytes to write
- * @param off offset of first byte to write (normally zero)
- * @param siz number of bytes to write (normally buf.length)
- * @throws SQLException if the operation fails
- */
- void writeToCopy(byte[] buf, int off, int siz) throws SQLException;
-
- /**
- * Force any buffered output to be sent over the network to the
- * backend. In general this is a useless operation as it will get
- * pushed over in due time or when endCopy is called. Some specific
- * modified server versions (Truviso) want this data sooner.
- * If you are unsure if you need to use this method, don't.
- */
- void flushCopy() throws SQLException;
-
- /**
- * Finishes copy operation succesfully.
- * @return number of updated rows for server 8.2 or newer (see getHandledRowCount())
- * @throws SQLException if the operation fails.
- */
- public long endCopy() throws SQLException;
-}
diff --git a/org/postgresql/copy/CopyManager.java b/org/postgresql/copy/CopyManager.java
deleted file mode 100644
index a2a1331..0000000
--- a/org/postgresql/copy/CopyManager.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2009-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-
-/**
- * Bulk data copy for PostgreSQL
- */
-package org.postgresql.copy;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.Writer;
-import java.sql.SQLException;
-
-import org.postgresql.core.Encoding;
-import org.postgresql.core.QueryExecutor;
-import org.postgresql.core.BaseConnection;
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * API for PostgreSQL COPY bulk data transfer
- */
-public class CopyManager {
- // I don't know what the best buffer size is, so we let people specify it if
- // they want, and if they don't know, we don't make them guess, so that if we
- // do figure it out we can just set it here and they reap the rewards.
- // Note that this is currently being used for both a number of bytes and a number
- // of characters.
- final static int DEFAULT_BUFFER_SIZE = 65536;
-
- private final Encoding encoding;
- private final QueryExecutor queryExecutor;
- private final BaseConnection connection;
-
- public CopyManager(BaseConnection connection) throws SQLException {
- this.encoding = connection.getEncoding();
- this.queryExecutor = connection.getQueryExecutor();
- this.connection = connection;
- }
-
- public CopyIn copyIn(String sql) throws SQLException {
- CopyOperation op = null;
- try {
- op = queryExecutor.startCopy(sql, connection.getAutoCommit());
- return (CopyIn) op;
- } catch(ClassCastException cce) {
- op.cancelCopy();
- throw new PSQLException(GT.tr("Requested CopyIn but got {0}", op.getClass().getName()), PSQLState.WRONG_OBJECT_TYPE, cce);
- }
- }
-
- public CopyOut copyOut(String sql) throws SQLException {
- CopyOperation op = null;
- try {
- op = queryExecutor.startCopy(sql, connection.getAutoCommit());
- return (CopyOut) op;
- } catch(ClassCastException cce) {
- op.cancelCopy();
- throw new PSQLException(GT.tr("Requested CopyOut but got {0}", op.getClass().getName()), PSQLState.WRONG_OBJECT_TYPE, cce);
- }
- }
-
- /**
- * Pass results of a COPY TO STDOUT query from database into a Writer.
- * @param sql COPY TO STDOUT statement
- * @param to the stream to write the results to (row by row)
- * @return number of rows updated for server 8.2 or newer; -1 for older
- * @throws SQLException on database usage errors
- * @throws IOException upon writer or database connection failure
- */
- public long copyOut(final String sql, Writer to) throws SQLException, IOException {
- byte[] buf;
- CopyOut cp = copyOut(sql);
- try {
- while ( (buf = cp.readFromCopy()) != null ) {
- to.write(encoding.decode(buf));
- }
- return cp.getHandledRowCount();
- } finally { // see to it that we do not leave the connection locked
- if(cp.isActive())
- cp.cancelCopy();
- }
- }
-
- /**
- * Pass results of a COPY TO STDOUT query from database into an OutputStream.
- * @param sql COPY TO STDOUT statement
- * @param to the stream to write the results to (row by row)
- * @return number of rows updated for server 8.2 or newer; -1 for older
- * @throws SQLException on database usage errors
- * @throws IOException upon output stream or database connection failure
- */
- public long copyOut(final String sql, OutputStream to) throws SQLException, IOException {
- byte[] buf;
- CopyOut cp = copyOut(sql);
- try {
- while( (buf = cp.readFromCopy()) != null ) {
- to.write(buf);
- }
- return cp.getHandledRowCount();
- } finally { // see to it that we do not leave the connection locked
- if(cp.isActive())
- cp.cancelCopy();
- }
- }
-
- /**
- * Use COPY FROM STDIN for very fast copying from a Reader into a database table.
- * @param sql COPY FROM STDIN statement
- * @param from a CSV file or such
- * @return number of rows updated for server 8.2 or newer; -1 for older
- * @throws SQLException on database usage issues
- * @throws IOException upon reader or database connection failure
- */
- public long copyIn(final String sql, Reader from) throws SQLException, IOException {
- return copyIn(sql, from, DEFAULT_BUFFER_SIZE);
- }
-
- /**
- * Use COPY FROM STDIN for very fast copying from a Reader into a database table.
- * @param sql COPY FROM STDIN statement
- * @param from a CSV file or such
- * @param bufferSize number of characters to buffer and push over network to server at once
- * @return number of rows updated for server 8.2 or newer; -1 for older
- * @throws SQLException on database usage issues
- * @throws IOException upon reader or database connection failure
- */
- public long copyIn(final String sql, Reader from, int bufferSize) throws SQLException, IOException {
- char[] cbuf = new char[bufferSize];
- int len;
- CopyIn cp = copyIn(sql);
- try {
- while ( (len = from.read(cbuf)) > 0) {
- byte[] buf = encoding.encode(new String(cbuf, 0, len));
- cp.writeToCopy(buf, 0, buf.length);
- }
- return cp.endCopy();
- } finally { // see to it that we do not leave the connection locked
- if(cp.isActive())
- cp.cancelCopy();
- }
- }
-
- /**
- * Use COPY FROM STDIN for very fast copying from an InputStream into a database table.
- * @param sql COPY FROM STDIN statement
- * @param from a CSV file or such
- * @return number of rows updated for server 8.2 or newer; -1 for older
- * @throws SQLException on database usage issues
- * @throws IOException upon input stream or database connection failure
- */
- public long copyIn(final String sql, InputStream from) throws SQLException, IOException {
- return copyIn(sql, from, DEFAULT_BUFFER_SIZE);
- }
-
- /**
- * Use COPY FROM STDIN for very fast copying from an InputStream into a database table.
- * @param sql COPY FROM STDIN statement
- * @param from a CSV file or such
- * @param bufferSize number of bytes to buffer and push over network to server at once
- * @return number of rows updated for server 8.2 or newer; -1 for older
- * @throws SQLException on database usage issues
- * @throws IOException upon input stream or database connection failure
- */
- public long copyIn(final String sql, InputStream from, int bufferSize) throws SQLException, IOException {
- byte[] buf = new byte[bufferSize];
- int len;
- CopyIn cp = copyIn(sql);
- try {
- while( (len = from.read(buf)) > 0 ) {
- cp.writeToCopy(buf, 0, len);
- }
- return cp.endCopy();
- } finally { // see to it that we do not leave the connection locked
- if(cp.isActive())
- cp.cancelCopy();
- }
- }
-}
diff --git a/org/postgresql/copy/CopyOperation.java b/org/postgresql/copy/CopyOperation.java
deleted file mode 100644
index 0612593..0000000
--- a/org/postgresql/copy/CopyOperation.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2009-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.copy;
-
-import java.sql.SQLException;
-
-/**
- * Exchange bulk data between client and PostgreSQL database tables.
- * See CopyIn and CopyOut for full interfaces for corresponding copy directions.
- */
-public interface CopyOperation {
-
- /**
- * @return number of fields in each row for this operation
- */
- int getFieldCount();
-
- /**
- * @return overall format of each row: 0 = textual, 1 = binary
- */
- int getFormat();
-
- /**
- * @param field number of field (0..fieldCount()-1)
- * @return format of requested field: 0 = textual, 1 = binary
- */
- int getFieldFormat(int field);
-
- /**
- * @return is connection reserved for this Copy operation?
- */
- boolean isActive();
-
- /**
- * Cancels this copy operation, discarding any exchanged data.
- * @throws SQLException if cancelling fails
- */
- void cancelCopy() throws SQLException;
-
- /**
- * After succesful end of copy, returns the number
- * of database records handled in that operation.
- * Only implemented in PostgreSQL server version 8.2 and up.
- * Otherwise, returns -1.
- * @return number of handled rows or -1
- */
- public long getHandledRowCount();
-}
diff --git a/org/postgresql/copy/CopyOut.java b/org/postgresql/copy/CopyOut.java
deleted file mode 100644
index f262e32..0000000
--- a/org/postgresql/copy/CopyOut.java
+++ /dev/null
@@ -1,14 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2009-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.copy;
-
-import java.sql.SQLException;
-
-public interface CopyOut extends CopyOperation {
- byte[] readFromCopy() throws SQLException;
-}
diff --git a/org/postgresql/copy/PGCopyInputStream.java b/org/postgresql/copy/PGCopyInputStream.java
deleted file mode 100644
index 8450475..0000000
--- a/org/postgresql/copy/PGCopyInputStream.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2009-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.copy;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.sql.SQLException;
-
-import org.postgresql.PGConnection;
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * InputStream for reading from a PostgreSQL COPY TO STDOUT operation
- */
-public class PGCopyInputStream extends InputStream implements CopyOut {
- private CopyOut op;
- private byte[] buf;
- private int at, len;
-
- /**
- * Uses given connection for specified COPY TO STDOUT operation
- * @param connection database connection to use for copying (protocol version 3 required)
- * @param sql COPY TO STDOUT statement
- * @throws SQLException if initializing the operation fails
- */
- public PGCopyInputStream(PGConnection connection, String sql) throws SQLException {
- this(connection.getCopyAPI().copyOut(sql));
- }
-
- /**
- * Use given CopyOut operation for reading
- * @param op COPY TO STDOUT operation
- * @throws SQLException if initializing the operation fails
- */
- public PGCopyInputStream(CopyOut op) {
- this.op = op;
- }
-
- private boolean gotBuf() throws IOException {
- if(at >= len) {
- try {
- buf = op.readFromCopy();
- } catch(SQLException sqle) {
- throw new IOException(GT.tr("Copying from database failed: {0}", sqle));
- }
- if(buf == null) {
- at = -1;
- return false;
- } else {
- at = 0;
- len = buf.length;
- return true;
- }
- }
- return buf != null;
- }
-
- private void checkClosed() throws IOException {
- if (op == null) {
- throw new IOException(GT.tr("This copy stream is closed."));
- }
- }
-
-
- public int available() throws IOException {
- checkClosed();
- return ( buf != null ? len - at : 0 );
- }
-
- public int read() throws IOException {
- checkClosed();
- return gotBuf() ? buf[at++] : -1;
- }
-
- public int read(byte[] buf) throws IOException {
- return read(buf, 0, buf.length);
- }
-
- public int read(byte[] buf, int off, int siz) throws IOException {
- checkClosed();
- int got = 0;
- while( got < siz && gotBuf() ) {
- buf[off+got++] = this.buf[at++];
- }
- return got;
- }
-
- public byte[] readFromCopy() throws SQLException {
- byte[] result = buf;
- try {
- if(gotBuf()) {
- if(at>0 || len < buf.length) {
- byte[] ba = new byte[len-at];
- for(int i=at; i<len; i++)
- ba[i-at] = buf[i];
- result = ba;
- }
- at = len; // either partly or fully returned, buffer is exhausted
- }
- } catch(IOException ioe) {
- throw new PSQLException(GT.tr("Read from copy failed."), PSQLState.CONNECTION_FAILURE);
- }
- return result;
- }
-
- public void close() throws IOException {
- // Don't complain about a double close.
- if (op == null)
- return;
-
- try {
- op.cancelCopy();
- } catch(SQLException se) {
- IOException ioe = new IOException("Failed to close copy reader.");
- ioe.initCause(se);
- throw ioe;
- }
- op = null;
- }
-
- public void cancelCopy() throws SQLException {
- op.cancelCopy();
- }
-
- public int getFormat() {
- return op.getFormat();
- }
-
- public int getFieldFormat(int field) {
- return op.getFieldFormat(field);
- }
-
- public int getFieldCount() {
- return op.getFieldCount();
- }
-
- public boolean isActive() {
- return op.isActive();
- }
-
- public long getHandledRowCount() {
- return op.getHandledRowCount();
- }
-}
diff --git a/org/postgresql/copy/PGCopyOutputStream.java b/org/postgresql/copy/PGCopyOutputStream.java
deleted file mode 100644
index 9e5162c..0000000
--- a/org/postgresql/copy/PGCopyOutputStream.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2009-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.copy;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.sql.SQLException;
-
-import org.postgresql.PGConnection;
-import org.postgresql.util.GT;
-
-/**
- * OutputStream for buffered input into a PostgreSQL COPY FROM STDIN operation
- */
-public class PGCopyOutputStream extends OutputStream implements CopyIn {
- private CopyIn op;
- private final byte[] copyBuffer;
- private final byte[] singleByteBuffer = new byte[1];
- private int at = 0;
-
- /**
- * Uses given connection for specified COPY FROM STDIN operation
- * @param connection database connection to use for copying (protocol version 3 required)
- * @param sql COPY FROM STDIN statement
- * @throws SQLException if initializing the operation fails
- */
- public PGCopyOutputStream(PGConnection connection, String sql) throws SQLException {
- this(connection, sql, CopyManager.DEFAULT_BUFFER_SIZE);
- }
-
- /**
- * Uses given connection for specified COPY FROM STDIN operation
- * @param connection database connection to use for copying (protocol version 3 required)
- * @param sql COPY FROM STDIN statement
- * @param bufferSize try to send this many bytes at a time
- * @throws SQLException if initializing the operation fails
- */
- public PGCopyOutputStream(PGConnection connection, String sql, int bufferSize) throws SQLException {
- this(connection.getCopyAPI().copyIn(sql), bufferSize);
- }
-
- /**
- * Use given CopyIn operation for writing
- * @param op COPY FROM STDIN operation
- */
- public PGCopyOutputStream(CopyIn op) {
- this(op, CopyManager.DEFAULT_BUFFER_SIZE);
- }
-
- /**
- * Use given CopyIn operation for writing
- * @param op COPY FROM STDIN operation
- * @param bufferSize try to send this many bytes at a time
- */
- public PGCopyOutputStream(CopyIn op, int bufferSize) {
- this.op = op;
- copyBuffer = new byte[bufferSize];
- }
-
- public void write(int b) throws IOException {
- checkClosed();
- if(b<0 || b>255)
- throw new IOException(GT.tr("Cannot write to copy a byte of value {0}", new Integer(b)));
- singleByteBuffer[0] = (byte)b;
- write(singleByteBuffer, 0, 1);
- }
-
- public void write(byte[] buf) throws IOException {
- write(buf, 0, buf.length);
- }
-
- public void write(byte[] buf, int off, int siz) throws IOException {
- checkClosed();
- try {
- writeToCopy(buf, off, siz);
- } catch(SQLException se) {
- IOException ioe = new IOException("Write to copy failed.");
- ioe.initCause(se);
- throw ioe;
- }
- }
-
- private void checkClosed() throws IOException {
- if (op == null) {
- throw new IOException(GT.tr("This copy stream is closed."));
- }
- }
-
- public void close() throws IOException {
- // Don't complain about a double close.
- if (op == null)
- return;
-
- try{
- endCopy();
- } catch(SQLException se) {
- IOException ioe = new IOException("Ending write to copy failed.");
- ioe.initCause(se);
- throw ioe;
- }
- op = null;
- }
-
- public void flush() throws IOException {
- try {
- op.writeToCopy(copyBuffer, 0, at);
- at = 0;
- op.flushCopy();
- } catch (SQLException e) {
- IOException ioe = new IOException("Unable to flush stream");
- ioe.initCause(e);
- throw ioe;
- }
- }
-
- public void writeToCopy(byte[] buf, int off, int siz) throws SQLException {
- if(at > 0 && siz > copyBuffer.length - at) { // would not fit into rest of our buf, so flush buf
- op.writeToCopy(copyBuffer, 0, at);
- at = 0;
- }
- if(siz > copyBuffer.length) { // would still not fit into buf, so just pass it through
- op.writeToCopy(buf, off, siz);
- } else { // fits into our buf, so save it there
- System.arraycopy(buf, off, copyBuffer, at, siz);
- at += siz;
- }
- }
-
- public int getFormat() {
- return op.getFormat();
- }
-
- public int getFieldFormat(int field) {
- return op.getFieldFormat(field);
- }
-
- public void cancelCopy() throws SQLException {
- op.cancelCopy();
- }
-
- public int getFieldCount() {
- return op.getFieldCount();
- }
-
- public boolean isActive() {
- return op.isActive();
- }
-
- public void flushCopy() throws SQLException {
- op.flushCopy();
- }
-
- public long endCopy() throws SQLException {
- if(at > 0) {
- op.writeToCopy(copyBuffer, 0, at);
- }
- op.endCopy();
- return getHandledRowCount();
- }
-
- public long getHandledRowCount() {
- return op.getHandledRowCount();
- }
-
-}
diff --git a/org/postgresql/core/BaseConnection.java b/org/postgresql/core/BaseConnection.java
deleted file mode 100644
index 6373d53..0000000
--- a/org/postgresql/core/BaseConnection.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import java.sql.*;
-import org.postgresql.PGConnection;
-import org.postgresql.jdbc2.TimestampUtils;
-
-/**
- * Driver-internal connection interface. Application code should not use
- * this interface.
- */
-public interface BaseConnection extends PGConnection, Connection
-{
- /**
- * Cancel the current query executing on this connection.
- *
- * @throws SQLException if something goes wrong.
- */
- public void cancelQuery() throws SQLException;
-
- /**
- * Execute a SQL query that returns a single resultset.
- * Never causes a new transaction to be started regardless of the autocommit setting.
- *
- * @param s the query to execute
- * @return the (non-null) returned resultset
- * @throws SQLException if something goes wrong.
- */
- public ResultSet execSQLQuery(String s) throws SQLException;
-
- public ResultSet execSQLQuery(String s, int resultSetType, int resultSetConcurrency) throws SQLException;
-
- /**
- * Execute a SQL query that does not return results.
- * Never causes a new transaction to be started regardless of the autocommit setting.
- *
- * @param s the query to execute
- * @throws SQLException if something goes wrong.
- */
- public void execSQLUpdate(String s) throws SQLException;
-
- /**
- * Get the QueryExecutor implementation for this connection.
- *
- * @return the (non-null) executor
- */
- public QueryExecutor getQueryExecutor();
-
- /**
- * Construct and return an appropriate object for the given
- * type and value. This only considers the types registered via
- * {@link org.postgresql.PGConnection#addDataType(String,Class)} and
- * {@link org.postgresql.PGConnection#addDataType(String,String)}.
- *<p>
- * If no class is registered as handling the given type, then a generic
- * {@link org.postgresql.util.PGobject} instance is returned.
- *
- * @param type the backend typename
- * @param value the type-specific string representation of the value
- * @param byteValue the type-specific binary representation of the value
- * @return an appropriate object; never null.
- * @throws SQLException if something goes wrong
- */
- public Object getObject(String type, String value, byte[] byteValue) throws SQLException;
-
- public Encoding getEncoding() throws SQLException;
-
- public TypeInfo getTypeInfo();
-
- /**
- * Check if we should use driver behaviour introduced in a particular
- * driver version. This defaults to behaving as the actual driver's version
- * but can be overridden by the "compatible" URL parameter.
- *
- * @param ver the driver version to check
- * @return true if the driver's behavioural version is at least "ver".
- * @throws SQLException if something goes wrong
- */
- public boolean haveMinimumCompatibleVersion(String ver);
-
- /**
- * Check if we have at least a particular server version.
- *
- * @param ver the server version to check
- * @return true if the server version is at least "ver".
- * @throws SQLException if something goes wrong
- */
- public boolean haveMinimumServerVersion(String ver);
-
- /**
- * Encode a string using the database's client_encoding
- * (usually UTF8, but can vary on older server versions).
- * This is used when constructing synthetic resultsets (for
- * example, in metadata methods).
- *
- * @param str the string to encode
- * @return an encoded representation of the string
- * @throws SQLException if something goes wrong.
- */
- public byte[] encodeString(String str) throws SQLException;
-
- /**
- * Escapes a string for use as string-literal within an SQL command. The
- * method chooses the applicable escaping rules based on the value of
- * {@link #getStandardConformingStrings()}.
- *
- * @param str a string value
- * @return the escaped representation of the string
- * @throws SQLException if the string contains a <tt>\0</tt> character
- */
- public String escapeString(String str) throws SQLException;
-
- /**
- * Returns whether the server treats string-literals according to the SQL
- * standard or if it uses traditional PostgreSQL escaping rules. Versions
- * up to 8.1 always treated backslashes as escape characters in
- * string-literals. Since 8.2, this depends on the value of the
- * <tt>standard_conforming_strings<tt> server variable.
- *
- * @return true if the server treats string literals according to the SQL
- * standard
- *
- * @see ProtocolConnection#getStandardConformingStrings()
- */
- public boolean getStandardConformingStrings();
-
- // Ew. Quick hack to give access to the connection-specific utils implementation.
- public TimestampUtils getTimestampUtils();
-
- // Get the per-connection logger.
- public Logger getLogger();
-
- // Get the bind-string-as-varchar config flag
- public boolean getStringVarcharFlag();
-
- /**
- * Get the current transaction state of this connection.
- *
- * @return a ProtocolConnection.TRANSACTION_* constant.
- */
- public int getTransactionState();
-
- /**
- * Returns true if value for the given oid should be sent using binary
- * transfer. False if value should be sent using text transfer.
- *
- * @param oid The oid to check.
- * @return True for binary transfer, false for text transfer.
- */
- public boolean binaryTransferSend(int oid);
-}
diff --git a/org/postgresql/core/BaseResultSet.java b/org/postgresql/core/BaseResultSet.java
deleted file mode 100644
index 0512888..0000000
--- a/org/postgresql/core/BaseResultSet.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import java.sql.*;
-
-/**
- * Driver-internal resultset interface. Application code should not use
- * this interface.
- */
-public interface BaseResultSet extends ResultSet
-{
- /**
- * Return a sanitized numeric string for a column. This handles
- * "money" representations, stripping $ and () as appropriate.
- *
- * @param col the 1-based column to retrieve
- * @return the sanitized string
- * @throws SQLException if something goes wrong
- */
- public String getFixedString(int col) throws SQLException;
-
-}
diff --git a/org/postgresql/core/BaseStatement.java b/org/postgresql/core/BaseStatement.java
deleted file mode 100644
index 7e1ac27..0000000
--- a/org/postgresql/core/BaseStatement.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import org.postgresql.PGStatement;
-import java.sql.*;
-import java.util.List;
-
-/**
- * Driver-internal statement interface. Application code should not use
- * this interface.
- */
-public interface BaseStatement extends PGStatement, Statement
-{
- /**
- * Create a synthetic resultset from data provided by the driver.
- *
- * @param fields the column metadata for the resultset
- * @param tuples the resultset data
- * @return the new ResultSet
- * @throws SQLException if something goes wrong
- */
- public ResultSet createDriverResultSet(Field[] fields, List tuples) throws SQLException;
-
- /**
- * Create a resultset from data retrieved from the server.
- *
- * @param originalQuery the query that generated this resultset; used when dealing with updateable resultsets
- * @param fields the column metadata for the resultset
- * @param tuples the resultset data
- * @param cursor the cursor to use to retrieve more data from the server; if null, no additional data is present.
- * @return the new ResultSet
- * @throws SQLException if something goes wrong
- */
- public ResultSet createResultSet(Query originalQuery, Field[] fields, List tuples, ResultCursor cursor) throws SQLException;
-
- /**
- * Execute a query, passing additional query flags.
- *
- * @param p_sql the query to execute
- * @param flags additional {@link QueryExecutor} flags for execution; these
- * are bitwise-ORed into the default flags.
- * @throws SQLException if something goes wrong.
- */
- public boolean executeWithFlags(String p_sql, int flags) throws SQLException;
-
- /**
- * Execute a prepared query, passing additional query flags.
- *
- * @param flags additional {@link QueryExecutor} flags for execution; these
- * are bitwise-ORed into the default flags.
- * @throws SQLException if something goes wrong.
- */
- public boolean executeWithFlags(int flags) throws SQLException;
-}
diff --git a/org/postgresql/core/ConnectionFactory.java b/org/postgresql/core/ConnectionFactory.java
deleted file mode 100644
index a351619..0000000
--- a/org/postgresql/core/ConnectionFactory.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import java.util.Properties;
-import java.sql.SQLException;
-
-import org.postgresql.util.HostSpec;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLState;
-
-/**
- * Handles protocol-specific connection setup.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-public abstract class ConnectionFactory {
- /**
- * Protocol version to implementation instance map.
- * If no protocol version is specified, instances are
- * tried in order until an exception is thrown or a non-null
- * connection is returned.
- */
- private static final Object[][] versions = {
- { "3", new org.postgresql.core.v3.ConnectionFactoryImpl() },
- { "2", new org.postgresql.core.v2.ConnectionFactoryImpl() },
- };
-
- /**
- * Establishes and initializes a new connection.
- *<p>
- * If the "protocolVersion" property is specified, only that protocol
- * version is tried. Otherwise, all protocols are tried in order, falling
- * back to older protocols as necessary.
- *<p>
- * Currently, protocol versions 3 (7.4+) and 2 (pre-7.4) are supported.
- *
- * @param hostSpecs at least one host and port to connect to; multiple elements for round-robin failover
- * @param user the username to authenticate with; may not be null.
- * @param database the database on the server to connect to; may not be null.
- * @param info extra properties controlling the connection;
- * notably, "password" if present supplies the password to authenticate with.
- * @param logger the logger to use for this connection
- * @return the new, initialized, connection
- * @throws SQLException if the connection could not be established.
- */
- public static ProtocolConnection openConnection(HostSpec[] hostSpecs, String user, String database, Properties info, Logger logger) throws SQLException {
- String protoName = info.getProperty("protocolVersion");
-
- for (int i = 0; i < versions.length; ++i)
- {
- String versionProtoName = (String) versions[i][0];
- if (protoName != null && !protoName.equals(versionProtoName))
- continue;
-
- ConnectionFactory factory = (ConnectionFactory) versions[i][1];
- ProtocolConnection connection = factory.openConnectionImpl(hostSpecs, user, database, info, logger);
- if (connection != null)
- return connection;
- }
-
- throw new PSQLException(GT.tr("A connection could not be made using the requested protocol {0}.", protoName),
- PSQLState.CONNECTION_UNABLE_TO_CONNECT);
- }
-
- /**
- * Implementation of {@link #openConnection} for a particular protocol version.
- * Implemented by subclasses of {@link ConnectionFactory}.
- *
- * @param hostSpecs at least one host and port to connect to; multiple elements for round-robin failover
- * @param user the username to authenticate with; may not be null.
- * @param database the database on the server to connect to; may not be null.
- * @param info extra properties controlling the connection;
- * notably, "password" if present supplies the password to authenticate with.
- * @param logger the logger to use for this connection
- * @return the new, initialized, connection, or <code>null</code> if this protocol
- * version is not supported by the server.
- * @throws SQLException if the connection could not be established for a reason other
- * than protocol version incompatibility.
- */
- public abstract ProtocolConnection openConnectionImpl(HostSpec[] hostSpecs, String user, String database, Properties info, Logger logger) throws SQLException;
-}
diff --git a/org/postgresql/core/Encoding.java b/org/postgresql/core/Encoding.java
deleted file mode 100644
index a77e8cc..0000000
--- a/org/postgresql/core/Encoding.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.io.IOException;
-import java.util.HashMap;
-
-/**
- * Representation of a particular character encoding.
- */
-public class Encoding
-{
- private static final Encoding DEFAULT_ENCODING = new Encoding(null);
-
- /*
- * Preferred JVM encodings for backend encodings.
- */
- private static final HashMap encodings = new HashMap();
-
- static {
- //Note: this list should match the set of supported server
- // encodings found in backend/util/mb/encnames.c
- encodings.put("SQL_ASCII", new String[] { "ASCII", "us-ascii" });
- encodings.put("UNICODE", new String[] { "UTF-8", "UTF8" });
- encodings.put("UTF8", new String[] { "UTF-8", "UTF8" }); // 8.1's canonical name for UNICODE changed.
- encodings.put("LATIN1", new String[] { "ISO8859_1" });
- encodings.put("LATIN2", new String[] { "ISO8859_2" });
- encodings.put("LATIN3", new String[] { "ISO8859_3" });
- encodings.put("LATIN4", new String[] { "ISO8859_4" });
- encodings.put("ISO_8859_5", new String[] { "ISO8859_5" });
- encodings.put("ISO_8859_6", new String[] { "ISO8859_6" });
- encodings.put("ISO_8859_7", new String[] { "ISO8859_7" });
- encodings.put("ISO_8859_8", new String[] { "ISO8859_8" });
- encodings.put("LATIN5", new String[] { "ISO8859_9" });
- encodings.put("LATIN7", new String[] { "ISO8859_13" });
- encodings.put("LATIN9", new String[] { "ISO8859_15_FDIS" });
- encodings.put("EUC_JP", new String[] { "EUC_JP" });
- encodings.put("EUC_CN", new String[] { "EUC_CN" });
- encodings.put("EUC_KR", new String[] { "EUC_KR" });
- encodings.put("JOHAB", new String[] { "Johab" });
- encodings.put("EUC_TW", new String[] { "EUC_TW" });
- encodings.put("SJIS", new String[] { "MS932", "SJIS" });
- encodings.put("BIG5", new String[] { "Big5", "MS950", "Cp950" });
- encodings.put("GBK", new String[] { "GBK", "MS936" });
- encodings.put("UHC", new String[] { "MS949", "Cp949", "Cp949C" });
- encodings.put("TCVN", new String[] { "Cp1258" });
- encodings.put("WIN1256", new String[] { "Cp1256" });
- encodings.put("WIN1250", new String[] { "Cp1250" });
- encodings.put("WIN874", new String[] { "MS874", "Cp874" });
- encodings.put("WIN", new String[] { "Cp1251" });
- encodings.put("ALT", new String[] { "Cp866" });
- // We prefer KOI8-U, since it is a superset of KOI8-R.
- encodings.put("KOI8", new String[] { "KOI8_U", "KOI8_R" });
- // If the database isn't encoding-aware then we can't have
- // any preferred encodings.
- encodings.put("UNKNOWN", new String[0]);
- // The following encodings do not have a java equivalent
- encodings.put("MULE_INTERNAL", new String[0]);
- encodings.put("LATIN6", new String[0]);
- encodings.put("LATIN8", new String[0]);
- encodings.put("LATIN10", new String[0]);
- }
-
- private final String encoding;
- private final boolean fastASCIINumbers;
-
- protected Encoding(String encoding)
- {
- this.encoding = encoding;
- fastASCIINumbers = testAsciiNumbers();
- }
-
- /**
- * Returns true if this encoding has characters
- * '-' and '0'..'9' in exactly same posision as ascii.
- *
- * @return true if the bytes can be scanned directly for ascii numbers.
- */
- public boolean hasAsciiNumbers() {
- return fastASCIINumbers;
- }
-
- /**
- * Construct an Encoding for a given JVM encoding.
- *
- * @param jvmEncoding the name of the JVM encoding
- * @return an Encoding instance for the specified encoding,
- * or an Encoding instance for the default JVM encoding if the
- * specified encoding is unavailable.
- */
- public static Encoding getJVMEncoding(String jvmEncoding) {
- if (isAvailable(jvmEncoding))
- {
- if (jvmEncoding.equals("UTF-8") || jvmEncoding.equals("UTF8"))
- return new UTF8Encoding(jvmEncoding);
- else
- return new Encoding(jvmEncoding);
- }
- else
- return defaultEncoding();
- }
-
- /**
- * Construct an Encoding for a given database encoding.
- *
- * @param databaseEncoding the name of the database encoding
- * @return an Encoding instance for the specified encoding,
- * or an Encoding instance for the default JVM encoding if the
- * specified encoding is unavailable.
- */
- public static Encoding getDatabaseEncoding(String databaseEncoding)
- {
- // If the backend encoding is known and there is a suitable
- // encoding in the JVM we use that. Otherwise we fall back
- // to the default encoding of the JVM.
-
- String[] candidates = (String[]) encodings.get(databaseEncoding);
- if (candidates != null)
- {
- for (int i = 0; i < candidates.length; i++)
- {
- if (isAvailable(candidates[i]))
- {
- return new Encoding(candidates[i]);
- }
- }
- }
-
- // Try the encoding name directly -- maybe the charset has been
- // provided by the user.
- if (isAvailable(databaseEncoding))
- return new Encoding(databaseEncoding);
-
- // Fall back to default JVM encoding.
- return defaultEncoding();
- }
-
- /**
- * Get the name of the (JVM) encoding used.
- *
- * @return the JVM encoding name used by this instance.
- */
- public String name()
- {
- return encoding;
- }
-
- /**
- * Encode a string to an array of bytes.
- *
- * @param s the string to encode
- * @return a bytearray containing the encoded string
- * @throws IOException if something goes wrong
- */
- public byte[] encode(String s) throws IOException
- {
- if (s == null)
- return null;
-
- if (encoding == null)
- return s.getBytes();
-
- return s.getBytes(encoding);
- }
-
- /**
- * Decode an array of bytes into a string.
- *
- * @param encodedString a bytearray containing the encoded string the string to encod
- * @param offset the offset in <code>encodedString</code> of the first byte of the encoded representation
- * @param length the length, in bytes, of the encoded representation
- * @return the decoded string
- * @throws IOException if something goes wrong
- */
- public String decode(byte[] encodedString, int offset, int length) throws IOException
- {
- if (encoding == null)
- return new String(encodedString, offset, length);
-
- return new String(encodedString, offset, length, encoding);
- }
-
- /**
- * Decode an array of bytes into a string.
- *
- * @param encodedString a bytearray containing the encoded string the string to encod
- * @return the decoded string
- * @throws IOException if something goes wrong
- */
- public String decode(byte[] encodedString) throws IOException
- {
- return decode(encodedString, 0, encodedString.length);
- }
-
- /**
- * Get a Reader that decodes the given InputStream using this encoding.
- *
- * @param in the underlying stream to decode from
- * @return a non-null Reader implementation.
- * @throws IOException if something goes wrong
- */
- public Reader getDecodingReader(InputStream in) throws IOException
- {
- if (encoding == null)
- return new InputStreamReader(in);
-
- return new InputStreamReader(in, encoding);
- }
-
- /**
- * Get a Writer that encodes to the given OutputStream using this encoding.
- *
- * @param out the underlying stream to encode to
- * @return a non-null Writer implementation.
- * @throws IOException if something goes wrong
- */
- public Writer getEncodingWriter(OutputStream out) throws IOException
- {
- if (encoding == null)
- return new OutputStreamWriter(out);
-
- return new OutputStreamWriter(out, encoding);
- }
-
- /**
- * Get an Encoding using the default encoding for the JVM.
- * @return an Encoding instance
- */
- public static Encoding defaultEncoding()
- {
- return DEFAULT_ENCODING;
- }
-
- /**
- * Test if an encoding is available in the JVM.
- *
- * @param encodingName the JVM encoding name to test
- * @return true iff the encoding is supported
- */
- private static boolean isAvailable(String encodingName)
- {
- try
- {
- "DUMMY".getBytes(encodingName);
- return true;
- }
- catch (java.io.UnsupportedEncodingException e)
- {
- return false;
- }
- }
-
- public String toString() {
- return (encoding == null ? "<default JVM encoding>" : encoding);
- }
-
- /**
- * Checks weather this encoding is compatible with ASCII for the number
- * characters '-' and '0'..'9'. Where compatible means that they are encoded
- * with exactly same values.
- *
- * @return If faster ASCII number parsing can be used with this encoding.
- */
- private boolean testAsciiNumbers() {
- // TODO: test all postgres supported encoding to see if there are
- // any which do _not_ have ascii numbers in same location
- // at least all the encoding listed in the encodings hashmap have
- // working ascii numbers
- try {
- String test = "-0123456789";
- byte[] bytes = encode(test);
- String res = new String(bytes, "US-ASCII");
- return test.equals(res);
- } catch (java.io.UnsupportedEncodingException e) {
- return false;
- } catch (IOException e) {
- return false;
- }
- }
-}
diff --git a/org/postgresql/core/Field.java b/org/postgresql/core/Field.java
deleted file mode 100644
index b7d614c..0000000
--- a/org/postgresql/core/Field.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import java.sql.ResultSetMetaData;
-
-/*
- */
-public class Field
-{
- //The V3 protocol defines two constants for the format of data
- public static final int TEXT_FORMAT = 0;
- public static final int BINARY_FORMAT = 1;
-
- private final int length; // Internal Length of this field
- private final int oid; // OID of the type
- private final int mod; // type modifier of this field
- private final String columnLabel; // Column label
- private String columnName; // Column name
-
- private int format = TEXT_FORMAT; // In the V3 protocol each field has a format
- // 0 = text, 1 = binary
- // In the V2 protocol all fields in a
- // binary cursor are binary and all
- // others are text
-
- private final int tableOid; // OID of table ( zero if no table )
- private final int positionInTable;
-
- // Cache fields filled in by AbstractJdbc2ResultSetMetaData.fetchFieldMetaData.
- // Don't use unless that has been called.
- private String tableName = "";
- private String schemaName = "";
- private int nullable = ResultSetMetaData.columnNullableUnknown;
- private boolean autoIncrement = false;
-
- /*
- * Construct a field based on the information fed to it.
- *
- * @param name the name (column name and label) of the field
- * @param oid the OID of the field
- * @param len the length of the field
- */
- public Field(String name, int oid, int length, int mod)
- {
- this(name, name, oid, length, mod, 0, 0);
- }
-
- /*
- * Constructor without mod parameter.
- *
- * @param name the name (column name and label) of the field
- * @param oid the OID of the field
- * @param len the length of the field
- */
- public Field(String name, int oid)
- {
- this(name, oid, 0, -1);
- }
-
- /*
- * Construct a field based on the information fed to it.
- *
- * @param columnLabel the column label of the field
- * @param columnName the column label the name of the field
- * @param oid the OID of the field
- * @param length the length of the field
- * @param tableOid the OID of the columns' table
- * @param positionInTable the position of column in the table (first column is 1, second column is 2, etc...)
- */
- public Field(String columnLabel, String columnName, int oid, int length, int mod, int tableOid, int positionInTable)
- {
- this.columnLabel = columnLabel;
- this.columnName = columnName;
- this.oid = oid;
- this.length = length;
- this.mod = mod;
- this.tableOid = tableOid;
- this.positionInTable = positionInTable;
- }
-
- /*
- * @return the oid of this Field's data type
- */
- public int getOID()
- {
- return oid;
- }
-
- /*
- * @return the mod of this Field's data type
- */
- public int getMod()
- {
- return mod;
- }
-
- /*
- * @return the column label of this Field's data type
- */
- public String getColumnLabel()
- {
- return columnLabel;
- }
-
- /*
- * @return the length of this Field's data type
- */
- public int getLength()
- {
- return length;
- }
-
- /*
- * @return the format of this Field's data (text=0, binary=1)
- */
- public int getFormat()
- {
- return format;
- }
-
- /*
- * @param format the format of this Field's data (text=0, binary=1)
- */
- public void setFormat(int format)
- {
- this.format = format;
- }
-
- /*
- * @return the columns' table oid, zero if no oid available
- */
- public int getTableOid()
- {
- return tableOid;
- }
-
- public int getPositionInTable()
- {
- return positionInTable;
- }
-
- public void setNullable(int nullable)
- {
- this.nullable = nullable;
- }
-
- public int getNullable()
- {
- return nullable;
- }
-
- public void setAutoIncrement(boolean autoIncrement)
- {
- this.autoIncrement = autoIncrement;
- }
-
- public boolean getAutoIncrement()
- {
- return autoIncrement;
- }
-
- public void setColumnName(String columnName)
- {
- this.columnName = columnName;
- }
-
- public String getColumnName()
- {
- return columnName;
- }
-
- public void setTableName(String tableName)
- {
- this.tableName = tableName;
- }
-
- public String getTableName()
- {
- return tableName;
- }
-
- public void setSchemaName(String schemaName)
- {
- this.schemaName = schemaName;
- }
-
- public String getSchemaName()
- {
- return schemaName;
- }
-
- public String toString() {
- return "Field("+ (columnName != null ? columnName : "") + "," +
- Oid.toString(oid) + "," + length + "," +
- (format == TEXT_FORMAT ? 'T' : 'B') + ")";
- }
-}
diff --git a/org/postgresql/core/Logger.java b/org/postgresql/core/Logger.java
deleted file mode 100644
index 1d4ccd8..0000000
--- a/org/postgresql/core/Logger.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2005-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import java.text.SimpleDateFormat;
-import java.text.FieldPosition;
-import java.sql.DriverManager;
-import java.io.PrintWriter;
-import java.util.Date;
-
-import org.postgresql.Driver;
-
-/**
- * Poor man's logging infrastructure. This just deals with maintaining a per-
- * connection ID and log level, and timestamping output.
- */
-public final class Logger {
- // For brevity we only log the time, not date or timezone (the main reason
- // for the timestamp is to see delays etc. between log lines, not to pin
- // down an instant in time)
- private final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss.SSS ");
- private final FieldPosition dummyPosition = new FieldPosition(0);
- private final StringBuffer buffer = new StringBuffer();
- private final String connectionIDString;
-
- private int level = 0;
-
- public Logger() {
- connectionIDString = "(driver) ";
- }
-
- public Logger(int connectionID) {
- connectionIDString = "(" + connectionID + ") ";
- }
-
- public void setLogLevel(int level) {
- this.level = level;
- }
-
- public int getLogLevel() {
- return level;
- }
-
- public boolean logDebug() {
- return level >= Driver.DEBUG;
- }
-
- public boolean logInfo() {
- return level >= Driver.INFO;
- }
-
- public void debug(String str) {
- debug(str, null);
- }
-
- public void debug(String str, Throwable t) {
- if (logDebug())
- log(str, t);
- }
-
- public void info(String str) {
- info(str, null);
- }
-
- public void info(String str, Throwable t) {
- if (logInfo())
- log(str, t);
- }
-
- public void log(String str, Throwable t) {
- PrintWriter writer = DriverManager.getLogWriter();
- if (writer == null)
- return;
-
- synchronized (this) {
- buffer.setLength(0);
- dateFormat.format(new Date(), buffer, dummyPosition);
- buffer.append(connectionIDString);
- buffer.append(str);
-
- // synchronize to ensure that the exception (if any) does
- // not get split up from the corresponding log message
- synchronized (writer) {
- writer.println(buffer.toString());
- if (t != null)
- t.printStackTrace(writer);
- }
- }
- }
-}
diff --git a/org/postgresql/core/Notification.java b/org/postgresql/core/Notification.java
deleted file mode 100644
index 4ee69c9..0000000
--- a/org/postgresql/core/Notification.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import org.postgresql.PGNotification;
-
-public class Notification implements PGNotification
-{
- public Notification(String p_name, int p_pid)
- {
- this(p_name, p_pid, "");
- }
-
- public Notification(String p_name, int p_pid, String p_parameter)
- {
- m_name = p_name;
- m_pid = p_pid;
- m_parameter = p_parameter;
- }
-
- /*
- * Returns name of this notification
- */
- public String getName()
- {
- return m_name;
- }
-
- /*
- * Returns the process id of the backend process making this notification
- */
- public int getPID()
- {
- return m_pid;
- }
-
- public String getParameter()
- {
- return m_parameter;
- }
-
- private String m_name;
- private String m_parameter;
- private int m_pid;
-
-}
-
diff --git a/org/postgresql/core/Oid.java b/org/postgresql/core/Oid.java
deleted file mode 100644
index 5a88d0d..0000000
--- a/org/postgresql/core/Oid.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import java.lang.reflect.Field;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * Provides constants for well-known backend OIDs for the types we commonly
- * use.
- */
-public class Oid {
- public static final int UNSPECIFIED = 0;
- public static final int INT2 = 21;
- public static final int INT2_ARRAY = 1005;
- public static final int INT4 = 23;
- public static final int INT4_ARRAY = 1007;
- public static final int INT8 = 20;
- public static final int INT8_ARRAY = 1016;
- public static final int TEXT = 25;
- public static final int TEXT_ARRAY = 1009;
- public static final int NUMERIC = 1700;
- public static final int NUMERIC_ARRAY = 1231;
- public static final int FLOAT4 = 700;
- public static final int FLOAT4_ARRAY = 1021;
- public static final int FLOAT8 = 701;
- public static final int FLOAT8_ARRAY = 1022;
- public static final int BOOL = 16;
- public static final int BOOL_ARRAY = 1000;
- public static final int DATE = 1082;
- public static final int DATE_ARRAY = 1182;
- public static final int TIME = 1083;
- public static final int TIME_ARRAY = 1183;
- public static final int TIMETZ = 1266;
- public static final int TIMETZ_ARRAY = 1270;
- public static final int TIMESTAMP = 1114;
- public static final int TIMESTAMP_ARRAY = 1115;
- public static final int TIMESTAMPTZ = 1184;
- public static final int TIMESTAMPTZ_ARRAY = 1185;
- public static final int BYTEA = 17;
- public static final int BYTEA_ARRAY = 1001;
- public static final int VARCHAR = 1043;
- public static final int VARCHAR_ARRAY = 1015;
- public static final int OID = 26;
- public static final int OID_ARRAY = 1028;
- public static final int BPCHAR = 1042;
- public static final int BPCHAR_ARRAY = 1014;
- public static final int MONEY = 790;
- public static final int MONEY_ARRAY = 791;
- public static final int NAME = 19;
- public static final int NAME_ARRAY = 1003;
- public static final int BIT = 1560;
- public static final int BIT_ARRAY = 1561;
- public static final int VOID = 2278;
- public static final int INTERVAL = 1186;
- public static final int INTERVAL_ARRAY = 1187;
- public static final int CHAR = 18; // This is not char(N), this is "char" a single byte type.
- public static final int CHAR_ARRAY = 1002;
- public static final int VARBIT = 1562;
- public static final int VARBIT_ARRAY = 1563;
- public static final int UUID = 2950;
- public static final int UUID_ARRAY = 2951;
- public static final int XML = 142;
- public static final int XML_ARRAY = 143;
- public static final int POINT = 600;
- public static final int BOX = 603;
-
- /**
- * Returns the name of the oid as string.
- *
- * @param oid The oid to convert to name.
- * @return The name of the oid or "<unknown>" if oid no constant for
- * oid value has been defined.
- */
- public static String toString(int oid) {
- try {
- Field[] fields = Oid.class.getFields();
- for (int i = 0; i < fields.length; ++i) {
- if (fields[i].getInt(null) == oid) {
- return fields[i].getName();
- }
- }
- } catch (IllegalAccessException e) {
- // never happens
- }
- return "<unknown:" + oid + ">";
- }
-
- public static int valueOf(String oid) throws PSQLException {
- try {
- return (int)Long.parseLong(oid);
- } catch (NumberFormatException ex) {
- }
- try {
- oid = oid.toUpperCase();
- Field[] fields = Oid.class.getFields();
- for (int i = 0; i < fields.length; ++i) {
- if (fields[i].getName().toUpperCase().equals(oid)) {
- return fields[i].getInt(null);
- }
- }
- } catch (IllegalAccessException e) {
- // never happens
- }
- throw new PSQLException(GT.tr("oid type {0} not known and not a number", oid), PSQLState.INVALID_PARAMETER_VALUE);
- }
-}
diff --git a/org/postgresql/core/PGBindException.java b/org/postgresql/core/PGBindException.java
deleted file mode 100644
index ddd2a4d..0000000
--- a/org/postgresql/core/PGBindException.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import java.io.IOException;
-
-public class PGBindException extends IOException {
-
- private IOException _ioe;
-
- public PGBindException(IOException ioe) {
- _ioe = ioe;
- }
-
- public IOException getIOException() {
- return _ioe;
- }
-}
diff --git a/org/postgresql/core/PGStream.java b/org/postgresql/core/PGStream.java
deleted file mode 100644
index fad4c12..0000000
--- a/org/postgresql/core/PGStream.java
+++ /dev/null
@@ -1,547 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import java.io.BufferedOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.FilterOutputStream;
-import java.io.IOException;
-import java.io.EOFException;
-import java.io.Writer;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.sql.SQLException;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.HostSpec;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.PSQLException;
-
-/**
- * Wrapper around the raw connection to the server that implements some basic
- * primitives (reading/writing formatted data, doing string encoding, etc).
- *<p>
- * In general, instances of PGStream are not threadsafe; the caller must ensure
- * that only one thread at a time is accessing a particular PGStream instance.
- */
-public class PGStream
-{
- private final HostSpec hostSpec;
-
- private final byte[] _int4buf;
- private final byte[] _int2buf;
-
- private Socket connection;
- private VisibleBufferedInputStream pg_input;
- private OutputStream pg_output;
- private byte[] streamBuffer;
-
- private Encoding encoding;
- private Writer encodingWriter;
-
- /**
- * Constructor: Connect to the PostgreSQL back end and return
- * a stream connection.
- *
- * @param hostSpec the host and port to connect to
- * @exception IOException if an IOException occurs below it.
- */
- public PGStream(HostSpec hostSpec) throws IOException
- {
- this.hostSpec = hostSpec;
-
- Socket socket = new Socket();
- socket.connect(new InetSocketAddress(hostSpec.getHost(), hostSpec.getPort()));
- changeSocket(socket);
- setEncoding(Encoding.getJVMEncoding("US-ASCII"));
-
- _int2buf = new byte[2];
- _int4buf = new byte[4];
- }
-
- public HostSpec getHostSpec() {
- return hostSpec;
- }
-
- public Socket getSocket() {
- return connection;
- }
-
- /**
- * Check for pending backend messages without blocking.
- * Might return false when there actually are messages
- * waiting, depending on the characteristics of the
- * underlying socket. This is used to detect asynchronous
- * notifies from the backend, when available.
- *
- * @return true if there is a pending backend message
- */
- public boolean hasMessagePending() throws IOException {
- return pg_input.available() > 0 || connection.getInputStream().available() > 0;
- }
-
- /**
- * Switch this stream to using a new socket. Any existing socket
- * is <em>not</em> closed; it's assumed that we are changing to
- * a new socket that delegates to the original socket (e.g. SSL).
- *
- * @param socket the new socket to change to
- * @throws IOException if something goes wrong
- */
- public void changeSocket(Socket socket) throws IOException {
- this.connection = socket;
-
- // Submitted by Jason Venner <jason at idiom.com>. Disable Nagle
- // as we are selective about flushing output only when we
- // really need to.
- connection.setTcpNoDelay(true);
-
- // Buffer sizes submitted by Sverre H Huseby <sverrehu at online.no>
- pg_input = new VisibleBufferedInputStream(connection.getInputStream(), 8192);
- pg_output = new BufferedOutputStream(connection.getOutputStream(), 8192);
-
- if (encoding != null)
- setEncoding(encoding);
- }
-
- public Encoding getEncoding() {
- return encoding;
- }
-
- /**
- * Change the encoding used by this connection.
- *
- * @param encoding the new encoding to use
- * @throws IOException if something goes wrong
- */
- public void setEncoding(Encoding encoding) throws IOException {
- // Close down any old writer.
- if (encodingWriter != null)
- encodingWriter.close();
-
- this.encoding = encoding;
-
- // Intercept flush() downcalls from the writer; our caller
- // will call PGStream.flush() as needed.
- OutputStream interceptor = new FilterOutputStream(pg_output) {
- public void flush() throws IOException {
- }
- public void close() throws IOException {
- super.flush();
- }
- };
-
- encodingWriter = encoding.getEncodingWriter(interceptor);
- }
-
- /**
- * Get a Writer instance that encodes directly onto the underlying stream.
- *<p>
- * The returned Writer should not be closed, as it's a shared object.
- * Writer.flush needs to be called when switching between use of the Writer and
- * use of the PGStream write methods, but it won't actually flush output
- * all the way out -- call {@link #flush} to actually ensure all output
- * has been pushed to the server.
- *
- * @return the shared Writer instance
- * @throws IOException if something goes wrong.
- */
- public Writer getEncodingWriter() throws IOException {
- if (encodingWriter == null)
- throw new IOException("No encoding has been set on this connection");
- return encodingWriter;
- }
-
- /**
- * Sends a single character to the back end
- *
- * @param val the character to be sent
- * @exception IOException if an I/O error occurs
- */
- public void SendChar(int val) throws IOException
- {
- pg_output.write(val);
- }
-
- /**
- * Sends a 4-byte integer to the back end
- *
- * @param val the integer to be sent
- * @exception IOException if an I/O error occurs
- */
- public void SendInteger4(int val) throws IOException
- {
- _int4buf[0] = (byte)(val >>> 24);
- _int4buf[1] = (byte)(val >>> 16);
- _int4buf[2] = (byte)(val >>> 8);
- _int4buf[3] = (byte)(val);
- pg_output.write(_int4buf);
- }
-
- /**
- * Sends a 2-byte integer (short) to the back end
- *
- * @param val the integer to be sent
- * @exception IOException if an I/O error occurs or <code>val</code> cannot be encoded in 2 bytes
- */
- public void SendInteger2(int val) throws IOException
- {
- if (val < Short.MIN_VALUE || val > Short.MAX_VALUE)
- throw new IOException("Tried to send an out-of-range integer as a 2-byte value: " + val);
-
- _int2buf[0] = (byte)(val >>> 8);
- _int2buf[1] = (byte)val;
- pg_output.write(_int2buf);
- }
-
- /**
- * Send an array of bytes to the backend
- *
- * @param buf The array of bytes to be sent
- * @exception IOException if an I/O error occurs
- */
- public void Send(byte buf[]) throws IOException
- {
- pg_output.write(buf);
- }
-
- /**
- * Send a fixed-size array of bytes to the backend. If buf.length < siz,
- * pad with zeros. If buf.lengh > siz, truncate the array.
- *
- * @param buf the array of bytes to be sent
- * @param siz the number of bytes to be sent
- * @exception IOException if an I/O error occurs
- */
- public void Send(byte buf[], int siz) throws IOException
- {
- Send(buf, 0, siz);
- }
-
- /**
- * Send a fixed-size array of bytes to the backend. If length < siz,
- * pad with zeros. If length > siz, truncate the array.
- *
- * @param buf the array of bytes to be sent
- * @param off offset in the array to start sending from
- * @param siz the number of bytes to be sent
- * @exception IOException if an I/O error occurs
- */
- public void Send(byte buf[], int off, int siz) throws IOException
- {
- int bufamt = buf.length - off;
- pg_output.write(buf, off, bufamt < siz ? bufamt : siz);
- for (int i = bufamt ; i < siz ; ++i)
- {
- pg_output.write(0);
- }
- }
-
- /**
- * Receives a single character from the backend, without
- * advancing the current protocol stream position.
- *
- * @return the character received
- * @exception IOException if an I/O Error occurs
- */
- public int PeekChar() throws IOException
- {
- int c = pg_input.peek();
- if (c < 0)
- throw new EOFException();
- return c;
- }
-
- /**
- * Receives a single character from the backend
- *
- * @return the character received
- * @exception IOException if an I/O Error occurs
- */
- public int ReceiveChar() throws IOException
- {
- int c = pg_input.read();
- if (c < 0)
- throw new EOFException();
- return c;
- }
-
- /**
- * Receives a four byte integer from the backend
- *
- * @return the integer received from the backend
- * @exception IOException if an I/O error occurs
- */
- public int ReceiveInteger4() throws IOException
- {
- if (pg_input.read(_int4buf) != 4)
- throw new EOFException();
-
- return (_int4buf[0] & 0xFF) << 24 | (_int4buf[1] & 0xFF) << 16 | (_int4buf[2] & 0xFF) << 8 | _int4buf[3] & 0xFF;
- }
-
- /**
- * Receives a two byte integer from the backend
- *
- * @return the integer received from the backend
- * @exception IOException if an I/O error occurs
- */
- public int ReceiveInteger2() throws IOException
- {
- if (pg_input.read(_int2buf) != 2)
- throw new EOFException();
-
- return (_int2buf[0] & 0xFF) << 8 | _int2buf[1] & 0xFF;
- }
-
- /**
- * Receives a fixed-size string from the backend.
- *
- * @param len the length of the string to receive, in bytes.
- * @return the decoded string
- */
- public String ReceiveString(int len) throws IOException {
- if (!pg_input.ensureBytes(len)) {
- throw new EOFException();
- }
-
- String res = encoding.decode(pg_input.getBuffer(), pg_input.getIndex(),
- len);
- pg_input.skip(len);
- return res;
- }
-
- /**
- * Receives a null-terminated string from the backend. If we don't see a
- * null, then we assume something has gone wrong.
- *
- * @return string from back end
- * @exception IOException if an I/O error occurs, or end of file
- */
- public String ReceiveString() throws IOException
- {
- int len = pg_input.scanCStringLength();
- String res = encoding.decode(pg_input.getBuffer(), pg_input.getIndex(),
- len - 1);
- pg_input.skip(len);
- return res;
- }
-
- /**
- * Read a tuple from the back end. A tuple is a two dimensional
- * array of bytes. This variant reads the V3 protocol's tuple
- * representation.
- *
- * @return null if the current response has no more tuples, otherwise
- * an array of bytearrays
- * @exception IOException if a data I/O error occurs
- */
- public byte[][] ReceiveTupleV3() throws IOException, OutOfMemoryError
- {
- //TODO: use l_msgSize
- int l_msgSize = ReceiveInteger4();
- int i;
- int l_nf = ReceiveInteger2();
- byte[][] answer = new byte[l_nf][];
-
- OutOfMemoryError oom = null;
- for (i = 0 ; i < l_nf ; ++i)
- {
- int l_size = ReceiveInteger4();
- if (l_size != -1) {
- try {
- answer[i] = new byte[l_size];
- Receive(answer[i], 0, l_size);
- } catch(OutOfMemoryError oome) {
- oom = oome;
- Skip(l_size);
- }
- }
- }
-
- if (oom != null)
- throw oom;
-
- return answer;
- }
-
- /**
- * Read a tuple from the back end. A tuple is a two dimensional
- * array of bytes. This variant reads the V2 protocol's tuple
- * representation.
- *
- * @param nf the number of fields expected
- * @param bin true if the tuple is a binary tuple
- * @return null if the current response has no more tuples, otherwise
- * an array of bytearrays
- * @exception IOException if a data I/O error occurs
- */
- public byte[][] ReceiveTupleV2(int nf, boolean bin) throws IOException, OutOfMemoryError
- {
- int i, bim = (nf + 7) / 8;
- byte[] bitmask = Receive(bim);
- byte[][] answer = new byte[nf][];
-
- int whichbit = 0x80;
- int whichbyte = 0;
-
- OutOfMemoryError oom = null;
- for (i = 0 ; i < nf ; ++i)
- {
- boolean isNull = ((bitmask[whichbyte] & whichbit) == 0);
- whichbit >>= 1;
- if (whichbit == 0)
- {
- ++whichbyte;
- whichbit = 0x80;
- }
- if (!isNull)
- {
- int len = ReceiveInteger4();
- if (!bin)
- len -= 4;
- if (len < 0)
- len = 0;
- try {
- answer[i] = new byte[len];
- Receive(answer[i], 0, len);
- } catch(OutOfMemoryError oome) {
- oom = oome;
- Skip(len);
- }
- }
- }
-
- if (oom != null)
- throw oom;
-
- return answer;
- }
-
- /**
- * Reads in a given number of bytes from the backend
- *
- * @param siz number of bytes to read
- * @return array of bytes received
- * @exception IOException if a data I/O error occurs
- */
- public byte[] Receive(int siz) throws IOException
- {
- byte[] answer = new byte[siz];
- Receive(answer, 0, siz);
- return answer;
- }
-
- /**
- * Reads in a given number of bytes from the backend
- *
- * @param buf buffer to store result
- * @param off offset in buffer
- * @param siz number of bytes to read
- * @exception IOException if a data I/O error occurs
- */
- public void Receive(byte[] buf, int off, int siz) throws IOException
- {
- int s = 0;
-
- while (s < siz)
- {
- int w = pg_input.read(buf, off + s, siz - s);
- if (w < 0)
- throw new EOFException();
- s += w;
- }
- }
-
- public void Skip(int size) throws IOException {
- long s = 0;
- while (s < size) {
- s += pg_input.skip(size - s);
- }
- }
-
-
- /**
- * Copy data from an input stream to the connection.
- *
- * @param inStream the stream to read data from
- * @param remaining the number of bytes to copy
- */
- public void SendStream(InputStream inStream, int remaining) throws IOException {
- int expectedLength = remaining;
- if (streamBuffer == null)
- streamBuffer = new byte[8192];
-
- while (remaining > 0)
- {
- int count = (remaining > streamBuffer.length ? streamBuffer.length : remaining);
- int readCount;
-
- try
- {
- readCount = inStream.read(streamBuffer, 0, count);
- if (readCount < 0)
- throw new EOFException(GT.tr("Premature end of input stream, expected {0} bytes, but only read {1}.", new Object[]{new Integer(expectedLength), new Integer(expectedLength - remaining)}));
- }
- catch (IOException ioe)
- {
- while (remaining > 0)
- {
- Send(streamBuffer, count);
- remaining -= count;
- count = (remaining > streamBuffer.length ? streamBuffer.length : remaining);
- }
- throw new PGBindException(ioe);
- }
-
- Send(streamBuffer, readCount);
- remaining -= readCount;
- }
- }
-
-
-
- /**
- * Flush any pending output to the backend.
- * @exception IOException if an I/O error occurs
- */
- public void flush() throws IOException
- {
- if (encodingWriter != null)
- encodingWriter.flush();
- pg_output.flush();
- }
-
- /**
- * Consume an expected EOF from the backend
- * @exception SQLException if we get something other than an EOF
- */
- public void ReceiveEOF() throws SQLException, IOException
- {
- int c = pg_input.read();
- if (c < 0)
- return;
- throw new PSQLException(GT.tr("Expected an EOF from server, got: {0}", new Integer(c)), PSQLState.COMMUNICATION_ERROR);
- }
-
- /**
- * Closes the connection
- *
- * @exception IOException if an I/O Error occurs
- */
- public void close() throws IOException
- {
- if (encodingWriter != null)
- encodingWriter.close();
-
- pg_output.close();
- pg_input.close();
- connection.close();
- }
-}
diff --git a/org/postgresql/core/ParameterList.java b/org/postgresql/core/ParameterList.java
deleted file mode 100644
index ef59193..0000000
--- a/org/postgresql/core/ParameterList.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import java.sql.SQLException;
-import java.io.InputStream;
-
-/**
- * Abstraction of a list of parameters to be substituted into a Query.
- * The protocol-specific details of how to efficiently store and stream
- * the parameters is hidden behind implementations of this interface.
- *<p>
- * In general, instances of ParameterList are associated with a particular
- * Query object (the one that created them) and shouldn't be used against
- * another Query.
- *<p>
- * Parameter indexes are 1-based to match JDBC's PreparedStatement, i.e.
- * the first parameter has index 1.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-public interface ParameterList {
-
-
- void registerOutParameter( int index, int sqlType ) throws SQLException;
- /**
- * Get the number of parameters in this list. This value never changes
- * for a particular instance, and might be zero.
- *
- * @return the number of parameters in this list.
- */
- int getParameterCount();
-
- /**
- * Get the number of IN parameters in this list.
- *
- * @return the number of IN parameters in this list
- */
- int getInParameterCount();
-
- /**
- * Get the number of OUT parameters in this list.
- *
- * @return the number of OUT parameters in this list
- */
- int getOutParameterCount();
-
- /**
- * Return the oids of the parameters in this list. May be null for
- * a ParameterList that does not support typing of parameters.
- */
- public int[] getTypeOIDs();
-
- /**
- * Binds an integer value to a parameter. The type of the parameter is
- * implicitly 'int4'.
- *
- * @param index the 1-based parameter index to bind.
- * @param value the integer value to use.
- * @throws SQLException on error or if <code>index</code> is out of range
- */
- void setIntParameter(int index, int value) throws SQLException;
-
- /**
- * Binds a String value that is an unquoted literal to the
- * server's query parser (for example, a bare integer) to a parameter.
- * Associated with the parameter is a typename for the parameter that
- * should correspond to an entry in pg_types.
- *
- * @param index the 1-based parameter index to bind.
- * @param value the unquoted literal string to use.
- * @param oid the type OID of the parameter, or <code>0</code>
- * to infer the type.
- * @throws SQLException on error or if <code>index</code> is out of range
- */
- void setLiteralParameter(int index, String value, int oid) throws SQLException;
-
- /**
- * Binds a String value that needs to be quoted for the server's parser
- * to understand (for example, a timestamp) to a parameter.
- * Associated with the parameter is a typename for the parameter that
- * should correspond to an entry in pg_types.
- *
- * @param index the 1-based parameter index to bind.
- * @param value the quoted string to use.
- * @param oid the type OID of the parameter, or <code>0</code>
- * to infer the type.
- * @throws SQLException on error or if <code>index</code> is out of range
- */
- void setStringParameter(int index, String value, int oid) throws SQLException;
-
- /**
- * Binds a binary bytea value stored as a bytearray to a parameter. The
- * parameter's type is implicitly set to 'bytea'. The bytearray's
- * contains should remain unchanged until query execution has completed.
- *
- * @param index the 1-based parameter index to bind.
- * @param data an array containing the raw data value
- * @param offset the offset within <code>data</code> of the start of the parameter data.
- * @param length the number of bytes of parameter data within <code>data</code> to use.
- * @throws SQLException on error or if <code>index</code> is out of range
- */
- void setBytea(int index, byte[] data, int offset, int length) throws SQLException;
-
- /**
- * Binds a binary bytea value stored as an InputStream. The
- * parameter's type is implicitly set to 'bytea'. The stream should
- * remain valid until query execution has completed.
- *
- * @param index the 1-based parameter index to bind.
- * @param stream a stream containing the parameter data.
- * @param length the number of bytes of parameter data to read from <code>stream</code>.
- * @throws SQLException on error or if <code>index</code> is out of range
- */
- void setBytea(int index, InputStream stream, int length) throws SQLException;
-
- /**
- * Binds given byte[] value to a parameter. The bytes must already
- * be in correct format matching the OID.
- *
- * @param index the 1-based parameter index to bind.
- * @param value the bytes to send.
- * @param oid the type OID of the parameter.
- * @throws SQLException on error or if <code>index</code> is out of range
- */
- void setBinaryParameter(int index, byte[] value, int oid) throws SQLException;
-
- /**
- * Binds a SQL NULL value to a parameter.
- * Associated with the parameter is a typename for the parameter that
- * should correspond to an entry in pg_types.
- *
- * @param index the 1-based parameter index to bind.
- * @param oid the type OID of the parameter, or <code>0</code>
- * to infer the type.
- * @throws SQLException on error or if <code>index</code> is out of range
- */
- void setNull(int index, int oid) throws SQLException;
-
- /**
- * Perform a shallow copy of this ParameterList, returning a new instance
- * (still suitable for passing to the owning Query). If this ParameterList
- * is immutable, copy() may return the same immutable object.
- *
- * @return a new ParameterList instance
- */
- ParameterList copy();
-
- /**
- * Unbind all parameter values bound in this list.
- */
- void clear();
-
- /**
- * Return a human-readable representation of a particular parameter in
- * this ParameterList. If the parameter is not bound, returns "?".
- *
- * @param index the 1-based parameter index to bind.
- * @return a string representation of the parameter.
- */
- String toString(int index);
-}
diff --git a/org/postgresql/core/Parser.java b/org/postgresql/core/Parser.java
deleted file mode 100644
index 9debf39..0000000
--- a/org/postgresql/core/Parser.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2006-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-/**
- * Basic query parser infrastructure.
- *
- * @author Michael Paesold (mpaesold at gmx.at)
- */
-public class Parser {
-
- /**
- * Find the end of the single-quoted string starting at the given offset.
- *
- * Note: for <tt>'single '' quote in string'</tt>, this method currently
- * returns the offset of first <tt>'</tt> character after the initial
- * one. The caller must call the method a second time for the second
- * part of the quoted string.
- */
- public static int parseSingleQuotes(final char[] query, int offset,
- boolean standardConformingStrings) {
- // check for escape string syntax (E'')
- if (standardConformingStrings
- && offset >= 2
- && (query[offset-1] == 'e' || query[offset-1] == 'E')
- && charTerminatesIdentifier(query[offset-2]))
- {
- standardConformingStrings = false;
- }
-
- if (standardConformingStrings)
- {
- // do NOT treat backslashes as escape characters
- while (++offset < query.length)
- {
- switch (query[offset])
- {
- case '\'':
- return offset;
- default:
- break;
- }
- }
- }
- else
- {
- // treat backslashes as escape characters
- while (++offset < query.length)
- {
- switch (query[offset])
- {
- case '\\':
- ++offset;
- break;
- case '\'':
- return offset;
- default:
- break;
- }
- }
- }
-
- return query.length;
- }
-
- /**
- * Find the end of the double-quoted string starting at the given offset.
- *
- * Note: for <tt>"double "" quote in string"</tt>,
- * this method currently returns the offset of first <tt>"</tt>
- * character after the initial one. The caller must call the method a
- * second time for the second part of the quoted string.
- */
- public static int parseDoubleQuotes(final char[] query, int offset) {
- while (++offset < query.length && query[offset] != '"') ;
- return offset;
- }
-
- /**
- * Test if the dollar character (<tt>$</tt>) at the given offset starts
- * a dollar-quoted string and return the offset of the ending dollar
- * character.
- */
- public static int parseDollarQuotes(final char[] query, int offset) {
- if (offset + 1 < query.length
- && (offset == 0 || !isIdentifierContChar(query[offset-1])))
- {
- int endIdx = -1;
- if (query[offset + 1] == '$')
- endIdx = offset + 1;
- else if (isDollarQuoteStartChar(query[offset + 1]))
- {
- for (int d = offset + 2; d < query.length; ++d)
- {
- if (query[d] == '$')
- {
- endIdx = d;
- break;
- }
- else if (!isDollarQuoteContChar(query[d]))
- break;
- }
- }
- if (endIdx > 0)
- {
- // found; note: tag includes start and end $ character
- int tagIdx = offset, tagLen = endIdx - offset + 1;
- offset = endIdx; // loop continues at endIdx + 1
- for (++offset; offset < query.length; ++offset)
- {
- if (query[offset] == '$' &&
- subArraysEqual(query, tagIdx, offset, tagLen))
- {
- offset += tagLen - 1;
- break;
- }
- }
- }
- }
- return offset;
- }
-
- /**
- * Test if the <tt>-</tt> character at <tt>offset</tt> starts a
- * <tt>--</tt> style line comment, and return the position of the first
- * <tt>\r</tt> or <tt>\n</tt> character.
- */
- public static int parseLineComment(final char[] query, int offset) {
- if (offset + 1 < query.length && query[offset + 1] == '-')
- {
- while (++offset < query.length)
- {
- if (query[offset] == '\r' || query[offset] == '\n')
- break;
- }
- }
- return offset;
- }
-
- /**
- * Test if the <tt>/</tt> character at <tt>offset</tt> starts a block
- * comment, and return the position of the last <tt>/</tt> character.
- */
- public static int parseBlockComment(final char[] query, int offset) {
- if (offset + 1 < query.length && query[offset + 1] == '*')
- {
- // /* /* */ */ nest, according to SQL spec
- int level = 1;
- for (offset += 2; offset < query.length; ++offset)
- {
- switch (query[offset-1])
- {
- case '*':
- if (query[offset] == '/')
- {
- --level;
- ++offset; // don't parse / in */* twice
- }
- break;
- case '/':
- if (query[offset] == '*')
- {
- ++level;
- ++offset; // don't parse * in /*/ twice
- }
- break;
- default:
- break;
- }
-
- if (level == 0)
- {
- --offset; // reset position to last '/' char
- break;
- }
- }
- }
- return offset;
- }
-
- /**
- * @return true if the character is a whitespace character as defined
- * in the backend's parser
- */
- public static boolean isSpace(char c) {
- return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f';
- }
-
- /**
- * @return true if the given character is a valid character for an
- * operator in the backend's parser
- */
- public static boolean isOperatorChar(char c) {
- /*
- * Extracted from operators defined by {self} and {op_chars}
- * in pgsql/src/backend/parser/scan.l.
- */
- return ",()[].;:+-*/%^<>=~!@#&|`?".indexOf(c) != -1;
- }
-
- /**
- * Checks if a character is valid as the start of an identifier.
- *
- * @param c the character to check
- * @return true if valid as first character of an identifier; false if not
- */
- public static boolean isIdentifierStartChar(char c) {
- /*
- * Extracted from {ident_start} and {ident_cont} in
- * pgsql/src/backend/parser/scan.l:
- * ident_start [A-Za-z\200-\377_]
- * ident_cont [A-Za-z\200-\377_0-9\$]
- */
- return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
- || c == '_' || c > 127 ;
- }
-
- /**
- * Checks if a character is valid as the second or later character of an
- * identifier.
- *
- * @param c the character to check
- * @return true if valid as second or later character of an identifier; false if not
- */
- public static boolean isIdentifierContChar(char c) {
- return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
- || c == '_' || c > 127
- || (c >= '0' && c <= '9')
- || c == '$';
- }
-
- /**
- * @return true if the character terminates an identifier
- */
- public static boolean charTerminatesIdentifier(char c) {
- return c == '"' || isSpace(c) || isOperatorChar(c);
- }
-
- /**
- * Checks if a character is valid as the start of a dollar quoting tag.
- *
- * @param c the character to check
- * @return true if valid as first character of a dollar quoting tag; false if not
- */
- public static boolean isDollarQuoteStartChar(char c) {
- /*
- * The allowed dollar quote start and continuation characters
- * must stay in sync with what the backend defines in
- * pgsql/src/backend/parser/scan.l
- */
- return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
- || c == '_' || c > 127;
- }
-
- /**
- * Checks if a character is valid as the second or later character of a
- * dollar quoting tag.
- *
- * @param c the character to check
- * @return true if valid as second or later character of a dollar quoting tag;
- * false if not
- */
- public static boolean isDollarQuoteContChar(char c) {
- return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
- || c == '_' || c > 127
- || (c >= '0' && c <= '9');
- }
-
- /**
- * Compares two sub-arrays of the given character array for equalness.
- * If the length is zero, the result is true if and only if the offsets
- * are within the bounds of the array.
- *
- * @param arr a char array
- * @param offA first sub-array start offset
- * @param offB second sub-array start offset
- * @param len length of the sub arrays to compare
- * @return true if the sub-arrays are equal; false if not
- */
- private static boolean subArraysEqual(final char[] arr,
- final int offA, final int offB,
- final int len) {
- if (offA < 0 || offB < 0
- || offA >= arr.length || offB >= arr.length
- || offA + len > arr.length || offB + len > arr.length)
- return false;
-
- for (int i = 0; i < len; ++i)
- {
- if (arr[offA + i] != arr[offB + i])
- return false;
- }
-
- return true;
- }
-}
diff --git a/org/postgresql/core/ProtocolConnection.java b/org/postgresql/core/ProtocolConnection.java
deleted file mode 100644
index 62c0f1b..0000000
--- a/org/postgresql/core/ProtocolConnection.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import org.postgresql.PGNotification;
-import org.postgresql.util.HostSpec;
-
-import java.sql.*;
-import java.util.Set;
-
-/**
- * Provides access to protocol-level connection operations.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-public interface ProtocolConnection {
- /**
- * Constant returned by {@link #getTransactionState} indicating that no
- * transaction is currently open.
- */
- static final int TRANSACTION_IDLE = 0;
-
- /**
- * Constant returned by {@link #getTransactionState} indicating that a
- * transaction is currently open.
- */
- static final int TRANSACTION_OPEN = 1;
-
- /**
- * Constant returned by {@link #getTransactionState} indicating that a
- * transaction is currently open, but it has seen errors and will
- * refuse subsequent queries until a ROLLBACK.
- */
- static final int TRANSACTION_FAILED = 2;
-
- /**
- * @return the host and port this connection is connected to.
- */
- HostSpec getHostSpec();
-
- /**
- * @return the user this connection authenticated as.
- */
- String getUser();
-
- /**
- * @return the database this connection is connected to.
- */
- String getDatabase();
-
- /**
- * @return the server version of the connected server, formatted as X.Y.Z.
- */
- String getServerVersion();
-
- /**
- * @return the current encoding in use by this connection
- */
- Encoding getEncoding();
-
- /**
- * Returns whether the server treats string-literals according to the SQL
- * standard or if it uses traditional PostgreSQL escaping rules. Versions
- * up to 8.1 always treated backslashes as escape characters in
- * string-literals. Since 8.2, this depends on the value of the
- * <tt>standard_conforming_strings<tt> server variable.
- *
- * @return true if the server treats string literals according to the SQL
- * standard
- */
- boolean getStandardConformingStrings();
-
- /**
- * Get the current transaction state of this connection.
- *
- * @return a ProtocolConnection.TRANSACTION_* constant.
- */
- int getTransactionState();
-
- /**
- * Retrieve and clear the set of asynchronous notifications pending on this
- * connection.
- *
- * @return an array of notifications; if there are no notifications, an empty
- * array is returned.
- */
- PGNotification[] getNotifications() throws SQLException;
-
- /**
- * Retrieve and clear the chain of warnings accumulated on this connection.
- *
- * @return the first SQLWarning in the chain; subsequent warnings can be
- * found via SQLWarning.getNextWarning().
- */
- SQLWarning getWarnings();
-
- /**
- * @return the QueryExecutor instance for this connection.
- */
- QueryExecutor getQueryExecutor();
-
- /**
- * Sends a query cancellation for this connection.
- * @throws SQLException if something goes wrong.
- */
- void sendQueryCancel() throws SQLException;
-
- /**
- * Close this connection cleanly.
- */
- void close();
-
- /**
- * Check if this connection is closed.
- *
- * @return true iff the connection is closed.
- */
- boolean isClosed();
-
- /**
- *
- * @return the version of the implementation
- */
- public int getProtocolVersion();
-
- /**
- * Sets the oids that should be received using binary encoding.
- *
- * @param useBinaryForOids The oids to request with binary encoding.
- */
- public void setBinaryReceiveOids(Set<Integer> useBinaryForOids);
-
- /**
- * Returns true if server uses integer instead of double for binary
- * date and time encodings.
- *
- * @return the server integer_datetime setting.
- */
- public boolean getIntegerDateTimes();
-}
diff --git a/org/postgresql/core/Query.java b/org/postgresql/core/Query.java
deleted file mode 100644
index 098a437..0000000
--- a/org/postgresql/core/Query.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-/**
- * Abstraction of a generic Query, hiding the details of
- * any protocol-version-specific data needed to execute
- * the query efficiently.
- *<p>
- * Query objects should be explicitly closed when no longer
- * needed; if resources are allocated on the server for this
- * query, their cleanup is triggered by closing the Query.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-public interface Query {
- /**
- * Create a ParameterList suitable for storing parameters
- * associated with this Query.
- *<p>
- * If this query has no parameters, a ParameterList will
- * be returned, but it may be a shared immutable object.
- * If this query does have parameters, the returned
- * ParameterList is a new list, unshared by other callers.
- *
- * @return a suitable ParameterList instance for this query
- */
- ParameterList createParameterList();
-
- /**
- * Stringize this query to a human-readable form, substituting
- * particular parameter values for parameter placeholders.
- *
- * @param parameters a ParameterList returned by this Query's
- * {@link #createParameterList} method, or <code>null</code> to
- * leave the parameter placeholders unsubstituted.
- * @return a human-readable representation of this query
- */
- String toString(ParameterList parameters);
-
- /**
- * Close this query and free any server-side resources associated
- * with it. The resources may not be immediately deallocated, but
- * closing a Query may make the deallocation more prompt.
- *<p>
- * A closed Query should not be executed.
- */
- void close();
-
- boolean isStatementDescribed();
-}
diff --git a/org/postgresql/core/QueryExecutor.java b/org/postgresql/core/QueryExecutor.java
deleted file mode 100644
index 2d6e754..0000000
--- a/org/postgresql/core/QueryExecutor.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import java.sql.SQLException;
-
-import org.postgresql.copy.CopyOperation;
-
-/**
- * Abstracts the protocol-specific details of executing a query.
- *<p>
- * Every connection has a single QueryExecutor implementation associated with it.
- * This object provides:
- *
- * <ul>
- * <li> factory methods for Query objects ({@link #createSimpleQuery}
- * and {@link #createParameterizedQuery})
- * <li> execution methods for created Query objects ({@link #execute(Query,ParameterList,ResultHandler,int,int,int)}
- * for single queries and {@link #execute(Query[],ParameterList[],ResultHandler,int,int,int)} for batches of
- * queries)
- * <li> a fastpath call interface ({@link #createFastpathParameters}
- * and {@link #fastpathCall}).
- * </ul>
- *
- *<p>
- * Query objects may represent a query that has parameter placeholders. To provide
- * actual values for these parameters, a {@link ParameterList} object is created
- * via a factory method ({@link Query#createParameterList}). The parameters are filled
- * in by the caller and passed along with the query to the query execution methods.
- * Several ParameterLists for a given query might exist at one time (or over time);
- * this allows the underlying Query to be reused for several executions, or for
- * batch execution of the same Query.
- *
- *<p>
- * In general, a Query created by a particular QueryExecutor may only be
- * executed by that QueryExecutor, and a ParameterList created by a particular
- * Query may only be used as parameters to that Query. Unpredictable things will
- * happen if this isn't done.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-public interface QueryExecutor {
- /**
- * Flag for query execution that indicates the given Query object is unlikely
- * to be reused.
- */
- static int QUERY_ONESHOT = 1;
-
- /**
- * Flag for query execution that indicates that resultset metadata isn't needed
- * and can be safely omitted.
- */
- static int QUERY_NO_METADATA = 2;
-
- /**
- * Flag for query execution that indicates that a resultset isn't expected and
- * the query executor can safely discard any rows (although the resultset should
- * still appear to be from a resultset-returning query).
- */
- static int QUERY_NO_RESULTS = 4;
-
- /**
- * Flag for query execution that indicates a forward-fetch-capable cursor should
- * be used if possible.
- */
- static int QUERY_FORWARD_CURSOR = 8;
-
- /**
- * Flag for query execution that indicates the automatic BEGIN on the first statement
- * when outside a transaction should not be done.
- */
- static int QUERY_SUPPRESS_BEGIN = 16;
-
- /**
- * Flag for query execution when we don't really want to execute, we just
- * want to get the parameter metadata for the statement.
- */
- static int QUERY_DESCRIBE_ONLY = 32;
-
- /**
- * Flag for query execution used by generated keys where we want to receive
- * both the ResultSet and associated update count from the command status.
- */
- static int QUERY_BOTH_ROWS_AND_STATUS = 64;
-
- /**
- * Flag to disable batch execution when we expect results (generated keys)
- * from a statement.
- */
- static int QUERY_DISALLOW_BATCHING = 128;
-
- /**
- * Flag for query execution to avoid using binary transfer.
- */
- static int QUERY_NO_BINARY_TRANSFER = 256;
-
- /**
- * Execute a Query, passing results to a provided ResultHandler.
- *
- * @param query the query to execute; must be a query returned from
- * calling {@link #createSimpleQuery(String)} or {@link #createParameterizedQuery(String)}
- * on this QueryExecutor object.
- * @param parameters the parameters for the query. Must be non-<code>null</code>
- * if the query takes parameters. Must be a parameter object returned by
- * {@link org.postgresql.core.Query#createParameterList()}.
- * @param handler a ResultHandler responsible for handling results generated
- * by this query
- * @param maxRows the maximum number of rows to retrieve
- * @param fetchSize if QUERY_FORWARD_CURSOR is set, the preferred number of rows to retrieve before suspending
- * @param flags a combination of QUERY_* flags indicating how to handle the query.
- *
- * @throws SQLException if query execution fails
- */
- void execute(Query query,
- ParameterList parameters,
- ResultHandler handler,
- int maxRows,
- int fetchSize,
- int flags)
- throws SQLException;
-
- /**
- * Execute several Query, passing results to a provided ResultHandler.
- *
- * @param queries the queries to execute; each must be a query returned from
- * calling {@link #createSimpleQuery(String)} or {@link #createParameterizedQuery(String)}
- * on this QueryExecutor object.
- * @param parameterLists the parameter lists for the queries. The parameter lists
- * correspond 1:1 to the queries passed in the <code>queries</code> array. Each must be
- * non-<code>null</code> if the corresponding query takes parameters, and must
- * be a parameter object returned by {@link org.postgresql.core.Query#createParameterList()}
- * created by the corresponding query.
- * @param handler a ResultHandler responsible for handling results generated
- * by this query
- * @param maxRows the maximum number of rows to retrieve
- * @param fetchSize if QUERY_FORWARD_CURSOR is set, the preferred number of rows to retrieve before suspending
- * @param flags a combination of QUERY_* flags indicating how to handle the query.
- *
- * @throws SQLException if query execution fails
- */
- void execute(Query[] queries,
- ParameterList[] parameterLists,
- ResultHandler handler,
- int maxRows,
- int fetchSize,
- int flags)
- throws SQLException;
-
- /**
- * Fetch additional rows from a cursor.
- *
- * @param cursor the cursor to fetch from
- * @param handler the handler to feed results to
- * @param fetchSize the preferred number of rows to retrieve before suspending
- * @throws SQLException if query execution fails
- */
- void fetch(ResultCursor cursor, ResultHandler handler, int fetchSize) throws SQLException;
-
- /**
- * Create an unparameterized Query object suitable for execution by
- * this QueryExecutor. The provided query string is not parsed for
- * parameter placeholders ('?' characters), and the
- * {@link Query#createParameterList} of the returned object will
- * always return an empty ParameterList.
- *
- * @param sql the SQL for the query to create
- * @return a new Query object
- */
- Query createSimpleQuery(String sql);
-
- /**
- * Create a parameterized Query object suitable for execution by
- * this QueryExecutor. The provided query string is parsed for
- * parameter placeholders ('?' characters), and the
- * {@link Query#createParameterList} of the returned object will
- * create an appropriately-sized ParameterList.
- *
- * @param sql the SQL for the query to create, with '?' placeholders for
- * parameters.
- * @return a new Query object
- */
- Query createParameterizedQuery(String sql); // Parsed for parameter placeholders ('?')
-
- /**
- * Prior to attempting to retrieve notifications, we need to pull
- * any recently received notifications off of the network buffers.
- * The notification retrieval in ProtocolConnection cannot do this
- * as it is prone to deadlock, so the higher level caller must be
- * responsible which requires exposing this method.
- */
- void processNotifies() throws SQLException;
-
- //
- // Fastpath interface.
- //
-
- /**
- * Create a new ParameterList implementation suitable for invoking a
- * fastpath function via {@link #fastpathCall}.
- *
- * @param count the number of parameters the fastpath call will take
- * @return a ParameterList suitable for passing to {@link #fastpathCall}.
- */
- ParameterList createFastpathParameters(int count);
-
- /**
- * Invoke a backend function via the fastpath interface.
- *
- * @param fnid the OID of the backend function to invoke
- * @param params a ParameterList returned from {@link #createFastpathParameters}
- * containing the parameters to pass to the backend function
- *
- * @return the binary-format result of the fastpath call, or <code>null</code>
- * if a void result was returned
- * @throws SQLException if an error occurs while executing the fastpath call
- */
- byte[] fastpathCall(int fnid, ParameterList params, boolean suppressBegin) throws SQLException;
-
- /**
- * Issues a COPY FROM STDIN / COPY TO STDOUT statement and returns
- * handler for associated operation. Until the copy operation completes,
- * no other database operation may be performed.
- * Implemented for protocol version 3 only.
- * @throws SQLException when initializing the given query fails
- */
- CopyOperation startCopy(String sql, boolean suppressBegin) throws SQLException;
-}
diff --git a/org/postgresql/core/ResultCursor.java b/org/postgresql/core/ResultCursor.java
deleted file mode 100644
index e4b9c40..0000000
--- a/org/postgresql/core/ResultCursor.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-/**
- * Abstraction of a cursor over a returned resultset.
- * This is an opaque interface that only provides a way
- * to close the cursor; all other operations are done by
- * passing a ResultCursor to QueryExecutor methods.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-public interface ResultCursor {
- /**
- * Close this cursor. This may not immediately free underlying resources
- * but may make it happen more promptly. Closed cursors should not be
- * passed to QueryExecutor methods.
- */
- void close();
-}
diff --git a/org/postgresql/core/ResultHandler.java b/org/postgresql/core/ResultHandler.java
deleted file mode 100644
index f72719f..0000000
--- a/org/postgresql/core/ResultHandler.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import java.sql.*;
-import java.util.List;
-
-/**
- * Callback interface for passing query results from the protocol-specific
- * layer to the protocol-independent JDBC implementation code.
- *<p>
- * In general, a single query execution will consist of a number of calls
- * to handleResultRows, handleCommandStatus, handleWarning, and handleError,
- * followed by a single call to handleCompletion when query execution is
- * complete. If the caller wants to throw SQLException, this can be done
- * in handleCompletion.
- *<p>
- * Each executed query ends with a call to handleResultRows,
- * handleCommandStatus, or handleError. If an error occurs, subsequent queries
- * won't generate callbacks.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-public interface ResultHandler {
- /**
- * Called when result rows are received from a query.
- *
- * @param fromQuery the underlying query that generated these results;
- * this may not be very specific (e.g. it may be a query that includes
- * multiple statements).
- * @param fields column metadata for the resultset; might be
- * <code>null</code> if Query.QUERY_NO_METADATA was specified.
- * @param tuples the actual data
- * @param cursor a cursor to use to fetch additional data;
- * <code>null</code> if no further results are present.
- */
- void handleResultRows(Query fromQuery, Field[] fields, List tuples, ResultCursor cursor);
-
- /**
- * Called when a query that did not return a resultset completes.
- *
- * @param status the command status string (e.g. "SELECT") returned by
- * the backend
- * @param updateCount the number of rows affected by an INSERT, UPDATE,
- * DELETE, FETCH, or MOVE command; -1 if not available.
- * @param insertOID for a single-row INSERT query, the OID of the newly
- * inserted row; 0 if not available.
- */
- void handleCommandStatus(String status, int updateCount, long insertOID);
-
- /**
- * Called when a warning is emitted.
- *
- * @param warning the warning that occured.
- */
- void handleWarning(SQLWarning warning);
-
- /**
- * Called when an error occurs. Subsequent queries are abandoned;
- * in general the only calls between a handleError call and
- * a subsequent handleCompletion call are handleError or handleWarning.
- *
- * @param error the error that occurred
- */
- void handleError(SQLException error);
-
- /**
- * Called before a QueryExecutor method returns. This method
- * may throw a SQLException if desired; if it does, the QueryExecutor
- * method will propagate that exception to the original caller.
- *
- * @throws SQLException if the handler wishes the original method to
- * throw an exception.
- */
- void handleCompletion() throws SQLException;
-}
diff --git a/org/postgresql/core/SetupQueryRunner.java b/org/postgresql/core/SetupQueryRunner.java
deleted file mode 100644
index 18c6b62..0000000
--- a/org/postgresql/core/SetupQueryRunner.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import java.util.List;
-import java.sql.SQLWarning;
-import java.sql.SQLException;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.PSQLException;
-
-/**
- * Poor man's Statement & ResultSet, used for initial queries while we're
- * still initializing the system.
- */
-public class SetupQueryRunner {
-
- private static class SimpleResultHandler implements ResultHandler {
- private SQLException error;
- private List tuples;
- private final ProtocolConnection protoConnection;
-
- SimpleResultHandler(ProtocolConnection protoConnection) {
- this.protoConnection = protoConnection;
- }
-
- List getResults() {
- return tuples;
- }
-
- public void handleResultRows(Query fromQuery, Field[] fields, List tuples, ResultCursor cursor) {
- this.tuples = tuples;
- }
-
- public void handleCommandStatus(String status, int updateCount, long insertOID) {
- }
-
- public void handleWarning(SQLWarning warning) {
- // We ignore warnings. We assume we know what we're
- // doing in the setup queries.
- }
-
- public void handleError(SQLException newError) {
- if (error == null)
- error = newError;
- else
- error.setNextException(newError);
- }
-
- public void handleCompletion() throws SQLException {
- if (error != null)
- throw error;
- }
- }
-
- public static byte[][] run(ProtocolConnection protoConnection, String queryString, boolean wantResults) throws SQLException {
- QueryExecutor executor = protoConnection.getQueryExecutor();
- Query query = executor.createSimpleQuery(queryString);
- SimpleResultHandler handler = new SimpleResultHandler(protoConnection);
-
- int flags = QueryExecutor.QUERY_ONESHOT | QueryExecutor.QUERY_SUPPRESS_BEGIN;
- if (!wantResults)
- flags |= QueryExecutor.QUERY_NO_RESULTS | QueryExecutor.QUERY_NO_METADATA;
-
- try
- {
- executor.execute(query, null, handler, 0, 0, flags);
- }
- finally
- {
- query.close();
- }
-
- if (!wantResults)
- return null;
-
- List tuples = handler.getResults();
- if (tuples == null || tuples.size() != 1)
- throw new PSQLException(GT.tr("An unexpected result was returned by a query."), PSQLState.CONNECTION_UNABLE_TO_CONNECT);
-
- return (byte[][]) tuples.get(0);
- }
-
-}
diff --git a/org/postgresql/core/TypeInfo.java b/org/postgresql/core/TypeInfo.java
deleted file mode 100644
index d9a3a13..0000000
--- a/org/postgresql/core/TypeInfo.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2008-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import java.sql.SQLException;
-import java.util.Iterator;
-
-public interface TypeInfo
-{
- public void addCoreType(String pgTypeName, Integer oid, Integer sqlType, String javaClass, Integer arrayOid);
-
- public void addDataType(String type, Class klass) throws SQLException;
-
- /**
- * Look up the SQL typecode for a given type oid.
- *
- * @param oid the type's OID
- * @return the SQL type code (a constant from {@link java.sql.Types})
- * for the type
- */
- public int getSQLType(int oid) throws SQLException;
-
- /**
- * Look up the SQL typecode for a given postgresql type name.
- *
- * @param pgTypeName the server type name to look up
- * @return the SQL type code (a constant from {@link java.sql.Types})
- * for the type
- */
- public int getSQLType(String pgTypeName) throws SQLException;
-
- /**
- * Look up the oid for a given postgresql type name. This is
- * the inverse of {@link #getPGType(int)}.
- *
- * @param pgTypeName the server type name to look up
- * @return the type's OID, or 0 if unknown
- */
- public int getPGType(String pgTypeName) throws SQLException;
-
- /**
- * Look up the postgresql type name for a given oid. This is the
- * inverse of {@link #getPGType(String)}.
- *
- * @param oid the type's OID
- * @return the server type name for that OID or null if unknown
- */
- public String getPGType(int oid) throws SQLException;
-
- /**
- * Look up the oid of an array's base type given the array's type oid.
- *
- * @param oid the array type's OID
- * @return the base type's OID, or 0 if unknown
- */
- public int getPGArrayElement(int oid) throws SQLException;
-
- /**
- * Determine the oid of the given base postgresql type's array type
- *
- * @param elementTypeName the base type's
- * @return the array type's OID, or 0 if unknown
- */
- public int getPGArrayType(String elementTypeName) throws SQLException;
-
- /**
- * Determine the delimiter for the elements of the given array type oid.
- *
- * @param oid the array type's OID
- * @return the base type's array type delimiter
- */
- public char getArrayDelimiter(int oid) throws SQLException;
-
- public Iterator getPGTypeNamesWithSQLTypes();
-
- public Class getPGobject(String type);
-
- public String getJavaClass(int oid) throws SQLException;
-
- public String getTypeForAlias(String alias);
-
- public int getPrecision(int oid, int typmod);
-
- public int getScale(int oid, int typmod);
-
- public boolean isCaseSensitive(int oid);
-
- public boolean isSigned(int oid);
-
- public int getDisplaySize(int oid, int typmod);
-
- public int getMaximumPrecision(int oid);
-
- public boolean requiresQuoting(int oid) throws SQLException;
-
-}
diff --git a/org/postgresql/core/UTF8Encoding.java b/org/postgresql/core/UTF8Encoding.java
deleted file mode 100644
index 390c947..0000000
--- a/org/postgresql/core/UTF8Encoding.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core;
-
-import java.io.IOException;
-import org.postgresql.util.GT;
-
-class UTF8Encoding extends Encoding {
- UTF8Encoding(String jvmEncoding) {
- super(jvmEncoding);
- }
-
- private static final int MIN_2_BYTES = 0x80;
- private static final int MIN_3_BYTES = 0x800;
- private static final int MIN_4_BYTES = 0x10000;
- private static final int MAX_CODE_POINT = 0x10ffff;
-
- private char[] decoderArray = new char[1024];
-
- // helper for decode
- private final static void checkByte(int ch, int pos, int len) throws IOException {
- if ((ch & 0xc0) != 0x80)
- throw new IOException(GT.tr("Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}",
- new Object[] { new Integer(pos), new Integer(len), new Integer(ch) }));
- }
-
- private final static void checkMinimal(int ch, int minValue) throws IOException {
- if (ch >= minValue)
- return;
-
- int actualLen;
- switch (minValue) {
- case MIN_2_BYTES:
- actualLen = 2;
- break;
- case MIN_3_BYTES:
- actualLen = 3;
- break;
- case MIN_4_BYTES:
- actualLen = 4;
- break;
- default:
- throw new IllegalArgumentException("unexpected minValue passed to checkMinimal: " + minValue);
- }
-
- int expectedLen;
- if (ch < MIN_2_BYTES)
- expectedLen = 1;
- else if (ch < MIN_3_BYTES)
- expectedLen = 2;
- else if (ch < MIN_4_BYTES)
- expectedLen = 3;
- else
- throw new IllegalArgumentException("unexpected ch passed to checkMinimal: " + ch);
-
- throw new IOException(GT.tr("Illegal UTF-8 sequence: {0} bytes used to encode a {1} byte value: {2}",
- new Object[] { new Integer(actualLen), new Integer(expectedLen), new Integer(ch) }));
- }
-
- /**
- * Custom byte[] -> String conversion routine for UTF-8 only.
- * This is about twice as fast as using the String(byte[],int,int,String)
- * ctor, at least under JDK 1.4.2. The extra checks for illegal representations
- * add about 10-15% overhead, but they seem worth it given the number of SQL_ASCII
- * databases out there.
- *
- * @param data the array containing UTF8-encoded data
- * @param offset the offset of the first byte in <code>data</code> to decode from
- * @param length the number of bytes to decode
- * @return a decoded string
- * @throws IOException if something goes wrong
- */
- public synchronized String decode(byte[] data, int offset, int length) throws IOException {
- char[] cdata = decoderArray;
- if (cdata.length < length)
- cdata = decoderArray = new char[length];
-
- int in = offset;
- int out = 0;
- int end = length + offset;
-
- try
- {
- while (in < end)
- {
- int ch = data[in++] & 0xff;
-
- // Convert UTF-8 to 21-bit codepoint.
- if (ch < 0x80) {
- // 0xxxxxxx -- length 1.
- } else if (ch < 0xc0) {
- // 10xxxxxx -- illegal!
- throw new IOException(GT.tr("Illegal UTF-8 sequence: initial byte is {0}: {1}",
- new Object[] { "10xxxxxx", new Integer(ch) }));
- } else if (ch < 0xe0) {
- // 110xxxxx 10xxxxxx
- ch = ((ch & 0x1f) << 6);
- checkByte(data[in], 2, 2);
- ch = ch | (data[in++] & 0x3f);
- checkMinimal(ch, MIN_2_BYTES);
- } else if (ch < 0xf0) {
- // 1110xxxx 10xxxxxx 10xxxxxx
- ch = ((ch & 0x0f) << 12);
- checkByte(data[in], 2, 3);
- ch = ch | ((data[in++] & 0x3f) << 6);
- checkByte(data[in], 3, 3);
- ch = ch | (data[in++] & 0x3f);
- checkMinimal(ch, MIN_3_BYTES);
- } else if (ch < 0xf8) {
- // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
- ch = ((ch & 0x07) << 18);
- checkByte(data[in], 2, 4);
- ch = ch | ((data[in++] & 0x3f) << 12);
- checkByte(data[in], 3, 4);
- ch = ch | ((data[in++] & 0x3f) << 6);
- checkByte(data[in], 4, 4);
- ch = ch | (data[in++] & 0x3f);
- checkMinimal(ch, MIN_4_BYTES);
- } else {
- throw new IOException(GT.tr("Illegal UTF-8 sequence: initial byte is {0}: {1}",
- new Object[] { "11111xxx", new Integer(ch) }));
- }
-
- if (ch > MAX_CODE_POINT)
- throw new IOException(GT.tr("Illegal UTF-8 sequence: final value is out of range: {0}",
- new Integer(ch)));
-
- // Convert 21-bit codepoint to Java chars:
- // 0..ffff are represented directly as a single char
- // 10000..10ffff are represented as a "surrogate pair" of two chars
- // See: http://java.sun.com/developer/technicalArticles/Intl/Supplementary/
-
- if (ch > 0xffff) {
- // Use a surrogate pair to represent it.
- ch -= 0x10000; // ch is now 0..fffff (20 bits)
- cdata[out++] = (char) (0xd800 + (ch >> 10)); // top 10 bits
- cdata[out++] = (char) (0xdc00 + (ch & 0x3ff)); // bottom 10 bits
- } else if (ch >= 0xd800 && ch < 0xe000) {
- // Not allowed to encode the surrogate range directly.
- throw new IOException(GT.tr("Illegal UTF-8 sequence: final value is a surrogate value: {0}",
- new Integer(ch)));
- } else {
- // Normal case.
- cdata[out++] = (char) ch;
- }
- }
- }
- catch (ArrayIndexOutOfBoundsException a)
- {
- throw new IOException("Illegal UTF-8 sequence: multibyte sequence was truncated");
- }
-
- // Check if we ran past the end without seeing an exception.
- if (in > end)
- throw new IOException("Illegal UTF-8 sequence: multibyte sequence was truncated");
-
- return new String(cdata, 0, out);
- }
-}
diff --git a/org/postgresql/core/Utils.java b/org/postgresql/core/Utils.java
deleted file mode 100644
index 0e6fc40..0000000
--- a/org/postgresql/core/Utils.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-
-package org.postgresql.core;
-
-import java.sql.SQLException;
-
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.Charset;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * Collection of utilities used by the protocol-level code.
- */
-public class Utils {
- /**
- * Turn a bytearray into a printable form, representing
- * each byte in hex.
- *
- * @param data the bytearray to stringize
- * @return a hex-encoded printable representation of <code>data</code>
- */
- public static String toHexString(byte[] data) {
- StringBuffer sb = new StringBuffer(data.length * 2);
- for (int i = 0; i < data.length; ++i)
- {
- sb.append(Integer.toHexString((data[i] >> 4) & 15));
- sb.append(Integer.toHexString(data[i] & 15));
- }
- return sb.toString();
- }
-
- /**
- * Keep a local copy of the UTF-8 Charset so we can avoid
- * synchronization overhead from looking up the Charset by
- * name as String.getBytes(String) requires.
- */
- private final static Charset utf8Charset = Charset.forName("UTF-8");
-
- /**
- * Encode a string as UTF-8.
- *
- * @param str the string to encode
- * @return the UTF-8 representation of <code>str</code>
- */
- public static byte[] encodeUTF8(String str) {
- // Previously we just used str.getBytes("UTF-8"), but when
- // the JVM is using more than one encoding the lookup cost
- // makes that a loser to the below (even in the single thread case).
- // When multiple threads are doing Charset lookups, they all get
- // blocked and must wait, severely dropping throughput.
- //
- ByteBuffer buf = utf8Charset.encode(CharBuffer.wrap(str));
- byte b[] = new byte[buf.limit()];
- buf.get(b, 0, buf.limit());
- return b;
- }
-
- /**
- * Escape the given literal <tt>value</tt> and append it to the string buffer
- * <tt>sbuf</tt>. If <tt>sbuf</tt> is <tt>null</tt>, a new StringBuffer will be
- * returned. The argument <tt>standardConformingStrings</tt> defines whether the
- * backend expects standard-conforming string literals or allows backslash
- * escape sequences.
- *
- * @param sbuf the string buffer to append to; or <tt>null</tt>
- * @param value the string value
- * @param standardConformingStrings
- * @return the sbuf argument; or a new string buffer for sbuf == null
- * @throws SQLException if the string contains a <tt>\0</tt> character
- */
- public static StringBuffer appendEscapedLiteral(StringBuffer sbuf, String value,
- boolean standardConformingStrings)
- throws SQLException {
- if (sbuf == null)
- sbuf = new StringBuffer(value.length() * 11 / 10); // Add 10% for escaping.
-
- if (standardConformingStrings)
- {
- // With standard_conforming_strings on, escape only single-quotes.
- for (int i = 0; i < value.length(); ++i)
- {
- char ch = value.charAt(i);
- if (ch == '\0')
- throw new PSQLException(GT.tr("Zero bytes may not occur in string parameters."), PSQLState.INVALID_PARAMETER_VALUE);
- if (ch == '\'')
- sbuf.append('\'');
- sbuf.append(ch);
- }
- }
- else
- {
- // With standard_conforming_string off, escape backslashes and
- // single-quotes, but still escape single-quotes by doubling, to
- // avoid a security hazard if the reported value of
- // standard_conforming_strings is incorrect, or an error if
- // backslash_quote is off.
- for (int i = 0; i < value.length(); ++i)
- {
- char ch = value.charAt(i);
- if (ch == '\0')
- throw new PSQLException(GT.tr("Zero bytes may not occur in string parameters."), PSQLState.INVALID_PARAMETER_VALUE);
- if (ch == '\\' || ch == '\'')
- sbuf.append(ch);
- sbuf.append(ch);
- }
- }
-
- return sbuf;
- }
-
- /**
- * Escape the given identifier <tt>value</tt> and append it to the string
- * buffer * <tt>sbuf</tt>. If <tt>sbuf</tt> is <tt>null</tt>, a new
- * StringBuffer will be returned. This method is different from
- * appendEscapedLiteral in that it includes the quoting required for the
- * identifier while appendEscapedLiteral does not.
- *
- * @param sbuf the string buffer to append to; or <tt>null</tt>
- * @param value the string value
- * @return the sbuf argument; or a new string buffer for sbuf == null
- * @throws SQLException if the string contains a <tt>\0</tt> character
- */
- public static StringBuffer appendEscapedIdentifier(StringBuffer sbuf, String value)
- throws SQLException {
- if (sbuf == null)
- sbuf = new StringBuffer(2 + value.length() * 11 / 10); // Add 10% for escaping.
-
- sbuf.append('"');
-
- for (int i = 0; i < value.length(); ++i)
- {
- char ch = value.charAt(i);
- if (ch == '\0')
- throw new PSQLException(GT.tr("Zero bytes may not occur in identifiers."), PSQLState.INVALID_PARAMETER_VALUE);
- if (ch == '"')
- sbuf.append(ch);
- sbuf.append(ch);
- }
-
- sbuf.append('"');
-
- return sbuf;
- }
-}
diff --git a/org/postgresql/core/VisibleBufferedInputStream.java b/org/postgresql/core/VisibleBufferedInputStream.java
deleted file mode 100644
index 5378696..0000000
--- a/org/postgresql/core/VisibleBufferedInputStream.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * Copyright (c) 2006-2011, PostgreSQL Global Development Group
- *
- *
- *-------------------------------------------------------------------------
- */
-package org.postgresql.core;
-
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * A faster version of BufferedInputStream. Does no synchronisation and
- * allows direct access to the used byte[] buffer.
- *
- * @author Mikko Tiihonen
- */
-public class VisibleBufferedInputStream extends InputStream {
-
- /**
- * If a direct read to byte array is called that would require
- * a smaller read from the wrapped stream that MINIMUM_READ then
- * first fill the buffer and serve the bytes from there. Larger
- * reads are directly done to the provided byte array.
- */
- private static final int MINIMUM_READ = 1024;
-
- /**
- * In how large spans is the C string zero-byte scanned.
- */
- private static final int STRING_SCAN_SPAN = 1024;
-
- /**
- * The wrapped input stream.
- */
- private final InputStream wrapped;
-
- /**
- * The buffer.
- */
- private byte[] buffer;
-
- /**
- * Current read position in the buffer.
- */
- private int index;
-
- /**
- * How far is the buffer filled with valid data.
- */
- private int endIndex;
-
- /**
- * Creates a new buffer around the given stream.
- *
- * @param in The stream to buffer.
- * @param bufferSize The initial size of the buffer.
- */
- public VisibleBufferedInputStream(InputStream in, int bufferSize) {
- wrapped = in;
- buffer = new byte[bufferSize < MINIMUM_READ ?
- MINIMUM_READ : bufferSize];
- }
-
- /**
- * {@inheritDoc}
- */
- public int read() throws IOException {
- if (ensureBytes(1)) {
- return buffer[index++] & 0xFF;
- }
- return -1;
- }
-
- /**
- * Reads a byte from the buffer without advancing the index pointer.
- */
- public int peek() throws IOException {
- if (ensureBytes(1)) {
- return buffer[index] & 0xFF;
- }
- return -1;
- }
-
- /**
- * Reads byte from the buffer without any checks. This method never
- * reads from the underlaying stream.
- * Before calling this method the {@link #ensureBytes} method must
- * have been called.
- *
- * @return The next byte from the buffer.
- * @throws ArrayIndexOutOfBoundsException If ensureBytes was not called
- * to make sure the buffer contains the byte.
- */
- public byte readRaw() {
- return buffer[index++];
- }
-
- /**
- * Ensures that the buffer contains at least n bytes.
- * This method invalidates the buffer and index fields.
- *
- * @param n The amount of bytes to ensure exists in buffer
- * @return true if required bytes are available and false if EOF
- * @throws IOException If reading of the wrapped stream failed.
- */
- public boolean ensureBytes(int n) throws IOException {
- int required = n - endIndex + index;
- while (required > 0) {
- if (!readMore(required)) {
- return false;
- }
- required = n - endIndex + index;
- }
- return true;
- }
-
- /**
- * Reads more bytes into the buffer.
- *
- * @param wanted How much should be at least read.
- * @return True if at least some bytes were read.
- * @throws IOException If reading of the wrapped stream failed.
- */
- private boolean readMore(int wanted) throws IOException {
- if (endIndex == index) {
- index = 0;
- endIndex = 0;
- }
- int canFit = buffer.length - endIndex;
- if (canFit < wanted) {
- // would the wanted bytes fit if we compacted the buffer
- // and still leave some slack
- if (index + canFit > wanted + MINIMUM_READ) {
- compact();
- } else {
- doubleBuffer();
- }
- canFit = buffer.length - endIndex;
- }
- int read = wrapped.read(buffer, endIndex, canFit);
- if (read < 0) {
- return false;
- }
- endIndex += read;
- return true;
- }
-
- /**
- * Doubles the size of the buffer.
- */
- private void doubleBuffer() {
- byte[] buf = new byte[buffer.length * 2];
- moveBufferTo(buf);
- buffer = buf;
- }
-
- /**
- * Compacts the unread bytes of the buffer to the beginning of the buffer.
- */
- private void compact() {
- moveBufferTo(buffer);
- }
-
- /**
- * Moves bytes from the buffer to the begining of the destination buffer.
- * Also sets the index and endIndex variables.
- *
- * @param dest The destination buffer.
- */
- private void moveBufferTo(byte[] dest) {
- int size = endIndex - index;
- System.arraycopy(buffer, index, dest, 0, size);
- index = 0;
- endIndex = size;
- }
-
- /**
- * {@inheritDoc}
- */
- public int read(byte to[], int off, int len) throws IOException {
- if ((off | len | (off + len) | (to.length - (off + len))) < 0) {
- throw new IndexOutOfBoundsException();
- } else if (len == 0) {
- return 0;
- }
-
- // if the read would go to wrapped stream, but would result
- // in a small read then try read to the buffer instead
- int avail = endIndex - index;
- if (len - avail < MINIMUM_READ) {
- ensureBytes(len);
- avail = endIndex - index;
- }
-
- // first copy from buffer
- if (avail > 0) {
- if (len <= avail) {
- System.arraycopy(buffer, index, to, off, len);
- index += len;
- return len;
- }
- System.arraycopy(buffer, index, to, off, avail);
- len -= avail;
- off += avail;
- }
- int read = avail;
-
- // good place to reset index because the buffer is fully drained
- index = 0;
- endIndex = 0;
-
- // then directly from wrapped stream
- do {
- int r = wrapped.read(to, off, len);
- if (r <= 0) {
- return (read == 0) ? r : read;
- }
- read += r;
- off += r;
- len -= r;
- } while (len > 0);
-
- return read;
- }
-
- /**
- * {@inheritDoc}
- */
- public long skip(long n) throws IOException {
- int avail = endIndex - index;
- if (avail >= n) {
- index += n;
- return n;
- }
- n -= avail;
- index = 0;
- endIndex = 0;
- return avail + wrapped.skip(n);
- }
-
- /**
- * {@inheritDoc}
- */
- public int available() throws IOException {
- int avail = endIndex - index;
- return avail > 0 ? avail : wrapped.available();
- }
-
- /**
- * {@inheritDoc}
- */
- public void close() throws IOException {
- wrapped.close();
- }
-
- /**
- * Returns direct handle to the used buffer. Use the {@link #ensureBytes}
- * to prefill required bytes the buffer and {@link #getIndex} to fetch
- * the current position of the buffer.
- *
- * @return The underlaying buffer.
- */
- public byte[] getBuffer() {
- return buffer;
- }
-
- /**
- * Returns the current read position in the buffer.
- *
- * @return the current read position in the buffer.
- */
- public int getIndex() {
- return index;
- }
-
- /**
- * Scans the length of the next null terminated string (C-style string) from
- * the stream.
- *
- * @return The length of the next null terminated string.
- * @throws IOException If reading of stream fails.
- * @throws EOFxception If the stream did not contain any null terminators.
- */
- public int scanCStringLength() throws IOException {
- int pos = index;
- for (;;) {
- while (pos < endIndex) {
- if (buffer[pos++] == '\0') {
- return pos - index;
- }
- }
- if (!readMore(STRING_SCAN_SPAN)) {
- throw new EOFException();
- }
- pos = index;
- }
- }
-}
diff --git a/org/postgresql/core/types/PGBigDecimal.java b/org/postgresql/core/types/PGBigDecimal.java
deleted file mode 100644
index 59b5f43..0000000
--- a/org/postgresql/core/types/PGBigDecimal.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Created on May 15, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.postgresql.core.types;
-import java.math.BigDecimal;
-import java.sql.Types;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * @author davec
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class PGBigDecimal implements PGType
-{
- private BigDecimal val;
-
- protected PGBigDecimal( BigDecimal x )
- {
- // ensure the value is a valid numeric value to avoid
- // sql injection attacks
- val = new BigDecimal(x.toString());
-
- }
-
- public static PGType castToServerType( BigDecimal val, int targetType ) throws PSQLException
- {
- try
- {
- switch ( targetType )
- {
- case Types.BIT:
- return new PGBoolean( val.doubleValue() == 0?Boolean.FALSE:Boolean.TRUE );
- case Types.BIGINT:
- return new PGLong( new Long( val.longValue() ) );
- case Types.INTEGER:
- return new PGInteger( new Integer( val.intValue() ) ) ;
- case Types.SMALLINT:
- case Types.TINYINT:
- return new PGShort( new Short( val.shortValue() ) );
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- return new PGString( val.toString() );
- case Types.DECIMAL:
- case Types.NUMERIC:
- case Types.DOUBLE:
- case Types.FLOAT:
- case Types.REAL:
- return new PGBigDecimal( val );
- default:
- return new PGUnknown(val);
- }
- }
- catch( Exception ex )
- {
- throw new PSQLException(GT.tr("Cannot convert an instance of {0} to type {1}", new Object[]{val.getClass().getName(),"Types.OTHER"}), PSQLState.INVALID_PARAMETER_TYPE, ex);
- }
- }
- public String toString()
- {
- return val.toString();
- }
-
-}
diff --git a/org/postgresql/core/types/PGBoolean.java b/org/postgresql/core/types/PGBoolean.java
deleted file mode 100644
index 6067889..0000000
--- a/org/postgresql/core/types/PGBoolean.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Created on May 15, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.postgresql.core.types;
-
-import java.sql.Types;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * @author davec
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class PGBoolean implements PGType
-{
- private Boolean val;
-
- public PGBoolean(Boolean x)
- {
- val = x;
- }
- public static PGType castToServerType( Boolean val, int targetType ) throws PSQLException
- {
- try
- {
- switch ( targetType )
- {
- case Types.BIGINT:
- return new PGLong(new Long( val.booleanValue()==true?1:0 ));
- case Types.INTEGER:
- return new PGInteger( new Integer( val.booleanValue()==true?1:0 ) );
- case Types.SMALLINT:
- case Types.TINYINT:
- return new PGShort( new Short( val.booleanValue()==true?(short)1:(short)0 ) );
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- return new PGString( val.booleanValue()==true?"true":"false" );
- case Types.DOUBLE:
- case Types.FLOAT:
- return new PGDouble( new Double(val.booleanValue()==true?1:0));
- case Types.REAL:
- return new PGFloat( new Float(val.booleanValue()==true?1:0));
- case Types.NUMERIC:
- case Types.DECIMAL:
- return new PGBigDecimal( new java.math.BigDecimal(val.booleanValue()==true?1:0));
-
- case Types.BIT:
- return new PGBoolean( val );
- default:
- return new PGUnknown( val );
- }
- }
- catch(Exception ex)
- {
- throw new PSQLException(GT.tr("Cannot convert an instance of {0} to type {1}", new Object[]{val.getClass().getName(),"Types.OTHER"}), PSQLState.INVALID_PARAMETER_TYPE, ex);
- }
- }
- public String toString()
- {
- return val.booleanValue()==true?"true":"false";
- }
-
-}
diff --git a/org/postgresql/core/types/PGByte.java b/org/postgresql/core/types/PGByte.java
deleted file mode 100644
index 21c6acf..0000000
--- a/org/postgresql/core/types/PGByte.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Created on May 15, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.postgresql.core.types;
-
-import java.math.BigDecimal;
-import java.sql.Types;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * @author davec
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class PGByte implements PGType
-{
-
- private Byte val;
-
- public PGByte( Byte x )
- {
- val = x;
- }
- /* (non-Javadoc)
- * @see org.postgresql.types.PGType#castToServerType(int)
- */
- public static PGType castToServerType(Byte val, int targetType) throws PSQLException
- {
- try
- {
- switch ( targetType )
- {
- case Types.BIT:
- return new PGBoolean( val.byteValue() == 0?Boolean.FALSE:Boolean.TRUE );
-
- case Types.SMALLINT:
- case Types.TINYINT:
- return new PGByte( val );
- case Types.REAL:
- return new PGFloat( new Float( val.floatValue() ) );
- case Types.DOUBLE:
- case Types.FLOAT:
- return new PGDouble( new Double( val.doubleValue() ) );
- case Types.NUMERIC:
- case Types.DECIMAL:
- return new PGBigDecimal( new BigDecimal(val.toString()) );
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- return new PGString ( val.toString() );
- default:
- return new PGUnknown(val);
- }
- }
- catch( Exception ex )
- {
- throw new PSQLException(GT.tr("Cannot convert an instance of {0} to type {1}", new Object[]{val.getClass().getName(),"Types.OTHER"}), PSQLState.INVALID_PARAMETER_TYPE, ex);
- }
- }
-
- public String toString()
- {
- return val.toString();
- }
-}
diff --git a/org/postgresql/core/types/PGDouble.java b/org/postgresql/core/types/PGDouble.java
deleted file mode 100644
index ab21a50..0000000
--- a/org/postgresql/core/types/PGDouble.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Created on May 15, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.postgresql.core.types;
-
-import java.math.BigDecimal;
-import java.sql.Types;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * @author davec
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class PGDouble implements PGType
-{
- private Double val;
-
- protected PGDouble( Double x )
- {
- val = x;
- }
-
- public static PGType castToServerType( Double val, int targetType ) throws PSQLException
- {
- try
- {
- switch ( targetType )
- {
- case Types.BIT:
- return new PGBoolean( val.doubleValue() == 0?Boolean.FALSE:Boolean.TRUE );
-
- case Types.BIGINT:
- return new PGLong( new Long( val.longValue() ) );
- case Types.INTEGER:
- return new PGInteger( new Integer( val.intValue() ) ) ;
- case Types.SMALLINT:
- case Types.TINYINT:
- return new PGShort( new Short( val.shortValue() ) );
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- return new PGString( val.toString() );
- case Types.DOUBLE:
- case Types.FLOAT:
- return new PGDouble( val );
- case Types.REAL:
- return new PGFloat( new Float( val.floatValue()));
- case Types.DECIMAL:
- case Types.NUMERIC:
- return new PGBigDecimal( new BigDecimal( val.toString()));
- default:
- return new PGUnknown(val);
- }
- }
- catch( Exception ex )
- {
- throw new PSQLException(GT.tr("Cannot convert an instance of {0} to type {1}", new Object[]{val.getClass().getName(),"Types.OTHER"}), PSQLState.INVALID_PARAMETER_TYPE, ex);
- }
- }
- public String toString()
- {
- return val.toString();
- }
-}
diff --git a/org/postgresql/core/types/PGFloat.java b/org/postgresql/core/types/PGFloat.java
deleted file mode 100644
index 8f2ca8c..0000000
--- a/org/postgresql/core/types/PGFloat.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Created on May 15, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.postgresql.core.types;
-
-import java.math.BigDecimal;
-import java.sql.Types;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * @author davec
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class PGFloat implements PGType
-{
- private Float val;
-
- protected PGFloat( Float x )
- {
- val = x;
- }
-
- public static PGType castToServerType( Float val, int targetType ) throws PSQLException
- {
- try
- {
- switch ( targetType )
- {
- case Types.BIT:
- return new PGBoolean( val.floatValue() == 0?Boolean.FALSE:Boolean.TRUE );
-
- case Types.BIGINT:
- return new PGLong(new Long( val.longValue() ));
- case Types.INTEGER:
- return new PGInteger(new Integer( val.intValue() ) );
- case Types.SMALLINT:
- case Types.TINYINT:
- return new PGShort(new Short( val.shortValue() ));
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- return new PGString( val.toString() );
- case Types.DOUBLE:
- case Types.FLOAT:
- return( new PGDouble( new Double( val.doubleValue())));
- case Types.REAL:
- return new PGFloat( val );
- case Types.DECIMAL:
- case Types.NUMERIC:
- return new PGBigDecimal( new BigDecimal( val.toString()));
- default:
- return new PGUnknown(val);
- }
- }
- catch( Exception ex)
- {
- throw new PSQLException(GT.tr("Cannot convert an instance of {0} to type {1}", new Object[]{val.getClass().getName(),"Types.OTHER"}), PSQLState.INVALID_PARAMETER_TYPE, ex);
- }
- }
- public String toString()
- {
- return val.toString();
- }
-}
diff --git a/org/postgresql/core/types/PGInteger.java b/org/postgresql/core/types/PGInteger.java
deleted file mode 100644
index b416cce..0000000
--- a/org/postgresql/core/types/PGInteger.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Created on May 15, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.postgresql.core.types;
-
-import java.math.BigDecimal;
-import java.sql.Types;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * @author davec
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class PGInteger implements PGType
-{
- private Integer val;
-
- protected PGInteger( Integer x )
- {
- val = x;
- }
-
- public static PGType castToServerType( Integer val, int targetType ) throws PSQLException
- {
- try
- {
- switch ( targetType )
- {
- case Types.BIT:
- return new PGBoolean( val.intValue() == 0?Boolean.FALSE:Boolean.TRUE );
- case Types.REAL:
- return new PGFloat( new Float( val.floatValue() ) );
- case Types.DOUBLE:
- case Types.FLOAT:
- return new PGDouble(new Double( val.doubleValue() ));
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- return new PGString( val.toString() );
- case Types.SMALLINT:
- case Types.TINYINT:
- return new PGShort( new Short( val.shortValue() ));
- case Types.INTEGER:
- return new PGInteger( val );
- case Types.DECIMAL:
- case Types.NUMERIC:
- return new PGBigDecimal( new BigDecimal( val.toString()));
- default:
- return new PGUnknown(val);
- }
- }
- catch( Exception ex )
- {
- throw new PSQLException(GT.tr("Cannot convert an instance of {0} to type {1}", new Object[]{val.getClass().getName(),"Types.OTHER"}), PSQLState.INVALID_PARAMETER_TYPE, ex);
- }
- }
- public String toString()
- {
- return val.toString();
- }
-}
diff --git a/org/postgresql/core/types/PGLong.java b/org/postgresql/core/types/PGLong.java
deleted file mode 100644
index ddb4db6..0000000
--- a/org/postgresql/core/types/PGLong.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Created on May 15, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.postgresql.core.types;
-import java.math.BigDecimal;
-import java.sql.Types;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * @author davec
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class PGLong implements PGType
-{
- private Long val;
-
- protected PGLong( Long x )
- {
- val = x;
- }
-
- public static PGType castToServerType(Long val, int targetType ) throws PSQLException
- {
- try
- {
- switch ( targetType )
- {
- case Types.BIT:
- return new PGBoolean(val.longValue()==0?Boolean.FALSE:Boolean.TRUE);
- case Types.REAL:
- return new PGFloat( new Float(val.floatValue()) );
- case Types.FLOAT:
- case Types.DOUBLE:
- return new PGDouble( new Double(val.doubleValue()) );
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- return new PGString(val.toString());
- case Types.BIGINT:
- return new PGLong( val );
- case Types.INTEGER:
- return new PGInteger( new Integer( val.intValue()));
- case Types.SMALLINT:
- case Types.TINYINT:
- return new PGShort( new Short( val.shortValue() ));
- case Types.DECIMAL:
- case Types.NUMERIC:
- return new PGBigDecimal( new BigDecimal( val.toString()));
- default:
- return new PGUnknown(val);
- }
- }
- catch( Exception ex )
- {
- throw new PSQLException(GT.tr("Cannot convert an instance of {0} to type {1}", new Object[]{val.getClass().getName(),"Types.OTHER"}), PSQLState.INVALID_PARAMETER_TYPE, ex);
- }
- }
- public String toString()
- {
- return val.toString();
- }
-}
diff --git a/org/postgresql/core/types/PGNumber.java b/org/postgresql/core/types/PGNumber.java
deleted file mode 100644
index d8cd715..0000000
--- a/org/postgresql/core/types/PGNumber.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Created on May 15, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.postgresql.core.types;
-
-import java.sql.Types;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * @author davec
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class PGNumber implements PGType
-{
- private Number val;
-
- protected PGNumber( Number x )
- {
- val = x;
- }
- public static PGType castToServerType( Number val, int targetType ) throws PSQLException
- {
- try
- {
- switch ( targetType )
- {
- case Types.BIT:
- return new PGBoolean( val.doubleValue() == 0?Boolean.FALSE:Boolean.TRUE );
-
- case Types.BIGINT:
- return new PGLong(new Long( val.longValue() ));
- case Types.INTEGER:
- return new PGInteger(new Integer( val.intValue() ) );
- case Types.TINYINT:
- case Types.SMALLINT:
- return new PGShort(new Short( val.shortValue() ));
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- return new PGString( val.toString() );
- case Types.DOUBLE:
- case Types.FLOAT:
- return( new PGDouble( new Double( val.doubleValue())));
- case Types.REAL:
- return (new PGFloat( new Float( val.floatValue())));
- case Types.DECIMAL:
- case Types.NUMERIC:
- return new PGNumber( val );
- default:
- return new PGUnknown(val);
- }
- }
- catch( Exception ex )
- {
- throw new PSQLException(GT.tr("Cannot convert an instance of {0} to type {1}", new Object[]{val.getClass().getName(),"Types.OTHER"}), PSQLState.INVALID_PARAMETER_TYPE, ex);
- }
- }
- public String toString()
- {
- return val.toString();
- }
-
-}
diff --git a/org/postgresql/core/types/PGShort.java b/org/postgresql/core/types/PGShort.java
deleted file mode 100644
index cf63050..0000000
--- a/org/postgresql/core/types/PGShort.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Created on May 15, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.postgresql.core.types;
-
-import java.math.BigDecimal;
-import java.sql.Types;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * @author davec
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class PGShort implements PGType
-{
- Short val;
- protected PGShort( Short x )
- {
- val = x;
- }
- public static PGType castToServerType( Short val, int targetType ) throws PSQLException
- {
- try
- {
- switch ( targetType )
- {
- case Types.BIT:
- return new PGBoolean( val.shortValue() == 0?Boolean.FALSE:Boolean.TRUE );
-
- case Types.SMALLINT:
- case Types.TINYINT:
- return new PGShort(val);
- case Types.REAL:
- return new PGFloat( new Float( val.floatValue() ) );
- case Types.DOUBLE:
- case Types.FLOAT:
- return new PGDouble( new Double( val.doubleValue() ) );
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- return new PGString ( val.toString() );
- case Types.DECIMAL:
- case Types.NUMERIC:
- return new PGBigDecimal( new BigDecimal( val.toString()));
- default:
- return new PGUnknown(val);
- }
- }
- catch (Exception ex)
- {
- throw new PSQLException(GT.tr("Cannot convert an instance of {0} to type {1}", new Object[]{val.getClass().getName(),"Types.OTHER"}), PSQLState.INVALID_PARAMETER_TYPE, ex);
- }
- }
-
- public String toString()
- {
- return val.toString();
- }
-}
diff --git a/org/postgresql/core/types/PGString.java b/org/postgresql/core/types/PGString.java
deleted file mode 100644
index 5fa7236..0000000
--- a/org/postgresql/core/types/PGString.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Created on May 15, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.postgresql.core.types;
-
-import java.math.BigDecimal;
-import java.sql.Types;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * @author davec
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class PGString implements PGType
-{
-
- String val;
- protected PGString( String x )
- {
- val = x;
- }
- /* (non-Javadoc)
- * @see org.postgresql.types.PGType#castToServerType(int)
- */
- public static PGType castToServerType(String val, int targetType) throws PSQLException
- {
- try
- {
- switch (targetType )
- {
- case Types.BIT:
- {
- if ( val.equalsIgnoreCase("true") || val.equalsIgnoreCase("1") || val.equalsIgnoreCase("t"))
- return new PGBoolean( Boolean.TRUE );
- if ( val.equalsIgnoreCase("false") || val.equalsIgnoreCase("0") || val.equalsIgnoreCase("f"))
- return new PGBoolean( Boolean.FALSE);
- }
-
- return new PGBoolean( Boolean.FALSE);
-
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- return new PGString(val);
- case Types.BIGINT:
- return new PGLong( new Long(Long.parseLong( val )));
- case Types.INTEGER:
- return new PGInteger( new Integer(Integer.parseInt( val )));
- case Types.TINYINT:
- return new PGShort( new Short( Short.parseShort( val )));
- case Types.FLOAT:
- case Types.DOUBLE:
- return new PGDouble( new Double(Double.parseDouble( val )));
- case Types.REAL:
- return new PGFloat( new Float( Float.parseFloat( val )));
- case Types.NUMERIC:
- case Types.DECIMAL:
- return new PGBigDecimal( new BigDecimal( val));
- default:
- return new PGUnknown( val );
-
- }
- }
- catch( Exception ex )
- {
- throw new PSQLException(GT.tr("Cannot convert an instance of {0} to type {1}", new Object[]{val.getClass().getName(),"Types.OTHER"}), PSQLState.INVALID_PARAMETER_TYPE, ex);
- }
- }
- public String toString()
- {
- return val;
- }
-
-}
diff --git a/org/postgresql/core/types/PGType.java b/org/postgresql/core/types/PGType.java
deleted file mode 100644
index 1f7b26d..0000000
--- a/org/postgresql/core/types/PGType.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Created on May 15, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.postgresql.core.types;
-
-/**
- * @author davec
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public interface PGType
-{
- public String toString();
-}
diff --git a/org/postgresql/core/types/PGUnknown.java b/org/postgresql/core/types/PGUnknown.java
deleted file mode 100644
index a71deee..0000000
--- a/org/postgresql/core/types/PGUnknown.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Created on May 15, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.postgresql.core.types;
-
-/**
- * @author davec
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class PGUnknown implements PGType
-{
-
- /* (non-Javadoc)
- * @see org.postgresql.types.PGType#castToServerType(int)
- */
- Object val;
- public PGUnknown( Object x)
- {
- val = x;
- }
- public static PGType castToServerType(Object val, int targetType)
- {
- return new PGUnknown( val );
- }
- public String toString()
- {
- return val.toString();
- }
-
-}
diff --git a/org/postgresql/core/v2/ConnectionFactoryImpl.java b/org/postgresql/core/v2/ConnectionFactoryImpl.java
deleted file mode 100644
index 07cf232..0000000
--- a/org/postgresql/core/v2/ConnectionFactoryImpl.java
+++ /dev/null
@@ -1,488 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v2;
-
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import java.sql.SQLException;
-import java.sql.SQLWarning;
-import java.io.IOException;
-import java.net.ConnectException;
-
-import org.postgresql.core.*;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.UnixCrypt;
-import org.postgresql.util.MD5Digest;
-import org.postgresql.util.GT;
-import org.postgresql.util.HostSpec;
-
-/**
- * ConnectionFactory implementation for version 2 (pre-7.4) connections.
- *
- * @author Oliver Jowett (oliver at opencloud.com), based on the previous implementation
- */
-public class ConnectionFactoryImpl extends ConnectionFactory {
- private static final int AUTH_REQ_OK = 0;
- private static final int AUTH_REQ_KRB4 = 1;
- private static final int AUTH_REQ_KRB5 = 2;
- private static final int AUTH_REQ_PASSWORD = 3;
- private static final int AUTH_REQ_CRYPT = 4;
- private static final int AUTH_REQ_MD5 = 5;
- private static final int AUTH_REQ_SCM = 6;
-
- public ProtocolConnection openConnectionImpl(HostSpec[] hostSpecs, String user, String database, Properties info, Logger logger) throws SQLException {
- // Extract interesting values from the info properties:
- // - the SSL setting
- boolean requireSSL;
- boolean trySSL;
- String sslmode = info.getProperty("sslmode");
- if (sslmode==null)
- { //Fall back to the ssl property
- requireSSL = trySSL = (info.getProperty("ssl") != null);
- } else {
- if ("disable".equals(sslmode))
- {
- requireSSL = trySSL = false;
- }
- //allow and prefer are not handled yet
- /*else if ("allow".equals(sslmode) || "prefer".equals(sslmode))
- {
- //XXX Allow and prefer are treated the same way
- requireSSL = false;
- trySSL = true;
- }*/
- else if ("require".equals(sslmode) || "verify-ca".equals(sslmode) || "verify-full".equals(sslmode))
- {
- requireSSL = trySSL = true;
- } else {
- throw new PSQLException (GT.tr("Invalid sslmode value: {0}", sslmode), PSQLState.CONNECTION_UNABLE_TO_CONNECT);
- }
- }
-
- // - the TCP keep alive setting
- boolean requireTCPKeepAlive = (Boolean.valueOf(info.getProperty("tcpKeepAlive")).booleanValue());
-
- for (int whichHost = 0; whichHost < hostSpecs.length; ++whichHost) {
- HostSpec hostSpec = hostSpecs[whichHost];
- if (logger.logDebug())
- logger.debug("Trying to establish a protocol version 2 connection to " + hostSpec);
-
- //
- // Establish a connection.
- //
-
-
- PGStream newStream = null;
- try
- {
- newStream = new PGStream(hostSpec);
-
- // Construct and send an ssl startup packet if requested.
- if (trySSL)
- newStream = enableSSL(newStream, requireSSL, info, logger);
-
-
- // Set the socket timeout if the "socketTimeout" property has been set.
- String socketTimeoutProperty = info.getProperty("socketTimeout", "0");
- try {
- int socketTimeout = Integer.parseInt(socketTimeoutProperty);
- if (socketTimeout > 0) {
- newStream.getSocket().setSoTimeout(socketTimeout*1000);
- }
- } catch (NumberFormatException nfe) {
- logger.info("Couldn't parse socketTimeout value:" + socketTimeoutProperty);
- }
-
-
- // Enable TCP keep-alive probe if required.
- newStream.getSocket().setKeepAlive(requireTCPKeepAlive);
-
- // Construct and send a startup packet.
- sendStartupPacket(newStream, user, database, logger);
-
- // Do authentication (until AuthenticationOk).
- doAuthentication(newStream, user, info.getProperty("password"), logger);
-
- // Do final startup.
- ProtocolConnectionImpl protoConnection = new ProtocolConnectionImpl(newStream, user, database, logger);
- readStartupMessages(newStream, protoConnection, logger);
-
- // Run some initial queries
- runInitialQueries(protoConnection, info, logger);
-
- // And we're done.
- return protoConnection;
- }
- catch (ConnectException cex)
- {
- // Added by Peter Mount <peter at retep.org.uk>
- // ConnectException is thrown when the connection cannot be made.
- // we trap this an return a more meaningful message for the end user
-
- if (whichHost + 1 < hostSpecs.length) {
- // still more addresses to try
- continue;
- }
- throw new PSQLException (GT.tr("Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections."), PSQLState.CONNECTION_UNABLE_TO_CONNECT, cex);
- }
- catch (IOException ioe)
- {
- if (newStream != null)
- {
- try
- {
- newStream.close();
- }
- catch (IOException e)
- {
- }
- }
-
- if (whichHost + 1 < hostSpecs.length) {
- // still more addresses to try
- continue;
- }
- throw new PSQLException (GT.tr("The connection attempt failed."), PSQLState.CONNECTION_UNABLE_TO_CONNECT, ioe);
- }
- catch (SQLException se)
- {
- if (newStream != null)
- {
- try
- {
- newStream.close();
- }
- catch (IOException e)
- {
- }
- }
-
- if (whichHost + 1 < hostSpecs.length) {
- // still more addresses to try
- continue;
- }
- throw se;
- }
- }
- throw new PSQLException (GT.tr("The connection url is invalid."), PSQLState.CONNECTION_UNABLE_TO_CONNECT);
- }
-
- private PGStream enableSSL(PGStream pgStream, boolean requireSSL, Properties info, Logger logger) throws IOException, SQLException {
- if (logger.logDebug())
- logger.debug(" FE=> SSLRequest");
-
- // Send SSL request packet
- pgStream.SendInteger4(8);
- pgStream.SendInteger2(1234);
- pgStream.SendInteger2(5679);
- pgStream.flush();
-
- // Now get the response from the backend, one of N, E, S.
- int beresp = pgStream.ReceiveChar();
- switch (beresp)
- {
- case 'E':
- if (logger.logDebug())
- logger.debug(" <=BE SSLError");
-
- // Server doesn't even know about the SSL handshake protocol
- if (requireSSL)
- throw new PSQLException(GT.tr("The server does not support SSL."), PSQLState.CONNECTION_REJECTED);
-
- // We have to reconnect to continue.
- pgStream.close();
- return new PGStream(pgStream.getHostSpec());
-
- case 'N':
- if (logger.logDebug())
- logger.debug(" <=BE SSLRefused");
-
- // Server does not support ssl
- if (requireSSL)
- throw new PSQLException(GT.tr("The server does not support SSL."), PSQLState.CONNECTION_REJECTED);
-
- return pgStream;
-
- case 'S':
- if (logger.logDebug())
- logger.debug(" <=BE SSLOk");
-
- // Server supports ssl
- org.postgresql.ssl.MakeSSL.convert(pgStream, info, logger);
- return pgStream;
-
- default:
- throw new PSQLException(GT.tr("An error occurred while setting up the SSL connection."), PSQLState.PROTOCOL_VIOLATION);
- }
- }
-
- private void sendStartupPacket(PGStream pgStream, String user, String database, Logger logger) throws IOException {
- // 4: total size including self
- // 2: protocol major
- // 2: protocol minor
- // 64: database name
- // 32: user name
- // 64: options
- // 64: unused
- // 64: tty
-
- if (logger.logDebug())
- logger.debug(" FE=> StartupPacket(user=" + user + ",database=" + database + ")");
-
- pgStream.SendInteger4(4 + 4 + 64 + 32 + 64 + 64 + 64);
- pgStream.SendInteger2(2); // protocol major
- pgStream.SendInteger2(0); // protocol minor
- pgStream.Send(database.getBytes("UTF-8"), 64);
- pgStream.Send(user.getBytes("UTF-8"), 32);
- pgStream.Send(new byte[64]); // options
- pgStream.Send(new byte[64]); // unused
- pgStream.Send(new byte[64]); // tty
- pgStream.flush();
- }
-
- private void doAuthentication(PGStream pgStream, String user, String password, Logger logger) throws IOException, SQLException
- {
- // Now get the response from the backend, either an error message
- // or an authentication request
-
- while (true)
- {
- int beresp = pgStream.ReceiveChar();
-
- switch (beresp)
- {
- case 'E':
- // An error occured, so pass the error message to the
- // user.
- //
- // The most common one to be thrown here is:
- // "User authentication failed"
- //
- String errorMsg = pgStream.ReceiveString();
- if (logger.logDebug())
- logger.debug(" <=BE ErrorMessage(" + errorMsg + ")");
- throw new PSQLException(GT.tr("Connection rejected: {0}.", errorMsg), PSQLState.CONNECTION_REJECTED);
-
- case 'R':
- // Authentication request.
- // Get the type of request
- int areq = pgStream.ReceiveInteger4();
-
- // Process the request.
- switch (areq)
- {
- case AUTH_REQ_CRYPT:
- {
- byte salt[] = pgStream.Receive(2);
-
- if (logger.logDebug())
- logger.debug(" <=BE AuthenticationReqCrypt(salt='" + new String(salt, "US-ASCII") + "')");
-
- if (password == null)
- throw new PSQLException(GT.tr("The server requested password-based authentication, but no password was provided."), PSQLState.CONNECTION_REJECTED);
-
- byte[] encodedResult = UnixCrypt.crypt(salt, password.getBytes("UTF-8"));
-
- if (logger.logDebug())
- logger.debug(" FE=> Password(crypt='" + new String(encodedResult, "US-ASCII") + "')");
-
- pgStream.SendInteger4(4 + encodedResult.length + 1);
- pgStream.Send(encodedResult);
- pgStream.SendChar(0);
- pgStream.flush();
-
- break;
- }
-
- case AUTH_REQ_MD5:
- {
- byte[] md5Salt = pgStream.Receive(4);
- if (logger.logDebug())
- logger.debug(" <=BE AuthenticationReqMD5(salt=" + Utils.toHexString(md5Salt) + ")");
-
- if (password == null)
- throw new PSQLException(GT.tr("The server requested password-based authentication, but no password was provided."), PSQLState.CONNECTION_REJECTED);
-
- byte[] digest = MD5Digest.encode(user.getBytes("UTF-8"), password.getBytes("UTF-8"), md5Salt);
- if (logger.logDebug())
- logger.debug(" FE=> Password(md5digest=" + new String(digest, "US-ASCII") + ")");
-
- pgStream.SendInteger4(4 + digest.length + 1);
- pgStream.Send(digest);
- pgStream.SendChar(0);
- pgStream.flush();
-
- break;
- }
-
- case AUTH_REQ_PASSWORD:
- {
- if (logger.logDebug())
- logger.debug(" <=BE AuthenticationReqPassword");
-
- if (password == null)
- throw new PSQLException(GT.tr("The server requested password-based authentication, but no password was provided."), PSQLState.CONNECTION_REJECTED);
-
- if (logger.logDebug())
- logger.debug(" FE=> Password(password=<not shown>)");
-
- byte[] encodedPassword = password.getBytes("UTF-8");
- pgStream.SendInteger4(4 + encodedPassword.length + 1);
- pgStream.Send(encodedPassword);
- pgStream.SendChar(0);
- pgStream.flush();
-
- break;
- }
-
- case AUTH_REQ_OK:
- if (logger.logDebug())
- logger.debug(" <=BE AuthenticationOk");
-
- return ; // We're done.
-
- default:
- if (logger.logDebug())
- logger.debug(" <=BE AuthenticationReq (unsupported type " + ((int)areq) + ")");
-
- throw new PSQLException(GT.tr("The authentication type {0} is not supported. Check that you have configured the pg_hba.conf file to include the client''s IP address or subnet, and that it is using an authentication scheme supported by the driver.", new Integer(areq)), PSQLState.CONNECTION_REJECTED);
- }
-
- break;
-
- default:
- throw new PSQLException(GT.tr("Protocol error. Session setup failed."), PSQLState.PROTOCOL_VIOLATION);
- }
- }
- }
-
- private void readStartupMessages(PGStream pgStream, ProtocolConnectionImpl protoConnection, Logger logger) throws IOException, SQLException {
- while (true)
- {
- int beresp = pgStream.ReceiveChar();
- switch (beresp)
- {
- case 'Z': // ReadyForQuery
- if (logger.logDebug())
- logger.debug(" <=BE ReadyForQuery");
- return ;
-
- case 'K': // BackendKeyData
- int pid = pgStream.ReceiveInteger4();
- int ckey = pgStream.ReceiveInteger4();
- if (logger.logDebug())
- logger.debug(" <=BE BackendKeyData(pid=" + pid + ",ckey=" + ckey + ")");
- protoConnection.setBackendKeyData(pid, ckey);
- break;
-
- case 'E': // ErrorResponse
- String errorMsg = pgStream.ReceiveString();
- if (logger.logDebug())
- logger.debug(" <=BE ErrorResponse(" + errorMsg + ")");
- throw new PSQLException(GT.tr("Backend start-up failed: {0}.", errorMsg), PSQLState.CONNECTION_UNABLE_TO_CONNECT);
-
- case 'N': // NoticeResponse
- String warnMsg = pgStream.ReceiveString();
- if (logger.logDebug())
- logger.debug(" <=BE NoticeResponse(" + warnMsg + ")");
- protoConnection.addWarning(new SQLWarning(warnMsg));
- break;
-
- default:
- throw new PSQLException(GT.tr("Protocol error. Session setup failed."), PSQLState.PROTOCOL_VIOLATION);
- }
- }
- }
-
- private void runInitialQueries(ProtocolConnectionImpl protoConnection, Properties info, Logger logger) throws SQLException, IOException {
- byte[][] results = SetupQueryRunner.run(protoConnection, "set datestyle = 'ISO'; select version(), case when pg_encoding_to_char(1) = 'SQL_ASCII' then 'UNKNOWN' else getdatabaseencoding() end", true);
-
- String rawDbVersion = protoConnection.getEncoding().decode(results[0]);
- StringTokenizer versionParts = new StringTokenizer(rawDbVersion);
- versionParts.nextToken(); /* "PostgreSQL" */
- String dbVersion = versionParts.nextToken(); /* "X.Y.Z" */
-
- protoConnection.setServerVersion(dbVersion);
-
- if (dbVersion.compareTo("7.3") >= 0)
- {
- // set encoding to be unicode; set datestyle; ensure autocommit is on
- // (no-op on 7.4, but might be needed under 7.3)
- // The begin/commit is to avoid leaving a transaction open if we're talking to a
- // 7.3 server that defaults to autocommit = off.
-
- if (logger.logDebug())
- logger.debug("Switching to UTF8 client_encoding");
-
- String sql = "begin; set autocommit = on; set client_encoding = 'UTF8'; ";
- if (dbVersion.compareTo("9.0") >= 0) {
- sql += "SET extra_float_digits=3; ";
- } else if (dbVersion.compareTo("7.4") >= 0) {
- sql += "SET extra_float_digits=2; ";
- }
- sql += "commit";
-
- SetupQueryRunner.run(protoConnection, sql, false);
- protoConnection.setEncoding(Encoding.getDatabaseEncoding("UTF8"));
- }
- else
- {
- String charSet = info.getProperty("charSet");
- String dbEncoding = (results[1] == null ? null : protoConnection.getEncoding().decode(results[1]));
- if (logger.logDebug())
- {
- logger.debug("Specified charset: " + charSet);
- logger.debug("Database encoding: " + dbEncoding);
- }
-
- if (charSet != null)
- {
- // Explicitly specified encoding.
- protoConnection.setEncoding(Encoding.getJVMEncoding(charSet));
- }
- else if (dbEncoding != null)
- {
- // Use database-supplied encoding.
- protoConnection.setEncoding(Encoding.getDatabaseEncoding(dbEncoding));
- }
- else
- {
- // Fall back to defaults.
- // XXX is this ever reached?
- protoConnection.setEncoding(Encoding.defaultEncoding());
- }
- }
-
- if (logger.logDebug())
- logger.debug("Connection encoding (using JVM's nomenclature): " + protoConnection.getEncoding());
-
- if (dbVersion.compareTo("8.1") >= 0)
- {
- // Server versions since 8.1 report standard_conforming_strings
- results = SetupQueryRunner.run(protoConnection, "select current_setting('standard_conforming_strings')", true);
- String value = protoConnection.getEncoding().decode(results[0]);
- protoConnection.setStandardConformingStrings(value.equalsIgnoreCase("on"));
- }
- else
- {
- protoConnection.setStandardConformingStrings(false);
- }
-
- String appName = info.getProperty("ApplicationName");
- if (appName != null && dbVersion.compareTo("9.0") >= 0)
- {
- StringBuffer sb = new StringBuffer("SET application_name = '");
- Utils.appendEscapedLiteral(sb, appName, protoConnection.getStandardConformingStrings());
- sb.append("'");
- SetupQueryRunner.run(protoConnection, sb.toString(), false);
- }
- }
-}
diff --git a/org/postgresql/core/v2/FastpathParameterList.java b/org/postgresql/core/v2/FastpathParameterList.java
deleted file mode 100644
index 4863df8..0000000
--- a/org/postgresql/core/v2/FastpathParameterList.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v2;
-
-import org.postgresql.core.*;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.sql.SQLException;
-import java.util.Arrays;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.StreamWrapper;
-import org.postgresql.util.GT;
-
-/**
- * Implementation of fastpath parameter lists for the V2 protocol.
- * The V2 protocol expects different representations of parameters in
- * queries to that used in fastpath calls, so we do a separate implementation
- * which supports only what fastpath needs here.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-class FastpathParameterList implements ParameterList {
- FastpathParameterList(int paramCount) {
- this.paramValues = new Object[paramCount];
- }
-
- public void registerOutParameter(int index, int sqlType ){}
- public void registerOutParameter(int index, int sqlType, int precision ){};
-
- public int getInParameterCount() {
- return paramValues.length;
- }
- public int getOutParameterCount()
- {
- return 0;
- }
- public int getParameterCount()
- {
- return paramValues.length;
- }
- public int[] getTypeOIDs() {
- return null;
- }
-
- public void setIntParameter(int index, int value) throws SQLException {
- if (index < 1 || index > paramValues.length)
- throw new PSQLException(GT.tr("The column index is out of range: {0}, number of columns: {1}.", new Object[]{new Integer(index), new Integer(paramValues.length)}), PSQLState.INVALID_PARAMETER_VALUE );
-
- byte[] data = new byte[4];
- data[3] = (byte)value;
- data[2] = (byte)(value >> 8);
- data[1] = (byte)(value >> 16);
- data[0] = (byte)(value >> 24);
-
- paramValues[index - 1] = data;
- }
-
- public void setLiteralParameter(int index, String value, int oid) throws SQLException {
- // Not enough type info here for the V2 path (which requires binary reprs)
- throw new IllegalArgumentException("can't setLiteralParameter() on a fastpath parameter");
- }
-
- public void setStringParameter(int index, String value, int oid) throws SQLException {
- paramValues[index - 1] = value;
- }
-
- public void setBytea(int index, byte[] data, int offset, int length) throws SQLException {
- if (index < 1 || index > paramValues.length)
- throw new PSQLException(GT.tr("The column index is out of range: {0}, number of columns: {1}.", new Object[]{new Integer(index), new Integer(paramValues.length)}), PSQLState.INVALID_PARAMETER_VALUE );
-
- paramValues[index - 1] = new StreamWrapper(data, offset, length);
- }
-
- public void setBytea(int index, final InputStream stream, final int length) throws SQLException {
- if (index < 1 || index > paramValues.length)
- throw new PSQLException(GT.tr("The column index is out of range: {0}, number of columns: {1}.", new Object[]{new Integer(index), new Integer(paramValues.length)}), PSQLState.INVALID_PARAMETER_VALUE );
-
- paramValues[index - 1] = new StreamWrapper(stream, length);
- }
-
- public void setNull(int index, int oid) throws SQLException {
- throw new IllegalArgumentException("can't setNull() on a v2 fastpath parameter");
- }
-
- public String toString(int index) {
- if (index < 1 || index > paramValues.length)
- throw new IllegalArgumentException("parameter " + index + " out of range");
-
- return "<fastpath parameter>";
- }
-
- private void copyStream(PGStream pgStream, StreamWrapper wrapper) throws IOException {
- byte[] rawData = wrapper.getBytes();
- if (rawData != null)
- {
- pgStream.Send(rawData, wrapper.getOffset(), wrapper.getLength());
- return ;
- }
-
- pgStream.SendStream(wrapper.getStream(), wrapper.getLength());
- }
-
- void writeV2FastpathValue(int index, PGStream pgStream) throws IOException {
- --index;
-
- if (paramValues[index] instanceof StreamWrapper)
- {
- StreamWrapper wrapper = (StreamWrapper)paramValues[index];
- pgStream.SendInteger4(wrapper.getLength());
- copyStream(pgStream, wrapper);
- }
- else if (paramValues[index] instanceof byte[])
- {
- byte[] data = (byte[])paramValues[index];
- pgStream.SendInteger4(data.length);
- pgStream.Send(data);
- }
- else if (paramValues[index] instanceof String)
- {
- byte[] data = pgStream.getEncoding().encode((String)paramValues[index]);
- pgStream.SendInteger4(data.length);
- pgStream.Send(data);
- }
- else
- {
- throw new IllegalArgumentException("don't know how to stream parameter " + index);
- }
- }
-
- void checkAllParametersSet() throws SQLException {
- for (int i = 0; i < paramValues.length; i++)
- {
- if (paramValues[i] == null)
- throw new PSQLException(GT.tr("No value specified for parameter {0}.", new Integer(i + 1)), PSQLState.INVALID_PARAMETER_VALUE);
- }
- }
-
- public ParameterList copy() {
- FastpathParameterList newCopy = new FastpathParameterList(paramValues.length);
- System.arraycopy(paramValues, 0, newCopy.paramValues, 0, paramValues.length);
- return newCopy;
- }
-
- public void clear() {
- Arrays.fill(paramValues, null);
- }
-
- public void setBinaryParameter(int index, byte[] value, int oid) {
- throw new UnsupportedOperationException();
- }
-
- private final Object[] paramValues;
-}
-
diff --git a/org/postgresql/core/v2/ProtocolConnectionImpl.java b/org/postgresql/core/v2/ProtocolConnectionImpl.java
deleted file mode 100644
index 204ad9f..0000000
--- a/org/postgresql/core/v2/ProtocolConnectionImpl.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v2;
-
-import java.sql.SQLException;
-import java.sql.SQLWarning;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Set;
-
-import org.postgresql.PGNotification;
-import org.postgresql.core.*;
-import org.postgresql.util.HostSpec;
-
-/**
- * V2 implementation of ProtocolConnection.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-class ProtocolConnectionImpl implements ProtocolConnection {
- ProtocolConnectionImpl(PGStream pgStream, String user, String database, Logger logger) {
- this.pgStream = pgStream;
- this.user = user;
- this.database = database;
- this.logger = logger;
- this.executor = new QueryExecutorImpl(this, pgStream, logger);
- }
-
- public HostSpec getHostSpec() {
- return pgStream.getHostSpec();
- }
-
- public String getUser() {
- return user;
- }
-
- public String getDatabase() {
- return database;
- }
-
- public String getServerVersion() {
- return serverVersion;
- }
-
- public synchronized boolean getStandardConformingStrings()
- {
- return standardConformingStrings;
- }
-
- public synchronized int getTransactionState()
- {
- return transactionState;
- }
-
- public synchronized PGNotification[] getNotifications() throws SQLException {
- PGNotification[] array = (PGNotification[])notifications.toArray(new PGNotification[notifications.size()]);
- notifications.clear();
- return array;
- }
-
- public synchronized SQLWarning getWarnings()
- {
- SQLWarning chain = warnings;
- warnings = null;
- return chain;
- }
-
- public QueryExecutor getQueryExecutor() {
- return executor;
- }
-
- public void sendQueryCancel() throws SQLException {
- if (cancelPid <= 0)
- return ;
-
- PGStream cancelStream = null;
-
- // Now we need to construct and send a cancel packet
- try
- {
- if (logger.logDebug())
- logger.debug(" FE=> CancelRequest(pid=" + cancelPid + ",ckey=" + cancelKey + ")");
-
- cancelStream = new PGStream(pgStream.getHostSpec());
- cancelStream.SendInteger4(16);
- cancelStream.SendInteger2(1234);
- cancelStream.SendInteger2(5678);
- cancelStream.SendInteger4(cancelPid);
- cancelStream.SendInteger4(cancelKey);
- cancelStream.flush();
- cancelStream.ReceiveEOF();
- cancelStream.close();
- cancelStream = null;
- }
- catch (IOException e)
- {
- // Safe to ignore.
- if (logger.logDebug())
- logger.debug("Ignoring exception on cancel request:", e);
- }
- finally
- {
- if (cancelStream != null)
- {
- try
- {
- cancelStream.close();
- }
- catch (IOException e)
- {
- // Ignored.
- }
- }
- }
- }
-
- public void close() {
- if (closed)
- return ;
-
- try
- {
- if (logger.logDebug())
- logger.debug(" FE=> Terminate");
- pgStream.SendChar('X');
- pgStream.flush();
- pgStream.close();
- }
- catch (IOException ioe)
- {
- // Forget it.
- if (logger.logDebug())
- logger.debug("Discarding IOException on close:", ioe);
- }
-
- closed = true;
- }
-
- public Encoding getEncoding() {
- return pgStream.getEncoding();
- }
-
- public boolean isClosed() {
- return closed;
- }
-
- //
- // Package-private accessors called during connection setup
- //
-
- void setEncoding(Encoding encoding) throws IOException {
- pgStream.setEncoding(encoding);
- }
-
- void setServerVersion(String serverVersion) {
- this.serverVersion = serverVersion;
- }
-
- void setBackendKeyData(int cancelPid, int cancelKey) {
- this.cancelPid = cancelPid;
- this.cancelKey = cancelKey;
- }
-
- synchronized void setStandardConformingStrings(boolean value) {
- standardConformingStrings = value;
- }
-
- //
- // Package-private accessors called by the query executor
- //
-
- synchronized void addWarning(SQLWarning newWarning)
- {
- if (warnings == null)
- warnings = newWarning;
- else
- warnings.setNextWarning(newWarning);
- }
-
- synchronized void addNotification(PGNotification notification)
- {
- notifications.add(notification);
- }
-
- synchronized void setTransactionState(int state)
- {
- transactionState = state;
- }
-
- public int getProtocolVersion()
- {
- return 2;
- }
-
- public void setBinaryReceiveOids(Set<Integer> ignored) {
- // ignored for v2 connections
- }
-
- public boolean getIntegerDateTimes() {
- // not supported in v2 protocol
- return false;
- }
-
- private String serverVersion;
- private int cancelPid;
- private int cancelKey;
-
- private boolean standardConformingStrings;
- private int transactionState;
- private SQLWarning warnings;
-
- private boolean closed = false;
-
- private final ArrayList notifications = new ArrayList();
-
- private final PGStream pgStream;
- private final String user;
- private final String database;
- private final QueryExecutorImpl executor;
- private final Logger logger;
-}
diff --git a/org/postgresql/core/v2/QueryExecutorImpl.java b/org/postgresql/core/v2/QueryExecutorImpl.java
deleted file mode 100644
index bfa83de..0000000
--- a/org/postgresql/core/v2/QueryExecutorImpl.java
+++ /dev/null
@@ -1,612 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v2;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.io.IOException;
-import java.io.Writer;
-import java.sql.*;
-
-import org.postgresql.core.*;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.GT;
-import org.postgresql.copy.CopyOperation;
-
-/**
- * QueryExecutor implementation for the V2 protocol.
- */
-public class QueryExecutorImpl implements QueryExecutor {
- public QueryExecutorImpl(ProtocolConnectionImpl protoConnection, PGStream pgStream, Logger logger) {
- this.protoConnection = protoConnection;
- this.pgStream = pgStream;
- this.logger = logger;
- }
-
- //
- // Query parsing
- //
-
- public Query createSimpleQuery(String sql) {
- return new V2Query(sql, false, protoConnection);
- }
-
- public Query createParameterizedQuery(String sql) {
- return new V2Query(sql, true, protoConnection);
- }
-
- //
- // Fastpath
- //
-
- public ParameterList createFastpathParameters(int count) {
- return new FastpathParameterList(count);
- }
-
- public synchronized byte[]
- fastpathCall(int fnid, ParameterList parameters, boolean suppressBegin) throws SQLException {
- if (protoConnection.getTransactionState() == ProtocolConnection.TRANSACTION_IDLE && !suppressBegin)
- {
-
- if (logger.logDebug())
- logger.debug("Issuing BEGIN before fastpath call.");
-
- ResultHandler handler = new ResultHandler() {
- private boolean sawBegin = false;
- private SQLException sqle = null;
-
- public void handleResultRows(Query fromQuery, Field[] fields, List tuples, ResultCursor cursor) {
- }
-
- public void handleCommandStatus(String status, int updateCount, long insertOID) {
- if (!sawBegin)
- {
- if (!status.equals("BEGIN"))
- handleError(new PSQLException(GT.tr("Expected command status BEGIN, got {0}.", status),
- PSQLState.PROTOCOL_VIOLATION));
- sawBegin = true;
- }
- else
- {
- handleError(new PSQLException(GT.tr("Unexpected command status: {0}.", status),
- PSQLState.PROTOCOL_VIOLATION));
- }
- }
-
- public void handleWarning(SQLWarning warning) {
- // we don't want to ignore warnings and it would be tricky
- // to chain them back to the connection, so since we don't
- // expect to get them in the first place, we just consider
- // them errors.
- handleError(warning);
- }
-
- public void handleError(SQLException error) {
- if (sqle == null)
- {
- sqle = error;
- }
- else
- {
- sqle.setNextException(error);
- }
- }
-
- public void handleCompletion() throws SQLException{
- if (sqle != null)
- throw sqle;
- }
- };
-
- try
- {
- // Create and issue a dummy query to use the existing prefix infrastructure
- V2Query query = (V2Query)createSimpleQuery("");
- SimpleParameterList params = (SimpleParameterList)query.createParameterList();
- sendQuery(query, params, "BEGIN");
- processResults(query, handler, 0, 0);
- }
- catch (IOException ioe)
- {
- throw new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, ioe);
- }
- }
-
- try
- {
- sendFastpathCall(fnid, (FastpathParameterList)parameters);
- return receiveFastpathResult();
- }
- catch (IOException ioe)
- {
- throw new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, ioe);
- }
- }
-
- private void sendFastpathCall(int fnid, FastpathParameterList params) throws IOException {
- // Send call.
- int count = params.getParameterCount();
-
- if (logger.logDebug())
- logger.debug(" FE=> FastpathCall(fnid=" + fnid + ",paramCount=" + count + ")");
-
- pgStream.SendChar('F');
- pgStream.SendChar(0);
- pgStream.SendInteger4(fnid);
- pgStream.SendInteger4(count);
-
- for (int i = 1; i <= count; ++i)
- params.writeV2FastpathValue(i, pgStream);
-
- pgStream.flush();
- }
-
- public synchronized void processNotifies() throws SQLException {
- // Asynchronous notifies only arrive when we are not in a transaction
- if (protoConnection.getTransactionState() != ProtocolConnection.TRANSACTION_IDLE)
- return;
-
- try {
- while (pgStream.hasMessagePending()) {
- int c = pgStream.ReceiveChar();
- switch (c) {
- case 'A': // Asynchronous Notify
- receiveAsyncNotify();
- break;
- case 'E': // Error Message
- throw receiveErrorMessage();
- // break;
- case 'N': // Error Notification
- protoConnection.addWarning(receiveNotification());
- break;
- default:
- throw new PSQLException(GT.tr("Unknown Response Type {0}.", new Character((char) c)), PSQLState.CONNECTION_FAILURE);
- }
- }
- } catch (IOException ioe) {
- throw new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, ioe);
- }
- }
-
- private byte[] receiveFastpathResult() throws IOException, SQLException {
- SQLException error = null;
- boolean endQuery = false;
- byte[] result = null;
-
- while (!endQuery)
- {
- int c = pgStream.ReceiveChar();
-
- switch (c)
- {
- case 'A': // Asynchronous Notify
- receiveAsyncNotify();
- break;
-
- case 'E': // Error Message
- SQLException newError = receiveErrorMessage();
- if (error == null)
- error = newError;
- else
- error.setNextException(newError);
- // keep processing
- break;
-
- case 'N': // Error Notification
- protoConnection.addWarning(receiveNotification());
- break;
-
- case 'V': // Fastpath result
- c = pgStream.ReceiveChar();
- if (c == 'G')
- {
- if (logger.logDebug())
- logger.debug(" <=BE FastpathResult");
-
- // Result.
- int len = pgStream.ReceiveInteger4();
- result = pgStream.Receive(len);
- c = pgStream.ReceiveChar();
- }
- else
- {
- if (logger.logDebug())
- logger.debug(" <=BE FastpathVoidResult");
- }
-
- if (c != '0')
- throw new PSQLException(GT.tr("Unknown Response Type {0}.", new Character((char) c)), PSQLState.CONNECTION_FAILURE);
-
- break;
-
- case 'Z':
- if (logger.logDebug())
- logger.debug(" <=BE ReadyForQuery");
- endQuery = true;
- break;
-
- default:
- throw new PSQLException(GT.tr("Unknown Response Type {0}.", new Character((char) c)), PSQLState.CONNECTION_FAILURE);
- }
-
- }
-
- // did we get an error during this query?
- if (error != null)
- throw error;
-
- return result;
- }
-
- //
- // Query execution
- //
-
- public synchronized void execute(Query query,
- ParameterList parameters,
- ResultHandler handler,
- int maxRows, int fetchSize, int flags)
- throws SQLException
- {
- execute((V2Query)query, (SimpleParameterList)parameters, handler, maxRows, flags);
- }
-
- // Nothing special yet, just run the queries one at a time.
- public synchronized void execute(Query[] queries,
- ParameterList[] parameters,
- ResultHandler handler,
- int maxRows, int fetchSize, int flags)
- throws SQLException
- {
- final ResultHandler delegateHandler = handler;
- handler = new ResultHandler() {
- public void handleResultRows(Query fromQuery, Field[] fields, List tuples, ResultCursor cursor) {
- delegateHandler.handleResultRows(fromQuery, fields, tuples, cursor);
- }
-
- public void handleCommandStatus(String status, int updateCount, long insertOID) {
- delegateHandler.handleCommandStatus(status, updateCount, insertOID);
- }
-
- public void handleWarning(SQLWarning warning) {
- delegateHandler.handleWarning(warning);
- }
-
- public void handleError(SQLException error) {
- delegateHandler.handleError(error);
- }
-
- public void handleCompletion() throws SQLException {
- }
- };
-
- for (int i = 0; i < queries.length; ++i)
- execute((V2Query)queries[i], (SimpleParameterList)parameters[i], handler, maxRows, flags);
-
- delegateHandler.handleCompletion();
- }
-
- public void fetch(ResultCursor cursor, ResultHandler handler, int rows) throws SQLException {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "fetch(ResultCursor,ResultHandler,int)");
- }
-
- private void execute(V2Query query,
- SimpleParameterList parameters,
- ResultHandler handler,
- int maxRows, int flags) throws SQLException
- {
-
- // The V2 protocol has no support for retrieving metadata
- // without executing the whole query.
- if ((flags & QueryExecutor.QUERY_DESCRIBE_ONLY) != 0)
- return;
-
- if (parameters == null)
- parameters = (SimpleParameterList)query.createParameterList();
-
- parameters.checkAllParametersSet();
-
- String queryPrefix = null;
- if (protoConnection.getTransactionState() == ProtocolConnection.TRANSACTION_IDLE &&
- (flags & QueryExecutor.QUERY_SUPPRESS_BEGIN) == 0)
- {
-
- queryPrefix = "BEGIN;";
-
- // Insert a handler that intercepts the BEGIN.
- final ResultHandler delegateHandler = handler;
- handler = new ResultHandler() {
- private boolean sawBegin = false;
-
- public void handleResultRows(Query fromQuery, Field[] fields, List tuples, ResultCursor cursor) {
- if (sawBegin)
- delegateHandler.handleResultRows(fromQuery, fields, tuples, cursor);
- }
-
- public void handleCommandStatus(String status, int updateCount, long insertOID) {
- if (!sawBegin)
- {
- if (!status.equals("BEGIN"))
- handleError(new PSQLException(GT.tr("Expected command status BEGIN, got {0}.", status),
- PSQLState.PROTOCOL_VIOLATION));
- sawBegin = true;
- }
- else
- {
- delegateHandler.handleCommandStatus(status, updateCount, insertOID);
- }
- }
-
- public void handleWarning(SQLWarning warning) {
- delegateHandler.handleWarning(warning);
- }
-
- public void handleError(SQLException error) {
- delegateHandler.handleError(error);
- }
-
- public void handleCompletion() throws SQLException{
- delegateHandler.handleCompletion();
- }
- };
- }
-
- try
- {
- sendQuery(query, parameters, queryPrefix);
- processResults(query, handler, maxRows, flags);
- }
- catch (IOException e)
- {
- protoConnection.close();
- handler.handleError(new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, e));
- }
-
- handler.handleCompletion();
- }
-
- /*
- * Send a query to the backend.
- */
- protected void sendQuery(V2Query query, SimpleParameterList params, String queryPrefix) throws IOException {
- if (logger.logDebug())
- logger.debug(" FE=> Query(\"" + (queryPrefix == null ? "" : queryPrefix) + query.toString(params) + "\")");
-
- pgStream.SendChar('Q');
-
- Writer encodingWriter = pgStream.getEncodingWriter();
-
- if (queryPrefix != null)
- encodingWriter.write(queryPrefix);
-
- String[] fragments = query.getFragments();
- for (int i = 0 ; i < fragments.length; ++i)
- {
- encodingWriter.write(fragments[i]);
- if (i < params.getParameterCount())
- params.writeV2Value(i + 1, encodingWriter);
- }
-
- encodingWriter.write(0);
- pgStream.flush();
- }
-
- protected void processResults(Query originalQuery, ResultHandler handler, int maxRows, int flags) throws IOException {
- boolean bothRowsAndStatus = (flags & QueryExecutor.QUERY_BOTH_ROWS_AND_STATUS) != 0;
- Field[] fields = null;
- List tuples = null;
-
- boolean endQuery = false;
- while (!endQuery)
- {
- int c = pgStream.ReceiveChar();
-
- switch (c)
- {
- case 'A': // Asynchronous Notify
- receiveAsyncNotify();
- break;
-
- case 'B': // Binary Data Transfer
- {
- if (fields == null)
- throw new IOException("Data transfer before field metadata");
-
- if (logger.logDebug())
- logger.debug(" <=BE BinaryRow");
-
- Object tuple = null;
- try {
- tuple = pgStream.ReceiveTupleV2(fields.length, true);
- } catch(OutOfMemoryError oome) {
- if (maxRows == 0 || tuples.size() < maxRows) {
- handler.handleError(new PSQLException(GT.tr("Ran out of memory retrieving query results."), PSQLState.OUT_OF_MEMORY, oome));
- }
- }
-
- for (int i = 0; i < fields.length; i++)
- fields[i].setFormat(Field.BINARY_FORMAT); //Set the field to binary format
- if (maxRows == 0 || tuples.size() < maxRows)
- tuples.add(tuple);
- }
- break;
-
- case 'C': // Command Status
- String status = pgStream.ReceiveString();
-
- if (logger.logDebug())
- logger.debug(" <=BE CommandStatus(" + status + ")");
-
- if (fields != null)
- {
- handler.handleResultRows(originalQuery, fields, tuples, null);
- fields = null;
-
- if (bothRowsAndStatus)
- interpretCommandStatus(status, handler);
- }
- else
- {
- interpretCommandStatus(status, handler);
- }
-
- break;
-
- case 'D': // Text Data Transfer
- {
- if (fields == null)
- throw new IOException("Data transfer before field metadata");
-
- if (logger.logDebug())
- logger.debug(" <=BE DataRow");
-
- Object tuple = null;
- try {
- tuple = pgStream.ReceiveTupleV2(fields.length, false);
- } catch(OutOfMemoryError oome) {
- if (maxRows == 0 || tuples.size() < maxRows)
- handler.handleError(new PSQLException(GT.tr("Ran out of memory retrieving query results."), PSQLState.OUT_OF_MEMORY, oome));
- }
- if (maxRows == 0 || tuples.size() < maxRows)
- tuples.add(tuple);
- }
-
- break;
-
- case 'E': // Error Message
- handler.handleError(receiveErrorMessage());
- // keep processing
- break;
-
- case 'I': // Empty Query
- if (logger.logDebug())
- logger.debug(" <=BE EmptyQuery");
- c = pgStream.ReceiveChar();
- if (c != 0)
- throw new IOException("Expected \\0 after EmptyQuery, got: " + c);
- break;
-
- case 'N': // Error Notification
- handler.handleWarning(receiveNotification());
- break;
-
- case 'P': // Portal Name
- String portalName = pgStream.ReceiveString();
- if (logger.logDebug())
- logger.debug(" <=BE PortalName(" + portalName + ")");
- break;
-
- case 'T': // MetaData Field Description
- fields = receiveFields();
- tuples = new ArrayList();
- break;
-
- case 'Z':
- if (logger.logDebug())
- logger.debug(" <=BE ReadyForQuery");
- endQuery = true;
- break;
-
- default:
- throw new IOException("Unexpected packet type: " + c);
- }
-
- }
- }
-
- /*
- * Receive the field descriptions from the back end.
- */
- private Field[] receiveFields() throws IOException
- {
- int size = pgStream.ReceiveInteger2();
- Field[] fields = new Field[size];
-
- if (logger.logDebug())
- logger.debug(" <=BE RowDescription(" + fields.length + ")");
-
- for (int i = 0; i < fields.length; i++)
- {
- String columnLabel = pgStream.ReceiveString();
- int typeOid = pgStream.ReceiveInteger4();
- int typeLength = pgStream.ReceiveInteger2();
- int typeModifier = pgStream.ReceiveInteger4();
- fields[i] = new Field(columnLabel, columnLabel, typeOid, typeLength, typeModifier, 0, 0);
- }
-
- return fields;
- }
-
- private void receiveAsyncNotify() throws IOException {
- int pid = pgStream.ReceiveInteger4();
- String msg = pgStream.ReceiveString();
-
- if (logger.logDebug())
- logger.debug(" <=BE AsyncNotify(pid=" + pid + ",msg=" + msg + ")");
-
- protoConnection.addNotification(new org.postgresql.core.Notification(msg, pid));
- }
-
- private SQLException receiveErrorMessage() throws IOException {
- String errorMsg = pgStream.ReceiveString().trim();
- if (logger.logDebug())
- logger.debug(" <=BE ErrorResponse(" + errorMsg + ")");
- return new PSQLException(errorMsg, PSQLState.UNKNOWN_STATE);
- }
-
- private SQLWarning receiveNotification() throws IOException {
- String warnMsg = pgStream.ReceiveString();
-
- // Strip out the severity field so we have consistency with
- // the V3 protocol. SQLWarning.getMessage should return just
- // the actual message.
- //
- int severityMark = warnMsg.indexOf(":");
- warnMsg = warnMsg.substring(severityMark+1).trim();
- if (logger.logDebug())
- logger.debug(" <=BE NoticeResponse(" + warnMsg + ")");
- return new SQLWarning(warnMsg);
- }
-
- private void interpretCommandStatus(String status, ResultHandler handler) throws IOException {
- int update_count = 0;
- long insert_oid = 0;
-
- if (status.equals("BEGIN"))
- protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_OPEN);
- else if (status.equals("COMMIT") || status.equals("ROLLBACK"))
- protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_IDLE);
- else if (status.startsWith("INSERT") || status.startsWith("UPDATE") || status.startsWith("DELETE") || status.startsWith("MOVE"))
- {
- try
- {
- update_count = Integer.parseInt(status.substring(1 + status.lastIndexOf(' ')));
- if (status.startsWith("INSERT"))
- insert_oid = Long.parseLong(status.substring(1 + status.indexOf(' '),
- status.lastIndexOf(' ')));
- }
- catch (NumberFormatException nfe)
- {
- handler.handleError(new PSQLException(GT.tr("Unable to interpret the update count in command completion tag: {0}.", status), PSQLState.CONNECTION_FAILURE));
- return ;
- }
- }
-
- handler.handleCommandStatus(status, update_count, insert_oid);
- }
-
- private final ProtocolConnectionImpl protoConnection;
- private final PGStream pgStream;
- private final Logger logger;
-
- public CopyOperation startCopy(String sql, boolean suppressBegin) throws SQLException {
- throw new PSQLException(GT.tr("Copy not implemented for protocol version 2"), PSQLState.NOT_IMPLEMENTED);
- }
-}
diff --git a/org/postgresql/core/v2/SimpleParameterList.java b/org/postgresql/core/v2/SimpleParameterList.java
deleted file mode 100644
index da83c05..0000000
--- a/org/postgresql/core/v2/SimpleParameterList.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v2;
-
-import org.postgresql.core.*;
-
-import java.io.InputStream;
-import java.io.Writer;
-import java.io.IOException;
-import java.sql.SQLException;
-import java.util.Arrays;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.StreamWrapper;
-import org.postgresql.util.GT;
-
-/**
- * Parameter list for query parameters in the V2 protocol.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-class SimpleParameterList implements ParameterList {
- SimpleParameterList(int paramCount, boolean useEStringSyntax) {
- this.paramValues = new Object[paramCount];
- this.useEStringSyntax = useEStringSyntax;
- }
- public void registerOutParameter(int index, int sqlType ){};
- public void registerOutParameter(int index, int sqlType, int precision ){};
-
- public int getInParameterCount() {
- return paramValues.length;
- }
- public int getParameterCount()
- {
- return paramValues.length;
- }
- public int getOutParameterCount()
- {
- return 1;
- }
- public int[] getTypeOIDs() {
- return null;
- }
-
- public void setIntParameter(int index, int value) throws SQLException {
- setLiteralParameter(index, "" + value, Oid.INT4);
- }
-
- public void setLiteralParameter(int index, String value, int oid) throws SQLException {
- if (index < 1 || index > paramValues.length)
- throw new PSQLException(GT.tr("The column index is out of range: {0}, number of columns: {1}.", new Object[]{new Integer(index), new Integer(paramValues.length)}), PSQLState.INVALID_PARAMETER_VALUE );
-
- paramValues[index - 1] = value;
- }
-
- public void setStringParameter(int index, String value, int oid) throws SQLException {
- StringBuffer sbuf = new StringBuffer(2 + value.length() * 11 / 10); // Add 10% for escaping.
-
- if (useEStringSyntax)
- sbuf.append(' ').append('E');
- sbuf.append('\'');
- Utils.appendEscapedLiteral(sbuf, value, false);
- sbuf.append('\'');
-
- setLiteralParameter(index, sbuf.toString(), oid);
- }
-
- public void setBytea(int index, byte[] data, int offset, int length) throws SQLException {
- if (index < 1 || index > paramValues.length)
- throw new PSQLException(GT.tr("The column index is out of range: {0}, number of columns: {1}.", new Object[]{new Integer(index), new Integer(paramValues.length)}), PSQLState.INVALID_PARAMETER_VALUE );
-
- paramValues[index - 1] = new StreamWrapper(data, offset, length);
- }
-
- public void setBytea(int index, final InputStream stream, final int length) throws SQLException {
- if (index < 1 || index > paramValues.length)
- throw new PSQLException(GT.tr("The column index is out of range: {0}, number of columns: {1}.", new Object[]{new Integer(index), new Integer(paramValues.length)}), PSQLState.INVALID_PARAMETER_VALUE );
-
- paramValues[index - 1] = new StreamWrapper(stream, length);
- }
-
- public void setNull(int index, int oid) throws SQLException {
- if (index < 1 || index > paramValues.length)
- throw new PSQLException(GT.tr("The column index is out of range: {0}, number of columns: {1}.", new Object[]{new Integer(index), new Integer(paramValues.length)}), PSQLState.INVALID_PARAMETER_VALUE );
-
- paramValues[index - 1] = NULL_OBJECT;
- }
-
- public String toString(int index) {
- if (index < 1 || index > paramValues.length)
- throw new IllegalArgumentException("Parameter index " + index + " out of range");
-
- if (paramValues[index - 1] == null)
- return "?";
- else if (paramValues[index -1] == NULL_OBJECT)
- return "NULL";
- else
- return paramValues[index -1].toString();
- }
-
- /**
- * Send a streamable bytea encoded as a text representation with an arbitary encoding.
- */
- private void streamBytea(StreamWrapper param, Writer encodingWriter) throws IOException {
- // NB: we escape everything in this path, as I don't like assuming
- // that byte values 32..127 will make it through the encoding
- // unscathed..
-
- InputStream stream = param.getStream();
- char[] buffer = new char[] { '\\', '\\', 0, 0, 0 };
-
- if (useEStringSyntax)
- {
- encodingWriter.write(' ');
- encodingWriter.write('E');
- }
-
- encodingWriter.write('\'');
- for (int remaining = param.getLength(); remaining > 0; --remaining)
- {
- int nextByte = stream.read();
-
- buffer[2] = (char)( '0' + ((nextByte >> 6) & 3));
- buffer[3] = (char)( '0' + ((nextByte >> 3) & 7));
- buffer[4] = (char)( '0' + (nextByte & 7));
-
- encodingWriter.write(buffer, 0, 5);
- }
-
- encodingWriter.write('\'');
- }
-
-
- void writeV2Value(int index, Writer encodingWriter) throws IOException {
- if (paramValues[index - 1] instanceof StreamWrapper)
- {
- streamBytea((StreamWrapper)paramValues[index - 1], encodingWriter);
- }
- else
- {
- encodingWriter.write((String)paramValues[index - 1]);
- }
- }
-
- void checkAllParametersSet() throws SQLException {
- for (int i = 0; i < paramValues.length; i++)
- {
- if (paramValues[i] == null)
- throw new PSQLException(GT.tr("No value specified for parameter {0}.", new Integer(i + 1)), PSQLState.INVALID_PARAMETER_VALUE);
- }
- }
-
- public ParameterList copy() {
- SimpleParameterList newCopy = new SimpleParameterList(paramValues.length, useEStringSyntax);
- System.arraycopy(paramValues, 0, newCopy.paramValues, 0, paramValues.length);
- return newCopy;
- }
-
- public void clear() {
- Arrays.fill(paramValues, null);
- }
-
- public void setBinaryParameter(int index, byte[] value, int oid) {
- throw new UnsupportedOperationException();
- }
-
- private final Object[] paramValues;
-
- private final boolean useEStringSyntax;
-
- /* Object representing NULL; conveniently, String streams exactly as we want it to. *
- * nb: we explicitly say "new String" to avoid interning giving us an object that
- * might be the same (by identity) as a String elsewhere.
- */
- private final static String NULL_OBJECT = new String("NULL");
-}
-
diff --git a/org/postgresql/core/v2/V2Query.java b/org/postgresql/core/v2/V2Query.java
deleted file mode 100644
index b06c9ef..0000000
--- a/org/postgresql/core/v2/V2Query.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v2;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.postgresql.core.*;
-
-/**
- * Query implementation for all queries via the V2 protocol.
- */
-class V2Query implements Query {
- V2Query(String query, boolean withParameters, ProtocolConnection pconn) {
-
- useEStringSyntax = pconn.getServerVersion() != null
- && pconn.getServerVersion().compareTo("8.1") > 0;
- boolean stdStrings = pconn.getStandardConformingStrings();
-
- if (!withParameters)
- {
- fragments = new String[] { query };
- return ;
- }
-
- // Parse query and find parameter placeholders.
-
- List v = new ArrayList();
- int lastParmEnd = 0;
-
- char []aChars = query.toCharArray();
-
- for (int i = 0; i < aChars.length; ++i)
- {
- switch (aChars[i])
- {
- case '\'': // single-quotes
- i = Parser.parseSingleQuotes(aChars, i, stdStrings);
- break;
-
- case '"': // double-quotes
- i = Parser.parseDoubleQuotes(aChars, i);
- break;
-
- case '-': // possibly -- style comment
- i = Parser.parseLineComment(aChars, i);
- break;
-
- case '/': // possibly /* */ style comment
- i = Parser.parseBlockComment(aChars, i);
- break;
-
- case '$': // possibly dollar quote start
- i = Parser.parseDollarQuotes(aChars, i);
- break;
-
- case '?':
- v.add(query.substring (lastParmEnd, i));
- lastParmEnd = i + 1;
- break;
-
- default:
- break;
- }
- }
-
- v.add(query.substring (lastParmEnd, query.length()));
-
- fragments = new String[v.size()];
- for (int i = 0 ; i < fragments.length; ++i)
- fragments[i] = (String)v.get(i);
- }
-
- public ParameterList createParameterList() {
- if (fragments.length == 1)
- return NO_PARAMETERS;
-
- return new SimpleParameterList(fragments.length - 1, useEStringSyntax);
- }
-
- public String toString(ParameterList parameters) {
- StringBuffer sbuf = new StringBuffer(fragments[0]);
- for (int i = 1; i < fragments.length; ++i)
- {
- if (parameters == null)
- sbuf.append("?");
- else
- sbuf.append(parameters.toString(i));
- sbuf.append(fragments[i]);
- }
- return sbuf.toString();
- }
-
- public void close() {
- }
-
- String[] getFragments() {
- return fragments;
- }
-
- public boolean isStatementDescribed() {
- return false;
- }
-
- private static final ParameterList NO_PARAMETERS = new SimpleParameterList(0, false);
-
- private final String[] fragments; // Query fragments, length == # of parameters + 1
-
- private final boolean useEStringSyntax; // whether escaped string syntax should be used
-}
-
diff --git a/org/postgresql/core/v3/CompositeParameterList.java b/org/postgresql/core/v3/CompositeParameterList.java
deleted file mode 100644
index e757059..0000000
--- a/org/postgresql/core/v3/CompositeParameterList.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v3;
-
-import org.postgresql.core.*;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.GT;
-
-import java.sql.SQLException;
-import java.io.InputStream;
-
-/**
- * Parameter list for V3 query strings that contain multiple statements.
- * We delegate to one SimpleParameterList per statement, and translate
- * parameter indexes as needed.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-class CompositeParameterList implements V3ParameterList {
- CompositeParameterList(SimpleParameterList[] subparams, int[] offsets) {
- this.subparams = subparams;
- this.offsets = offsets;
- this.total = offsets[offsets.length - 1] + subparams[offsets.length - 1].getInParameterCount();
- }
-
- private final int findSubParam(int index) throws SQLException {
- if (index < 1 || index > total)
- throw new PSQLException(GT.tr("The column index is out of range: {0}, number of columns: {1}.", new Object[]{new Integer(index), new Integer(total)}), PSQLState.INVALID_PARAMETER_VALUE );
-
- for (int i = offsets.length - 1; i >= 0; --i)
- if (offsets[i] < index)
- return i;
-
- throw new IllegalArgumentException("I am confused; can't find a subparam for index " + index);
- }
- public void registerOutParameter(int index, int sqlType)
- {
-
- }
- public int getDirection(int i)
- {return 0;}
- public int getParameterCount()
- {
- return total;
- }
- public int getInParameterCount() {
- return total;
- }
- public int getOutParameterCount()
- {
- return 0;
- }
-
- public int[] getTypeOIDs() {
- int oids[] = new int[total];
- for (int i=0; i<offsets.length; i++) {
- int subOids[] = subparams[i].getTypeOIDs();
- System.arraycopy(subOids, 0, oids, offsets[i], subOids.length);
- }
- return oids;
- }
-
- public void setIntParameter(int index, int value) throws SQLException {
- int sub = findSubParam(index);
- subparams[sub].setIntParameter(index - offsets[sub], value);
- }
-
- public void setLiteralParameter(int index, String value, int oid) throws SQLException {
- int sub = findSubParam(index);
- subparams[sub].setStringParameter(index - offsets[sub], value, oid);
- }
-
- public void setStringParameter(int index, String value, int oid) throws SQLException {
- int sub = findSubParam(index);
- subparams[sub].setStringParameter(index - offsets[sub], value, oid);
- }
-
- public void setBinaryParameter(int index, byte[] value, int oid) throws SQLException {
- int sub = findSubParam(index);
- subparams[sub].setBinaryParameter(index - offsets[sub], value, oid);
- }
-
- public void setBytea(int index, byte[] data, int offset, int length) throws SQLException {
- int sub = findSubParam(index);
- subparams[sub].setBytea(index - offsets[sub], data, offset, length);
- }
-
- public void setBytea(int index, InputStream stream, int length) throws SQLException {
- int sub = findSubParam(index);
- subparams[sub].setBytea(index - offsets[sub], stream, length);
- }
-
- public void setNull(int index, int oid) throws SQLException {
- int sub = findSubParam(index);
- subparams[sub].setNull(index - offsets[sub], oid);
- }
-
- public String toString(int index) {
- try
- {
- int sub = findSubParam(index);
- return subparams[sub].toString(index - offsets[sub]);
- }
- catch (SQLException e)
- {
- throw new IllegalStateException(e.getMessage());
- }
- }
-
- public ParameterList copy() {
- SimpleParameterList[] copySub = new SimpleParameterList[subparams.length];
- for (int sub = 0; sub < subparams.length; ++sub)
- copySub[sub] = (SimpleParameterList)subparams[sub].copy();
-
- return new CompositeParameterList(copySub, offsets);
- }
-
- public void clear() {
- for (int sub = 0; sub < subparams.length; ++sub)
- {
- subparams[sub].clear();
- }
- }
-
- public SimpleParameterList[] getSubparams() {
- return subparams;
- }
-
- public void checkAllParametersSet() throws SQLException {
- for (int sub = 0; sub < subparams.length; ++sub)
- subparams[sub].checkAllParametersSet();
- }
-
- public void convertFunctionOutParameters()
- {
- for (int sub = 0; sub < subparams.length; ++sub)
- subparams[sub].convertFunctionOutParameters();
- }
-
- private final int total;
- private final SimpleParameterList[] subparams;
- private final int[] offsets;
-}
diff --git a/org/postgresql/core/v3/CompositeQuery.java b/org/postgresql/core/v3/CompositeQuery.java
deleted file mode 100644
index a82311f..0000000
--- a/org/postgresql/core/v3/CompositeQuery.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v3;
-
-import org.postgresql.core.*;
-
-/**
- * V3 Query implementation for queries that involve multiple statements.
- * We split it up into one SimpleQuery per statement, and wrap the
- * corresponding per-statement SimpleParameterList objects in
- * a CompositeParameterList.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-class CompositeQuery implements V3Query {
- CompositeQuery(SimpleQuery[] subqueries, int[] offsets) {
- this.subqueries = subqueries;
- this.offsets = offsets;
- }
-
- public ParameterList createParameterList() {
- SimpleParameterList[] subparams = new SimpleParameterList[subqueries.length];
- for (int i = 0; i < subqueries.length; ++i)
- subparams[i] = (SimpleParameterList)subqueries[i].createParameterList();
- return new CompositeParameterList(subparams, offsets);
- }
-
- public String toString(ParameterList parameters) {
- StringBuffer sbuf = new StringBuffer(subqueries[0].toString());
- for (int i = 1; i < subqueries.length; ++i)
- {
- sbuf.append(';');
- sbuf.append(subqueries[i]);
- }
- return sbuf.toString();
- }
-
- public String toString() {
- return toString(null);
- }
-
- public void close() {
- for (int i = 0; i < subqueries.length; ++i)
- subqueries[i].close();
- }
-
- public SimpleQuery[] getSubqueries() {
- return subqueries;
- }
-
- public boolean isStatementDescribed() {
- for (int i = 0; i < subqueries.length; ++i)
- if (!subqueries[i].isStatementDescribed()) {
- return false;
- }
- return true;
- }
-
- private final SimpleQuery[] subqueries;
- private final int[] offsets;
-}
diff --git a/org/postgresql/core/v3/ConnectionFactoryImpl.java b/org/postgresql/core/v3/ConnectionFactoryImpl.java
deleted file mode 100644
index 10a2e3d..0000000
--- a/org/postgresql/core/v3/ConnectionFactoryImpl.java
+++ /dev/null
@@ -1,650 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v3;
-
-import java.util.Properties;
-import java.util.TimeZone;
-
-import java.sql.SQLException;
-import java.io.IOException;
-import java.net.ConnectException;
-
-import org.postgresql.core.*;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.PSQLWarning;
-import org.postgresql.util.ServerErrorMessage;
-import org.postgresql.util.UnixCrypt;
-import org.postgresql.util.MD5Digest;
-import org.postgresql.util.GT;
-import org.postgresql.util.HostSpec;
-
-/**
- * ConnectionFactory implementation for version 3 (7.4+) connections.
- *
- * @author Oliver Jowett (oliver at opencloud.com), based on the previous implementation
- */
-public class ConnectionFactoryImpl extends ConnectionFactory {
- private static final int AUTH_REQ_OK = 0;
- private static final int AUTH_REQ_KRB4 = 1;
- private static final int AUTH_REQ_KRB5 = 2;
- private static final int AUTH_REQ_PASSWORD = 3;
- private static final int AUTH_REQ_CRYPT = 4;
- private static final int AUTH_REQ_MD5 = 5;
- private static final int AUTH_REQ_SCM = 6;
- private static final int AUTH_REQ_GSS = 7;
- private static final int AUTH_REQ_GSS_CONTINUE = 8;
- private static final int AUTH_REQ_SSPI = 9;
-
- /** Marker exception; thrown when we want to fall back to using V2. */
- private static class UnsupportedProtocolException extends IOException {
- }
-
- public ProtocolConnection openConnectionImpl(HostSpec[] hostSpecs, String user, String database, Properties info, Logger logger) throws SQLException {
- // Extract interesting values from the info properties:
- // - the SSL setting
- boolean requireSSL;
- boolean trySSL;
- String sslmode = info.getProperty("sslmode");
- if (sslmode==null)
- { //Fall back to the ssl property
- requireSSL = trySSL = (info.getProperty("ssl") != null);
- } else {
- if ("disable".equals(sslmode))
- {
- requireSSL = trySSL = false;
- }
- //allow and prefer are not handled yet
- /*else if ("allow".equals(sslmode) || "prefer".equals(sslmode))
- {
- //XXX Allow and prefer are treated the same way
- requireSSL = false;
- trySSL = true;
- }*/
- else if ("require".equals(sslmode) || "verify-ca".equals(sslmode) || "verify-full".equals(sslmode))
- {
- requireSSL = trySSL = true;
- } else {
- throw new PSQLException (GT.tr("Invalid sslmode value: {0}", sslmode), PSQLState.CONNECTION_UNABLE_TO_CONNECT);
- }
- }
-
- // - the TCP keep alive setting
- boolean requireTCPKeepAlive = (Boolean.valueOf(info.getProperty("tcpKeepAlive")).booleanValue());
-
- // NOTE: To simplify this code, it is assumed that if we are
- // using the V3 protocol, then the database is at least 7.4. That
- // eliminates the need to check database versions and maintain
- // backward-compatible code here.
- //
- // Change by Chris Smith <cdsmith at twu.net>
-
- for (int whichHost = 0; whichHost < hostSpecs.length; ++whichHost) {
- HostSpec hostSpec = hostSpecs[whichHost];
-
- if (logger.logDebug())
- logger.debug("Trying to establish a protocol version 3 connection to " + hostSpec);
-
- //
- // Establish a connection.
- //
-
- PGStream newStream = null;
- try
- {
- newStream = new PGStream(hostSpec);
-
- // Construct and send an ssl startup packet if requested.
- if (trySSL)
- newStream = enableSSL(newStream, requireSSL, info, logger);
-
- // Set the socket timeout if the "socketTimeout" property has been set.
- String socketTimeoutProperty = info.getProperty("socketTimeout", "0");
- try {
- int socketTimeout = Integer.parseInt(socketTimeoutProperty);
- if (socketTimeout > 0) {
- newStream.getSocket().setSoTimeout(socketTimeout*1000);
- }
- } catch (NumberFormatException nfe) {
- logger.info("Couldn't parse socketTimeout value:" + socketTimeoutProperty);
- }
-
- // Enable TCP keep-alive probe if required.
- newStream.getSocket().setKeepAlive(requireTCPKeepAlive);
-
- // Try to set SO_SNDBUF and SO_RECVBUF socket options, if requested.
- // If receiveBufferSize and send_buffer_size are set to a value greater
- // than 0, adjust. -1 means use the system default, 0 is ignored since not
- // supported.
-
- // Set SO_RECVBUF read buffer size
- String receiveBufferSizeProperty = info.getProperty("receiveBufferSize", "-1");
- try {
- int receiveBufferSize = Integer.parseInt(receiveBufferSizeProperty);
- if (receiveBufferSize > -1) {
- // value of 0 not a valid buffer size value
- if (receiveBufferSize > 0) {
- newStream.getSocket().setReceiveBufferSize(receiveBufferSize);
- } else {
- logger.info("Ignore invalid value for receiveBufferSize: " + receiveBufferSize);
- }
- }
- } catch (NumberFormatException nfe) {
- logger.info("Couldn't parse receiveBufferSize value: " + receiveBufferSizeProperty);
- }
-
- // Set SO_SNDBUF write buffer size
- String sendBufferSizeProperty = info.getProperty("sendBufferSize", "-1");
- try {
- int sendBufferSize = Integer.parseInt(sendBufferSizeProperty);
- if (sendBufferSize > -1) {
- if (sendBufferSize > 0) {
- newStream.getSocket().setSendBufferSize(sendBufferSize);
- } else {
- logger.info("Ignore invalid value for sendBufferSize: " + sendBufferSize);
- }
- }
- } catch (NumberFormatException nfe) {
- logger.info("Couldn't parse sendBufferSize value: " + sendBufferSizeProperty);
- }
-
- logger.info("Receive Buffer Size is " + newStream.getSocket().getReceiveBufferSize());
- logger.info("Send Buffer Size is " + newStream.getSocket().getSendBufferSize());
-
- // Construct and send a startup packet.
- String[][] params = {
- { "user", user },
- { "database", database },
- { "client_encoding", "UTF8" },
- { "DateStyle", "ISO" },
- { "extra_float_digits", "2" },
- { "TimeZone", createPostgresTimeZone() },
- };
-
- sendStartupPacket(newStream, params, logger);
-
- // Do authentication (until AuthenticationOk).
- doAuthentication(newStream, hostSpec.getHost(), user, info, logger);
-
- // Do final startup.
- ProtocolConnectionImpl protoConnection = new ProtocolConnectionImpl(newStream, user, database, info, logger);
- readStartupMessages(newStream, protoConnection, logger);
-
- runInitialQueries(protoConnection, info, logger);
-
- // And we're done.
- return protoConnection;
- }
- catch (UnsupportedProtocolException upe)
- {
- // Swallow this and return null so ConnectionFactory tries the next protocol.
- if (logger.logDebug())
- logger.debug("Protocol not supported, abandoning connection.");
- try
- {
- newStream.close();
- }
- catch (IOException e)
- {
- }
- return null;
- }
- catch (ConnectException cex)
- {
- // Added by Peter Mount <peter at retep.org.uk>
- // ConnectException is thrown when the connection cannot be made.
- // we trap this an return a more meaningful message for the end user
- if (whichHost + 1 < hostSpecs.length) {
- // still more addresses to try
- continue;
- }
- throw new PSQLException (GT.tr("Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections."), PSQLState.CONNECTION_UNABLE_TO_CONNECT, cex);
- }
- catch (IOException ioe)
- {
- if (newStream != null)
- {
- try
- {
- newStream.close();
- }
- catch (IOException e)
- {
- }
- }
- if (whichHost + 1 < hostSpecs.length) {
- // still more addresses to try
- continue;
- }
- throw new PSQLException (GT.tr("The connection attempt failed."), PSQLState.CONNECTION_UNABLE_TO_CONNECT, ioe);
- }
- catch (SQLException se)
- {
- if (newStream != null)
- {
- try
- {
- newStream.close();
- }
- catch (IOException e)
- {
- }
- }
- if (whichHost + 1 < hostSpecs.length) {
- // still more addresses to try
- continue;
- }
- throw se;
- }
- }
- throw new PSQLException (GT.tr("The connection url is invalid."), PSQLState.CONNECTION_UNABLE_TO_CONNECT);
- }
-
- /**
- * Convert Java time zone to postgres time zone.
- * All others stay the same except that GMT+nn changes to GMT-nn and
- * vise versa.
- *
- * @return The current JVM time zone in postgresql format.
- */
- private String createPostgresTimeZone() {
- String tz = TimeZone.getDefault().getID();
- if (tz.length() <= 3 || !tz.startsWith("GMT")) {
- return tz;
- }
- char sign = tz.charAt(3);
- String start;
- if (sign == '+') {
- start = "GMT-";
- } else if (sign == '-') {
- start = "GMT+";
- } else {
- // unknown type
- return tz;
- }
-
- return start + tz.substring(4);
- }
-
- private PGStream enableSSL(PGStream pgStream, boolean requireSSL, Properties info, Logger logger) throws IOException, SQLException {
- if (logger.logDebug())
- logger.debug(" FE=> SSLRequest");
-
- // Send SSL request packet
- pgStream.SendInteger4(8);
- pgStream.SendInteger2(1234);
- pgStream.SendInteger2(5679);
- pgStream.flush();
-
- // Now get the response from the backend, one of N, E, S.
- int beresp = pgStream.ReceiveChar();
- switch (beresp)
- {
- case 'E':
- if (logger.logDebug())
- logger.debug(" <=BE SSLError");
-
- // Server doesn't even know about the SSL handshake protocol
- if (requireSSL)
- throw new PSQLException(GT.tr("The server does not support SSL."), PSQLState.CONNECTION_REJECTED);
-
- // We have to reconnect to continue.
- pgStream.close();
- return new PGStream(pgStream.getHostSpec());
-
- case 'N':
- if (logger.logDebug())
- logger.debug(" <=BE SSLRefused");
-
- // Server does not support ssl
- if (requireSSL)
- throw new PSQLException(GT.tr("The server does not support SSL."), PSQLState.CONNECTION_REJECTED);
-
- return pgStream;
-
- case 'S':
- if (logger.logDebug())
- logger.debug(" <=BE SSLOk");
-
- // Server supports ssl
- org.postgresql.ssl.MakeSSL.convert(pgStream, info, logger);
- return pgStream;
-
- default:
- throw new PSQLException(GT.tr("An error occurred while setting up the SSL connection."), PSQLState.PROTOCOL_VIOLATION);
- }
- }
-
- private void sendStartupPacket(PGStream pgStream, String[][] params, Logger logger) throws IOException {
- if (logger.logDebug())
- {
- String details = "";
- for (int i = 0; i < params.length; ++i)
- {
- if (i != 0)
- details += ", ";
- details += params[i][0] + "=" + params[i][1];
- }
- logger.debug(" FE=> StartupPacket(" + details + ")");
- }
-
- /*
- * Precalculate message length and encode params.
- */
- int length = 4 + 4;
- byte[][] encodedParams = new byte[params.length * 2][];
- for (int i = 0; i < params.length; ++i)
- {
- encodedParams[i*2] = params[i][0].getBytes("UTF-8");
- encodedParams[i*2 + 1] = params[i][1].getBytes("UTF-8");
- length += encodedParams[i * 2].length + 1 + encodedParams[i * 2 + 1].length + 1;
- }
-
- length += 1; // Terminating \0
-
- /*
- * Send the startup message.
- */
- pgStream.SendInteger4(length);
- pgStream.SendInteger2(3); // protocol major
- pgStream.SendInteger2(0); // protocol minor
- for (int i = 0; i < encodedParams.length; ++i)
- {
- pgStream.Send(encodedParams[i]);
- pgStream.SendChar(0);
- }
-
- pgStream.SendChar(0);
- pgStream.flush();
- }
-
- private void doAuthentication(PGStream pgStream, String host, String user, Properties info, Logger logger) throws IOException, SQLException
- {
- // Now get the response from the backend, either an error message
- // or an authentication request
-
- String password = info.getProperty("password");
-
- while (true)
- {
- int beresp = pgStream.ReceiveChar();
-
- switch (beresp)
- {
- case 'E':
- // An error occured, so pass the error message to the
- // user.
- //
- // The most common one to be thrown here is:
- // "User authentication failed"
- //
- int l_elen = pgStream.ReceiveInteger4();
- if (l_elen > 30000)
- {
- // if the error length is > than 30000 we assume this is really a v2 protocol
- // server, so trigger fallback.
- throw new UnsupportedProtocolException();
- }
-
- ServerErrorMessage errorMsg = new ServerErrorMessage(pgStream.ReceiveString(l_elen - 4), logger.getLogLevel());
- if (logger.logDebug())
- logger.debug(" <=BE ErrorMessage(" + errorMsg + ")");
- throw new PSQLException(errorMsg);
-
- case 'R':
- // Authentication request.
- // Get the message length
- int l_msgLen = pgStream.ReceiveInteger4();
-
- // Get the type of request
- int areq = pgStream.ReceiveInteger4();
-
- // Process the request.
- switch (areq)
- {
- case AUTH_REQ_CRYPT:
- {
- byte[] salt = pgStream.Receive(2);
-
- if (logger.logDebug())
- logger.debug(" <=BE AuthenticationReqCrypt(salt='" + new String(salt, "US-ASCII") + "')");
-
- if (password == null)
- throw new PSQLException(GT.tr("The server requested password-based authentication, but no password was provided."), PSQLState.CONNECTION_REJECTED);
-
- byte[] encodedResult = UnixCrypt.crypt(salt, password.getBytes("UTF-8"));
-
- if (logger.logDebug())
- logger.debug(" FE=> Password(crypt='" + new String(encodedResult, "US-ASCII") + "')");
-
- pgStream.SendChar('p');
- pgStream.SendInteger4(4 + encodedResult.length + 1);
- pgStream.Send(encodedResult);
- pgStream.SendChar(0);
- pgStream.flush();
-
- break;
- }
-
- case AUTH_REQ_MD5:
- {
- byte[] md5Salt = pgStream.Receive(4);
- if (logger.logDebug())
- {
- logger.debug(" <=BE AuthenticationReqMD5(salt=" + Utils.toHexString(md5Salt) + ")");
- }
-
- if (password == null)
- throw new PSQLException(GT.tr("The server requested password-based authentication, but no password was provided."), PSQLState.CONNECTION_REJECTED);
-
- byte[] digest = MD5Digest.encode(user.getBytes("UTF-8"), password.getBytes("UTF-8"), md5Salt);
-
- if (logger.logDebug())
- {
- logger.debug(" FE=> Password(md5digest=" + new String(digest, "US-ASCII") + ")");
- }
-
- pgStream.SendChar('p');
- pgStream.SendInteger4(4 + digest.length + 1);
- pgStream.Send(digest);
- pgStream.SendChar(0);
- pgStream.flush();
-
- break;
- }
-
- case AUTH_REQ_PASSWORD:
- {
- if (logger.logDebug())
- {
- logger.debug(" <=BE AuthenticationReqPassword");
- logger.debug(" FE=> Password(password=<not shown>)");
- }
-
- if (password == null)
- throw new PSQLException(GT.tr("The server requested password-based authentication, but no password was provided."), PSQLState.CONNECTION_REJECTED);
-
- byte[] encodedPassword = password.getBytes("UTF-8");
-
- pgStream.SendChar('p');
- pgStream.SendInteger4(4 + encodedPassword.length + 1);
- pgStream.Send(encodedPassword);
- pgStream.SendChar(0);
- pgStream.flush();
-
- break;
- }
-
- case AUTH_REQ_GSS:
- case AUTH_REQ_SSPI:
- org.postgresql.gss.MakeGSS.authenticate(pgStream, host,
- user, password,
- info.getProperty("jaasApplicationName"),
- info.getProperty("kerberosServerName"),
- logger,
- Boolean.valueOf(info.getProperty("useSpnego")).booleanValue());
- break;
-
- case AUTH_REQ_OK:
- if (logger.logDebug())
- logger.debug(" <=BE AuthenticationOk");
-
- return ; // We're done.
-
- default:
- if (logger.logDebug())
- logger.debug(" <=BE AuthenticationReq (unsupported type " + ((int)areq) + ")");
-
- throw new PSQLException(GT.tr("The authentication type {0} is not supported. Check that you have configured the pg_hba.conf file to include the client''s IP address or subnet, and that it is using an authentication scheme supported by the driver.", new Integer(areq)), PSQLState.CONNECTION_REJECTED);
- }
-
- break;
-
- default:
- throw new PSQLException(GT.tr("Protocol error. Session setup failed."), PSQLState.PROTOCOL_VIOLATION);
- }
- }
- }
-
- private void readStartupMessages(PGStream pgStream, ProtocolConnectionImpl protoConnection, Logger logger) throws IOException, SQLException {
- while (true)
- {
- int beresp = pgStream.ReceiveChar();
- switch (beresp)
- {
- case 'Z':
- // Ready For Query; we're done.
- if (pgStream.ReceiveInteger4() != 5)
- throw new IOException("unexpected length of ReadyForQuery packet");
-
- char tStatus = (char)pgStream.ReceiveChar();
- if (logger.logDebug())
- logger.debug(" <=BE ReadyForQuery(" + tStatus + ")");
-
- // Update connection state.
- switch (tStatus)
- {
- case 'I':
- protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_IDLE);
- break;
- case 'T':
- protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_OPEN);
- break;
- case 'E':
- protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_FAILED);
- break;
- default:
- // Huh?
- break;
- }
-
- return ;
-
- case 'K':
- // BackendKeyData
- int l_msgLen = pgStream.ReceiveInteger4();
- if (l_msgLen != 12)
- throw new PSQLException(GT.tr("Protocol error. Session setup failed."), PSQLState.PROTOCOL_VIOLATION);
-
- int pid = pgStream.ReceiveInteger4();
- int ckey = pgStream.ReceiveInteger4();
-
- if (logger.logDebug())
- logger.debug(" <=BE BackendKeyData(pid=" + pid + ",ckey=" + ckey + ")");
-
- protoConnection.setBackendKeyData(pid, ckey);
- break;
-
- case 'E':
- // Error
- int l_elen = pgStream.ReceiveInteger4();
- ServerErrorMessage l_errorMsg = new ServerErrorMessage(pgStream.ReceiveString(l_elen - 4), logger.getLogLevel());
-
- if (logger.logDebug())
- logger.debug(" <=BE ErrorMessage(" + l_errorMsg + ")");
-
- throw new PSQLException(l_errorMsg);
-
- case 'N':
- // Warning
- int l_nlen = pgStream.ReceiveInteger4();
- ServerErrorMessage l_warnMsg = new ServerErrorMessage(pgStream.ReceiveString(l_nlen - 4), logger.getLogLevel());
-
- if (logger.logDebug())
- logger.debug(" <=BE NoticeResponse(" + l_warnMsg + ")");
-
- protoConnection.addWarning(new PSQLWarning(l_warnMsg));
- break;
-
- case 'S':
- // ParameterStatus
- int l_len = pgStream.ReceiveInteger4();
- String name = pgStream.ReceiveString();
- String value = pgStream.ReceiveString();
-
- if (logger.logDebug())
- logger.debug(" <=BE ParameterStatus(" + name + " = " + value + ")");
-
- if (name.equals("server_version"))
- protoConnection.setServerVersion(value);
- else if (name.equals("client_encoding"))
- {
- if (!value.equals("UTF8"))
- throw new PSQLException(GT.tr("Protocol error. Session setup failed."), PSQLState.PROTOCOL_VIOLATION);
- pgStream.setEncoding(Encoding.getDatabaseEncoding("UTF8"));
- }
- else if (name.equals("standard_conforming_strings"))
- {
- if (value.equals("on"))
- protoConnection.setStandardConformingStrings(true);
- else if (value.equals("off"))
- protoConnection.setStandardConformingStrings(false);
- else
- throw new PSQLException(GT.tr("Protocol error. Session setup failed."), PSQLState.PROTOCOL_VIOLATION);
- }
- else if (name.equals("integer_datetimes"))
- {
- if (value.equals("on"))
- protoConnection.setIntegerDateTimes(true);
- else if (value.equals("off"))
- protoConnection.setIntegerDateTimes(false);
- else
- throw new PSQLException(GT.tr("Protocol error. Session setup failed."), PSQLState.PROTOCOL_VIOLATION);
- }
-
- break;
-
- default:
- if (logger.logDebug())
- logger.debug("invalid message type=" + (char)beresp);
- throw new PSQLException(GT.tr("Protocol error. Session setup failed."), PSQLState.PROTOCOL_VIOLATION);
- }
- }
- }
-
- private void runInitialQueries(ProtocolConnection protoConnection, Properties info, Logger logger) throws SQLException
- {
- String dbVersion = protoConnection.getServerVersion();
-
- if (dbVersion.compareTo("9.0") >= 0) {
- SetupQueryRunner.run(protoConnection, "SET extra_float_digits = 3", false);
- }
-
- String appName = info.getProperty("ApplicationName");
- if (appName != null && dbVersion.compareTo("9.0") >= 0) {
- StringBuffer sql = new StringBuffer();
- sql.append("SET application_name = '");
- Utils.appendEscapedLiteral(sql, appName, protoConnection.getStandardConformingStrings());
- sql.append("'");
- SetupQueryRunner.run(protoConnection, sql.toString(), false);
- }
-
- }
-
-}
diff --git a/org/postgresql/core/v3/CopyInImpl.java b/org/postgresql/core/v3/CopyInImpl.java
deleted file mode 100644
index 78488b6..0000000
--- a/org/postgresql/core/v3/CopyInImpl.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2009-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v3;
-
-import java.sql.SQLException;
-
-import org.postgresql.copy.CopyIn;
-
-/**
- * Anticipated flow of a COPY FROM STDIN operation:
- *
- * CopyManager.copyIn()
- * ->QueryExecutor.startCopy()
- * - sends given query to server
- * ->processCopyResults():
- * - receives CopyInResponse from Server
- * - creates new CopyInImpl
- * ->initCopy():
- * - receives copy metadata from server
- * ->CopyInImpl.init()
- * ->lock() connection for this operation
- * - if query fails an exception is thrown
- * - if query returns wrong CopyOperation, copyIn() cancels it before throwing exception
- * <-return: new CopyInImpl holding lock on connection
- * repeat CopyIn.writeToCopy() for all data
- * ->CopyInImpl.writeToCopy()
- * ->QueryExecutorImpl.writeToCopy()
- * - sends given data
- * ->processCopyResults()
- * - parameterized not to block, just peek for new messages from server
- * - on ErrorResponse, waits until protocol is restored and unlocks connection
- * CopyIn.endCopy()
- * ->CopyInImpl.endCopy()
- * ->QueryExecutorImpl.endCopy()
- * - sends CopyDone
- * - processCopyResults()
- * - on CommandComplete
- * ->CopyOperationImpl.handleCommandComplete()
- * - sets updatedRowCount when applicable
- * - on ReadyForQuery unlock() connection for use by other operations
- * <-return: CopyInImpl.getUpdatedRowCount()
- */
-public class CopyInImpl extends CopyOperationImpl implements CopyIn {
-
- public void writeToCopy(byte[] data, int off, int siz) throws SQLException {
- queryExecutor.writeToCopy(this, data, off, siz);
- }
-
- public void flushCopy() throws SQLException {
- queryExecutor.flushCopy(this);
- }
-
- public long endCopy() throws SQLException {
- return queryExecutor.endCopy(this);
- }
-}
diff --git a/org/postgresql/core/v3/CopyOperationImpl.java b/org/postgresql/core/v3/CopyOperationImpl.java
deleted file mode 100644
index 1460ced..0000000
--- a/org/postgresql/core/v3/CopyOperationImpl.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2009-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v3;
-
-import java.sql.SQLException;
-
-import org.postgresql.copy.CopyOperation;
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-public class CopyOperationImpl implements CopyOperation {
- QueryExecutorImpl queryExecutor;
- int rowFormat;
- int[] fieldFormats;
- long handledRowCount = -1;
-
- void init(QueryExecutorImpl q, int fmt, int[] fmts) {
- queryExecutor = q;
- rowFormat = fmt;
- fieldFormats = fmts;
- }
-
- public void cancelCopy() throws SQLException {
- queryExecutor.cancelCopy(this);
- }
-
- public int getFieldCount() {
- return fieldFormats.length;
- }
-
- public int getFieldFormat(int field) {
- return fieldFormats[field];
- }
-
- public int getFormat() {
- return rowFormat;
- }
-
- public boolean isActive() {
- synchronized(queryExecutor) {
- return queryExecutor.hasLock(this);
- }
- }
-
- public void handleCommandStatus(String status) throws PSQLException {
- if(status.startsWith("COPY")) {
- int i = status.lastIndexOf(' ');
- handledRowCount = i > 3 ? Long.parseLong(status.substring( i + 1 )) : -1;
- } else {
- throw new PSQLException(GT.tr("CommandComplete expected COPY but got: " + status), PSQLState.COMMUNICATION_ERROR);
- }
- }
-
- public long getHandledRowCount() {
- return handledRowCount;
- }
-}
diff --git a/org/postgresql/core/v3/CopyOutImpl.java b/org/postgresql/core/v3/CopyOutImpl.java
deleted file mode 100644
index e555384..0000000
--- a/org/postgresql/core/v3/CopyOutImpl.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2009-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v3;
-
-import java.sql.SQLException;
-
-import org.postgresql.copy.CopyOut;
-
-/**
- * Anticipated flow of a COPY TO STDOUT operation:
- *
- * CopyManager.copyOut()
- * ->QueryExecutor.startCopy()
- * - sends given query to server
- * ->processCopyResults():
- * - receives CopyOutResponse from Server
- * - creates new CopyOutImpl
- * ->initCopy():
- * - receives copy metadata from server
- * ->CopyOutImpl.init()
- * ->lock() connection for this operation
- * - if query fails an exception is thrown
- * - if query returns wrong CopyOperation, copyOut() cancels it before throwing exception
- * <-returned: new CopyOutImpl holding lock on connection
- * repeat CopyOut.readFromCopy() until null
- * ->CopyOutImpl.readFromCopy()
- * ->QueryExecutorImpl.readFromCopy()
- * ->processCopyResults()
- * - on copydata row from server
- * ->CopyOutImpl.handleCopydata() stores reference to byte array
- * - on CopyDone, CommandComplete, ReadyForQuery
- * ->unlock() connection for use by other operations
- * <-returned: byte array of data received from server or null at end.
- */
-public class CopyOutImpl extends CopyOperationImpl implements CopyOut {
- private byte[] currentDataRow;
-
- public byte[] readFromCopy() throws SQLException {
- currentDataRow = null;
- queryExecutor.readFromCopy(this);
- return currentDataRow;
- }
-
- void handleCopydata(byte[] data) {
- currentDataRow = data;
- }
-}
diff --git a/org/postgresql/core/v3/Portal.java b/org/postgresql/core/v3/Portal.java
deleted file mode 100644
index 005828c..0000000
--- a/org/postgresql/core/v3/Portal.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v3;
-
-import java.lang.ref.PhantomReference;
-import org.postgresql.core.*;
-
-/**
- * V3 ResultCursor implementation in terms of backend Portals.
- * This holds the state of a single Portal. We use a PhantomReference
- * managed by our caller to handle resource cleanup.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-class Portal implements ResultCursor {
- Portal(SimpleQuery query, String portalName) {
- this.query = query;
- this.portalName = portalName;
- this.encodedName = Utils.encodeUTF8(portalName);
- }
-
- public void close() {
- if (cleanupRef != null)
- {
- cleanupRef.clear();
- cleanupRef.enqueue();
- cleanupRef = null;
- }
- }
-
- String getPortalName() {
- return portalName;
- }
-
- byte[] getEncodedPortalName() {
- return encodedName;
- }
-
- SimpleQuery getQuery() {
- return query;
- }
-
- void setCleanupRef(PhantomReference cleanupRef) {
- this.cleanupRef = cleanupRef;
- }
-
- public String toString() {
- return portalName;
- }
-
- // Holding on to a reference to the generating query has
- // the nice side-effect that while this Portal is referenced,
- // so is the SimpleQuery, so the underlying statement won't
- // be closed while the portal is open (the backend closes
- // all open portals when the statement is closed)
-
- private final SimpleQuery query;
- private final String portalName;
- private final byte[] encodedName;
- private PhantomReference cleanupRef;
-}
diff --git a/org/postgresql/core/v3/ProtocolConnectionImpl.java b/org/postgresql/core/v3/ProtocolConnectionImpl.java
deleted file mode 100644
index 6c40204..0000000
--- a/org/postgresql/core/v3/ProtocolConnectionImpl.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v3;
-
-import org.postgresql.PGNotification;
-import org.postgresql.core.*;
-import org.postgresql.util.HostSpec;
-
-import java.sql.SQLException;
-import java.sql.SQLWarning;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Properties;
-
-
-/**
- * ProtocolConnection implementation for the V3 protocol.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-class ProtocolConnectionImpl implements ProtocolConnection {
- ProtocolConnectionImpl(PGStream pgStream, String user, String database, Properties info, Logger logger) {
- this.pgStream = pgStream;
- this.user = user;
- this.database = database;
- this.logger = logger;
- this.executor = new QueryExecutorImpl(this, pgStream, info, logger);
- // default value for server versions that don't report standard_conforming_strings
- this.standardConformingStrings = false;
- }
-
- public HostSpec getHostSpec() {
- return pgStream.getHostSpec();
- }
-
- public String getUser() {
- return user;
- }
-
- public String getDatabase() {
- return database;
- }
-
- public String getServerVersion() {
- return serverVersion;
- }
-
- public synchronized boolean getStandardConformingStrings()
- {
- return standardConformingStrings;
- }
-
- public synchronized int getTransactionState()
- {
- return transactionState;
- }
-
- public synchronized PGNotification[] getNotifications() throws SQLException {
- PGNotification[] array = (PGNotification[])notifications.toArray(new PGNotification[notifications.size()]);
- notifications.clear();
- return array;
- }
-
- public synchronized SQLWarning getWarnings()
- {
- SQLWarning chain = warnings;
- warnings = null;
- return chain;
- }
-
- public QueryExecutor getQueryExecutor() {
- return executor;
- }
-
- public void sendQueryCancel() throws SQLException {
- PGStream cancelStream = null;
-
- // Now we need to construct and send a cancel packet
- try
- {
- if (logger.logDebug())
- logger.debug(" FE=> CancelRequest(pid=" + cancelPid + ",ckey=" + cancelKey + ")");
-
- cancelStream = new PGStream(pgStream.getHostSpec());
- cancelStream.SendInteger4(16);
- cancelStream.SendInteger2(1234);
- cancelStream.SendInteger2(5678);
- cancelStream.SendInteger4(cancelPid);
- cancelStream.SendInteger4(cancelKey);
- cancelStream.flush();
- cancelStream.ReceiveEOF();
- cancelStream.close();
- cancelStream = null;
- }
- catch (IOException e)
- {
- // Safe to ignore.
- if (logger.logDebug())
- logger.debug("Ignoring exception on cancel request:", e);
- }
- finally
- {
- if (cancelStream != null)
- {
- try
- {
- cancelStream.close();
- }
- catch (IOException e)
- {
- // Ignored.
- }
- }
- }
- }
-
- public void close() {
- if (closed)
- return ;
-
- try
- {
- if (logger.logDebug())
- logger.debug(" FE=> Terminate");
-
- pgStream.SendChar('X');
- pgStream.SendInteger4(4);
- pgStream.flush();
- pgStream.close();
- }
- catch (IOException ioe)
- {
- // Forget it.
- if (logger.logDebug())
- logger.debug("Discarding IOException on close:", ioe);
- }
-
- closed = true;
- }
-
- public Encoding getEncoding() {
- return pgStream.getEncoding();
- }
-
- public boolean isClosed() {
- return closed;
- }
-
- //
- // Package-private accessors called during connection setup
- //
-
- void setServerVersion(String serverVersion) {
- this.serverVersion = serverVersion;
- }
-
- void setBackendKeyData(int cancelPid, int cancelKey) {
- this.cancelPid = cancelPid;
- this.cancelKey = cancelKey;
- }
-
- //
- // Package-private accessors called by the query executor
- //
-
- synchronized void addWarning(SQLWarning newWarning)
- {
- if (warnings == null)
- warnings = newWarning;
- else
- warnings.setNextWarning(newWarning);
- }
-
- synchronized void addNotification(PGNotification notification)
- {
- notifications.add(notification);
- }
-
- synchronized void setTransactionState(int state)
- {
- transactionState = state;
- }
-
- synchronized void setStandardConformingStrings(boolean value)
- {
- standardConformingStrings = value;
- }
-
- public int getProtocolVersion()
- {
- return 3;
- }
-
- public boolean useBinaryForReceive(int oid) {
- return useBinaryForOids.contains(oid);
- }
-
- public void setBinaryReceiveOids(Set oids) {
- useBinaryForOids.clear();
- useBinaryForOids.addAll(oids);
- }
-
- public void setIntegerDateTimes(boolean state) {
- integerDateTimes = state;
- }
-
- public boolean getIntegerDateTimes() {
- return integerDateTimes;
- }
-
- /**
- * True if server uses integers for date and time fields. False if
- * server uses double.
- */
- private boolean integerDateTimes;
-
- /**
- * Bit set that has a bit set for each oid which should be received
- * using binary format.
- */
- private final Set<Integer> useBinaryForOids = new HashSet<Integer>();
- private String serverVersion;
- private int cancelPid;
- private int cancelKey;
-
- private boolean standardConformingStrings;
- private int transactionState;
- private SQLWarning warnings;
-
- private boolean closed = false;
-
- private final ArrayList notifications = new ArrayList();
-
- private final PGStream pgStream;
- private final String user;
- private final String database;
- private final QueryExecutorImpl executor;
- private final Logger logger;
-}
diff --git a/org/postgresql/core/v3/QueryExecutorImpl.java b/org/postgresql/core/v3/QueryExecutorImpl.java
deleted file mode 100644
index 54dd104..0000000
--- a/org/postgresql/core/v3/QueryExecutorImpl.java
+++ /dev/null
@@ -1,2253 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v3;
-
-import org.postgresql.core.*;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.HashMap;
-import java.util.Properties;
-
-import java.lang.ref.*;
-
-import java.io.IOException;
-import java.sql.*;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLWarning;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.ServerErrorMessage;
-import org.postgresql.util.GT;
-import org.postgresql.copy.CopyOperation;
-
-/**
- * QueryExecutor implementation for the V3 protocol.
- */
-public class QueryExecutorImpl implements QueryExecutor {
- public QueryExecutorImpl(ProtocolConnectionImpl protoConnection, PGStream pgStream, Properties info, Logger logger) {
- this.protoConnection = protoConnection;
- this.pgStream = pgStream;
- this.logger = logger;
-
- if (info.getProperty("allowEncodingChanges") != null) {
- this.allowEncodingChanges = Boolean.valueOf(info.getProperty("allowEncodingChanges")).booleanValue();
- } else {
- this.allowEncodingChanges = false;
- }
- }
-
- /**
- * Supplement to synchronization of public methods on current QueryExecutor.
- *
- * Necessary for keeping the connection intact between calls to public methods
- * sharing a state such as COPY subprotocol. waitOnLock() must be called at
- * beginning of each connection access point.
- *
- * Public methods sharing that state must then be synchronized among themselves.
- * Normal method synchronization typically suffices for that.
- *
- * See notes on related methods as well as currentCopy() below.
- */
- private Object lockedFor = null;
-
- /**
- * Obtain lock over this connection for given object, blocking to wait if necessary.
- * @param obtainer object that gets the lock. Normally current thread.
- * @throws PSQLException when already holding the lock or getting interrupted.
- */
- private void lock(Object obtainer) throws PSQLException {
- if( lockedFor == obtainer )
- throw new PSQLException(GT.tr("Tried to obtain lock while already holding it"), PSQLState.OBJECT_NOT_IN_STATE);
- waitOnLock();
- lockedFor = obtainer;
- }
-
- /**
- * Release lock on this connection presumably held by given object.
- * @param holder object that holds the lock. Normally current thread.
- * @throws PSQLException when this thread does not hold the lock
- */
- private void unlock(Object holder) throws PSQLException {
- if(lockedFor != holder)
- throw new PSQLException(GT.tr("Tried to break lock on database connection"), PSQLState.OBJECT_NOT_IN_STATE);
- lockedFor = null;
- this.notify();
- }
-
- /**
- * Wait until our lock is released.
- * Execution of a single synchronized method can then continue without further ado.
- * Must be called at beginning of each synchronized public method.
- */
- private void waitOnLock() throws PSQLException {
- while( lockedFor != null ) {
- try {
- this.wait();
- } catch(InterruptedException ie) {
- throw new PSQLException(GT.tr("Interrupted while waiting to obtain lock on database connection"), PSQLState.OBJECT_NOT_IN_STATE, ie);
- }
- }
- }
-
- /**
- * @param holder object assumed to hold the lock
- * @return whether given object actually holds the lock
- */
- boolean hasLock(Object holder) {
- return lockedFor == holder;
- }
-
- //
- // Query parsing
- //
-
- public Query createSimpleQuery(String sql) {
- return parseQuery(sql, false);
- }
-
- public Query createParameterizedQuery(String sql) {
- return parseQuery(sql, true);
- }
-
- private Query parseQuery(String query, boolean withParameters) {
- // Parse query and find parameter placeholders;
- // also break the query into separate statements.
-
- ArrayList statementList = new ArrayList();
- ArrayList fragmentList = new ArrayList(15);
-
- int fragmentStart = 0;
- int inParen = 0;
-
- boolean standardConformingStrings = protoConnection.getStandardConformingStrings();
-
- char []aChars = query.toCharArray();
-
- for (int i = 0; i < aChars.length; ++i)
- {
- switch (aChars[i])
- {
- case '\'': // single-quotes
- i = Parser.parseSingleQuotes(aChars, i, standardConformingStrings);
- break;
-
- case '"': // double-quotes
- i = Parser.parseDoubleQuotes(aChars, i);
- break;
-
- case '-': // possibly -- style comment
- i = Parser.parseLineComment(aChars, i);
- break;
-
- case '/': // possibly /* */ style comment
- i = Parser.parseBlockComment(aChars, i);
- break;
-
- case '$': // possibly dollar quote start
- i = Parser.parseDollarQuotes(aChars, i);
- break;
-
- case '(':
- inParen++;
- break;
-
- case ')':
- inParen--;
- break;
-
- case '?':
- if (withParameters)
- {
- fragmentList.add(query.substring(fragmentStart, i));
- fragmentStart = i + 1;
- }
- break;
-
- case ';':
- if (inParen == 0)
- {
- fragmentList.add(query.substring(fragmentStart, i));
- fragmentStart = i + 1;
- if (fragmentList.size() > 1 || ((String)fragmentList.get(0)).trim().length() > 0)
- statementList.add(fragmentList.toArray(new String[fragmentList.size()]));
- fragmentList.clear();
- }
- break;
-
- default:
- break;
- }
- }
-
- fragmentList.add(query.substring(fragmentStart));
- if (fragmentList.size() > 1 || ((String)fragmentList.get(0)).trim().length() > 0)
- statementList.add(fragmentList.toArray(new String[fragmentList.size()]));
-
- if (statementList.isEmpty()) // Empty query.
- return EMPTY_QUERY;
-
- if (statementList.size() == 1)
- {
- // Only one statement.
- return new SimpleQuery((String[]) statementList.get(0), protoConnection);
- }
-
- // Multiple statements.
- SimpleQuery[] subqueries = new SimpleQuery[statementList.size()];
- int[] offsets = new int[statementList.size()];
- int offset = 0;
- for (int i = 0; i < statementList.size(); ++i)
- {
- String[] fragments = (String[]) statementList.get(i);
- offsets[i] = offset;
- subqueries[i] = new SimpleQuery(fragments, protoConnection);
- offset += fragments.length - 1;
- }
-
- return new CompositeQuery(subqueries, offsets);
- }
-
- //
- // Query execution
- //
-
- public synchronized void execute(Query query,
- ParameterList parameters,
- ResultHandler handler,
- int maxRows,
- int fetchSize,
- int flags)
- throws SQLException
- {
- waitOnLock();
- if (logger.logDebug())
- {
- logger.debug("simple execute, handler=" + handler +
- ", maxRows=" + maxRows + ", fetchSize=" + fetchSize + ", flags=" + flags);
- }
-
- if (parameters == null)
- parameters = SimpleQuery.NO_PARAMETERS;
-
- boolean describeOnly = (QUERY_DESCRIBE_ONLY & flags) != 0;
-
- ((V3ParameterList)parameters).convertFunctionOutParameters();
-
- // Check parameters are all set..
- if (!describeOnly)
- ((V3ParameterList)parameters).checkAllParametersSet();
-
- try
- {
- try
- {
- handler = sendQueryPreamble(handler, flags);
- ErrorTrackingResultHandler trackingHandler = new ErrorTrackingResultHandler(handler);
- queryCount = 0;
- sendQuery((V3Query)query, (V3ParameterList)parameters, maxRows, fetchSize, flags, trackingHandler);
- sendSync();
- processResults(handler, flags);
- }
- catch (PGBindException se)
- {
- // There are three causes of this error, an
- // invalid total Bind message length, a
- // BinaryStream that cannot provide the amount
- // of data claimed by the length arugment, and
- // a BinaryStream that throws an Exception
- // when reading.
- //
- // We simply do not send the Execute message
- // so we can just continue on as if nothing
- // has happened. Perhaps we need to
- // introduce an error here to force the
- // caller to rollback if there is a
- // transaction in progress?
- //
- sendSync();
- processResults(handler, flags);
- handler.handleError(new PSQLException(GT.tr("Unable to bind parameter values for statement."), PSQLState.INVALID_PARAMETER_VALUE, se.getIOException()));
- }
- }
- catch (IOException e)
- {
- protoConnection.close();
- handler.handleError(new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, e));
- }
-
- handler.handleCompletion();
- }
-
- // Deadlock avoidance:
- //
- // It's possible for the send and receive streams to get "deadlocked" against each other since
- // we do not have a separate thread. The scenario is this: we have two streams:
- //
- // driver -> TCP buffering -> server
- // server -> TCP buffering -> driver
- //
- // The server behaviour is roughly:
- // while true:
- // read message
- // execute message
- // write results
- //
- // If the server -> driver stream has a full buffer, the write will block.
- // If the driver is still writing when this happens, and the driver -> server
- // stream also fills up, we deadlock: the driver is blocked on write() waiting
- // for the server to read some more data, and the server is blocked on write()
- // waiting for the driver to read some more data.
- //
- // To avoid this, we guess at how many queries we can send before the server ->
- // driver stream's buffer is full (MAX_BUFFERED_QUERIES). This is the point where
- // the server blocks on write and stops reading data. If we reach this point, we
- // force a Sync message and read pending data from the server until ReadyForQuery,
- // then go back to writing more queries unless we saw an error.
- //
- // This is not 100% reliable -- it's only done in the batch-query case and only
- // at a reasonably high level (per query, not per message), and it's only an estimate
- // -- so it might break. To do it correctly in all cases would seem to require a
- // separate send or receive thread as we can only do the Sync-and-read-results
- // operation at particular points, and also as we don't really know how much data
- // the server is sending.
-
- // Assume 64k server->client buffering and 250 bytes response per query (conservative).
- private static final int MAX_BUFFERED_QUERIES = (64000 / 250);
-
- // Helper handler that tracks error status.
- private static class ErrorTrackingResultHandler implements ResultHandler {
- private final ResultHandler delegateHandler;
- private boolean sawError = false;
-
- ErrorTrackingResultHandler(ResultHandler delegateHandler) {
- this.delegateHandler = delegateHandler;
- }
-
- public void handleResultRows(Query fromQuery, Field[] fields, List tuples, ResultCursor cursor) {
- delegateHandler.handleResultRows(fromQuery, fields, tuples, cursor);
- }
-
- public void handleCommandStatus(String status, int updateCount, long insertOID) {
- delegateHandler.handleCommandStatus(status, updateCount, insertOID);
- }
-
- public void handleWarning(SQLWarning warning) {
- delegateHandler.handleWarning(warning);
- }
-
- public void handleError(SQLException error) {
- sawError = true;
- delegateHandler.handleError(error);
- }
-
- public void handleCompletion() throws SQLException {
- delegateHandler.handleCompletion();
- }
-
- boolean hasErrors() {
- return sawError;
- }
- }
-
- public synchronized void execute(Query[] queries,
- ParameterList[] parameterLists,
- ResultHandler handler,
- int maxRows,
- int fetchSize,
- int flags)
- throws SQLException
- {
- waitOnLock();
- if (logger.logDebug())
- {
- logger.debug("batch execute " + queries.length + " queries, handler=" + handler +
- ", maxRows=" + maxRows + ", fetchSize=" + fetchSize + ", flags=" + flags);
- }
-
- boolean describeOnly = (QUERY_DESCRIBE_ONLY & flags) != 0;
- // Check parameters and resolve OIDs.
- if (!describeOnly) {
- for (int i = 0; i < parameterLists.length; ++i)
- {
- if (parameterLists[i] != null)
- ((V3ParameterList)parameterLists[i]).checkAllParametersSet();
- }
- }
-
- try
- {
- handler = sendQueryPreamble(handler, flags);
- ErrorTrackingResultHandler trackingHandler = new ErrorTrackingResultHandler(handler);
- queryCount = 0;
-
- for (int i = 0; i < queries.length; ++i)
- {
- V3Query query = (V3Query)queries[i];
- V3ParameterList parameters = (V3ParameterList)parameterLists[i];
- if (parameters == null)
- parameters = SimpleQuery.NO_PARAMETERS;
-
- sendQuery(query, parameters, maxRows, fetchSize, flags, trackingHandler);
-
- if (trackingHandler.hasErrors())
- break;
- }
-
- if (!trackingHandler.hasErrors())
- {
- sendSync();
- processResults(handler, flags);
- }
- }
- catch (IOException e)
- {
- protoConnection.close();
- handler.handleError(new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, e));
- }
-
- handler.handleCompletion();
- }
-
- private ResultHandler sendQueryPreamble(final ResultHandler delegateHandler, int flags) throws IOException {
- // First, send CloseStatements for finalized SimpleQueries that had statement names assigned.
- processDeadParsedQueries();
- processDeadPortals();
-
- // Send BEGIN on first statement in transaction.
- if ((flags & QueryExecutor.QUERY_SUPPRESS_BEGIN) != 0 ||
- protoConnection.getTransactionState() != ProtocolConnection.TRANSACTION_IDLE)
- return delegateHandler;
-
- sendOneQuery(beginTransactionQuery, SimpleQuery.NO_PARAMETERS, 0, 0, QueryExecutor.QUERY_NO_METADATA);
-
- // Insert a handler that intercepts the BEGIN.
- return new ResultHandler() {
- private boolean sawBegin = false;
-
- public void handleResultRows(Query fromQuery, Field[] fields, List tuples, ResultCursor cursor) {
- if (sawBegin)
- delegateHandler.handleResultRows(fromQuery, fields, tuples, cursor);
- }
-
- public void handleCommandStatus(String status, int updateCount, long insertOID) {
- if (!sawBegin)
- {
- sawBegin = true;
- if (!status.equals("BEGIN"))
- handleError(new PSQLException(GT.tr("Expected command status BEGIN, got {0}.", status),
- PSQLState.PROTOCOL_VIOLATION));
- }
- else
- {
- delegateHandler.handleCommandStatus(status, updateCount, insertOID);
- }
- }
-
- public void handleWarning(SQLWarning warning) {
- delegateHandler.handleWarning(warning);
- }
-
- public void handleError(SQLException error) {
- delegateHandler.handleError(error);
- }
-
- public void handleCompletion() throws SQLException{
- delegateHandler.handleCompletion();
- }
- };
- }
-
- //
- // Fastpath
- //
-
- public synchronized byte[]
- fastpathCall(int fnid, ParameterList parameters, boolean suppressBegin) throws SQLException {
- waitOnLock();
- if (!suppressBegin)
- {
- doSubprotocolBegin();
- }
- try
- {
- sendFastpathCall(fnid, (SimpleParameterList)parameters);
- return receiveFastpathResult();
- }
- catch (IOException ioe)
- {
- protoConnection.close();
- throw new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, ioe);
- }
- }
-
- public void doSubprotocolBegin() throws SQLException {
- if (protoConnection.getTransactionState() == ProtocolConnection.TRANSACTION_IDLE)
- {
-
- if (logger.logDebug())
- logger.debug("Issuing BEGIN before fastpath or copy call.");
-
- ResultHandler handler = new ResultHandler() {
- private boolean sawBegin = false;
- private SQLException sqle = null;
-
- public void handleResultRows(Query fromQuery, Field[] fields, List tuples, ResultCursor cursor) {
- }
-
- public void handleCommandStatus(String status, int updateCount, long insertOID) {
- if (!sawBegin)
- {
- if (!status.equals("BEGIN"))
- handleError(new PSQLException(GT.tr("Expected command status BEGIN, got {0}.", status),
- PSQLState.PROTOCOL_VIOLATION));
- sawBegin = true;
- }
- else
- {
- handleError(new PSQLException(GT.tr("Unexpected command status: {0}.", status),
- PSQLState.PROTOCOL_VIOLATION));
- }
- }
-
- public void handleWarning(SQLWarning warning) {
- // we don't want to ignore warnings and it would be tricky
- // to chain them back to the connection, so since we don't
- // expect to get them in the first place, we just consider
- // them errors.
- handleError(warning);
- }
-
- public void handleError(SQLException error) {
- if (sqle == null)
- {
- sqle = error;
- }
- else
- {
- sqle.setNextException(error);
- }
- }
-
- public void handleCompletion() throws SQLException{
- if (sqle != null)
- throw sqle;
- }
- };
-
- try
- {
- sendOneQuery(beginTransactionQuery, SimpleQuery.NO_PARAMETERS, 0, 0, QueryExecutor.QUERY_NO_METADATA);
- sendSync();
- processResults(handler, 0);
- }
- catch (IOException ioe)
- {
- throw new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, ioe);
- }
- }
-
- }
-
- public ParameterList createFastpathParameters(int count) {
- return new SimpleParameterList(count, protoConnection);
- }
-
- private void sendFastpathCall(int fnid, SimpleParameterList params) throws SQLException, IOException {
- if (logger.logDebug())
- logger.debug(" FE=> FunctionCall(" + fnid + ", " + params.getParameterCount() + " params)");
-
- //
- // Total size = 4 (length)
- // + 4 (function OID)
- // + 2 (format code count) + N * 2 (format codes)
- // + 2 (parameter count) + encodedSize (parameters)
- // + 2 (result format)
-
- int paramCount = params.getParameterCount();
- int encodedSize = 0;
- for (int i = 1; i <= paramCount; ++i)
- {
- if (params.isNull(i))
- encodedSize += 4;
- else
- encodedSize += 4 + params.getV3Length(i);
- }
-
-
- pgStream.SendChar('F');
- pgStream.SendInteger4(4 + 4 + 2 + 2 * paramCount + 2 + encodedSize + 2);
- pgStream.SendInteger4(fnid);
- pgStream.SendInteger2(paramCount);
- for (int i = 1; i <= paramCount; ++i)
- pgStream.SendInteger2(params.isBinary(i) ? 1 : 0);
- pgStream.SendInteger2(paramCount);
- for (int i = 1; i <= paramCount; i++)
- {
- if (params.isNull(i))
- {
- pgStream.SendInteger4( -1);
- }
- else
- {
- pgStream.SendInteger4(params.getV3Length(i)); // Parameter size
- params.writeV3Value(i, pgStream);
- }
- }
- pgStream.SendInteger2(1); // Binary result format
- pgStream.flush();
- }
-
- public synchronized void processNotifies() throws SQLException {
- waitOnLock();
- // Asynchronous notifies only arrive when we are not in a transaction
- if (protoConnection.getTransactionState() != ProtocolConnection.TRANSACTION_IDLE)
- return;
-
- try {
- while (pgStream.hasMessagePending()) {
- int c = pgStream.ReceiveChar();
- switch (c) {
- case 'A': // Asynchronous Notify
- receiveAsyncNotify();
- break;
- case 'E': // Error Response (response to pretty much everything; backend then skips until Sync)
- throw receiveErrorResponse();
- // break;
- case 'N': // Notice Response (warnings / info)
- SQLWarning warning = receiveNoticeResponse();
- protoConnection.addWarning(warning);
- break;
- default:
- throw new PSQLException(GT.tr("Unknown Response Type {0}.", new Character((char) c)), PSQLState.CONNECTION_FAILURE);
- }
- }
- } catch (IOException ioe) {
- throw new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, ioe);
- }
- }
-
- private byte[] receiveFastpathResult() throws IOException, SQLException {
- boolean endQuery = false;
- SQLException error = null;
- byte[] returnValue = null;
-
- while (!endQuery)
- {
- int c = pgStream.ReceiveChar();
- switch (c)
- {
- case 'A': // Asynchronous Notify
- receiveAsyncNotify();
- break;
-
- case 'E': // Error Response (response to pretty much everything; backend then skips until Sync)
- SQLException newError = receiveErrorResponse();
- if (error == null)
- error = newError;
- else
- error.setNextException(newError);
- // keep processing
- break;
-
- case 'N': // Notice Response (warnings / info)
- SQLWarning warning = receiveNoticeResponse();
- protoConnection.addWarning(warning);
- break;
-
- case 'Z': // Ready For Query (eventual response to Sync)
- receiveRFQ();
- endQuery = true;
- break;
-
- case 'V': // FunctionCallResponse
- int msgLen = pgStream.ReceiveInteger4();
- int valueLen = pgStream.ReceiveInteger4();
-
- if (logger.logDebug())
- logger.debug(" <=BE FunctionCallResponse(" + valueLen + " bytes)");
-
- if (valueLen != -1)
- {
- byte buf[] = new byte[valueLen];
- pgStream.Receive(buf, 0, valueLen);
- returnValue = buf;
- }
-
- break;
-
- default:
- throw new PSQLException(GT.tr("Unknown Response Type {0}.", new Character((char) c)), PSQLState.CONNECTION_FAILURE);
- }
-
- }
-
- // did we get an error during this query?
- if (error != null)
- throw error;
-
- return returnValue;
- }
-
- //
- // Copy subprotocol implementation
- //
-
- /**
- * Sends given query to BE to start, initialize and lock connection for a CopyOperation.
- * @param sql COPY FROM STDIN / COPY TO STDOUT statement
- * @return CopyIn or CopyOut operation object
- * @throws SQLException on failure
- */
- public synchronized CopyOperation startCopy(String sql, boolean suppressBegin) throws SQLException {
- waitOnLock();
- if (!suppressBegin) {
- doSubprotocolBegin();
- }
- byte buf[] = Utils.encodeUTF8(sql);
-
- try {
- if (logger.logDebug())
- logger.debug(" FE=> Query(CopyStart)");
-
- pgStream.SendChar('Q');
- pgStream.SendInteger4(buf.length + 4 + 1);
- pgStream.Send(buf);
- pgStream.SendChar(0);
- pgStream.flush();
-
- return processCopyResults(null, true); // expect a CopyInResponse or CopyOutResponse to our query above
- } catch(IOException ioe) {
- throw new PSQLException(GT.tr("Database connection failed when starting copy"), PSQLState.CONNECTION_FAILURE, ioe);
- }
- }
-
- /**
- * Locks connection and calls initializer for a new CopyOperation
- * Called via startCopy -> processCopyResults
- * @param op an unitialized CopyOperation
- * @throws SQLException on locking failure
- * @throws IOException on database connection failure
- */
- private synchronized void initCopy(CopyOperationImpl op) throws SQLException, IOException {
- pgStream.ReceiveInteger4(); // length not used
- int rowFormat = pgStream.ReceiveChar();
- int numFields = pgStream.ReceiveInteger2();
- int[] fieldFormats = new int[numFields];
-
- for(int i=0; i<numFields; i++)
- fieldFormats[i] = pgStream.ReceiveInteger2();
-
- lock(op);
- op.init(this, rowFormat, fieldFormats);
- }
-
- /**
- * Finishes a copy operation and unlocks connection discarding any exchanged data.
- * @param op the copy operation presumably currently holding lock on this connection
- * @throws SQLException on any additional failure
- */
- public void cancelCopy(CopyOperationImpl op) throws SQLException {
- if(!hasLock(op))
- throw new PSQLException(GT.tr("Tried to cancel an inactive copy operation"), PSQLState.OBJECT_NOT_IN_STATE);
-
- SQLException error = null;
- int errors = 0;
-
- try {
- if(op instanceof CopyInImpl) {
- synchronized (this) {
- if (logger.logDebug()) {
- logger.debug("FE => CopyFail");
- }
- final byte[] msg = Utils.encodeUTF8("Copy cancel requested");
- pgStream.SendChar('f'); // CopyFail
- pgStream.SendInteger4(5 + msg.length);
- pgStream.Send(msg);
- pgStream.SendChar(0);
- pgStream.flush();
- do {
- try {
- processCopyResults(op, true); // discard rest of input
- } catch(SQLException se) { // expected error response to failing copy
- errors++;
- if( error != null ) {
- SQLException e = se, next;
- while( (next = e.getNextException()) != null )
- e = next;
- e.setNextException(error);
- }
- error = se;
- }
- } while(hasLock(op));
- }
- } else if (op instanceof CopyOutImpl) {
- protoConnection.sendQueryCancel();
- }
-
- } catch(IOException ioe) {
- throw new PSQLException(GT.tr("Database connection failed when canceling copy operation"), PSQLState.CONNECTION_FAILURE, ioe);
- }
-
- if (op instanceof CopyInImpl) {
- if(errors < 1) {
- throw new PSQLException(GT.tr("Missing expected error response to copy cancel request"), PSQLState.COMMUNICATION_ERROR);
- } else if(errors > 1) {
- throw new PSQLException(GT.tr("Got {0} error responses to single copy cancel request", String.valueOf(errors)), PSQLState.COMMUNICATION_ERROR, error);
- }
- }
- }
-
- /**
- * Finishes writing to copy and unlocks connection
- * @param op the copy operation presumably currently holding lock on this connection
- * @return number of rows updated for server versions 8.2 or newer
- * @throws SQLException on failure
- */
- public synchronized long endCopy(CopyInImpl op) throws SQLException {
- if(!hasLock(op))
- throw new PSQLException(GT.tr("Tried to end inactive copy"), PSQLState.OBJECT_NOT_IN_STATE);
-
- try {
- if (logger.logDebug())
- logger.debug(" FE=> CopyDone");
-
- pgStream.SendChar('c'); // CopyDone
- pgStream.SendInteger4(4);
- pgStream.flush();
-
- processCopyResults(op, true);
- return op.getHandledRowCount();
- } catch(IOException ioe) {
- throw new PSQLException(GT.tr("Database connection failed when ending copy"), PSQLState.CONNECTION_FAILURE, ioe);
- }
- }
-
- /**
- * Sends data during a live COPY IN operation. Only unlocks the connection if server
- * suddenly returns CommandComplete, which should not happen
- * @param op the CopyIn operation presumably currently holding lock on this connection
- * @param data bytes to send
- * @param off index of first byte to send (usually 0)
- * @param siz number of bytes to send (usually data.length)
- * @throws SQLException on failure
- */
- public synchronized void writeToCopy(CopyInImpl op, byte[] data, int off, int siz) throws SQLException {
- if(!hasLock(op))
- throw new PSQLException(GT.tr("Tried to write to an inactive copy operation"), PSQLState.OBJECT_NOT_IN_STATE);
-
- if (logger.logDebug())
- logger.debug(" FE=> CopyData(" + siz + ")");
-
- try {
- pgStream.SendChar('d');
- pgStream.SendInteger4(siz + 4);
- pgStream.Send(data, off, siz);
-
- processCopyResults(op, false); // collect any pending notifications without blocking
- } catch(IOException ioe) {
- throw new PSQLException(GT.tr("Database connection failed when writing to copy"), PSQLState.CONNECTION_FAILURE, ioe);
- }
- }
-
- public synchronized void flushCopy(CopyInImpl op) throws SQLException {
- if(!hasLock(op))
- throw new PSQLException(GT.tr("Tried to write to an inactive copy operation"), PSQLState.OBJECT_NOT_IN_STATE);
-
- try {
- pgStream.flush();
- processCopyResults(op, false); // collect any pending notifications without blocking
- } catch(IOException ioe) {
- throw new PSQLException(GT.tr("Database connection failed when writing to copy"), PSQLState.CONNECTION_FAILURE, ioe);
- }
- }
-
- /**
- * Blocks to wait for a row of data to be received from server on an active copy operation
- * Connection gets unlocked by processCopyResults() at end of operation
- * @param op the copy operation presumably currently holding lock on this connection
- * @throws SQLException on any failure
- */
- synchronized void readFromCopy(CopyOutImpl op) throws SQLException {
- if(!hasLock(op))
- throw new PSQLException(GT.tr("Tried to read from inactive copy"), PSQLState.OBJECT_NOT_IN_STATE);
-
- try {
- processCopyResults(op, true); // expect a call to handleCopydata() to store the data
- } catch(IOException ioe) {
- throw new PSQLException(GT.tr("Database connection failed when reading from copy"), PSQLState.CONNECTION_FAILURE, ioe);
- }
- }
-
- /**
- * Handles copy sub protocol responses from server.
- * Unlocks at end of sub protocol,
- * so operations on pgStream or QueryExecutor are not allowed in a method after calling this!
- * @param block whether to block waiting for input
- * @return
- * CopyIn when COPY FROM STDIN starts;
- * CopyOut when COPY TO STDOUT starts;
- * null when copy ends;
- * otherwise, the operation given as parameter.
- * @throws SQLException in case of misuse
- * @throws IOException from the underlying connection
- */
- CopyOperationImpl processCopyResults(CopyOperationImpl op, boolean block) throws SQLException, IOException {
-
- boolean endReceiving = false;
- SQLException error = null, errors = null;
- int len;
-
- while( !endReceiving && (block || pgStream.hasMessagePending()) ) {
-
- // There is a bug in the server's implementation of the copy
- // protocol. It returns command complete immediately upon
- // receiving the EOF marker in the binary protocol,
- // potentially before we've issued CopyDone. When we are not
- // blocking, we don't think we are done, so we hold off on
- // processing command complete and any subsequent messages
- // until we actually are done with the copy.
- //
- if (!block) {
- int c = pgStream.PeekChar();
- if (c == 'C') // CommandComplete
- {
- if (logger.logDebug())
- logger.debug(" <=BE CommandStatus, Ignored until CopyDone");
- break;
- }
- }
-
- int c = pgStream.ReceiveChar();
- switch(c) {
-
- case 'A': // Asynchronous Notify
-
- if (logger.logDebug())
- logger.debug(" <=BE Asynchronous Notification while copying");
-
- receiveAsyncNotify();
- break;
-
- case 'N': // Notice Response
-
- if (logger.logDebug())
- logger.debug(" <=BE Notification while copying");
-
- protoConnection.addWarning(receiveNoticeResponse());
- break;
-
- case 'C': // Command Complete
-
- String status = receiveCommandStatus();
-
- try {
- if(op == null)
- throw new PSQLException(GT.tr("Received CommandComplete ''{0}'' without an active copy operation", status), PSQLState.OBJECT_NOT_IN_STATE);
- op.handleCommandStatus(status);
- } catch(SQLException se) {
- error = se;
- }
-
- block = true;
- break;
-
- case 'E': // ErrorMessage (expected response to CopyFail)
-
- error = receiveErrorResponse();
- // We've received the error and we now expect to receive
- // Ready for query, but we must block because it might still be
- // on the wire and not here yet.
- block = true;
- break;
-
- case 'G': // CopyInResponse
-
- if (logger.logDebug())
- logger.debug(" <=BE CopyInResponse");
-
- if(op != null)
- error = new PSQLException(GT.tr("Got CopyInResponse from server during an active {0}", op.getClass().getName()), PSQLState.OBJECT_NOT_IN_STATE);
-
- op = new CopyInImpl();
- initCopy(op);
- endReceiving = true;
- break;
-
- case 'H': // CopyOutResponse
-
- if (logger.logDebug())
- logger.debug(" <=BE CopyOutResponse");
-
- if(op != null)
- error = new PSQLException(GT.tr("Got CopyOutResponse from server during an active {0}", op.getClass().getName()), PSQLState.OBJECT_NOT_IN_STATE);
-
- op = new CopyOutImpl();
- initCopy(op);
- endReceiving = true;
- break;
-
- case 'd': // CopyData
-
- if (logger.logDebug())
- logger.debug(" <=BE CopyData");
-
- len = pgStream.ReceiveInteger4() - 4;
- byte[] buf = pgStream.Receive(len);
- if(op == null) {
- error = new PSQLException(GT.tr("Got CopyData without an active copy operation"), PSQLState.OBJECT_NOT_IN_STATE);
- } else if (!(op instanceof CopyOutImpl)) {
- error = new PSQLException(GT.tr("Unexpected copydata from server for {0}",
- op.getClass().getName()), PSQLState.COMMUNICATION_ERROR);
- } else {
- ((CopyOutImpl)op).handleCopydata(buf);
- }
- endReceiving = true;
- break;
-
- case 'c': // CopyDone (expected after all copydata received)
-
- if (logger.logDebug())
- logger.debug(" <=BE CopyDone");
-
- len = pgStream.ReceiveInteger4() - 4;
- if(len > 0)
- pgStream.Receive(len); // not in specification; should never appear
-
- if(!(op instanceof CopyOutImpl))
- error = new PSQLException("Got CopyDone while not copying from server", PSQLState.OBJECT_NOT_IN_STATE);
-
- // keep receiving since we expect a CommandComplete
- block = true;
- break;
-
- case 'Z': // ReadyForQuery: After FE:CopyDone => BE:CommandComplete
-
- receiveRFQ();
- if(hasLock(op))
- unlock(op);
- op = null;
- endReceiving = true;
- break;
-
- // If the user sends a non-copy query, we've got to handle some additional things.
- //
- case 'T': // Row Description (response to Describe)
- if (logger.logDebug())
- logger.debug(" <=BE RowDescription (during copy ignored)");
-
-
- skipMessage();
- break;
-
- case 'D': // DataRow
- if (logger.logDebug())
- logger.debug(" <=BE DataRow (during copy ignored)");
-
- skipMessage();
- break;
-
- default:
- throw new IOException(GT.tr("Unexpected packet type during copy: {0}", Integer.toString(c)));
- }
-
- // Collect errors into a neat chain for completeness
- if(error != null) {
- if(errors != null)
- error.setNextException(errors);
- errors = error;
- error = null;
- }
- }
-
- if(errors != null)
- throw errors;
-
- return op;
- }
-
- /*
- * Send a query to the backend.
- */
- private void sendQuery(V3Query query, V3ParameterList parameters, int maxRows, int fetchSize, int flags, ErrorTrackingResultHandler trackingHandler) throws IOException, SQLException {
- // Now the query itself.
- SimpleQuery[] subqueries = query.getSubqueries();
- SimpleParameterList[] subparams = parameters.getSubparams();
- boolean disallowBatching = (flags & QueryExecutor.QUERY_DISALLOW_BATCHING) != 0;
-
- if (subqueries == null)
- {
- ++queryCount;
- if (disallowBatching || queryCount >= MAX_BUFFERED_QUERIES)
- {
- sendSync();
- processResults(trackingHandler, flags);
-
- queryCount = 0;
- }
-
- // If we saw errors, don't send anything more.
- if (!trackingHandler.hasErrors())
- sendOneQuery((SimpleQuery)query, (SimpleParameterList)parameters, maxRows, fetchSize, flags);
- }
- else
- {
- for (int i = 0; i < subqueries.length; ++i)
- {
- ++queryCount;
- if (disallowBatching || queryCount >= MAX_BUFFERED_QUERIES)
- {
- sendSync();
- processResults(trackingHandler, flags);
-
- // If we saw errors, don't send anything more.
- if (trackingHandler.hasErrors())
- break;
-
- queryCount = 0;
- }
-
- // In the situation where parameters is already
- // NO_PARAMETERS it cannot know the correct
- // number of array elements to return in the
- // above call to getSubparams(), so it must
- // return null which we check for here.
- //
- SimpleParameterList subparam = SimpleQuery.NO_PARAMETERS;
- if (subparams != null)
- {
- subparam = subparams[i];
- }
- sendOneQuery(subqueries[i], subparam, maxRows, fetchSize, flags);
- }
- }
- }
-
- //
- // Message sending
- //
-
- private void sendSync() throws IOException {
- if (logger.logDebug())
- logger.debug(" FE=> Sync");
-
- pgStream.SendChar('S'); // Sync
- pgStream.SendInteger4(4); // Length
- pgStream.flush();
- }
-
- private void sendParse(SimpleQuery query, SimpleParameterList params, boolean oneShot) throws IOException {
- // Already parsed, or we have a Parse pending and the types are right?
- int[] typeOIDs = params.getTypeOIDs();
- if (query.isPreparedFor(typeOIDs))
- return;
-
- // Clean up any existing statement, as we can't use it.
- query.unprepare();
- processDeadParsedQueries();
-
- // Remove any cached Field values
- query.setFields(null);
-
- String statementName = null;
- if (!oneShot)
- {
- // Generate a statement name to use.
- statementName = "S_" + (nextUniqueID++);
-
- // And prepare the new statement.
- // NB: Must clone the OID array, as it's a direct reference to
- // the SimpleParameterList's internal array that might be modified
- // under us.
- query.setStatementName(statementName);
- query.setStatementTypes((int[])typeOIDs.clone());
- }
-
- byte[] encodedStatementName = query.getEncodedStatementName();
- String[] fragments = query.getFragments();
-
- if (logger.logDebug())
- {
- StringBuffer sbuf = new StringBuffer(" FE=> Parse(stmt=" + statementName + ",query=\"");
- for (int i = 0; i < fragments.length; ++i)
- {
- if (i > 0)
- sbuf.append("$" + i);
- sbuf.append(fragments[i]);
- }
- sbuf.append("\",oids={");
- for (int i = 1; i <= params.getParameterCount(); ++i)
- {
- if (i != 1)
- sbuf.append(",");
- sbuf.append("" + params.getTypeOID(i));
- }
- sbuf.append("})");
- logger.debug(sbuf.toString());
- }
-
- //
- // Send Parse.
- //
-
- byte[][] parts = new byte[fragments.length * 2 - 1][];
- int j = 0;
- int encodedSize = 0;
-
- // Total size = 4 (size field)
- // + N + 1 (statement name, zero-terminated)
- // + N + 1 (query, zero terminated)
- // + 2 (parameter count) + N * 4 (parameter types)
- // original query: "frag0 ? frag1 ? frag2"
- // fragments: { "frag0", "frag1", "frag2" }
- // output: "frag0 $1 frag1 $2 frag2"
- for (int i = 0; i < fragments.length; ++i)
- {
- if (i != 0)
- {
- parts[j] = Utils.encodeUTF8("$" + i);
- encodedSize += parts[j].length;
- ++j;
- }
-
- parts[j] = Utils.encodeUTF8(fragments[i]);
- encodedSize += parts[j].length;
- ++j;
- }
-
- encodedSize = 4
- + (encodedStatementName == null ? 0 : encodedStatementName.length) + 1
- + encodedSize + 1
- + 2 + 4 * params.getParameterCount();
-
- pgStream.SendChar('P'); // Parse
- pgStream.SendInteger4(encodedSize);
- if (encodedStatementName != null)
- pgStream.Send(encodedStatementName);
- pgStream.SendChar(0); // End of statement name
- for (int i = 0; i < parts.length; ++i)
- { // Query string
- pgStream.Send(parts[i]);
- }
- pgStream.SendChar(0); // End of query string.
- pgStream.SendInteger2(params.getParameterCount()); // # of parameter types specified
- for (int i = 1; i <= params.getParameterCount(); ++i)
- pgStream.SendInteger4(params.getTypeOID(i));
-
- pendingParseQueue.add(new Object[]{query, query.getStatementName()});
- }
-
- private void sendBind(SimpleQuery query, SimpleParameterList params,
- Portal portal, boolean noBinaryTransfer) throws IOException {
- //
- // Send Bind.
- //
-
- String statementName = query.getStatementName();
- byte[] encodedStatementName = query.getEncodedStatementName();
- byte[] encodedPortalName = (portal == null ? null : portal.getEncodedPortalName());
-
- if (logger.logDebug())
- {
- StringBuffer sbuf = new StringBuffer(" FE=> Bind(stmt=" + statementName + ",portal=" + portal);
- for (int i = 1; i <= params.getParameterCount(); ++i)
- {
- sbuf.append(",$" + i + "=<" + params.toString(i) + ">");
- }
- sbuf.append(")");
- logger.debug(sbuf.toString());
- }
-
- // Total size = 4 (size field) + N + 1 (destination portal)
- // + N + 1 (statement name)
- // + 2 (param format code count) + N * 2 (format codes)
- // + 2 (param value count) + N (encoded param value size)
- // + 2 (result format code count, 0)
- long encodedSize = 0;
- for (int i = 1; i <= params.getParameterCount(); ++i)
- {
- if (params.isNull(i))
- encodedSize += 4;
- else
- encodedSize += (long)4 + params.getV3Length(i);
- }
-
- // This is not the number of binary fields, but the total number
- // of fields if any of them are binary or zero if all of them
- // are text.
-
- int numBinaryFields = 0;
- Field[] fields = query.getFields();
- if (!noBinaryTransfer && fields != null) {
- for (int i = 0; i < fields.length; ++i) {
- if (useBinary(fields[i])) {
- fields[i].setFormat(Field.BINARY_FORMAT);
- numBinaryFields = fields.length;
- }
- }
- }
-
- encodedSize = 4
- + (encodedPortalName == null ? 0 : encodedPortalName.length) + 1
- + (encodedStatementName == null ? 0 : encodedStatementName.length) + 1
- + 2 + params.getParameterCount() * 2
- + 2 + encodedSize
- + 2 + numBinaryFields * 2;
-
- // backend's MaxAllocSize is the largest message that can
- // be received from a client. If we have a bigger value
- // from either very large parameters or incorrent length
- // descriptions of setXXXStream we do not send the bind
- // messsage.
- //
- if (encodedSize > 0x3fffffff)
- {
- throw new PGBindException(new IOException(GT.tr("Bind message length {0} too long. This can be caused by very large or incorrect length specifications on InputStream parameters.", new Long(encodedSize))));
- }
-
- pgStream.SendChar('B'); // Bind
- pgStream.SendInteger4((int)encodedSize); // Message size
- if (encodedPortalName != null)
- pgStream.Send(encodedPortalName); // Destination portal name.
- pgStream.SendChar(0); // End of portal name.
- if (encodedStatementName != null)
- pgStream.Send(encodedStatementName); // Source statement name.
- pgStream.SendChar(0); // End of statement name.
-
- pgStream.SendInteger2(params.getParameterCount()); // # of parameter format codes
- for (int i = 1; i <= params.getParameterCount(); ++i)
- pgStream.SendInteger2(params.isBinary(i) ? 1 : 0); // Parameter format code
-
- pgStream.SendInteger2(params.getParameterCount()); // # of parameter values
-
- // If an error occurs when reading a stream we have to
- // continue pumping out data to match the length we
- // said we would. Once we've done that we throw
- // this exception. Multiple exceptions can occur and
- // it really doesn't matter which one is reported back
- // to the caller.
- //
- PGBindException bindException = null;
-
- for (int i = 1; i <= params.getParameterCount(); ++i)
- {
- if (params.isNull(i))
- pgStream.SendInteger4( -1); // Magic size of -1 means NULL
- else
- {
- pgStream.SendInteger4(params.getV3Length(i)); // Parameter size
- try
- {
- params.writeV3Value(i, pgStream); // Parameter value
- }
- catch (PGBindException be)
- {
- bindException = be;
- }
- }
- }
-
- pgStream.SendInteger2(numBinaryFields); // # of result format codes
- for (int i = 0; i < numBinaryFields; ++i) {
- pgStream.SendInteger2(fields[i].getFormat());
- }
-
- pendingBindQueue.add(portal);
-
- if (bindException != null)
- {
- throw bindException;
- }
- }
-
- /**
- * Returns true if the specified field should be retrieved using binary
- * encoding.
- *
- * @param field The field whose Oid type to analyse.
- * @return True if {@link Field#BINARY_FORMAT} should be used, false if
- * {@link Field#BINARY_FORMAT}.
- */
- private boolean useBinary(Field field) {
- int oid = field.getOID();
- return protoConnection.useBinaryForReceive(oid);
- }
-
- private void sendDescribePortal(SimpleQuery query, Portal portal) throws IOException {
- //
- // Send Describe.
- //
-
- if (logger.logDebug())
- {
- logger.debug(" FE=> Describe(portal=" + portal + ")");
- }
-
- byte[] encodedPortalName = (portal == null ? null : portal.getEncodedPortalName());
-
- // Total size = 4 (size field) + 1 (describe type, 'P') + N + 1 (portal name)
- int encodedSize = 4 + 1 + (encodedPortalName == null ? 0 : encodedPortalName.length) + 1;
-
- pgStream.SendChar('D'); // Describe
- pgStream.SendInteger4(encodedSize); // message size
- pgStream.SendChar('P'); // Describe (Portal)
- if (encodedPortalName != null)
- pgStream.Send(encodedPortalName); // portal name to close
- pgStream.SendChar(0); // end of portal name
-
- pendingDescribePortalQueue.add(query);
- query.setPortalDescribed(true);
- }
-
- private void sendDescribeStatement(SimpleQuery query, SimpleParameterList params, boolean describeOnly) throws IOException {
- // Send Statement Describe
-
- if (logger.logDebug())
- {
- logger.debug(" FE=> Describe(statement=" + query.getStatementName()+")");
- }
-
- byte[] encodedStatementName = query.getEncodedStatementName();
-
- // Total size = 4 (size field) + 1 (describe type, 'S') + N + 1 (portal name)
- int encodedSize = 4 + 1 + (encodedStatementName == null ? 0 : encodedStatementName.length) + 1;
-
- pgStream.SendChar('D'); // Describe
- pgStream.SendInteger4(encodedSize); // Message size
- pgStream.SendChar('S'); // Describe (Statement);
- if (encodedStatementName != null)
- pgStream.Send(encodedStatementName); // Statement name
- pgStream.SendChar(0); // end message
-
- pendingDescribeStatementQueue.add(new Object[]{query, params, new Boolean(describeOnly), query.getStatementName()});
- pendingDescribePortalQueue.add(query);
- query.setStatementDescribed(true);
- query.setPortalDescribed(true);
- }
-
- private void sendExecute(SimpleQuery query, Portal portal, int limit) throws IOException {
- //
- // Send Execute.
- //
-
- if (logger.logDebug())
- {
- logger.debug(" FE=> Execute(portal=" + portal + ",limit=" + limit + ")");
- }
-
- byte[] encodedPortalName = (portal == null ? null : portal.getEncodedPortalName());
- int encodedSize = (encodedPortalName == null ? 0 : encodedPortalName.length);
-
- // Total size = 4 (size field) + 1 + N (source portal) + 4 (max rows)
- pgStream.SendChar('E'); // Execute
- pgStream.SendInteger4(4 + 1 + encodedSize + 4); // message size
- if (encodedPortalName != null)
- pgStream.Send(encodedPortalName); // portal name
- pgStream.SendChar(0); // portal name terminator
- pgStream.SendInteger4(limit); // row limit
-
- pendingExecuteQueue.add(new Object[] { query, portal });
- }
-
- private void sendClosePortal(String portalName) throws IOException {
- //
- // Send Close.
- //
-
- if (logger.logDebug())
- {
- logger.debug(" FE=> ClosePortal(" + portalName + ")");
- }
-
- byte[] encodedPortalName = (portalName == null ? null : Utils.encodeUTF8(portalName));
- int encodedSize = (encodedPortalName == null ? 0 : encodedPortalName.length);
-
- // Total size = 4 (size field) + 1 (close type, 'P') + 1 + N (portal name)
- pgStream.SendChar('C'); // Close
- pgStream.SendInteger4(4 + 1 + 1 + encodedSize); // message size
- pgStream.SendChar('P'); // Close (Portal)
- if (encodedPortalName != null)
- pgStream.Send(encodedPortalName);
- pgStream.SendChar(0); // unnamed portal
- }
-
- private void sendCloseStatement(String statementName) throws IOException {
- //
- // Send Close.
- //
-
- if (logger.logDebug())
- {
- logger.debug(" FE=> CloseStatement(" + statementName + ")");
- }
-
- byte[] encodedStatementName = Utils.encodeUTF8(statementName);
-
- // Total size = 4 (size field) + 1 (close type, 'S') + N + 1 (statement name)
- pgStream.SendChar('C'); // Close
- pgStream.SendInteger4(4 + 1 + encodedStatementName.length + 1); // message size
- pgStream.SendChar('S'); // Close (Statement)
- pgStream.Send(encodedStatementName); // statement to close
- pgStream.SendChar(0); // statement name terminator
- }
-
- // sendOneQuery sends a single statement via the extended query protocol.
- // Per the FE/BE docs this is essentially the same as how a simple query runs
- // (except that it generates some extra acknowledgement messages, and we
- // can send several queries before doing the Sync)
- //
- // Parse S_n from "query string with parameter placeholders"; skipped if already done previously or if oneshot
- // Bind C_n from S_n plus parameters (or from unnamed statement for oneshot queries)
- // Describe C_n; skipped if caller doesn't want metadata
- // Execute C_n with maxRows limit; maxRows = 1 if caller doesn't want results
- // (above repeats once per call to sendOneQuery)
- // Sync (sent by caller)
- //
- private void sendOneQuery(SimpleQuery query, SimpleParameterList params, int maxRows, int fetchSize, int flags) throws IOException {
- // nb: if we decide to use a portal (usePortal == true) we must also use a named statement
- // (oneShot == false) as otherwise the portal will be closed under us unexpectedly when
- // the unnamed statement is next reused.
-
- boolean noResults = (flags & QueryExecutor.QUERY_NO_RESULTS) != 0;
- boolean noMeta = (flags & QueryExecutor.QUERY_NO_METADATA) != 0;
- boolean describeOnly = (flags & QueryExecutor.QUERY_DESCRIBE_ONLY) != 0;
- boolean usePortal = (flags & QueryExecutor.QUERY_FORWARD_CURSOR) != 0 && !noResults && !noMeta && fetchSize > 0 && !describeOnly;
- boolean oneShot = (flags & QueryExecutor.QUERY_ONESHOT) != 0 && !usePortal;
- boolean noBinaryTransfer = (flags & QUERY_NO_BINARY_TRANSFER) != 0;
-
- // Work out how many rows to fetch in this pass.
-
- int rows;
- if (noResults)
- {
- rows = 1; // We're discarding any results anyway, so limit data transfer to a minimum
- }
- else if (!usePortal)
- {
- rows = maxRows; // Not using a portal -- fetchSize is irrelevant
- }
- else if (maxRows != 0 && fetchSize > maxRows)
- {
- rows = maxRows; // fetchSize > maxRows, use maxRows (nb: fetchSize cannot be 0 if usePortal == true)
- }
- else
- {
- rows = fetchSize; // maxRows > fetchSize
- }
-
- sendParse(query, params, oneShot);
-
- // Must do this after sendParse to pick up any changes to the
- // query's state.
- //
- boolean queryHasUnknown = query.hasUnresolvedTypes();
- boolean paramsHasUnknown = params.hasUnresolvedTypes();
-
- boolean describeStatement = describeOnly || (!oneShot && paramsHasUnknown && queryHasUnknown && !query.isStatementDescribed());
-
- if (!describeStatement && paramsHasUnknown && !queryHasUnknown)
- {
- int queryOIDs[] = query.getStatementTypes();
- int paramOIDs[] = params.getTypeOIDs();
- for (int i=0; i<paramOIDs.length; i++) {
- // Only supply type information when there isn't any
- // already, don't arbitrarily overwrite user supplied
- // type information.
- if (paramOIDs[i] == Oid.UNSPECIFIED) {
- params.setResolvedType(i+1, queryOIDs[i]);
- }
- }
- }
-
- if (describeStatement) {
- sendDescribeStatement(query, params, describeOnly);
- if (describeOnly)
- return;
- }
-
- // Construct a new portal if needed.
- Portal portal = null;
- if (usePortal)
- {
- String portalName = "C_" + (nextUniqueID++);
- portal = new Portal(query, portalName);
- }
-
- sendBind(query, params, portal, noBinaryTransfer);
-
- // A statement describe will also output a RowDescription,
- // so don't reissue it here if we've already done so.
- //
- if (!noMeta && !describeStatement) {
- // don't send describe if we already have cached the
- // descriptionrow from previous executions
- if (query.getFields() == null) {
- sendDescribePortal(query, portal);
- }
- }
-
- sendExecute(query, portal, rows);
- }
-
- //
- // Garbage collection of parsed statements.
- //
- // When a statement is successfully parsed, registerParsedQuery is called.
- // This creates a PhantomReference referring to the "owner" of the statement
- // (the originating Query object) and inserts that reference as a key in
- // parsedQueryMap. The values of parsedQueryMap are the corresponding allocated
- // statement names. The originating Query object also holds a reference to the
- // PhantomReference.
- //
- // When the owning Query object is closed, it enqueues and clears the associated
- // PhantomReference.
- //
- // If the owning Query object becomes unreachable (see java.lang.ref javadoc) before
- // being closed, the corresponding PhantomReference is enqueued on
- // parsedQueryCleanupQueue. In the Sun JVM, phantom references are only enqueued
- // when a GC occurs, so this is not necessarily prompt but should eventually happen.
- //
- // Periodically (currently, just before query execution), the parsedQueryCleanupQueue
- // is polled. For each enqueued PhantomReference we find, we remove the corresponding
- // entry from parsedQueryMap, obtaining the name of the underlying statement in the
- // process. Then we send a message to the backend to deallocate that statement.
- //
-
- private final HashMap parsedQueryMap = new HashMap();
- private final ReferenceQueue parsedQueryCleanupQueue = new ReferenceQueue();
-
- private void registerParsedQuery(SimpleQuery query, String statementName) {
- if (statementName == null)
- return ;
-
- PhantomReference cleanupRef = new PhantomReference(query, parsedQueryCleanupQueue);
- parsedQueryMap.put(cleanupRef, statementName);
- query.setCleanupRef(cleanupRef);
- }
-
- private void processDeadParsedQueries() throws IOException {
- PhantomReference deadQuery;
- while ((deadQuery = (PhantomReference)parsedQueryCleanupQueue.poll()) != null)
- {
- String statementName = (String)parsedQueryMap.remove(deadQuery);
- sendCloseStatement(statementName);
- deadQuery.clear();
- }
- }
-
- //
- // Essentially the same strategy is used for the cleanup of portals.
- // Note that each Portal holds a reference to the corresponding Query
- // that generated it, so the Query won't be collected (and the statement
- // closed) until all the Portals are, too. This is required by the mechanics
- // of the backend protocol: when a statement is closed, all dependent portals
- // are also closed.
- //
-
- private final HashMap openPortalMap = new HashMap();
- private final ReferenceQueue openPortalCleanupQueue = new ReferenceQueue();
-
- private void registerOpenPortal(Portal portal) {
- if (portal == null)
- return ; // Using the unnamed portal.
-
- String portalName = portal.getPortalName();
- PhantomReference cleanupRef = new PhantomReference(portal, openPortalCleanupQueue);
- openPortalMap.put(cleanupRef, portalName);
- portal.setCleanupRef(cleanupRef);
- }
-
- private void processDeadPortals() throws IOException {
- PhantomReference deadPortal;
- while ((deadPortal = (PhantomReference)openPortalCleanupQueue.poll()) != null)
- {
- String portalName = (String)openPortalMap.remove(deadPortal);
- sendClosePortal(portalName);
- deadPortal.clear();
- }
- }
-
- protected void processResults(ResultHandler handler, int flags) throws IOException {
- boolean noResults = (flags & QueryExecutor.QUERY_NO_RESULTS) != 0;
- boolean bothRowsAndStatus = (flags & QueryExecutor.QUERY_BOTH_ROWS_AND_STATUS) != 0;
-
- List tuples = null;
-
- int len;
- int c;
- boolean endQuery = false;
-
- // At the end of a command execution we have the CommandComplete
- // message to tell us we're done, but with a describeOnly command
- // we have no real flag to let us know we're done. We've got to
- // look for the next RowDescription or NoData message and return
- // from there.
- boolean doneAfterRowDescNoData = false;
-
- int parseIndex = 0;
- int describeIndex = 0;
- int describePortalIndex = 0;
- int bindIndex = 0;
- int executeIndex = 0;
-
- while (!endQuery)
- {
- c = pgStream.ReceiveChar();
- switch (c)
- {
- case 'A': // Asynchronous Notify
- receiveAsyncNotify();
- break;
-
- case '1': // Parse Complete (response to Parse)
- pgStream.ReceiveInteger4(); // len, discarded
-
- Object[] parsedQueryAndStatement = (Object[])pendingParseQueue.get(parseIndex++);
-
- SimpleQuery parsedQuery = (SimpleQuery)parsedQueryAndStatement[0];
- String parsedStatementName = (String)parsedQueryAndStatement[1];
-
- if (logger.logDebug())
- logger.debug(" <=BE ParseComplete [" + parsedStatementName + "]");
-
- registerParsedQuery(parsedQuery, parsedStatementName);
- break;
-
- case 't': // ParameterDescription
- pgStream.ReceiveInteger4(); // len, discarded
-
- if (logger.logDebug())
- logger.debug(" <=BE ParameterDescription");
-
- {
- Object describeData[] = (Object[])pendingDescribeStatementQueue.get(describeIndex);
- SimpleQuery query = (SimpleQuery)describeData[0];
- SimpleParameterList params = (SimpleParameterList)describeData[1];
- boolean describeOnly = ((Boolean)describeData[2]).booleanValue();
- String origStatementName = (String)describeData[3];
-
- int numParams = pgStream.ReceiveInteger2();
-
- for (int i=1; i<=numParams; i++) {
- int typeOid = pgStream.ReceiveInteger4();
- params.setResolvedType(i, typeOid);
- }
-
- // Since we can issue multiple Parse and DescribeStatement
- // messages in a single network trip, we need to make
- // sure the describe results we requested are still
- // applicable to the latest parsed query.
- //
- if ((origStatementName == null && query.getStatementName() == null) || (origStatementName != null && origStatementName.equals(query.getStatementName()))) {
- query.setStatementTypes((int[])params.getTypeOIDs().clone());
- }
-
- if (describeOnly)
- doneAfterRowDescNoData = true;
- else
- describeIndex++;
- }
- break;
-
- case '2': // Bind Complete (response to Bind)
- pgStream.ReceiveInteger4(); // len, discarded
-
- Portal boundPortal = (Portal)pendingBindQueue.get(bindIndex++);
- if (logger.logDebug())
- logger.debug(" <=BE BindComplete [" + boundPortal + "]");
-
- registerOpenPortal(boundPortal);
- break;
-
- case '3': // Close Complete (response to Close)
- pgStream.ReceiveInteger4(); // len, discarded
- if (logger.logDebug())
- logger.debug(" <=BE CloseComplete");
- break;
-
- case 'n': // No Data (response to Describe)
- pgStream.ReceiveInteger4(); // len, discarded
- if (logger.logDebug())
- logger.debug(" <=BE NoData");
-
- describePortalIndex++;
-
- if (doneAfterRowDescNoData) {
- Object describeData[] = (Object[])pendingDescribeStatementQueue.get(describeIndex++);
- SimpleQuery currentQuery = (SimpleQuery)describeData[0];
-
- Field[] fields = currentQuery.getFields();
-
- if (fields != null)
- { // There was a resultset.
- tuples = new ArrayList();
- handler.handleResultRows(currentQuery, fields, tuples, null);
- tuples = null;
- }
- }
- break;
-
- case 's': // Portal Suspended (end of Execute)
- // nb: this appears *instead* of CommandStatus.
- // Must be a SELECT if we suspended, so don't worry about it.
-
- pgStream.ReceiveInteger4(); // len, discarded
- if (logger.logDebug())
- logger.debug(" <=BE PortalSuspended");
-
- {
- Object[] executeData = (Object[])pendingExecuteQueue.get(executeIndex++);
- SimpleQuery currentQuery = (SimpleQuery)executeData[0];
- Portal currentPortal = (Portal)executeData[1];
-
- Field[] fields = currentQuery.getFields();
- if (fields != null && !noResults && tuples == null)
- tuples = new ArrayList();
-
- handler.handleResultRows(currentQuery, fields, tuples, currentPortal);
- }
-
- tuples = null;
- break;
-
- case 'C': // Command Status (end of Execute)
- // Handle status.
- String status = receiveCommandStatus();
-
- doneAfterRowDescNoData = false;
-
- {
- Object[] executeData = (Object[])pendingExecuteQueue.get(executeIndex++);
- SimpleQuery currentQuery = (SimpleQuery)executeData[0];
- Portal currentPortal = (Portal)executeData[1];
-
- Field[] fields = currentQuery.getFields();
- if (fields != null && !noResults && tuples == null)
- tuples = new ArrayList();
-
- if (fields != null || tuples != null)
- { // There was a resultset.
- handler.handleResultRows(currentQuery, fields, tuples, null);
- tuples = null;
-
- if (bothRowsAndStatus)
- interpretCommandStatus(status, handler);
- }
- else
- {
- interpretCommandStatus(status, handler);
- }
-
- if (currentPortal != null)
- currentPortal.close();
- }
- break;
-
- case 'D': // Data Transfer (ongoing Execute response)
- byte[][] tuple = null;
- try {
- tuple = pgStream.ReceiveTupleV3();
- } catch(OutOfMemoryError oome) {
- if (!noResults) {
- handler.handleError(new PSQLException(GT.tr("Ran out of memory retrieving query results."), PSQLState.OUT_OF_MEMORY, oome));
- }
- }
-
-
- if (!noResults)
- {
- if (tuples == null)
- tuples = new ArrayList();
- tuples.add(tuple);
- }
-
- if (logger.logDebug()) {
- int length;
- if (tuple == null) {
- length = -1;
- } else {
- length = 0;
- for (int i=0; i< tuple.length; ++i) {
- if (tuple[i] == null) continue;
- length += tuple[i].length;
- }
- }
- logger.debug(" <=BE DataRow(len=" + length + ")");
- }
-
- break;
-
- case 'E': // Error Response (response to pretty much everything; backend then skips until Sync)
- SQLException error = receiveErrorResponse();
- handler.handleError(error);
-
- // keep processing
- break;
-
- case 'I': // Empty Query (end of Execute)
- pgStream.ReceiveInteger4();
-
- if (logger.logDebug())
- logger.debug(" <=BE EmptyQuery");
-
- {
- Object[] executeData = (Object[])pendingExecuteQueue.get(executeIndex++);
- Query currentQuery = (Query)executeData[0];
- Portal currentPortal = (Portal)executeData[1];
- handler.handleCommandStatus("EMPTY", 0, 0);
- if (currentPortal != null)
- currentPortal.close();
- }
-
- break;
-
- case 'N': // Notice Response
- SQLWarning warning = receiveNoticeResponse();
- handler.handleWarning(warning);
- break;
-
- case 'S': // Parameter Status
- {
- int l_len = pgStream.ReceiveInteger4();
- String name = pgStream.ReceiveString();
- String value = pgStream.ReceiveString();
- if (logger.logDebug())
- logger.debug(" <=BE ParameterStatus(" + name + " = " + value + ")");
-
- if (name.equals("client_encoding") && !value.equalsIgnoreCase("UTF8") && !allowEncodingChanges)
- {
- protoConnection.close(); // we're screwed now; we can't trust any subsequent string.
- handler.handleError(new PSQLException(GT.tr("The server''s client_encoding parameter was changed to {0}. The JDBC driver requires client_encoding to be UTF8 for correct operation.", value), PSQLState.CONNECTION_FAILURE));
- endQuery = true;
- }
-
- if (name.equals("DateStyle") && !value.startsWith("ISO,"))
- {
- protoConnection.close(); // we're screwed now; we can't trust any subsequent date.
- handler.handleError(new PSQLException(GT.tr("The server''s DateStyle parameter was changed to {0}. The JDBC driver requires DateStyle to begin with ISO for correct operation.", value), PSQLState.CONNECTION_FAILURE));
- endQuery = true;
- }
-
- if (name.equals("standard_conforming_strings"))
- {
- if (value.equals("on"))
- protoConnection.setStandardConformingStrings(true);
- else if (value.equals("off"))
- protoConnection.setStandardConformingStrings(false);
- else
- {
- protoConnection.close(); // we're screwed now; we don't know how to escape string literals
- handler.handleError(new PSQLException(GT.tr("The server''s standard_conforming_strings parameter was reported as {0}. The JDBC driver expected on or off.", value), PSQLState.CONNECTION_FAILURE));
- endQuery = true;
- }
- }
- }
- break;
-
- case 'T': // Row Description (response to Describe)
- Field[] fields = receiveFields();
- tuples = new ArrayList();
-
- SimpleQuery query = (SimpleQuery)pendingDescribePortalQueue.get(describePortalIndex++);
- query.setFields(fields);
-
- if (doneAfterRowDescNoData) {
- Object describeData[] = (Object[])pendingDescribeStatementQueue.get(describeIndex++);
- SimpleQuery currentQuery = (SimpleQuery)describeData[0];
- currentQuery.setFields(fields);
-
- handler.handleResultRows(currentQuery, fields, tuples, null);
- tuples = null;
- }
- break;
-
- case 'Z': // Ready For Query (eventual response to Sync)
- receiveRFQ();
- endQuery = true;
-
- // Reset the statement name of Parses that failed.
- while (parseIndex < pendingParseQueue.size())
- {
- Object[] failedQueryAndStatement = (Object[])pendingParseQueue.get(parseIndex++);
- SimpleQuery failedQuery = (SimpleQuery)failedQueryAndStatement[0];
- failedQuery.unprepare();
- }
-
- pendingParseQueue.clear(); // No more ParseComplete messages expected.
- pendingDescribeStatementQueue.clear(); // No more ParameterDescription messages expected.
- pendingDescribePortalQueue.clear(); // No more RowDescription messages expected.
- pendingBindQueue.clear(); // No more BindComplete messages expected.
- pendingExecuteQueue.clear(); // No more query executions expected.
- break;
-
- case 'G': // CopyInResponse
- if (logger.logDebug()) {
- logger.debug(" <=BE CopyInResponse");
- logger.debug(" FE=> CopyFail");
- }
-
- // COPY sub-protocol is not implemented yet
- // We'll send a CopyFail message for COPY FROM STDIN so that
- // server does not wait for the data.
-
- byte[] buf = Utils.encodeUTF8("The JDBC driver currently does not support COPY operations.");
- pgStream.SendChar('f');
- pgStream.SendInteger4(buf.length + 4 + 1);
- pgStream.Send(buf);
- pgStream.SendChar(0);
- pgStream.flush();
- sendSync(); // send sync message
- skipMessage(); // skip the response message
- break;
-
- case 'H': // CopyOutResponse
- if (logger.logDebug())
- logger.debug(" <=BE CopyOutResponse");
-
- skipMessage();
- // In case of CopyOutResponse, we cannot abort data transfer,
- // so just throw an error and ignore CopyData messages
- handler.handleError(new PSQLException(GT.tr("The driver currently does not support COPY operations."), PSQLState.NOT_IMPLEMENTED));
- break;
-
- case 'c': // CopyDone
- skipMessage();
- if (logger.logDebug()) {
- logger.debug(" <=BE CopyDone");
- }
- break;
-
- case 'd': // CopyData
- skipMessage();
- if (logger.logDebug()) {
- logger.debug(" <=BE CopyData");
- }
- break;
-
- default:
- throw new IOException("Unexpected packet type: " + c);
- }
-
- }
- }
-
- /**
- * Ignore the response message by reading the message length and skipping
- * over those bytes in the communication stream.
- */
- private void skipMessage() throws IOException {
- int l_len = pgStream.ReceiveInteger4();
- // skip l_len-4 (length includes the 4 bytes for message length itself
- pgStream.Skip(l_len - 4);
- }
-
- public synchronized void fetch(ResultCursor cursor, ResultHandler handler, int fetchSize)
- throws SQLException {
- waitOnLock();
- final Portal portal = (Portal)cursor;
-
- // Insert a ResultHandler that turns bare command statuses into empty datasets
- // (if the fetch returns no rows, we see just a CommandStatus..)
- final ResultHandler delegateHandler = handler;
- handler = new ResultHandler() {
- public void handleResultRows(Query fromQuery, Field[] fields, List tuples, ResultCursor cursor) {
- delegateHandler.handleResultRows(fromQuery, fields, tuples, cursor);
- }
-
- public void handleCommandStatus(String status, int updateCount, long insertOID) {
- handleResultRows(portal.getQuery(), null, new ArrayList(), null);
- }
-
- public void handleWarning(SQLWarning warning) {
- delegateHandler.handleWarning(warning);
- }
-
- public void handleError(SQLException error) {
- delegateHandler.handleError(error);
- }
-
- public void handleCompletion() throws SQLException{
- delegateHandler.handleCompletion();
- }
- };
-
- // Now actually run it.
-
- try
- {
- processDeadParsedQueries();
- processDeadPortals();
-
- sendExecute(portal.getQuery(), portal, fetchSize);
- sendSync();
-
- processResults(handler, 0);
- }
- catch (IOException e)
- {
- protoConnection.close();
- handler.handleError(new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, e));
- }
-
- handler.handleCompletion();
- }
-
- /*
- * Receive the field descriptions from the back end.
- */
- private Field[] receiveFields() throws IOException
- {
- int l_msgSize = pgStream.ReceiveInteger4();
- int size = pgStream.ReceiveInteger2();
- Field[] fields = new Field[size];
-
- if (logger.logDebug())
- logger.debug(" <=BE RowDescription(" + size + ")");
-
- for (int i = 0; i < fields.length; i++)
- {
- String columnLabel = pgStream.ReceiveString();
- int tableOid = pgStream.ReceiveInteger4();
- short positionInTable = (short)pgStream.ReceiveInteger2();
- int typeOid = pgStream.ReceiveInteger4();
- int typeLength = pgStream.ReceiveInteger2();
- int typeModifier = pgStream.ReceiveInteger4();
- int formatType = pgStream.ReceiveInteger2();
- fields[i] = new Field(columnLabel,
- "", /* name not yet determined */
- typeOid, typeLength, typeModifier, tableOid, positionInTable);
- fields[i].setFormat(formatType);
-
- if (logger.logDebug())
- logger.debug(" " + fields[i]);
- }
-
- return fields;
- }
-
- private void receiveAsyncNotify() throws IOException {
- int msglen = pgStream.ReceiveInteger4();
- int pid = pgStream.ReceiveInteger4();
- String msg = pgStream.ReceiveString();
- String param = pgStream.ReceiveString();
- protoConnection.addNotification(new org.postgresql.core.Notification(msg, pid, param));
-
- if (logger.logDebug())
- logger.debug(" <=BE AsyncNotify(" + pid + "," + msg + "," + param + ")");
- }
-
- private SQLException receiveErrorResponse() throws IOException {
- // it's possible to get more than one error message for a query
- // see libpq comments wrt backend closing a connection
- // so, append messages to a string buffer and keep processing
- // check at the bottom to see if we need to throw an exception
-
- int elen = pgStream.ReceiveInteger4();
- String totalMessage = pgStream.ReceiveString(elen - 4);
- ServerErrorMessage errorMsg = new ServerErrorMessage(totalMessage, logger.getLogLevel());
-
- if (logger.logDebug())
- logger.debug(" <=BE ErrorMessage(" + errorMsg.toString() + ")");
-
- return new PSQLException(errorMsg);
- }
-
- private SQLWarning receiveNoticeResponse() throws IOException {
- int nlen = pgStream.ReceiveInteger4();
- ServerErrorMessage warnMsg = new ServerErrorMessage(pgStream.ReceiveString(nlen - 4), logger.getLogLevel());
-
- if (logger.logDebug())
- logger.debug(" <=BE NoticeResponse(" + warnMsg.toString() + ")");
-
- return new PSQLWarning(warnMsg);
- }
-
- private String receiveCommandStatus() throws IOException {
- //TODO: better handle the msg len
- int l_len = pgStream.ReceiveInteger4();
- //read l_len -5 bytes (-4 for l_len and -1 for trailing \0)
- String status = pgStream.ReceiveString(l_len - 5);
- //now read and discard the trailing \0
- pgStream.Receive(1);
-
- if (logger.logDebug())
- logger.debug(" <=BE CommandStatus(" + status + ")");
-
- return status;
- }
-
- private void interpretCommandStatus(String status, ResultHandler handler) {
- int update_count = 0;
- long insert_oid = 0;
-
- if (status.startsWith("INSERT") || status.startsWith("UPDATE") || status.startsWith("DELETE") || status.startsWith("MOVE"))
- {
- try
- {
- update_count = Integer.parseInt(status.substring(1 + status.lastIndexOf(' ')));
- if (status.startsWith("INSERT"))
- insert_oid = Long.parseLong(status.substring(1 + status.indexOf(' '),
- status.lastIndexOf(' ')));
- }
- catch (NumberFormatException nfe)
- {
- handler.handleError(new PSQLException(GT.tr("Unable to interpret the update count in command completion tag: {0}.", status), PSQLState.CONNECTION_FAILURE));
- return ;
- }
- }
-
- handler.handleCommandStatus(status, update_count, insert_oid);
- }
-
- private void receiveRFQ() throws IOException {
- if (pgStream.ReceiveInteger4() != 5)
- throw new IOException("unexpected length of ReadyForQuery message");
-
- char tStatus = (char)pgStream.ReceiveChar();
- if (logger.logDebug())
- logger.debug(" <=BE ReadyForQuery(" + tStatus + ")");
-
- // Update connection state.
- switch (tStatus)
- {
- case 'I':
- protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_IDLE);
- break;
- case 'T':
- protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_OPEN);
- break;
- case 'E':
- protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_FAILED);
- break;
- default:
- throw new IOException("unexpected transaction state in ReadyForQuery message: " + (int)tStatus);
- }
- }
-
- private final ArrayList pendingParseQueue = new ArrayList(); // list of SimpleQuery instances
- private final ArrayList pendingBindQueue = new ArrayList(); // list of Portal instances
- private final ArrayList pendingExecuteQueue = new ArrayList(); // list of {SimpleQuery,Portal} object arrays
- private final ArrayList pendingDescribeStatementQueue = new ArrayList(); // list of {SimpleQuery, SimpleParameterList, Boolean} object arrays
- private final ArrayList pendingDescribePortalQueue = new ArrayList(); // list of SimpleQuery
-
- private long nextUniqueID = 1;
- private final ProtocolConnectionImpl protoConnection;
- private final PGStream pgStream;
- private final Logger logger;
- private final boolean allowEncodingChanges;
-
- /**
- * The number of queries executed so far without processing any results.
- * Used to avoid deadlocks, see MAX_BUFFERED_QUERIES.
- */
- private int queryCount;
-
- private final SimpleQuery beginTransactionQuery = new SimpleQuery(new String[] { "BEGIN" }, null);
-
- private final static SimpleQuery EMPTY_QUERY = new SimpleQuery(new String[] { "" }, null);
-}
diff --git a/org/postgresql/core/v3/SimpleParameterList.java b/org/postgresql/core/v3/SimpleParameterList.java
deleted file mode 100644
index 05d8b5e..0000000
--- a/org/postgresql/core/v3/SimpleParameterList.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2012, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v3;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.sql.SQLException;
-import java.util.Arrays;
-
-import org.postgresql.core.*;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.StreamWrapper;
-import org.postgresql.util.GT;
-import org.postgresql.util.ByteConverter;
-
-
-/**
- * Parameter list for a single-statement V3 query.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-class SimpleParameterList implements V3ParameterList {
-
- private final static int IN = 1;
- private final static int OUT = 2;
- private final static int INOUT = IN|OUT;
-
- private final static int TEXT = 0;
- private final static int BINARY = 4;
-
- SimpleParameterList(int paramCount, ProtocolConnectionImpl protoConnection) {
- this.paramValues = new Object[paramCount];
- this.paramTypes = new int[paramCount];
- this.encoded = new byte[paramCount][];
- this.flags = new int[paramCount];
- this.protoConnection = protoConnection;
- }
-
- public void registerOutParameter( int index, int sqlType ) throws SQLException
- {
- if (index < 1 || index > paramValues.length)
- throw new PSQLException(GT.tr("The column index is out of range: {0}, number of columns: {1}.", new Object[]{new Integer(index), new Integer(paramValues.length)}), PSQLState.INVALID_PARAMETER_VALUE);
-
- flags[index-1] |= OUT;
- }
-
- private void bind(int index, Object value, int oid, int binary) throws SQLException {
- if (index < 1 || index > paramValues.length)
- throw new PSQLException(GT.tr("The column index is out of range: {0}, number of columns: {1}.", new Object[]{new Integer(index), new Integer(paramValues.length)}), PSQLState.INVALID_PARAMETER_VALUE);
-
- --index;
-
- encoded[index] = null;
- paramValues[index] = value ;
- flags[index] = direction(index) | IN | binary;
-
- // If we are setting something to an UNSPECIFIED NULL, don't overwrite
- // our existing type for it. We don't need the correct type info to
- // send this value, and we don't want to overwrite and require a
- // reparse.
- if (oid == Oid.UNSPECIFIED && paramTypes[index] != Oid.UNSPECIFIED && value == NULL_OBJECT)
- return;
-
- paramTypes[index] = oid;
- }
-
- public int getParameterCount()
- {
- return paramValues.length;
- }
- public int getOutParameterCount()
- {
- int count=0;
- for( int i=paramTypes.length; --i >= 0;)
- {
- if ((direction(i) & OUT) == OUT)
- {
- count++;
- }
- }
- // Every function has at least one output.
- if (count == 0)
- count = 1;
- return count;
-
- }
- public int getInParameterCount()
- {
- int count=0;
- for( int i=0; i< paramTypes.length;i++)
- {
- if (direction(i) != OUT )
- {
- count++;
- }
- }
- return count;
- }
-
- public void setIntParameter(int index, int value) throws SQLException {
- byte[] data = new byte[4];
- ByteConverter.int4(data,0,value);
- bind(index, data, Oid.INT4, BINARY);
- }
-
- public void setLiteralParameter(int index, String value, int oid) throws SQLException {
- bind(index, value, oid, TEXT);
- }
-
- public void setStringParameter(int index, String value, int oid) throws SQLException {
- bind(index, value, oid, TEXT);
- }
-
- public void setBinaryParameter(int index, byte[] value, int oid) throws SQLException {
- bind(index, value, oid, BINARY);
- }
-
- public void setBytea(int index, byte[] data, int offset, int length) throws SQLException {
- bind(index, new StreamWrapper(data, offset, length), Oid.BYTEA, BINARY);
- }
-
- public void setBytea(int index, InputStream stream, int length) throws SQLException {
- bind(index, new StreamWrapper(stream, length), Oid.BYTEA, BINARY);
- }
-
- public void setNull(int index, int oid) throws SQLException {
- bind(index, NULL_OBJECT, oid, BINARY);
- }
-
- public String toString(int index) {
- --index;
- if (paramValues[index] == null)
- return "?";
- else if (paramValues[index] == NULL_OBJECT)
- return "NULL";
-
- else if ( (flags[index]& BINARY) == BINARY )
- {
- // handle some of the numeric types
-
- switch (paramTypes[index])
- {
- case Oid.INT2:
- short s = ByteConverter.int2((byte[])paramValues[index],0);
- return Short.toString(s);
-
- case Oid.INT4:
- int i = ByteConverter.int4((byte[])paramValues[index],0);
- return Integer.toString(i);
-
- case Oid.INT8:
- long l = ByteConverter.int8((byte[])paramValues[index],0);
- return Long.toString(l);
-
- case Oid.FLOAT4:
- float f = ByteConverter.float4((byte[])paramValues[index],0);
- return Float.toString(f);
-
- case Oid.FLOAT8:
- double d = ByteConverter.float8((byte[])paramValues[index],0);
- return Double.toString(d);
- }
- return "?";
- }
- else
- {
- String param = paramValues[index].toString();
- boolean hasBackslash = param.indexOf('\\') != -1;
-
- // add room for quotes + potential escaping.
- StringBuffer p = new StringBuffer(3 + param.length() * 11 / 10);
-
- boolean standardConformingStrings = false;
- boolean supportsEStringSyntax = false;
- if (protoConnection != null)
- {
- standardConformingStrings = protoConnection.getStandardConformingStrings();
- supportsEStringSyntax = protoConnection.getServerVersion().compareTo("8.1") >= 0;
- }
-
- if (hasBackslash && !standardConformingStrings && supportsEStringSyntax)
- p.append('E');
-
- p.append('\'');
- try
- {
- p = Utils.appendEscapedLiteral(p, param, standardConformingStrings);
- }
- catch (SQLException sqle)
- {
- // This should only happen if we have an embedded null
- // and there's not much we can do if we do hit one.
- //
- // The goal of toString isn't to be sent to the server,
- // so we aren't 100% accurate (see StreamWrapper), put
- // the unescaped version of the data.
- //
- p.append(param);
- }
- p.append('\'');
- return p.toString();
- }
- }
-
- public void checkAllParametersSet() throws SQLException {
- for (int i = 0; i < paramTypes.length; ++i)
- {
- if (direction(i) != OUT && paramValues[i] == null)
- throw new PSQLException(GT.tr("No value specified for parameter {0}.", new Integer(i + 1)), PSQLState.INVALID_PARAMETER_VALUE);
- }
- }
-
- public void convertFunctionOutParameters()
- {
- for (int i=0; i<paramTypes.length; ++i)
- {
- if (direction(i) == OUT)
- {
- paramTypes[i] = Oid.VOID;
- paramValues[i] = "null";
- }
- }
- }
-
- //
- // bytea helper
- //
-
- private static void streamBytea(PGStream pgStream, StreamWrapper wrapper) throws IOException {
- byte[] rawData = wrapper.getBytes();
- if (rawData != null)
- {
- pgStream.Send(rawData, wrapper.getOffset(), wrapper.getLength());
- return ;
- }
-
- pgStream.SendStream(wrapper.getStream(), wrapper.getLength());
- }
-
- public int[] getTypeOIDs() {
- return paramTypes;
- }
-
- //
- // Package-private V3 accessors
- //
-
- int getTypeOID(int index) {
- return paramTypes[index-1];
- }
-
- boolean hasUnresolvedTypes() {
- for (int i=0; i< paramTypes.length; i++) {
- if (paramTypes[i] == Oid.UNSPECIFIED)
- return true;
- }
- return false;
- }
-
- void setResolvedType(int index, int oid) {
- // only allow overwriting an unknown value
- if (paramTypes[index-1] == Oid.UNSPECIFIED) {
- paramTypes[index-1] = oid;
- } else if (paramTypes[index-1] != oid) {
- throw new IllegalArgumentException("Can't change resolved type for param: " + index + " from " + paramTypes[index-1] + " to " + oid);
- }
- }
-
- boolean isNull(int index) {
- return (paramValues[index-1] == NULL_OBJECT);
- }
-
- boolean isBinary(int index) {
- return (flags[index-1] & BINARY) != 0;
- }
-
- private int direction(int index) {
- return flags[index] & INOUT;
- }
-
- int getV3Length(int index) {
- --index;
-
- // Null?
- if (paramValues[index] == NULL_OBJECT)
- throw new IllegalArgumentException("can't getV3Length() on a null parameter");
-
- // Directly encoded?
- if (paramValues[index] instanceof byte[])
- return ((byte[]) paramValues[index]).length;
-
- // Binary-format bytea?
- if (paramValues[index] instanceof StreamWrapper)
- return ((StreamWrapper) paramValues[index]).getLength();
-
- // Already encoded?
- if (encoded[index] == null)
- {
- // Encode value and compute actual length using UTF-8.
- encoded[index] = Utils.encodeUTF8(paramValues[index].toString());
- }
-
- return encoded[index].length;
- }
-
- void writeV3Value(int index, PGStream pgStream) throws IOException {
- --index;
-
- // Null?
- if (paramValues[index] == NULL_OBJECT)
- throw new IllegalArgumentException("can't writeV3Value() on a null parameter");
-
- // Directly encoded?
- if (paramValues[index] instanceof byte[])
- {
- pgStream.Send((byte[])paramValues[index]);
- return ;
- }
-
- // Binary-format bytea?
- if (paramValues[index] instanceof StreamWrapper)
- {
- streamBytea(pgStream, (StreamWrapper)paramValues[index]);
- return ;
- }
-
- // Encoded string.
- if (encoded[index] == null)
- encoded[index] = Utils.encodeUTF8((String) paramValues[index]);
- pgStream.Send(encoded[index]);
- }
-
-
-
- public ParameterList copy() {
- SimpleParameterList newCopy = new SimpleParameterList(paramValues.length, protoConnection);
- System.arraycopy(paramValues, 0, newCopy.paramValues, 0, paramValues.length);
- System.arraycopy(paramTypes, 0, newCopy.paramTypes, 0, paramTypes.length);
- System.arraycopy(flags, 0, newCopy.flags, 0, flags.length);
- return newCopy;
- }
-
- public void clear() {
- Arrays.fill(paramValues, null);
- Arrays.fill(paramTypes, 0);
- Arrays.fill(encoded, null);
- Arrays.fill(flags, 0);
- }
- public SimpleParameterList[] getSubparams() {
- return null;
- }
-
- private final Object[] paramValues;
- private final int[] paramTypes;
- private final int[] flags;
- private final byte[][] encoded;
- private final ProtocolConnectionImpl protoConnection;
-
- /**
- * Marker object representing NULL; this distinguishes
- * "parameter never set" from "parameter set to null".
- */
- private final static Object NULL_OBJECT = new Object();
-}
-
diff --git a/org/postgresql/core/v3/SimpleQuery.java b/org/postgresql/core/v3/SimpleQuery.java
deleted file mode 100644
index b2f6e2b..0000000
--- a/org/postgresql/core/v3/SimpleQuery.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v3;
-
-import org.postgresql.core.*;
-import java.lang.ref.PhantomReference;
-
-/**
- * V3 Query implementation for a single-statement query.
- * This also holds the state of any associated server-side
- * named statement. We use a PhantomReference managed by
- * the QueryExecutor to handle statement cleanup.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-class SimpleQuery implements V3Query {
-
- SimpleQuery(String[] fragments, ProtocolConnectionImpl protoConnection)
- {
- this.fragments = fragments;
- this.protoConnection = protoConnection;
- }
-
- public ParameterList createParameterList() {
- if (fragments.length == 1)
- return NO_PARAMETERS;
-
- return new SimpleParameterList(fragments.length - 1, protoConnection);
- }
-
- public String toString(ParameterList parameters) {
- StringBuffer sbuf = new StringBuffer(fragments[0]);
- for (int i = 1; i < fragments.length; ++i)
- {
- if (parameters == null)
- sbuf.append('?');
- else
- sbuf.append(parameters.toString(i));
- sbuf.append(fragments[i]);
- }
- return sbuf.toString();
- }
-
- public String toString() {
- return toString(null);
- }
-
- public void close() {
- unprepare();
- }
-
- //
- // V3Query
- //
-
- public SimpleQuery[] getSubqueries() {
- return null;
- }
-
- //
- // Implementation guts
- //
-
- String[] getFragments() {
- return fragments;
- }
-
-
-
- void setStatementName(String statementName) {
- this.statementName = statementName;
- this.encodedStatementName = Utils.encodeUTF8(statementName);
- }
-
- void setStatementTypes(int[] paramTypes) {
- this.preparedTypes = paramTypes;
- }
-
- int[] getStatementTypes() {
- return preparedTypes;
- }
-
- String getStatementName() {
- return statementName;
- }
-
- boolean isPreparedFor(int[] paramTypes) {
- if (statementName == null)
- return false; // Not prepared.
-
- // Check for compatible types.
- for (int i = 0; i < paramTypes.length; ++i)
- if (paramTypes[i] != Oid.UNSPECIFIED && paramTypes[i] != preparedTypes[i])
- return false;
-
- return true;
- }
-
- boolean hasUnresolvedTypes() {
- if (preparedTypes == null)
- return true;
-
- for (int i=0; i<preparedTypes.length; i++) {
- if (preparedTypes[i] == Oid.UNSPECIFIED)
- return true;
- }
-
- return false;
- }
-
- byte[] getEncodedStatementName() {
- return encodedStatementName;
- }
-
- /**
- * Sets the fields that this query will return.
- *
- * @param fields The fields that this query will return.
- */
- void setFields(Field[] fields) {
- this.fields = fields;
- }
-
- /**
- * Returns the fields that this query will return. If the result set fields
- * are not known returns null.
- *
- * @return the fields that this query will return.
- */
- Field[] getFields() {
- return fields;
- }
-
- // Have we sent a Describe Portal message for this query yet?
- boolean isPortalDescribed() {
- return portalDescribed;
- }
- void setPortalDescribed(boolean portalDescribed) {
- this.portalDescribed = portalDescribed;
- }
-
- // Have we sent a Describe Statement message for this query yet?
- // Note that we might not have need to, so this may always be false.
- public boolean isStatementDescribed() {
- return statementDescribed;
- }
- void setStatementDescribed(boolean statementDescribed) {
- this.statementDescribed = statementDescribed;
- }
-
- void setCleanupRef(PhantomReference cleanupRef) {
- if (this.cleanupRef != null) {
- this.cleanupRef.clear();
- this.cleanupRef.enqueue();
- }
- this.cleanupRef = cleanupRef;
- }
-
- void unprepare() {
- if (cleanupRef != null)
- {
- cleanupRef.clear();
- cleanupRef.enqueue();
- cleanupRef = null;
- }
-
- statementName = null;
- encodedStatementName = null;
- fields = null;
- portalDescribed = false;
- statementDescribed = false;
- }
-
- private final String[] fragments;
- private final ProtocolConnectionImpl protoConnection;
- private String statementName;
- private byte[] encodedStatementName;
- /**
- * The stored fields from previous query of a prepared statement,
- * if executed before. Always null for non-prepared statements.
- */
- private Field[] fields;
- private boolean portalDescribed;
- private boolean statementDescribed;
- private PhantomReference cleanupRef;
- private int[] preparedTypes;
-
- final static SimpleParameterList NO_PARAMETERS = new SimpleParameterList(0, null);
-}
-
-
diff --git a/org/postgresql/core/v3/V3ParameterList.java b/org/postgresql/core/v3/V3ParameterList.java
deleted file mode 100644
index dc080ab..0000000
--- a/org/postgresql/core/v3/V3ParameterList.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v3;
-
-import java.sql.SQLException;
-import org.postgresql.core.ParameterList;
-
-/**
- * Common interface for all V3 parameter list implementations.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-interface V3ParameterList extends ParameterList {
- /**
- * Ensure that all parameters in this list have been
- * assigned values. Return silently if all is well, otherwise
- * throw an appropriate exception.
- *
- * @throws SQLException if not all parameters are set.
- */
- void checkAllParametersSet() throws SQLException;
-
- /**
- * Convert any function output parameters to the correct type (void)
- * and set an ignorable value for it.
- */
- void convertFunctionOutParameters();
-
- /**
- * Return a list of the SimpleParameterList objects that
- * make up this parameter list. If this object is already a
- * SimpleParameterList, returns null (avoids an extra array
- * construction in the common case).
- *
- * @return an array of single-statement parameter lists, or
- * <code>null</code> if this object is already a single-statement
- * parameter list.
- */
- SimpleParameterList[] getSubparams();
-
-
-
-}
diff --git a/org/postgresql/core/v3/V3Query.java b/org/postgresql/core/v3/V3Query.java
deleted file mode 100644
index 50aba8c..0000000
--- a/org/postgresql/core/v3/V3Query.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.core.v3;
-
-import org.postgresql.core.Query;
-
-/**
- * Common interface for all V3 query implementations.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-interface V3Query extends Query {
- /**
- * Return a list of the SimpleQuery objects that
- * make up this query. If this object is already a
- * SimpleQuery, returns null (avoids an extra array
- * construction in the common case).
- *
- * @return an array of single-statement queries, or <code>null</code>
- * if this object is already a single-statement query.
- */
- SimpleQuery[] getSubqueries();
-}
diff --git a/org/postgresql/ds/.gitignore b/org/postgresql/ds/.gitignore
deleted file mode 100644
index 007b55e..0000000
--- a/org/postgresql/ds/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-PGPooledConnection.java
-PGPoolingDataSource.java
-PGSimpleDataSource.java
-PGConnectionPoolDataSource.java
diff --git a/org/postgresql/ds/PGConnectionPoolDataSource.java.in b/org/postgresql/ds/PGConnectionPoolDataSource.java.in
deleted file mode 100644
index ce80f9c..0000000
--- a/org/postgresql/ds/PGConnectionPoolDataSource.java.in
+++ /dev/null
@@ -1,37 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ds;
-
-import javax.sql.ConnectionPoolDataSource;
-
-import org.postgresql.ds.common.*;
-
-/**
- * PostgreSQL implementation of ConnectionPoolDataSource. The app server or
- * middleware vendor should provide a DataSource implementation that takes advantage
- * of this ConnectionPoolDataSource. If not, you can use the PostgreSQL implementation
- * known as PoolingDataSource, but that should only be used if your server or middleware
- * vendor does not provide their own. Why? The server may want to reuse the same
- * Connection across all EJBs requesting a Connection within the same Transaction, or
- * provide other similar advanced features.
- *
- * <p>In any case, in order to use this ConnectionPoolDataSource, you must set the property
- * databaseName. The settings for serverName, portNumber, user, and password are
- * optional. Note: these properties are declared in the superclass.</p>
- *
- * <p>This implementation supports JDK 1.3 and higher.</p>
- *
- * @author Aaron Mulder (ammulder at chariotsolutions.com)
- */
-public class PGConnectionPoolDataSource
- extends @CONN_POOL_DS_CLASS@
- implements ConnectionPoolDataSource
-{
-
-}
-
diff --git a/org/postgresql/ds/PGPooledConnection.java.in b/org/postgresql/ds/PGPooledConnection.java.in
deleted file mode 100644
index a3c4806..0000000
--- a/org/postgresql/ds/PGPooledConnection.java.in
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ds;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-import javax.sql.PooledConnection;
-import javax.sql.ConnectionEvent;
-
-/**
- * PostgreSQL implementation of the PooledConnection interface. This shouldn't
- * be used directly, as the pooling client should just interact with the
- * ConnectionPool instead.
- * @see org.postgresql.ds.PGConnectionPoolDataSource
- *
- * @author Aaron Mulder (ammulder at chariotsolutions.com)
- * @author Csaba Nagy (ncsaba at yahoo.com)
- */
-public class PGPooledConnection
- extends @POOLED_CONN_CLASS@
- implements PooledConnection
-{
-
- public PGPooledConnection(Connection con, boolean autoCommit, boolean isXA)
- {
- super(con, autoCommit, isXA);
- }
-
- public PGPooledConnection(Connection con, boolean autoCommit)
- {
- this(con, autoCommit, false);
- }
-
- protected ConnectionEvent createConnectionEvent(SQLException sqle)
- {
- return new ConnectionEvent(this, sqle);
- }
-
-}
diff --git a/org/postgresql/ds/PGPoolingDataSource.java.in b/org/postgresql/ds/PGPoolingDataSource.java.in
deleted file mode 100644
index 0c01500..0000000
--- a/org/postgresql/ds/PGPoolingDataSource.java.in
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ds;
-
-import javax.sql.DataSource;
-
-/**
- * DataSource which uses connection pooling. <font color="red">Don't use this if
- * your server/middleware vendor provides a connection pooling implementation
- * which interfaces with the PostgreSQL ConnectionPoolDataSource implementation!</font>
- * This class is provided as a convenience, but the JDBC Driver is really not
- * supposed to handle the connection pooling algorithm. Instead, the server or
- * middleware product is supposed to handle the mechanics of connection pooling,
- * and use the PostgreSQL implementation of ConnectionPoolDataSource to provide
- * the connections to pool.
- *
- * <p>If you're sure you want to use this, then you must set the properties
- * dataSourceName, databaseName, user, and password (if required for the user).
- * The settings for serverName, portNumber, initialConnections, and
- * maxConnections are optional. Note that <i>only connections
- * for the default user will be pooled!</i> Connections for other users will
- * be normal non-pooled connections, and will not count against the maximum pool
- * size limit.</p>
- *
- * <p>If you put this DataSource in JNDI, and access it from different JVMs (or
- * otherwise load this class from different ClassLoaders), you'll end up with one
- * pool per ClassLoader or VM. This is another area where a server-specific
- * implementation may provide advanced features, such as using a single pool
- * across all VMs in a cluster.</p>
- *
- * <p>This implementation supports JDK 1.3 and higher.</p>
- *
- * @author Aaron Mulder (ammulder at chariotsolutions.com)
- */
-public class PGPoolingDataSource
- extends @POOLING_DS_CLASS@
- implements DataSource
-{
-
- protected void addDataSource(String dataSourceName)
- {
- dataSources.put(dataSourceName, this);
- }
-
-}
diff --git a/org/postgresql/ds/PGSimpleDataSource.java.in b/org/postgresql/ds/PGSimpleDataSource.java.in
deleted file mode 100644
index 3555885..0000000
--- a/org/postgresql/ds/PGSimpleDataSource.java.in
+++ /dev/null
@@ -1,24 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ds;
-
-import javax.sql.DataSource;
-
-/**
- * Simple DataSource which does not perform connection pooling. In order to use
- * the DataSource, you must set the property databaseName. The settings for
- * serverName, portNumber, user, and password are optional. Note: these properties
- * are declared in the superclass.
- *
- * @author Aaron Mulder (ammulder at chariotsolutions.com)
- */
-public class PGSimpleDataSource
- extends @SIMPLE_DS_CLASS@
- implements DataSource
-{
-}
diff --git a/org/postgresql/ds/common/BaseDataSource.java b/org/postgresql/ds/common/BaseDataSource.java
deleted file mode 100644
index b5d486d..0000000
--- a/org/postgresql/ds/common/BaseDataSource.java
+++ /dev/null
@@ -1,684 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ds.common;
-
-import javax.naming.*;
-import java.sql.*;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-
-/**
- * Base class for data sources and related classes.
- *
- * @author Aaron Mulder (ammulder at chariotsolutions.com)
- */
-public abstract class BaseDataSource implements Referenceable
-{
- // Load the normal driver, since we'll use it to actually connect to the
- // database. That way we don't have to maintain the connecting code in
- // multiple places.
- static {
- try
- {
- Class.forName("org.postgresql.Driver");
- }
- catch (ClassNotFoundException e)
- {
- System.err.println("PostgreSQL DataSource unable to load PostgreSQL JDBC Driver");
- }
- }
-
- // Needed to implement the DataSource/ConnectionPoolDataSource interfaces
- private transient PrintWriter logger;
-
- // Standard properties, defined in the JDBC 2.0 Optional Package spec
- private String serverName = "localhost";
- private String databaseName;
- private String user;
- private String password;
- private int portNumber = 0;
- private int prepareThreshold = 5;
- private int unknownLength = Integer.MAX_VALUE;
- private boolean binaryTransfer = true;
- private String binaryTransferEnable=null;
- private String binaryTransferDisable=null;
- private int loginTimeout = 0; // in seconds
- private int socketTimeout = 0; // in seconds
- private int receiveBufferSize = -1; // off (-1), not in use
- private int sendBufferSize = -1; // off (-1), not in use
- private boolean ssl = false;
- private String sslfactory=null;
- private boolean tcpKeepAlive = false;
- private String compatible=null;
- private int logLevel = 0;
- private int protocolVersion = 0;
- private String stringType=null;
- private String applicationName;
- private boolean logLevelSet=false;
-
- /**
- * Gets a connection to the PostgreSQL database. The database is identified by the
- * DataSource properties serverName, databaseName, and portNumber. The user to
- * connect as is identified by the DataSource properties user and password.
- *
- * @return A valid database connection.
- * @throws SQLException
- * Occurs when the database connection cannot be established.
- */
- public Connection getConnection() throws SQLException
- {
- return getConnection(user, password);
- }
-
- /**
- * Gets a connection to the PostgreSQL database. The database is identified by the
- * DataSource properties serverName, databaseName, and portNumber. The user to
- * connect as is identified by the arguments user and password, which override
- * the DataSource properties by the same name.
- *
- * @return A valid database connection.
- * @throws SQLException
- * Occurs when the database connection cannot be established.
- */
- public Connection getConnection(String user, String password) throws SQLException
- {
- try
- {
- Connection con = DriverManager.getConnection(getUrl(), user, password);
- if (logger != null)
- {
- logger.println("Created a non-pooled connection for " + user + " at " + getUrl());
- }
- return con;
- }
- catch (SQLException e)
- {
- if (logger != null)
- {
- logger.println("Failed to create a non-pooled connection for " + user + " at " + getUrl() + ": " + e);
- }
- throw e;
- }
- }
-
- /**
- * @return the login timeout, in seconds.
- */
- public int getLoginTimeout() throws SQLException
- {
- return loginTimeout;
- }
-
- /**
- * Set the login timeout, in seconds.
- */
- public void setLoginTimeout(int i) throws SQLException
- {
- this.loginTimeout = i;
- }
-
- /**
- * Gets the log writer used to log connections opened.
- */
- public PrintWriter getLogWriter() throws SQLException
- {
- return logger;
- }
-
- /**
- * The DataSource will note every connection opened to the provided log writer.
- */
- public void setLogWriter(PrintWriter printWriter) throws SQLException
- {
- logger = printWriter;
- }
-
- /**
- * Gets the name of the host the PostgreSQL database is running on.
- */
- public String getServerName()
- {
- return serverName;
- }
-
- /**
- * Sets the name of the host the PostgreSQL database is running on. If this
- * is changed, it will only affect future calls to getConnection. The default
- * value is <tt>localhost</tt>.
- */
- public void setServerName(String serverName)
- {
- if (serverName == null || serverName.equals(""))
- {
- this.serverName = "localhost";
- }
- else
- {
- this.serverName = serverName;
- }
- }
-
- public String getCompatible()
- {
- return compatible;
- }
-
- public void setCompatible(String compatible)
- {
- this.compatible = compatible;
- }
-
- public int getLogLevel()
- {
- return logLevel;
- }
-
- public void setLogLevel(int logLevel)
- {
- this.logLevel = logLevel;
- logLevelSet=true;
- }
-
- public int getProtocolVersion()
- {
- return protocolVersion;
- }
-
- public void setProtocolVersion(int protocolVersion)
- {
- this.protocolVersion = protocolVersion;
- }
-
- /**
- * Gets the name of the PostgreSQL database, running on the server identified
- * by the serverName property.
- */
- public String getDatabaseName()
- {
- return databaseName;
- }
-
- /**
- * Sets the name of the PostgreSQL database, running on the server identified
- * by the serverName property. If this is changed, it will only affect
- * future calls to getConnection.
- */
- public void setDatabaseName(String databaseName)
- {
- this.databaseName = databaseName;
- }
-
- /**
- * Gets a description of this DataSource-ish thing. Must be customized by
- * subclasses.
- */
- public abstract String getDescription();
-
- /**
- * Gets the user to connect as by default. If this is not specified, you must
- * use the getConnection method which takes a user and password as parameters.
- */
- public String getUser()
- {
- return user;
- }
-
- /**
- * Sets the user to connect as by default. If this is not specified, you must
- * use the getConnection method which takes a user and password as parameters.
- * If this is changed, it will only affect future calls to getConnection.
- */
- public void setUser(String user)
- {
- this.user = user;
- }
-
- /**
- * Gets the password to connect with by default. If this is not specified but a
- * password is needed to log in, you must use the getConnection method which takes
- * a user and password as parameters.
- */
- public String getPassword()
- {
- return password;
- }
-
- /**
- * Sets the password to connect with by default. If this is not specified but a
- * password is needed to log in, you must use the getConnection method which takes
- * a user and password as parameters. If this is changed, it will only affect
- * future calls to getConnection.
- */
- public void setPassword(String password)
- {
- this.password = password;
- }
-
- /**
- * Gets the port which the PostgreSQL server is listening on for TCP/IP
- * connections.
- *
- * @return The port, or 0 if the default port will be used.
- */
- public int getPortNumber()
- {
- return portNumber;
- }
-
- /**
- * Gets the port which the PostgreSQL server is listening on for TCP/IP
- * connections. Be sure the -i flag is passed to postmaster when PostgreSQL
- * is started. If this is not set, or set to 0, the default port will be used.
- */
- public void setPortNumber(int portNumber)
- {
- this.portNumber = portNumber;
- }
-
- /**
- * Sets the default threshold for enabling server-side prepare.
- * See {@link org.postgresql.PGConnection#setPrepareThreshold(int)} for details.
- *
- * @param count the number of times a statement object must be reused before server-side
- * prepare is enabled.
- */
- public void setPrepareThreshold(int count)
- {
- this.prepareThreshold = count;
- }
-
- /**
- * Sets the write buffer size of TCP/IP socket.
- */
- public void setReceiveBufferSize(int nbytes)
- {
- this.receiveBufferSize = nbytes;
- }
- /**
- * Gets the write buffer size of TCP/IP socket.
- */
- public int getReceiveBufferSize()
- {
- return receiveBufferSize;
- }
-
-
- /**
- * Sets the send buffer size of TCP/IP socket.
- */
- public void setSendBufferSize(int nbytes)
- {
- this.sendBufferSize = nbytes;
- }
- /**
- * Gets the send buffer size of TCP/IP socket.
- */
- public int getSendBufferSize()
- {
- return sendBufferSize;
- }
- /**
- * Gets the default threshold for enabling server-side prepare.
- *
- * @see #setPrepareThreshold(int)
- */
- public int getPrepareThreshold()
- {
- return prepareThreshold;
- }
-
- public void setUnknownLength(int unknownLength)
- {
- this.unknownLength = unknownLength;
- }
-
- public int getUnknownLength()
- {
- return unknownLength;
- }
-
- /**
- * Sets the socket timeout (SOTimeout), in seconds
- */
- public void setSocketTimeout(int seconds)
- {
- this.socketTimeout = seconds;
- }
-
- /**
- * @return the socket timeout (SOTimeout), in seconds
- */
- public int getSocketTimeout()
- {
- return this.socketTimeout;
- }
-
-
- /**
- * Set whether the connection will be SSL encrypted or not.
- *
- * @param enabled if <CODE>true</CODE>, connect with SSL.
- */
- public void setSsl(boolean enabled)
- {
- this.ssl = enabled;
- }
-
- /**
- * Gets SSL encryption setting.
- *
- * @return <CODE>true</CODE> if connections will be encrypted with SSL.
- */
- public boolean getSsl()
- {
- return this.ssl;
- }
-
- /**
- * Set the name of the {@link javax.net.ssl.SSLSocketFactory} to use for connections.
- * Use <CODE>org.postgresql.ssl.NonValidatingFactory</CODE> if you don't want certificate validation.
- *
- * @param classname name of a subclass of <CODE>javax.net.ssl.SSLSocketFactory</CODE> or <CODE>null</CODE> for the default implementation.
- */
- public void setSslfactory(String classname)
- {
- this.sslfactory = classname;
- }
-
- /**
- * Gets the name of the {@link javax.net.ssl.SSLSocketFactory} used for connections.
- *
- * @return name of the class or <CODE>null</CODE> if the default implementation is used.
- */
- public String getSslfactory()
- {
- return this.sslfactory;
- }
-
- public void setApplicationName(String applicationName)
- {
- this.applicationName = applicationName;
- }
-
- public String getApplicationName()
- {
- return applicationName;
- }
-
- public void setTcpKeepAlive(boolean enabled)
- {
- tcpKeepAlive = enabled;
- }
-
- public boolean getTcpKeepAlive()
- {
- return tcpKeepAlive;
- }
-
- /**
- * Sets protocol transfer mode.
- *
- * @param enabled True if the binary transfer mode is used for supported field types,
- * false if text based transfer is used.
- */
- public void setBinaryTransfer(boolean enabled)
- {
- this.binaryTransfer = enabled;
- }
-
- /**
- * Gets the protocol transfer mode.
- *
- * @see #setBinaryTransfer(boolean)
- */
- public boolean getBinaryTransfer()
- {
- return binaryTransfer;
- }
-
- /**
- * Add types to the override set of {@link org.postgresql.core.Oid} values used for binary transfer.
- *
- * @param oidList The comma separated list of Oids. Either textual or numeric value.
- */
- public void setBinaryTransferEnable(String oidList)
- {
- this.binaryTransferEnable = oidList;
- }
-
- /**
- * Gets override set of Oid values that have binary transfer enabled.
- *
- * @see #setBinaryTransferEnable(String)
- */
- public String getBinaryTransferEnable()
- {
- return binaryTransferEnable;
- }
-
- /**
- * Add types to the override set of {@link org.postgresql.core.Oid} values that will not be used for binary transfer.
- * This overrides any values in the driver detault set or values set with {@link #setBinaryTransferEnable(String)}.
- *
- * @param oidList The comma separated list of Oids. Either textual or numeric value.
- */
- public void setBinaryTransferDisable(String oidList)
- {
- this.binaryTransferDisable = oidList;
- }
-
- /**
- * Gets override set of Oid values that have binary transfer disabled.
- *
- * @see #setBinaryTransferDisable(String)
- */
- public String getBinaryTransferDisable()
- {
- return binaryTransferDisable;
- }
-
- public String getStringType()
- {
- return stringType;
- }
-
- public void setStringType(String stringType)
- {
- this.stringType = stringType;
- }
-
- /**
- * Generates a DriverManager URL from the other properties supplied.
- */
- private String getUrl()
- {
- StringBuffer sb = new StringBuffer(100);
- sb.append("jdbc:postgresql://");
- sb.append(serverName);
- if (portNumber != 0) {
- sb.append(":").append(portNumber);
- }
- sb.append("/").append(databaseName);
- sb.append("?loginTimeout=").append(loginTimeout);
- sb.append("&socketTimeout=").append(socketTimeout);
- sb.append("&prepareThreshold=").append(prepareThreshold);
- sb.append("&unknownLength=").append(unknownLength);
- if (logLevelSet) {
- sb.append("&loglevel=").append(logLevel);
- }
- if (protocolVersion != 0) {
- sb.append("&protocolVersion=").append(protocolVersion);
- }
- if (ssl) {
- sb.append("&ssl=true");
- if (sslfactory != null) {
- sb.append("&sslfactory=").append(sslfactory);
- }
- }
- if (receiveBufferSize != -1) {
- sb.append("&receiveBufferSize=").append(receiveBufferSize);
- }
- if (sendBufferSize != -1) {
- sb.append("&sendBufferSize=").append(sendBufferSize);
- }
- sb.append("&tcpKeepAlive=").append(tcpKeepAlive);
- if (compatible != null) {
- sb.append("&compatible="+compatible);
- }
- if (applicationName != null) {
- sb.append("&ApplicationName=");
- sb.append(applicationName);
- }
- sb.append("&binaryTransfer=true");
- if (binaryTransferEnable != null) {
- sb.append("&binaryTransferEnable=").append(binaryTransferEnable);
- }
- if ( stringType != null ){
- sb.append("&stringtype=");
- sb.append(stringType);
- }
- return sb.toString();
- }
-
- /**
- * Generates a reference using the appropriate object factory.
- */
- protected Reference createReference() {
- return new Reference(
- getClass().getName(),
- PGObjectFactory.class.getName(),
- null);
- }
-
- public Reference getReference() throws NamingException
- {
- Reference ref = createReference();
- ref.add(new StringRefAddr("serverName", serverName));
- if (portNumber != 0)
- {
- ref.add(new StringRefAddr("portNumber", Integer.toString(portNumber)));
- }
- ref.add(new StringRefAddr("databaseName", databaseName));
- if (user != null)
- {
- ref.add(new StringRefAddr("user", user));
- }
- if (password != null)
- {
- ref.add(new StringRefAddr("password", password));
- }
-
- ref.add(new StringRefAddr("prepareThreshold", Integer.toString(prepareThreshold)));
- ref.add(new StringRefAddr("unknownLength", Integer.toString(unknownLength)));
- ref.add(new StringRefAddr("binaryTransfer", Boolean.toString(binaryTransfer)));
- if (binaryTransferEnable != null)
- {
- ref.add(new StringRefAddr("binaryTransferEnable", binaryTransferEnable));
- }
- if (binaryTransferDisable != null)
- {
- ref.add(new StringRefAddr("binaryTransferDisable", binaryTransferDisable));
- }
- ref.add(new StringRefAddr("loginTimeout", Integer.toString(loginTimeout)));
- ref.add(new StringRefAddr("socketTimeout", Integer.toString(socketTimeout)));
-
- ref.add(new StringRefAddr("ssl", Boolean.toString(ssl)));
- if(sslfactory !=null)
- {
- ref.add(new StringRefAddr("sslfactory", sslfactory));
- }
-
- ref.add(new StringRefAddr("receiveBufferSize", Integer.toString(receiveBufferSize)));
- ref.add(new StringRefAddr("sendBufferSize", Integer.toString(sendBufferSize)));
- ref.add(new StringRefAddr("tcpKeepAlive", Boolean.toString(tcpKeepAlive)));
- if (compatible != null)
- {
- ref.add(new StringRefAddr("compatible", compatible));
- }
- if ( stringType != null)
- {
- ref.add(new StringRefAddr("stringtype",stringType));
- }
- if(logLevelSet)
- {
- ref.add(new StringRefAddr("logLevel", Integer.toString(logLevel)));
- }
- ref.add(new StringRefAddr("protocolVersion", Integer.toString(protocolVersion)));
- ref.add(new StringRefAddr("ApplicationName", applicationName));
-
- return ref;
- }
-
- protected void writeBaseObject(ObjectOutputStream out) throws IOException
- {
- out.writeObject(serverName);
- out.writeObject(databaseName);
- out.writeObject(user);
- out.writeObject(password);
- out.writeInt(portNumber);
- out.writeInt(prepareThreshold);
- out.writeInt(unknownLength);
- out.writeInt(loginTimeout);
- out.writeInt(socketTimeout);
- out.writeBoolean(ssl);
- out.writeObject(sslfactory);
- out.writeInt(receiveBufferSize);
- out.writeInt(sendBufferSize);
- out.writeBoolean(tcpKeepAlive);
- out.writeObject(compatible);
- out.writeObject(stringType);
- out.writeInt(logLevel);
- out.writeInt(protocolVersion);
- out.writeObject(applicationName);
- out.writeBoolean(binaryTransfer);
- out.writeObject(binaryTransferEnable);
- out.writeObject(binaryTransferDisable);
- }
-
- protected void readBaseObject(ObjectInputStream in) throws IOException, ClassNotFoundException
- {
- serverName = (String)in.readObject();
- databaseName = (String)in.readObject();
- user = (String)in.readObject();
- password = (String)in.readObject();
- portNumber = in.readInt();
- prepareThreshold = in.readInt();
- unknownLength = in.readInt();
- loginTimeout = in.readInt();
- socketTimeout = in.readInt();
- ssl = in.readBoolean();
- sslfactory = (String)in.readObject();
- receiveBufferSize = in.readInt();
- sendBufferSize = in.readInt();
- tcpKeepAlive = in.readBoolean();
- compatible = (String)in.readObject();
- stringType=(String)in.readObject();
- logLevel = in.readInt();
- protocolVersion = in.readInt();
- applicationName = (String)in.readObject();
- binaryTransfer = in.readBoolean();
- binaryTransferEnable = (String)in.readObject();
- binaryTransferDisable = (String)in.readObject();
- }
-
- public void initializeFrom(BaseDataSource source) throws IOException, ClassNotFoundException {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- source.writeBaseObject(oos);
- oos.close();
- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- ObjectInputStream ois = new ObjectInputStream(bais);
- readBaseObject(ois);
- }
-
-}
diff --git a/org/postgresql/ds/common/PGObjectFactory.java b/org/postgresql/ds/common/PGObjectFactory.java
deleted file mode 100644
index e143803..0000000
--- a/org/postgresql/ds/common/PGObjectFactory.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ds.common;
-
-import javax.naming.*;
-import javax.naming.spi.ObjectFactory;
-import java.util.Hashtable;
-
-import org.postgresql.ds.*;
-
-/**
- * Returns a DataSource-ish thing based on a JNDI reference. In the case of a
- * SimpleDataSource or ConnectionPool, a new instance is created each time, as
- * there is no connection state to maintain. In the case of a PoolingDataSource,
- * the same DataSource will be returned for every invocation within the same
- * VM/ClassLoader, so that the state of the connections in the pool will be
- * consistent.
- *
- * @author Aaron Mulder (ammulder at chariotsolutions.com)
- */
-public class PGObjectFactory implements ObjectFactory
-{
- /**
- * Dereferences a PostgreSQL DataSource. Other types of references are
- * ignored.
- */
- public Object getObjectInstance(Object obj, Name name, Context nameCtx,
- Hashtable environment) throws Exception
- {
- Reference ref = (Reference)obj;
- String className = ref.getClassName();
- if (className.equals("org.postgresql.ds.PGSimpleDataSource")
- || className.equals("org.postgresql.jdbc2.optional.SimpleDataSource")
- || className.equals("org.postgresql.jdbc3.Jdbc3SimpleDataSource"))
- {
- return loadSimpleDataSource(ref);
- }
- else if (className.equals("org.postgresql.ds.PGConnectionPoolDataSource")
- || className.equals("org.postgresql.jdbc2.optional.ConnectionPool")
- || className.equals("org.postgresql.jdbc3.Jdbc3ConnectionPool"))
- {
- return loadConnectionPool(ref);
- }
- else if (className.equals("org.postgresql.ds.PGPoolingDataSource")
- || className.equals("org.postgresql.jdbc2.optional.PoolingDataSource")
- || className.equals("org.postgresql.jdbc3.Jdbc3PoolingDataSource"))
- {
- return loadPoolingDataSource(ref);
- }
- else
- {
- return null;
- }
- }
-
- private Object loadPoolingDataSource(Reference ref)
- {
- // If DataSource exists, return it
- String name = getProperty(ref, "dataSourceName");
- PGPoolingDataSource pds = PGPoolingDataSource.getDataSource(name);
- if (pds != null)
- {
- return pds;
- }
- // Otherwise, create a new one
- pds = new PGPoolingDataSource();
- pds.setDataSourceName(name);
- loadBaseDataSource(pds, ref);
- String min = getProperty(ref, "initialConnections");
- if (min != null)
- {
- pds.setInitialConnections(Integer.parseInt(min));
- }
- String max = getProperty(ref, "maxConnections");
- if (max != null)
- {
- pds.setMaxConnections(Integer.parseInt(max));
- }
- return pds;
- }
-
- private Object loadSimpleDataSource(Reference ref)
- {
- PGSimpleDataSource ds = new PGSimpleDataSource();
- return loadBaseDataSource(ds, ref);
- }
-
- private Object loadConnectionPool(Reference ref)
- {
- PGConnectionPoolDataSource cp = new PGConnectionPoolDataSource();
- return loadBaseDataSource(cp, ref);
- }
-
- protected Object loadBaseDataSource(BaseDataSource ds, Reference ref)
- {
- ds.setDatabaseName(getProperty(ref, "databaseName"));
- ds.setPassword(getProperty(ref, "password"));
- String port = getProperty(ref, "portNumber");
- if (port != null)
- {
- ds.setPortNumber(Integer.parseInt(port));
- }
- ds.setServerName(getProperty(ref, "serverName"));
- ds.setUser(getProperty(ref, "user"));
-
- String prepareThreshold = getProperty(ref, "prepareThreshold");
- if (prepareThreshold != null)
- ds.setPrepareThreshold(Integer.parseInt(prepareThreshold));
-
- String binaryTransfer = getProperty(ref, "binaryTransfer");
- if (binaryTransfer != null)
- ds.setBinaryTransfer(Boolean.getBoolean(binaryTransfer));
-
- String binaryTransferEnable = getProperty(ref, "binaryTransferEnable");
- if (binaryTransferEnable != null)
- ds.setBinaryTransferEnable(binaryTransferEnable);
-
- String binaryTransferDisable = getProperty(ref, "binaryTransferDisable");
- if (binaryTransferDisable != null)
- ds.setBinaryTransferDisable(binaryTransferDisable);
-
- return ds;
- }
-
- protected String getProperty(Reference ref, String s)
- {
- RefAddr addr = ref.get(s);
- if (addr == null)
- {
- return null;
- }
- return (String)addr.getContent();
- }
-
-}
diff --git a/org/postgresql/ds/jdbc23/AbstractJdbc23ConnectionPoolDataSource.java b/org/postgresql/ds/jdbc23/AbstractJdbc23ConnectionPoolDataSource.java
deleted file mode 100644
index 1957bde..0000000
--- a/org/postgresql/ds/jdbc23/AbstractJdbc23ConnectionPoolDataSource.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ds.jdbc23;
-
-import javax.sql.PooledConnection;
-import java.sql.SQLException;
-import java.io.Serializable;
-import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
-import java.io.IOException;
-
-import org.postgresql.ds.common.*;
-import org.postgresql.ds.PGPooledConnection;
-
-/**
- * PostgreSQL implementation of ConnectionPoolDataSource. The app server or
- * middleware vendor should provide a DataSource implementation that takes advantage
- * of this ConnectionPoolDataSource. If not, you can use the PostgreSQL implementation
- * known as PoolingDataSource, but that should only be used if your server or middleware
- * vendor does not provide their own. Why? The server may want to reuse the same
- * Connection across all EJBs requesting a Connection within the same Transaction, or
- * provide other similar advanced features.
- *
- * <p>In any case, in order to use this ConnectionPoolDataSource, you must set the property
- * databaseName. The settings for serverName, portNumber, user, and password are
- * optional. Note: these properties are declared in the superclass.</p>
- *
- * <p>This implementation supports JDK 1.3 and higher.</p>
- *
- * @author Aaron Mulder (ammulder at chariotsolutions.com)
- */
-public class AbstractJdbc23ConnectionPoolDataSource extends BaseDataSource implements Serializable
-{
- private boolean defaultAutoCommit = true;
-
- /**
- * Gets a description of this DataSource.
- */
- public String getDescription()
- {
- return "ConnectionPoolDataSource from " + org.postgresql.Driver.getVersion();
- }
-
- /**
- * Gets a connection which may be pooled by the app server or middleware
- * implementation of DataSource.
- *
- * @throws java.sql.SQLException
- * Occurs when the physical database connection cannot be established.
- */
- public PooledConnection getPooledConnection() throws SQLException
- {
- return new PGPooledConnection(getConnection(), defaultAutoCommit);
- }
-
- /**
- * Gets a connection which may be pooled by the app server or middleware
- * implementation of DataSource.
- *
- * @throws java.sql.SQLException
- * Occurs when the physical database connection cannot be established.
- */
- public PooledConnection getPooledConnection(String user, String password) throws SQLException
- {
- return new PGPooledConnection(getConnection(user, password), defaultAutoCommit);
- }
-
- /**
- * Gets whether connections supplied by this pool will have autoCommit
- * turned on by default. The default value is <tt>false</tt>, so that
- * autoCommit will be turned off by default.
- */
- public boolean isDefaultAutoCommit()
- {
- return defaultAutoCommit;
- }
-
- /**
- * Sets whether connections supplied by this pool will have autoCommit
- * turned on by default. The default value is <tt>false</tt>, so that
- * autoCommit will be turned off by default.
- */
- public void setDefaultAutoCommit(boolean defaultAutoCommit)
- {
- this.defaultAutoCommit = defaultAutoCommit;
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException
- {
- writeBaseObject(out);
- out.writeBoolean(defaultAutoCommit);
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
- {
- readBaseObject(in);
- defaultAutoCommit = in.readBoolean();
- }
-
-}
diff --git a/org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java b/org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java
deleted file mode 100644
index 4ce1b3a..0000000
--- a/org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java
+++ /dev/null
@@ -1,462 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ds.jdbc23;
-
-import javax.sql.*;
-import java.sql.*;
-import java.util.*;
-import java.lang.reflect.*;
-import org.postgresql.PGConnection;
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * PostgreSQL implementation of the PooledConnection interface. This shouldn't
- * be used directly, as the pooling client should just interact with the
- * ConnectionPool instead.
- * @see org.postgresql.ds.PGConnectionPoolDataSource
- *
- * @author Aaron Mulder (ammulder at chariotsolutions.com)
- * @author Csaba Nagy (ncsaba at yahoo.com)
- */
-public abstract class AbstractJdbc23PooledConnection
-{
- private List listeners = new LinkedList();
- private Connection con;
- private ConnectionHandler last;
- private final boolean autoCommit;
- private final boolean isXA;
-
- /**
- * Creates a new PooledConnection representing the specified physical
- * connection.
- */
- public AbstractJdbc23PooledConnection(Connection con, boolean autoCommit, boolean isXA)
- {
- this.con = con;
- this.autoCommit = autoCommit;
- this.isXA = isXA;
- }
-
- /**
- * Adds a listener for close or fatal error events on the connection
- * handed out to a client.
- */
- public void addConnectionEventListener(ConnectionEventListener connectionEventListener)
- {
- listeners.add(connectionEventListener);
- }
-
- /**
- * Removes a listener for close or fatal error events on the connection
- * handed out to a client.
- */
- public void removeConnectionEventListener(ConnectionEventListener connectionEventListener)
- {
- listeners.remove(connectionEventListener);
- }
-
- /**
- * Closes the physical database connection represented by this
- * PooledConnection. If any client has a connection based on
- * this PooledConnection, it is forcibly closed as well.
- */
- public void close() throws SQLException
- {
- if (last != null)
- {
- last.close();
- if (!con.getAutoCommit())
- {
- try
- {
- con.rollback();
- }
- catch (SQLException e)
- {
- }
- }
- }
- try
- {
- con.close();
- }
- finally
- {
- con = null;
- }
- }
-
- /**
- * Gets a handle for a client to use. This is a wrapper around the
- * physical connection, so the client can call close and it will just
- * return the connection to the pool without really closing the
- * pgysical connection.
- *
- * <p>According to the JDBC 2.0 Optional Package spec (6.2.3), only one
- * client may have an active handle to the connection at a time, so if
- * there is a previous handle active when this is called, the previous
- * one is forcibly closed and its work rolled back.</p>
- */
- public Connection getConnection() throws SQLException
- {
- if (con == null)
- {
- // Before throwing the exception, let's notify the registered listeners about the error
- PSQLException sqlException = new PSQLException(GT.tr("This PooledConnection has already been closed."),
- PSQLState.CONNECTION_DOES_NOT_EXIST);
- fireConnectionFatalError(sqlException);
- throw sqlException;
- }
- // If any error occures while opening a new connection, the listeners
- // have to be notified. This gives a chance to connection pools to
- // eliminate bad pooled connections.
- try
- {
- // Only one connection can be open at a time from this PooledConnection. See JDBC 2.0 Optional Package spec section 6.2.3
- if (last != null)
- {
- last.close();
- if (!con.getAutoCommit())
- {
- try
- {
- con.rollback();
- }
- catch (SQLException e)
- {
- }
- }
- con.clearWarnings();
- }
- /*
- * In XA-mode, autocommit is handled in PGXAConnection,
- * because it depends on whether an XA-transaction is open
- * or not
- */
- if (!isXA)
- con.setAutoCommit(autoCommit);
- }
- catch (SQLException sqlException)
- {
- fireConnectionFatalError(sqlException);
- throw (SQLException)sqlException.fillInStackTrace();
- }
- ConnectionHandler handler = new ConnectionHandler(con);
- last = handler;
-
- Connection proxyCon = (Connection)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{Connection.class, PGConnection.class}, handler);
- last.setProxy(proxyCon);
- return proxyCon;
- }
-
- /**
- * Used to fire a connection closed event to all listeners.
- */
- void fireConnectionClosed()
- {
- ConnectionEvent evt = null;
- // Copy the listener list so the listener can remove itself during this method call
- ConnectionEventListener[] local = (ConnectionEventListener[]) listeners.toArray(new ConnectionEventListener[listeners.size()]);
- for (int i = 0; i < local.length; i++)
- {
- ConnectionEventListener listener = local[i];
- if (evt == null)
- {
- evt = createConnectionEvent(null);
- }
- listener.connectionClosed(evt);
- }
- }
-
- /**
- * Used to fire a connection error event to all listeners.
- */
- void fireConnectionFatalError(SQLException e)
- {
- ConnectionEvent evt = null;
- // Copy the listener list so the listener can remove itself during this method call
- ConnectionEventListener[] local = (ConnectionEventListener[])listeners.toArray(new ConnectionEventListener[listeners.size()]);
- for (int i = 0; i < local.length; i++)
- {
- ConnectionEventListener listener = local[i];
- if (evt == null)
- {
- evt = createConnectionEvent(e);
- }
- listener.connectionErrorOccurred(evt);
- }
- }
-
- protected abstract ConnectionEvent createConnectionEvent(SQLException e);
-
- // Classes we consider fatal.
- private static String[] fatalClasses = {
- "08", // connection error
- "53", // insufficient resources
-
- // nb: not just "57" as that includes query cancel which is nonfatal
- "57P01", // admin shutdown
- "57P02", // crash shutdown
- "57P03", // cannot connect now
-
- "58", // system error (backend)
- "60", // system error (driver)
- "99", // unexpected error
- "F0", // configuration file error (backend)
- "XX", // internal error (backend)
- };
-
- private static boolean isFatalState(String state) {
- if (state == null) // no info, assume fatal
- return true;
- if (state.length() < 2) // no class info, assume fatal
- return true;
-
- for (int i = 0; i < fatalClasses.length; ++i)
- if (state.startsWith(fatalClasses[i]))
- return true; // fatal
-
- return false;
- }
-
- /**
- * Fires a connection error event, but only if we
- * think the exception is fatal.
- *
- * @param e the SQLException to consider
- */
- private void fireConnectionError(SQLException e)
- {
- if (!isFatalState(e.getSQLState()))
- return;
-
- fireConnectionFatalError(e);
- }
-
- /**
- * Instead of declaring a class implementing Connection, which would have
- * to be updated for every JDK rev, use a dynamic proxy to handle all
- * calls through the Connection interface. This is the part that
- * requires JDK 1.3 or higher, though JDK 1.2 could be supported with a
- * 3rd-party proxy package.
- */
- private class ConnectionHandler implements InvocationHandler
- {
- private Connection con;
- private Connection proxy; // the Connection the client is currently using, which is a proxy
- private boolean automatic = false;
-
- public ConnectionHandler(Connection con)
- {
- this.con = con;
- }
-
- public Object invoke(Object proxy, Method method, Object[] args)
- throws Throwable
- {
- // From Object
- if (method.getDeclaringClass().getName().equals("java.lang.Object"))
- {
- if (method.getName().equals("toString"))
- {
- return "Pooled connection wrapping physical connection " + con;
- }
- if (method.getName().equals("equals"))
- {
- return new Boolean(proxy == args[0]);
- }
- if (method.getName().equals("hashCode"))
- {
- return new Integer(System.identityHashCode(proxy));
- }
- try
- {
- return method.invoke(con, args);
- }
- catch (InvocationTargetException e)
- {
- throw e.getTargetException();
- }
- }
- // All the rest is from the Connection or PGConnection interface
- if (method.getName().equals("isClosed"))
- {
- return con == null ? Boolean.TRUE : Boolean.FALSE;
- }
- if (con == null && !method.getName().equals("close"))
- {
- throw new PSQLException(automatic ? GT.tr("Connection has been closed automatically because a new connection was opened for the same PooledConnection or the PooledConnection has been closed.") : GT.tr("Connection has been closed."),
- PSQLState.CONNECTION_DOES_NOT_EXIST);
- }
- if (method.getName().equals("close"))
- {
- // we are already closed and a double close
- // is not an error.
- if (con == null)
- return null;
-
- SQLException ex = null;
- if (!isXA && !con.getAutoCommit())
- {
- try
- {
- con.rollback();
- }
- catch (SQLException e)
- {
- ex = e;
- }
- }
- con.clearWarnings();
- con = null;
- this.proxy = null;
- last = null;
- fireConnectionClosed();
- if (ex != null)
- {
- throw ex;
- }
- return null;
- }
-
- // From here on in, we invoke via reflection, catch exceptions,
- // and check if they're fatal before rethrowing.
-
- try {
- if (method.getName().equals("createStatement"))
- {
- Statement st = (Statement)method.invoke(con, args);
- return Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{Statement.class, org.postgresql.PGStatement.class}, new StatementHandler(this, st));
- }
- else if (method.getName().equals("prepareCall"))
- {
- Statement st = (Statement)method.invoke(con, args);
- return Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{CallableStatement.class, org.postgresql.PGStatement.class}, new StatementHandler(this, st));
- }
- else if (method.getName().equals("prepareStatement"))
- {
- Statement st = (Statement)method.invoke(con, args);
- return Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{PreparedStatement.class, org.postgresql.PGStatement.class}, new StatementHandler(this, st));
- }
- else
- {
- return method.invoke(con, args);
- }
- } catch (InvocationTargetException e) {
- Throwable te = e.getTargetException();
- if (te instanceof SQLException)
- fireConnectionError((SQLException)te); // Tell listeners about exception if it's fatal
- throw te;
- }
- }
-
- Connection getProxy() {
- return proxy;
- }
-
- void setProxy(Connection proxy) {
- this.proxy = proxy;
- }
-
- public void close()
- {
- if (con != null)
- {
- automatic = true;
- }
- con = null;
- proxy = null;
- // No close event fired here: see JDBC 2.0 Optional Package spec section 6.3
- }
-
- public boolean isClosed() {
- return con == null;
- }
- }
-
- /**
- * Instead of declaring classes implementing Statement, PreparedStatement,
- * and CallableStatement, which would have to be updated for every JDK rev,
- * use a dynamic proxy to handle all calls through the Statement
- * interfaces. This is the part that requires JDK 1.3 or higher, though
- * JDK 1.2 could be supported with a 3rd-party proxy package.
- *
- * The StatementHandler is required in order to return the proper
- * Connection proxy for the getConnection method.
- */
- private class StatementHandler implements InvocationHandler {
- private AbstractJdbc23PooledConnection.ConnectionHandler con;
- private Statement st;
-
- public StatementHandler(AbstractJdbc23PooledConnection.ConnectionHandler con, Statement st) {
- this.con = con;
- this.st = st;
- }
- public Object invoke(Object proxy, Method method, Object[] args)
- throws Throwable
- {
- // From Object
- if (method.getDeclaringClass().getName().equals("java.lang.Object"))
- {
- if (method.getName().equals("toString"))
- {
- return "Pooled statement wrapping physical statement " + st;
- }
- if (method.getName().equals("hashCode"))
- {
- return new Integer(System.identityHashCode(proxy));
- }
- if (method.getName().equals("equals"))
- {
- return new Boolean(proxy == args[0]);
- }
- return method.invoke(st, args);
- }
- // All the rest is from the Statement interface
- if (method.getName().equals("close"))
- {
- // closing an already closed object is a no-op
- if (st == null || con.isClosed())
- return null;
-
- try
- {
- st.close();
- }
- finally
- {
- con = null;
- st = null;
- }
- return null;
- }
- if (st == null || con.isClosed())
- {
- throw new PSQLException(GT.tr("Statement has been closed."),
- PSQLState.OBJECT_NOT_IN_STATE);
- }
-
- if (method.getName().equals("getConnection"))
- {
- return con.getProxy(); // the proxied connection, not a physical connection
- }
-
- try
- {
- return method.invoke(st, args);
- } catch (InvocationTargetException e) {
- Throwable te = e.getTargetException();
- if (te instanceof SQLException)
- fireConnectionError((SQLException)te); // Tell listeners about exception if it's fatal
- throw te;
- }
- }
- }
-}
diff --git a/org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java b/org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java
deleted file mode 100644
index 6546765..0000000
--- a/org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java
+++ /dev/null
@@ -1,516 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ds.jdbc23;
-
-import javax.sql.*;
-import javax.naming.*;
-import java.util.*;
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.PSQLException;
-import org.postgresql.ds.*;
-import org.postgresql.ds.common.*;
-
-/**
- * DataSource which uses connection pooling. <font color="red">Don't use this if
- * your server/middleware vendor provides a connection pooling implementation
- * which interfaces with the PostgreSQL ConnectionPoolDataSource implementation!</font>
- * This class is provided as a convenience, but the JDBC Driver is really not
- * supposed to handle the connection pooling algorithm. Instead, the server or
- * middleware product is supposed to handle the mechanics of connection pooling,
- * and use the PostgreSQL implementation of ConnectionPoolDataSource to provide
- * the connections to pool.
- *
- * <p>If you're sure you want to use this, then you must set the properties
- * dataSourceName, databaseName, user, and password (if required for the user).
- * The settings for serverName, portNumber, initialConnections, and
- * maxConnections are optional. Note that <i>only connections
- * for the default user will be pooled!</i> Connections for other users will
- * be normal non-pooled connections, and will not count against the maximum pool
- * size limit.</p>
- *
- * <p>If you put this DataSource in JNDI, and access it from different JVMs (or
- * otherwise load this class from different ClassLoaders), you'll end up with one
- * pool per ClassLoader or VM. This is another area where a server-specific
- * implementation may provide advanced features, such as using a single pool
- * across all VMs in a cluster.</p>
- *
- * <p>This implementation supports JDK 1.3 and higher.</p>
- *
- * @author Aaron Mulder (ammulder at chariotsolutions.com)
- */
-public abstract class AbstractJdbc23PoolingDataSource extends BaseDataSource
-{
- protected static Map dataSources = new HashMap();
-
- public static PGPoolingDataSource getDataSource(String name)
- {
- return (PGPoolingDataSource)dataSources.get(name);
- }
-
- // Additional Data Source properties
- protected String dataSourceName; // Must be protected for subclasses to sync updates to it
- private int initialConnections = 0;
- private int maxConnections = 0;
- // State variables
- private boolean initialized = false;
- private Stack available = new Stack();
- private Stack used = new Stack();
- private Object lock = new Object()
- ;
- private PGConnectionPoolDataSource source;
-
- /**
- * Gets a description of this DataSource.
- */
- public String getDescription()
- {
- return "Pooling DataSource '" + dataSourceName + " from " + org.postgresql.Driver.getVersion();
- }
-
- /**
- * Ensures the DataSource properties are not changed after the DataSource has
- * been used.
- *
- * @throws java.lang.IllegalStateException
- * The Server Name cannot be changed after the DataSource has been
- * used.
- */
- public void setServerName(String serverName)
- {
- if (initialized)
- {
- throw new IllegalStateException("Cannot set Data Source properties after DataSource has been used");
- }
- super.setServerName(serverName);
- }
-
- /**
- * Ensures the DataSource properties are not changed after the DataSource has
- * been used.
- *
- * @throws java.lang.IllegalStateException
- * The Database Name cannot be changed after the DataSource has been
- * used.
- */
- public void setDatabaseName(String databaseName)
- {
- if (initialized)
- {
- throw new IllegalStateException("Cannot set Data Source properties after DataSource has been used");
- }
- super.setDatabaseName(databaseName);
- }
-
- /**
- * Ensures the DataSource properties are not changed after the DataSource has
- * been used.
- *
- * @throws java.lang.IllegalStateException
- * The User cannot be changed after the DataSource has been
- * used.
- */
- public void setUser(String user)
- {
- if (initialized)
- {
- throw new IllegalStateException("Cannot set Data Source properties after DataSource has been used");
- }
- super.setUser(user);
- }
-
- /**
- * Ensures the DataSource properties are not changed after the DataSource has
- * been used.
- *
- * @throws java.lang.IllegalStateException
- * The Password cannot be changed after the DataSource has been
- * used.
- */
- public void setPassword(String password)
- {
- if (initialized)
- {
- throw new IllegalStateException("Cannot set Data Source properties after DataSource has been used");
- }
- super.setPassword(password);
- }
-
- /**
- * Ensures the DataSource properties are not changed after the DataSource has
- * been used.
- *
- * @throws java.lang.IllegalStateException
- * The Port Number cannot be changed after the DataSource has been
- * used.
- */
- public void setPortNumber(int portNumber)
- {
- if (initialized)
- {
- throw new IllegalStateException("Cannot set Data Source properties after DataSource has been used");
- }
- super.setPortNumber(portNumber);
- }
-
- /**
- * Gets the number of connections that will be created when this DataSource
- * is initialized. If you do not call initialize explicitly, it will be
- * initialized the first time a connection is drawn from it.
- */
- public int getInitialConnections()
- {
- return initialConnections;
- }
-
- /**
- * Sets the number of connections that will be created when this DataSource
- * is initialized. If you do not call initialize explicitly, it will be
- * initialized the first time a connection is drawn from it.
- *
- * @throws java.lang.IllegalStateException
- * The Initial Connections cannot be changed after the DataSource has been
- * used.
- */
- public void setInitialConnections(int initialConnections)
- {
- if (initialized)
- {
- throw new IllegalStateException("Cannot set Data Source properties after DataSource has been used");
- }
- this.initialConnections = initialConnections;
- }
-
- /**
- * Gets the maximum number of connections that the pool will allow. If a request
- * comes in and this many connections are in use, the request will block until a
- * connection is available. Note that connections for a user other than the
- * default user will not be pooled and don't count against this limit.
- *
- * @return The maximum number of pooled connection allowed, or 0 for no maximum.
- */
- public int getMaxConnections()
- {
- return maxConnections;
- }
-
- /**
- * Sets the maximum number of connections that the pool will allow. If a request
- * comes in and this many connections are in use, the request will block until a
- * connection is available. Note that connections for a user other than the
- * default user will not be pooled and don't count against this limit.
- *
- * @param maxConnections The maximum number of pooled connection to allow, or
- * 0 for no maximum.
- *
- * @throws java.lang.IllegalStateException
- * The Maximum Connections cannot be changed after the DataSource has been
- * used.
- */
- public void setMaxConnections(int maxConnections)
- {
- if (initialized)
- {
- throw new IllegalStateException("Cannot set Data Source properties after DataSource has been used");
- }
- this.maxConnections = maxConnections;
- }
-
- /**
- * Gets the name of this DataSource. This uniquely identifies the DataSource.
- * You cannot use more than one DataSource in the same VM with the same name.
- */
- public String getDataSourceName()
- {
- return dataSourceName;
- }
-
- /**
- * Sets the name of this DataSource. This is required, and uniquely identifies
- * the DataSource. You cannot create or use more than one DataSource in the
- * same VM with the same name.
- *
- * @throws java.lang.IllegalStateException
- * The Data Source Name cannot be changed after the DataSource has been
- * used.
- * @throws java.lang.IllegalArgumentException
- * Another PoolingDataSource with the same dataSourceName already
- * exists.
- */
- public void setDataSourceName(String dataSourceName)
- {
- if (initialized)
- {
- throw new IllegalStateException("Cannot set Data Source properties after DataSource has been used");
- }
- if (this.dataSourceName != null && dataSourceName != null && dataSourceName.equals(this.dataSourceName))
- {
- return ;
- }
- synchronized (dataSources)
- {
- if (getDataSource(dataSourceName) != null)
- {
- throw new IllegalArgumentException("DataSource with name '" + dataSourceName + "' already exists!");
- }
- if (this.dataSourceName != null)
- {
- dataSources.remove(this.dataSourceName);
- }
- this.dataSourceName = dataSourceName;
- addDataSource(dataSourceName);
- }
- }
-
- /**
- * Initializes this DataSource. If the initialConnections is greater than zero,
- * that number of connections will be created. After this method is called,
- * the DataSource properties cannot be changed. If you do not call this
- * explicitly, it will be called the first time you get a connection from the
- * DataSource.
- * @throws java.sql.SQLException
- * Occurs when the initialConnections is greater than zero, but the
- * DataSource is not able to create enough physical connections.
- */
- public void initialize() throws SQLException
- {
- synchronized (lock )
- {
- source = createConnectionPool();
- try {
- source.initializeFrom(this);
- } catch (Exception e) {
- throw new PSQLException(GT.tr("Failed to setup DataSource."),
- PSQLState.UNEXPECTED_ERROR, e);
- }
-
- while (available.size() < initialConnections)
- {
- available.push(source.getPooledConnection());
- }
-
- initialized = true;
- }
- }
-
- protected boolean isInitialized() {
- return initialized;
- }
-
- /**
- * Creates the appropriate ConnectionPool to use for this DataSource.
- */
- protected PGConnectionPoolDataSource createConnectionPool() {
- return new PGConnectionPoolDataSource();
- }
-
- /**
- * Gets a <b>non-pooled</b> connection, unless the user and password are the
- * same as the default values for this connection pool.
- *
- * @return A pooled connection.
- * @throws SQLException
- * Occurs when no pooled connection is available, and a new physical
- * connection cannot be created.
- */
- public Connection getConnection(String user, String password) throws SQLException
- {
- // If this is for the default user/password, use a pooled connection
- if (user == null ||
- (user.equals(getUser()) && ((password == null && getPassword() == null) || (password != null && password.equals(getPassword())))))
- {
- return getConnection();
- }
- // Otherwise, use a non-pooled connection
- if (!initialized)
- {
- initialize();
- }
- return super.getConnection(user, password);
- }
-
- /**
- * Gets a connection from the connection pool.
- *
- * @return A pooled connection.
- * @throws SQLException
- * Occurs when no pooled connection is available, and a new physical
- * connection cannot be created.
- */
- public Connection getConnection() throws SQLException
- {
- if (!initialized)
- {
- initialize();
- }
- return getPooledConnection();
- }
-
- /**
- * Closes this DataSource, and all the pooled connections, whether in use or not.
- */
- public void close()
- {
- synchronized (lock )
- {
- while (available.size() > 0)
- {
- PGPooledConnection pci = (PGPooledConnection)available.pop();
- try
- {
- pci.close();
- }
- catch (SQLException e)
- {
- }
- }
- available = null;
- while (used.size() > 0)
- {
- PGPooledConnection pci = (PGPooledConnection)used.pop();
- pci.removeConnectionEventListener(connectionEventListener);
- try
- {
- pci.close();
- }
- catch (SQLException e)
- {
- }
- }
- used = null;
- }
- removeStoredDataSource();
- }
-
- protected void removeStoredDataSource() {
- synchronized (dataSources)
- {
- dataSources.remove(dataSourceName);
- }
- }
-
- protected abstract void addDataSource(String dataSourceName);
-
- /**
- * Gets a connection from the pool. Will get an available one if
- * present, or create a new one if under the max limit. Will
- * block if all used and a new one would exceed the max.
- */
- private Connection getPooledConnection() throws SQLException
- {
- PooledConnection pc = null;
- synchronized (lock )
- {
- if (available == null)
- {
- throw new PSQLException(GT.tr("DataSource has been closed."),
- PSQLState.CONNECTION_DOES_NOT_EXIST);
- }
- while (true)
- {
- if (available.size() > 0)
- {
- pc = (PooledConnection)available.pop();
- used.push(pc);
- break;
- }
- if (maxConnections == 0 || used.size() < maxConnections)
- {
- pc = source.getPooledConnection();
- used.push(pc);
- break;
- }
- else
- {
- try
- {
- // Wake up every second at a minimum
- lock.wait(1000L);
- }
- catch (InterruptedException e)
- {
- }
- }
- }
- }
- pc.addConnectionEventListener(connectionEventListener);
- return pc.getConnection();
- }
-
- /**
- * Notified when a pooled connection is closed, or a fatal error occurs
- * on a pooled connection. This is the only way connections are marked
- * as unused.
- */
- private ConnectionEventListener connectionEventListener = new ConnectionEventListener()
- {
- public void connectionClosed(ConnectionEvent event)
- {
- ((PooledConnection)event.getSource()).removeConnectionEventListener(this);
- synchronized (lock )
- {
- if (available == null)
- {
- return ; // DataSource has been closed
- }
- boolean removed = used.remove(event.getSource());
- if (removed)
- {
- available.push(event.getSource());
- // There's now a new connection available
- lock.notify();
- }
- else
- {
- // a connection error occured
- }
- }
- }
-
- /**
- * This is only called for fatal errors, where the physical connection is
- * useless afterward and should be removed from the pool.
- */
- public void connectionErrorOccurred(ConnectionEvent event)
- {
- ((PooledConnection) event.getSource()).removeConnectionEventListener(this);
- synchronized (lock )
- {
- if (available == null)
- {
- return ; // DataSource has been closed
- }
- used.remove(event.getSource());
- // We're now at least 1 connection under the max
- lock.notify();
- }
- }
- };
-
- /**
- * Adds custom properties for this DataSource to the properties defined in
- * the superclass.
- */
- public Reference getReference() throws NamingException
- {
- Reference ref = super.getReference();
- ref.add(new StringRefAddr("dataSourceName", dataSourceName));
- if (initialConnections > 0)
- {
- ref.add(new StringRefAddr("initialConnections", Integer.toString(initialConnections)));
- }
- if (maxConnections > 0)
- {
- ref.add(new StringRefAddr("maxConnections", Integer.toString(maxConnections)));
- }
- return ref;
- }
-}
diff --git a/org/postgresql/ds/jdbc23/AbstractJdbc23SimpleDataSource.java b/org/postgresql/ds/jdbc23/AbstractJdbc23SimpleDataSource.java
deleted file mode 100644
index 279c171..0000000
--- a/org/postgresql/ds/jdbc23/AbstractJdbc23SimpleDataSource.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ds.jdbc23;
-
-import java.io.Serializable;
-import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
-import java.io.IOException;
-
-import org.postgresql.ds.common.*;
-
-/**
- * Simple DataSource which does not perform connection pooling. In order to use
- * the DataSource, you must set the property databaseName. The settings for
- * serverName, portNumber, user, and password are optional. Note: these properties
- * are declared in the superclass.
- *
- * @author Aaron Mulder (ammulder at chariotsolutions.com)
- */
-public abstract class AbstractJdbc23SimpleDataSource extends BaseDataSource implements Serializable
-{
- /**
- * Gets a description of this DataSource.
- */
- public String getDescription()
- {
- return "Non-Pooling DataSource from " + org.postgresql.Driver.getVersion();
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException
- {
- writeBaseObject(out);
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
- {
- readBaseObject(in);
- }
-}
diff --git a/org/postgresql/ds/jdbc4/AbstractJdbc4ConnectionPoolDataSource.java b/org/postgresql/ds/jdbc4/AbstractJdbc4ConnectionPoolDataSource.java
deleted file mode 100644
index 97e2658..0000000
--- a/org/postgresql/ds/jdbc4/AbstractJdbc4ConnectionPoolDataSource.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.postgresql.ds.jdbc4;
-
-import java.sql.SQLFeatureNotSupportedException;
-
-import org.postgresql.ds.jdbc23.AbstractJdbc23ConnectionPoolDataSource;
-
-public class AbstractJdbc4ConnectionPoolDataSource
- extends AbstractJdbc23ConnectionPoolDataSource
-{
-
- public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getParentLogger()");
- }
-
-}
-
diff --git a/org/postgresql/ds/jdbc4/AbstractJdbc4PooledConnection.java b/org/postgresql/ds/jdbc4/AbstractJdbc4PooledConnection.java
deleted file mode 100644
index dfe22c8..0000000
--- a/org/postgresql/ds/jdbc4/AbstractJdbc4PooledConnection.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ds.jdbc4;
-
-import java.sql.Connection;
-import java.sql.SQLFeatureNotSupportedException;
-import javax.sql.StatementEventListener;
-
-import org.postgresql.ds.jdbc23.AbstractJdbc23PooledConnection;
-
-public abstract class AbstractJdbc4PooledConnection extends AbstractJdbc23PooledConnection
-{
-
- public AbstractJdbc4PooledConnection(Connection con, boolean autoCommit, boolean isXA)
- {
- super(con, autoCommit, isXA);
- }
-
- public void removeStatementEventListener(StatementEventListener listener)
- {
- }
-
- public void addStatementEventListener(StatementEventListener listener)
- {
- }
-
- public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getParentLogger()");
- }
-
-}
diff --git a/org/postgresql/ds/jdbc4/AbstractJdbc4PoolingDataSource.java b/org/postgresql/ds/jdbc4/AbstractJdbc4PoolingDataSource.java
deleted file mode 100644
index 426f016..0000000
--- a/org/postgresql/ds/jdbc4/AbstractJdbc4PoolingDataSource.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ds.jdbc4;
-
-import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
-
-import org.postgresql.ds.jdbc23.AbstractJdbc23PoolingDataSource;
-
-public abstract class AbstractJdbc4PoolingDataSource extends AbstractJdbc23PoolingDataSource
-{
-
- public boolean isWrapperFor(Class<?> iface) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "isWrapperFor(Class<?>)");
- }
-
- public <T> T unwrap(Class<T> iface) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "unwrap(Class<T>)");
- }
-
- public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getParentLogger()");
- }
-
-}
diff --git a/org/postgresql/ds/jdbc4/AbstractJdbc4SimpleDataSource.java b/org/postgresql/ds/jdbc4/AbstractJdbc4SimpleDataSource.java
deleted file mode 100644
index 1d9b502..0000000
--- a/org/postgresql/ds/jdbc4/AbstractJdbc4SimpleDataSource.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ds.jdbc4;
-
-import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
-
-import org.postgresql.ds.jdbc23.AbstractJdbc23SimpleDataSource;
-
-public abstract class AbstractJdbc4SimpleDataSource extends AbstractJdbc23SimpleDataSource
-{
- public boolean isWrapperFor(Class<?> iface) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "isWrapperFor(Class<?>)");
- }
-
- public <T> T unwrap(Class<T> iface) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "unwrap(Class<T>)");
- }
-
- public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getParentLogger()");
- }
-
-}
diff --git a/org/postgresql/fastpath/Fastpath.java b/org/postgresql/fastpath/Fastpath.java
deleted file mode 100644
index 653f60b..0000000
--- a/org/postgresql/fastpath/Fastpath.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.fastpath;
-
-import java.sql.SQLException;
-import java.sql.ResultSet;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.postgresql.core.BaseConnection;
-import org.postgresql.core.QueryExecutor;
-import org.postgresql.core.ParameterList;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.GT;
-
-/**
- * This class implements the Fastpath api.
- *
- * <p>This is a means of executing functions embedded in the
- * backend from within a java application.
- *
- * <p>It is based around the file src/interfaces/libpq/fe-exec.c
- *
- */
-public class Fastpath
-{
- // Java passes oids around as longs, but in the backend
- // it's an unsigned int, so we use this to make the conversion
- // of long -> signed int which the backend interprets as unsigned.
- private final static long NUM_OIDS = 4294967296L; // 2^32
-
- // This maps the functions names to their id's (possible unique just
- // to a connection).
- private final Map func = new HashMap();
- private final QueryExecutor executor;
- private final BaseConnection connection;
-
- /**
- * Initialises the fastpath system
- *
- * @param conn BaseConnection to attach to
- */
- public Fastpath(BaseConnection conn)
- {
- this.connection = conn;
- this.executor = conn.getQueryExecutor();
- }
-
- /**
- * Send a function call to the PostgreSQL backend
- *
- * @param fnId Function id
- * @param resultType True if the result is an integer, false for other results
- * @param args FastpathArguments to pass to fastpath
- * @return null if no data, Integer if an integer result, or byte[] otherwise
- * @exception SQLException if a database-access error occurs.
- */
- public Object fastpath(int fnId, boolean resultType, FastpathArg[] args) throws SQLException
- {
- // Turn fastpath array into a parameter list.
- ParameterList params = executor.createFastpathParameters(args.length);
- for (int i = 0; i < args.length; ++i)
- {
- args[i].populateParameter(params, i + 1);
- }
-
- // Run it.
- byte[] returnValue = executor.fastpathCall(fnId, params, connection.getAutoCommit());
-
- // Interpret results.
- if (!resultType || returnValue == null)
- return returnValue;
-
- if (returnValue.length != 4)
- throw new PSQLException(GT.tr("Fastpath call {0} - No result was returned and we expected an integer.", new Integer(fnId)),
- PSQLState.NO_DATA);
-
- return new Integer((returnValue[3] & 255) |
- ((returnValue[2] & 255) << 8) |
- ((returnValue[1] & 255) << 16) |
- ((returnValue[0] & 255) << 24));
- }
-
- /**
- * Send a function call to the PostgreSQL backend by name.
- *
- * Note: the mapping for the procedure name to function id needs to exist,
- * usually to an earlier call to addfunction().
- *
- * This is the prefered method to call, as function id's can/may change
- * between versions of the backend.
- *
- * For an example of how this works, refer to org.postgresql.largeobject.LargeObject
- *
- * @param name Function name
- * @param resulttype True if the result is an integer, false for other
- * results
- * @param args FastpathArguments to pass to fastpath
- * @return null if no data, Integer if an integer result, or byte[] otherwise
- * @exception SQLException if name is unknown or if a database-access error
- * occurs.
- * @see org.postgresql.largeobject.LargeObject
- */
- public Object fastpath(String name, boolean resulttype, FastpathArg[] args) throws SQLException
- {
- if (connection.getLogger().logDebug())
- connection.getLogger().debug("Fastpath: calling " + name);
- return fastpath(getID(name), resulttype, args);
- }
-
- /**
- * This convenience method assumes that the return value is an Integer
- * @param name Function name
- * @param args Function arguments
- * @return integer result
- * @exception SQLException if a database-access error occurs or no result
- */
- public int getInteger(String name, FastpathArg[] args) throws SQLException
- {
- Integer i = (Integer)fastpath(name, true, args);
- if (i == null)
- throw new PSQLException(GT.tr("Fastpath call {0} - No result was returned and we expected an integer.", name),
- PSQLState.NO_DATA);
- return i.intValue();
- }
-
- /**
- * This convenience method assumes that the return value is an oid.
- * @param name Function name
- * @param args Function arguments
- * @exception SQLException if a database-access error occurs or no result
- */
- public long getOID(String name, FastpathArg[] args) throws SQLException
- {
- long oid = getInteger(name, args);
- if (oid < 0)
- oid += NUM_OIDS;
- return oid;
- }
-
- /**
- * This convenience method assumes that the return value is not an Integer
- * @param name Function name
- * @param args Function arguments
- * @return byte[] array containing result
- * @exception SQLException if a database-access error occurs or no result
- */
- public byte[] getData(String name, FastpathArg[] args) throws SQLException
- {
- return (byte[])fastpath(name, false, args);
- }
-
- /**
- * This adds a function to our lookup table.
- *
- * <p>User code should use the addFunctions method, which is based upon a
- * query, rather than hard coding the oid. The oid for a function is not
- * guaranteed to remain static, even on different servers of the same
- * version.
- *
- * @param name Function name
- * @param fnid Function id
- */
- public void addFunction(String name, int fnid)
- {
- func.put(name, new Integer(fnid));
- }
-
- /**
- * This takes a ResultSet containing two columns. Column 1 contains the
- * function name, Column 2 the oid.
- *
- * <p>It reads the entire ResultSet, loading the values into the function
- * table.
- *
- * <p><b>REMEMBER</b> to close() the resultset after calling this!!
- *
- * <p><b><em>Implementation note about function name lookups:</em></b>
- *
- * <p>PostgreSQL stores the function id's and their corresponding names in
- * the pg_proc table. To speed things up locally, instead of querying each
- * function from that table when required, a HashMap is used. Also, only
- * the function's required are entered into this table, keeping connection
- * times as fast as possible.
- *
- * <p>The org.postgresql.largeobject.LargeObject class performs a query upon it's startup,
- * and passes the returned ResultSet to the addFunctions() method here.
- *
- * <p>Once this has been done, the LargeObject api refers to the functions by
- * name.
- *
- * <p>Dont think that manually converting them to the oid's will work. Ok,
- * they will for now, but they can change during development (there was some
- * discussion about this for V7.0), so this is implemented to prevent any
- * unwarranted headaches in the future.
- *
- * @param rs ResultSet
- * @exception SQLException if a database-access error occurs.
- * @see org.postgresql.largeobject.LargeObjectManager
- */
- public void addFunctions(ResultSet rs) throws SQLException
- {
- while (rs.next())
- {
- func.put(rs.getString(1), new Integer(rs.getInt(2)));
- }
- }
-
- /**
- * This returns the function id associated by its name.
- *
- * <p>If addFunction() or addFunctions() have not been called for this name,
- * then an SQLException is thrown.
- *
- * @param name Function name to lookup
- * @return Function ID for fastpath call
- * @exception SQLException is function is unknown.
- */
- public int getID(String name) throws SQLException
- {
- Integer id = (Integer)func.get(name);
-
- // may be we could add a lookup to the database here, and store the result
- // in our lookup table, throwing the exception if that fails.
- // We must, however, ensure that if we do, any existing ResultSet is
- // unaffected, otherwise we could break user code.
- //
- // so, until we know we can do this (needs testing, on the TODO list)
- // for now, we throw the exception and do no lookups.
- if (id == null)
- throw new PSQLException(GT.tr("The fastpath function {0} is unknown.", name), PSQLState.UNEXPECTED_ERROR);
-
- return id.intValue();
- }
-
- /**
- * Creates a FastpathArg with an oid parameter.
- * This is here instead of a constructor of FastpathArg
- * because the constructor can't tell the difference between
- * an long that's really int8 and a long thats an oid.
- */
- public static FastpathArg createOIDArg(long oid)
- {
- if (oid > Integer.MAX_VALUE)
- oid -= NUM_OIDS;
- return new FastpathArg((int)oid);
- }
-
-}
-
diff --git a/org/postgresql/fastpath/FastpathArg.java b/org/postgresql/fastpath/FastpathArg.java
deleted file mode 100644
index 8d767f4..0000000
--- a/org/postgresql/fastpath/FastpathArg.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.fastpath;
-
-import java.sql.SQLException;
-import org.postgresql.core.ParameterList;
-
-// Not a very clean mapping to the new QueryExecutor/ParameterList
-// stuff, but it seems hard to support both v2 and v3 cleanly with
-// the same model while retaining API compatibility. So I've just
-// done it the ugly way..
-
-/**
- * Each fastpath call requires an array of arguments, the number and type
- * dependent on the function being called.
- */
-public class FastpathArg
-{
- /**
- * Encoded byte value of argument.
- */
- private final byte[] bytes;
- private final int bytesStart;
- private final int bytesLength;
-
- /**
- * Constructs an argument that consists of an integer value
- * @param value int value to set
- */
- public FastpathArg(int value)
- {
- bytes = new byte[4];
- bytes[3] = (byte) (value);
- bytes[2] = (byte) (value >> 8);
- bytes[1] = (byte) (value >> 16);
- bytes[0] = (byte) (value >> 24);
- bytesStart = 0;
- bytesLength = 4;
- }
-
- /**
- * Constructs an argument that consists of an array of bytes
- * @param bytes array to store
- */
- public FastpathArg(byte bytes[])
- {
- this(bytes, 0, bytes.length);
- }
-
- /**
- * Constructs an argument that consists of part of a byte array
- * @param buf source array
- * @param off offset within array
- * @param len length of data to include
- */
- public FastpathArg(byte buf[], int off, int len)
- {
- this.bytes = buf;
- this.bytesStart = off;
- this.bytesLength = len;
- }
-
- /**
- * Constructs an argument that consists of a String.
- * @param s String to store
- */
- public FastpathArg(String s)
- {
- this(s.getBytes());
- }
-
- void populateParameter(ParameterList params, int index) throws SQLException {
- if (bytes == null)
- params.setNull(index, 0);
- else
- params.setBytea(index, bytes, bytesStart, bytesLength);
- }
-}
-
diff --git a/org/postgresql/geometric/PGbox.java b/org/postgresql/geometric/PGbox.java
deleted file mode 100644
index 654a06e..0000000
--- a/org/postgresql/geometric/PGbox.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.geometric;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PGBinaryObject;
-import org.postgresql.util.PGobject;
-import org.postgresql.util.PGtokenizer;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-import java.io.Serializable;
-import java.sql.SQLException;
-
-/**
- * This represents the box datatype within org.postgresql.
- */
-public class PGbox extends PGobject implements PGBinaryObject, Serializable, Cloneable
-{
- /**
- * These are the two points.
- */
- public PGpoint point[] = new PGpoint[2];
-
- /**
- * @param x1 first x coordinate
- * @param y1 first y coordinate
- * @param x2 second x coordinate
- * @param y2 second y coordinate
- */
- public PGbox(double x1, double y1, double x2, double y2)
- {
- this();
- this.point[0] = new PGpoint(x1, y1);
- this.point[1] = new PGpoint(x2, y2);
- }
-
- /**
- * @param p1 first point
- * @param p2 second point
- */
- public PGbox(PGpoint p1, PGpoint p2)
- {
- this();
- this.point[0] = p1;
- this.point[1] = p2;
- }
-
- /**
- * @param s Box definition in PostgreSQL syntax
- * @exception SQLException if definition is invalid
- */
- public PGbox(String s) throws SQLException
- {
- this();
- setValue(s);
- }
-
- /**
- * Required constructor
- */
- public PGbox()
- {
- setType("box");
- }
-
- /**
- * This method sets the value of this object. It should be overidden,
- * but still called by subclasses.
- *
- * @param value a string representation of the value of the object
- * @exception SQLException thrown if value is invalid for this type
- */
- public void setValue(String value) throws SQLException
- {
- PGtokenizer t = new PGtokenizer(value, ',');
- if (t.getSize() != 2)
- throw new PSQLException(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,value}), PSQLState.DATA_TYPE_MISMATCH);
-
- point[0] = new PGpoint(t.getToken(0));
- point[1] = new PGpoint(t.getToken(1));
- }
-
- /**
- * @param b Definition of this point in PostgreSQL's binary syntax
- */
- public void setByteValue(byte[] b, int offset) {
- point[0] = new PGpoint();
- point[0].setByteValue(b, offset);
- point[1] = new PGpoint();
- point[1].setByteValue(b, offset + point[0].lengthInBytes());
- }
-
- /**
- * @param obj Object to compare with
- * @return true if the two boxes are identical
- */
- public boolean equals(Object obj)
- {
- if (obj instanceof PGbox)
- {
- PGbox p = (PGbox)obj;
-
- // Same points.
- if (p.point[0].equals(point[0]) && p.point[1].equals(point[1]))
- return true;
-
- // Points swapped.
- if (p.point[0].equals(point[1]) && p.point[1].equals(point[0]))
- return true;
-
- // Using the opposite two points of the box:
- // (x1,y1),(x2,y2) -> (x1,y2),(x2,y1)
- if (p.point[0].x == point[0].x && p.point[0].y == point[1].y &&
- p.point[1].x == point[1].x && p.point[1].y == point[0].y)
- return true;
-
- // Using the opposite two points of the box, and the points are swapped
- // (x1,y1),(x2,y2) -> (x2,y1),(x1,y2)
- if (p.point[0].x == point[1].x && p.point[0].y == point[0].y &&
- p.point[1].x == point[0].x && p.point[1].y == point[1].y)
- return true;
- }
-
- return false;
- }
-
- public int hashCode()
- {
- // This relies on the behaviour of point's hashcode being an exclusive-OR of
- // its X and Y components; we end up with an exclusive-OR of the two X and
- // two Y components, which is equal whenever equals() would return true
- // since xor is commutative.
- return point[0].hashCode() ^ point[1].hashCode();
- }
-
- public Object clone() throws CloneNotSupportedException
- {
- PGbox newPGbox = (PGbox) super.clone();
- if( newPGbox.point != null )
- {
- newPGbox.point = (PGpoint[]) newPGbox.point.clone();
- for( int i = 0; i < newPGbox.point.length; ++i )
- if( newPGbox.point[i] != null )
- newPGbox.point[i] = (PGpoint) newPGbox.point[i].clone();
- }
- return newPGbox;
- }
-
- /**
- * @return the PGbox in the syntax expected by org.postgresql
- */
- public String getValue()
- {
- return point[0].toString() + "," + point[1].toString();
- }
-
- public int lengthInBytes() {
- return point[0].lengthInBytes() + point[1].lengthInBytes();
- }
-
- public void toBytes(byte[] bytes, int offset) {
- point[0].toBytes(bytes, offset);
- point[1].toBytes(bytes, offset + point[0].lengthInBytes());
- }
-}
diff --git a/org/postgresql/geometric/PGcircle.java b/org/postgresql/geometric/PGcircle.java
deleted file mode 100644
index ca88ed4..0000000
--- a/org/postgresql/geometric/PGcircle.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.geometric;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PGobject;
-import org.postgresql.util.PGtokenizer;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-import java.io.Serializable;
-import java.sql.SQLException;
-
-/**
- * This represents org.postgresql's circle datatype, consisting of a point
- * and a radius
- */
-public class PGcircle extends PGobject implements Serializable, Cloneable
-{
- /**
- * This is the center point
- */
- public PGpoint center;
-
- /**
- * This is the radius
- */
- public double radius;
-
- /**
- * @param x coordinate of center
- * @param y coordinate of center
- * @param r radius of circle
- */
- public PGcircle(double x, double y, double r)
- {
- this(new PGpoint(x, y), r);
- }
-
- /**
- * @param c PGpoint describing the circle's center
- * @param r radius of circle
- */
- public PGcircle(PGpoint c, double r)
- {
- this();
- this.center = c;
- this.radius = r;
- }
-
- /**
- * @param s definition of the circle in PostgreSQL's syntax.
- * @exception SQLException on conversion failure
- */
- public PGcircle(String s) throws SQLException
- {
- this();
- setValue(s);
- }
-
- /**
- * This constructor is used by the driver.
- */
- public PGcircle()
- {
- setType("circle");
- }
-
- /**
- * @param s definition of the circle in PostgreSQL's syntax.
- * @exception SQLException on conversion failure
- */
- public void setValue(String s) throws SQLException
- {
- PGtokenizer t = new PGtokenizer(PGtokenizer.removeAngle(s), ',');
- if (t.getSize() != 2)
- throw new PSQLException(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,s}), PSQLState.DATA_TYPE_MISMATCH);
-
- try
- {
- center = new PGpoint(t.getToken(0));
- radius = Double.valueOf(t.getToken(1)).doubleValue();
- }
- catch (NumberFormatException e)
- {
- throw new PSQLException(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,s}), PSQLState.DATA_TYPE_MISMATCH, e);
- }
- }
-
- /**
- * @param obj Object to compare with
- * @return true if the two circles are identical
- */
- public boolean equals(Object obj)
- {
- if (obj instanceof PGcircle)
- {
- PGcircle p = (PGcircle)obj;
- return p.center.equals(center) && p.radius == radius;
- }
- return false;
- }
-
- public int hashCode()
- {
- long v = Double.doubleToLongBits(radius);
- return (int) (center.hashCode() ^ v ^ (v >>> 32));
- }
-
- public Object clone() throws CloneNotSupportedException
- {
- PGcircle newPGcircle = (PGcircle) super.clone();
- if( newPGcircle.center != null )
- newPGcircle.center = (PGpoint) newPGcircle.center.clone();
- return newPGcircle;
- }
-
- /**
- * @return the PGcircle in the syntax expected by org.postgresql
- */
- public String getValue()
- {
- return "<" + center + "," + radius + ">";
- }
-}
diff --git a/org/postgresql/geometric/PGline.java b/org/postgresql/geometric/PGline.java
deleted file mode 100644
index f082573..0000000
--- a/org/postgresql/geometric/PGline.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.geometric;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PGobject;
-import org.postgresql.util.PGtokenizer;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-import java.io.Serializable;
-import java.sql.SQLException;
-
-/**
- * This implements a line consisting of two points.
- *
- * Currently line is not yet implemented in the backend, but this class
- * ensures that when it's done were ready for it.
- */
-public class PGline extends PGobject implements Serializable, Cloneable
-{
- /**
- * These are the two points.
- */
- public PGpoint point[] = new PGpoint[2];
-
- /**
- * @param x1 coordinate for first point
- * @param y1 coordinate for first point
- * @param x2 coordinate for second point
- * @param y2 coordinate for second point
- */
- public PGline(double x1, double y1, double x2, double y2)
- {
- this(new PGpoint(x1, y1), new PGpoint(x2, y2));
- }
-
- /**
- * @param p1 first point
- * @param p2 second point
- */
- public PGline(PGpoint p1, PGpoint p2)
- {
- this();
- this.point[0] = p1;
- this.point[1] = p2;
- }
-
- /**
- * @param s definition of the line in PostgreSQL's syntax.
- * @exception SQLException on conversion failure
- */
- public PGline(String s) throws SQLException
- {
- this();
- setValue(s);
- }
-
- /**
- * reuired by the driver
- */
- public PGline()
- {
- setType("line");
- }
-
- /**
- * @param s Definition of the line in PostgreSQL's syntax
- * @exception SQLException on conversion failure
- */
- public void setValue(String s) throws SQLException
- {
- PGtokenizer t = new PGtokenizer(PGtokenizer.removeBox(s), ',');
- if (t.getSize() != 2)
- throw new PSQLException(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,s}), PSQLState.DATA_TYPE_MISMATCH);
-
- point[0] = new PGpoint(t.getToken(0));
- point[1] = new PGpoint(t.getToken(1));
- }
-
- /**
- * @param obj Object to compare with
- * @return true if the two lines are identical
- */
- public boolean equals(Object obj)
- {
- if (obj instanceof PGline)
- {
- PGline p = (PGline)obj;
- return (p.point[0].equals(point[0]) && p.point[1].equals(point[1])) ||
- (p.point[0].equals(point[1]) && p.point[1].equals(point[0]));
- }
- return false;
- }
-
- public int hashCode() {
- return point[0].hashCode() ^ point[1].hashCode();
- }
-
- public Object clone() throws CloneNotSupportedException
- {
- PGline newPGline = (PGline) super.clone();
- if( newPGline.point != null )
- {
- newPGline.point = (PGpoint[]) newPGline.point.clone();
- for( int i = 0; i < newPGline.point.length; ++i )
- if( newPGline.point[i] != null )
- newPGline.point[i] = (PGpoint) newPGline.point[i].clone();
- }
- return newPGline;
- }
-
- /**
- * @return the PGline in the syntax expected by org.postgresql
- */
- public String getValue()
- {
- return "[" + point[0] + "," + point[1] + "]";
- }
-}
diff --git a/org/postgresql/geometric/PGlseg.java b/org/postgresql/geometric/PGlseg.java
deleted file mode 100644
index 0425238..0000000
--- a/org/postgresql/geometric/PGlseg.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.geometric;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PGobject;
-import org.postgresql.util.PGtokenizer;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-import java.io.Serializable;
-import java.sql.SQLException;
-
-/**
- * This implements a lseg (line segment) consisting of two points
- */
-public class PGlseg extends PGobject implements Serializable, Cloneable
-{
- /**
- * These are the two points.
- */
- public PGpoint point[] = new PGpoint[2];
-
- /**
- * @param x1 coordinate for first point
- * @param y1 coordinate for first point
- * @param x2 coordinate for second point
- * @param y2 coordinate for second point
- */
- public PGlseg(double x1, double y1, double x2, double y2)
- {
- this(new PGpoint(x1, y1), new PGpoint(x2, y2));
- }
-
- /**
- * @param p1 first point
- * @param p2 second point
- */
- public PGlseg(PGpoint p1, PGpoint p2)
- {
- this();
- this.point[0] = p1;
- this.point[1] = p2;
- }
-
- /**
- * @param s definition of the line segment in PostgreSQL's syntax.
- * @exception SQLException on conversion failure
- */
- public PGlseg(String s) throws SQLException
- {
- this();
- setValue(s);
- }
-
- /**
- * reuired by the driver
- */
- public PGlseg()
- {
- setType("lseg");
- }
-
- /**
- * @param s Definition of the line segment in PostgreSQL's syntax
- * @exception SQLException on conversion failure
- */
- public void setValue(String s) throws SQLException
- {
- PGtokenizer t = new PGtokenizer(PGtokenizer.removeBox(s), ',');
- if (t.getSize() != 2)
- throw new PSQLException(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,s}), PSQLState.DATA_TYPE_MISMATCH);
-
- point[0] = new PGpoint(t.getToken(0));
- point[1] = new PGpoint(t.getToken(1));
- }
-
- /**
- * @param obj Object to compare with
- * @return true if the two line segments are identical
- */
- public boolean equals(Object obj)
- {
- if (obj instanceof PGlseg)
- {
- PGlseg p = (PGlseg)obj;
- return (p.point[0].equals(point[0]) && p.point[1].equals(point[1])) ||
- (p.point[0].equals(point[1]) && p.point[1].equals(point[0]));
- }
- return false;
- }
-
- public int hashCode()
- {
- return point[0].hashCode() ^ point[1].hashCode();
- }
-
- public Object clone() throws CloneNotSupportedException
- {
- PGlseg newPGlseg = (PGlseg) super.clone();
- if( newPGlseg.point != null )
- {
- newPGlseg.point = (PGpoint[]) newPGlseg.point.clone();
- for( int i = 0; i < newPGlseg.point.length; ++i )
- if( newPGlseg.point[i] != null )
- newPGlseg.point[i] = (PGpoint) newPGlseg.point[i].clone();
- }
- return newPGlseg;
- }
-
- /**
- * @return the PGlseg in the syntax expected by org.postgresql
- */
- public String getValue()
- {
- return "[" + point[0] + "," + point[1] + "]";
- }
-}
diff --git a/org/postgresql/geometric/PGpath.java b/org/postgresql/geometric/PGpath.java
deleted file mode 100644
index 49271c7..0000000
--- a/org/postgresql/geometric/PGpath.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.geometric;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PGobject;
-import org.postgresql.util.PGtokenizer;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-import java.io.Serializable;
-import java.sql.SQLException;
-
-/**
- * This implements a path (a multiple segmented line, which may be closed)
- */
-public class PGpath extends PGobject implements Serializable, Cloneable
-{
- /**
- * True if the path is open, false if closed
- */
- public boolean open;
-
- /**
- * The points defining this path
- */
- public PGpoint points[];
-
- /**
- * @param points the PGpoints that define the path
- * @param open True if the path is open, false if closed
- */
- public PGpath(PGpoint[] points, boolean open)
- {
- this();
- this.points = points;
- this.open = open;
- }
-
- /**
- * Required by the driver
- */
- public PGpath()
- {
- setType("path");
- }
-
- /**
- * @param s definition of the path in PostgreSQL's syntax.
- * @exception SQLException on conversion failure
- */
- public PGpath(String s) throws SQLException
- {
- this();
- setValue(s);
- }
-
- /**
- * @param s Definition of the path in PostgreSQL's syntax
- * @exception SQLException on conversion failure
- */
- public void setValue(String s) throws SQLException
- {
- // First test to see if were open
- if (s.startsWith("[") && s.endsWith("]"))
- {
- open = true;
- s = PGtokenizer.removeBox(s);
- }
- else if (s.startsWith("(") && s.endsWith(")"))
- {
- open = false;
- s = PGtokenizer.removePara(s);
- }
- else
- throw new PSQLException(GT.tr("Cannot tell if path is open or closed: {0}.", s), PSQLState.DATA_TYPE_MISMATCH);
-
- PGtokenizer t = new PGtokenizer(s, ',');
- int npoints = t.getSize();
- points = new PGpoint[npoints];
- for (int p = 0;p < npoints;p++)
- points[p] = new PGpoint(t.getToken(p));
- }
-
- /**
- * @param obj Object to compare with
- * @return true if the two paths are identical
- */
- public boolean equals(Object obj)
- {
- if (obj instanceof PGpath)
- {
- PGpath p = (PGpath)obj;
-
- if (p.points.length != points.length)
- return false;
-
- if (p.open != open)
- return false;
-
- for (int i = 0;i < points.length;i++)
- if (!points[i].equals(p.points[i]))
- return false;
-
- return true;
- }
- return false;
- }
-
- public int hashCode() {
- // XXX not very good..
- int hash = 0;
- for (int i = 0; i < points.length && i < 5; ++i)
- {
- hash = hash ^ points[i].hashCode();
- }
- return hash;
- }
-
- public Object clone() throws CloneNotSupportedException
- {
- PGpath newPGpath = (PGpath) super.clone();
- if( newPGpath.points != null )
- {
- newPGpath.points = (PGpoint[]) newPGpath.points.clone();
- for( int i = 0; i < newPGpath.points.length; ++i )
- newPGpath.points[i] = (PGpoint) newPGpath.points[i].clone();
- }
- return newPGpath;
- }
-
- /**
- * This returns the path in the syntax expected by org.postgresql
- */
- public String getValue()
- {
- StringBuffer b = new StringBuffer(open ? "[" : "(");
-
- for (int p = 0;p < points.length;p++)
- {
- if (p > 0)
- b.append(",");
- b.append(points[p].toString());
- }
- b.append(open ? "]" : ")");
-
- return b.toString();
- }
-
- public boolean isOpen()
- {
- return open;
- }
-
- public boolean isClosed()
- {
- return !open;
- }
-
- public void closePath()
- {
- open = false;
- }
-
- public void openPath()
- {
- open = true;
- }
-}
diff --git a/org/postgresql/geometric/PGpoint.java b/org/postgresql/geometric/PGpoint.java
deleted file mode 100644
index 96f07ba..0000000
--- a/org/postgresql/geometric/PGpoint.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.geometric;
-
-import org.postgresql.util.ByteConverter;
-import org.postgresql.util.GT;
-import org.postgresql.util.PGBinaryObject;
-import org.postgresql.util.PGobject;
-import org.postgresql.util.PGtokenizer;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-import java.awt.Point;
-import java.io.Serializable;
-import java.sql.SQLException;
-
-/**
- * It maps to the point datatype in org.postgresql.
- *
- * This implements a version of java.awt.Point, except it uses double
- * to represent the coordinates.
- */
-public class PGpoint extends PGobject implements PGBinaryObject, Serializable, Cloneable
-{
- /**
- * The X coordinate of the point
- */
- public double x;
-
- /**
- * The Y coordinate of the point
- */
- public double y;
-
- /**
- * @param x coordinate
- * @param y coordinate
- */
- public PGpoint(double x, double y)
- {
- this();
- this.x = x;
- this.y = y;
- }
-
- /**
- * This is called mainly from the other geometric types, when a
- * point is embedded within their definition.
- *
- * @param value Definition of this point in PostgreSQL's syntax
- */
- public PGpoint(String value) throws SQLException
- {
- this();
- setValue(value);
- }
-
- /**
- * Required by the driver
- */
- public PGpoint()
- {
- setType("point");
- }
-
- /**
- * @param s Definition of this point in PostgreSQL's syntax
- * @exception SQLException on conversion failure
- */
- public void setValue(String s) throws SQLException
- {
- PGtokenizer t = new PGtokenizer(PGtokenizer.removePara(s), ',');
- try
- {
- x = Double.valueOf(t.getToken(0)).doubleValue();
- y = Double.valueOf(t.getToken(1)).doubleValue();
- }
- catch (NumberFormatException e)
- {
- throw new PSQLException(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,s}), PSQLState.DATA_TYPE_MISMATCH, e);
- }
- }
-
- /**
- * @param b Definition of this point in PostgreSQL's binary syntax
- */
- public void setByteValue(byte[] b, int offset) {
- x = ByteConverter.float8(b, offset);
- y = ByteConverter.float8(b, offset + 8);
- }
-
- /**
- * @param obj Object to compare with
- * @return true if the two points are identical
- */
- public boolean equals(Object obj)
- {
- if (obj instanceof PGpoint)
- {
- PGpoint p = (PGpoint)obj;
- return x == p.x && y == p.y;
- }
- return false;
- }
-
- public int hashCode()
- {
- long v1 = Double.doubleToLongBits(x);
- long v2 = Double.doubleToLongBits(y);
- return (int) (v1 ^ v2 ^ (v1 >>> 32) ^ (v2 >>> 32));
- }
-
- /**
- * @return the PGpoint in the syntax expected by org.postgresql
- */
- public String getValue()
- {
- return "(" + x + "," + y + ")";
- }
-
- public int lengthInBytes() {
- return 16;
- }
-
- /**
- * @return the PGpoint in the binary syntax expected by org.postgresql
- */
- public void toBytes(byte[] b, int offset) {
- ByteConverter.float8(b, offset, x);
- ByteConverter.float8(b, offset + 8, y);
- }
-
- /**
- * Translate the point by the supplied amount.
- * @param x integer amount to add on the x axis
- * @param y integer amount to add on the y axis
- */
- public void translate(int x, int y)
- {
- translate((double)x, (double)y);
- }
-
- /**
- * Translate the point by the supplied amount.
- * @param x double amount to add on the x axis
- * @param y double amount to add on the y axis
- */
- public void translate(double x, double y)
- {
- this.x += x;
- this.y += y;
- }
-
- /**
- * Moves the point to the supplied coordinates.
- * @param x integer coordinate
- * @param y integer coordinate
- */
- public void move(int x, int y)
- {
- setLocation(x, y);
- }
-
- /**
- * Moves the point to the supplied coordinates.
- * @param x double coordinate
- * @param y double coordinate
- */
- public void move(double x, double y)
- {
- this.x = x;
- this.y = y;
- }
-
- /**
- * Moves the point to the supplied coordinates.
- * refer to java.awt.Point for description of this
- * @param x integer coordinate
- * @param y integer coordinate
- * @see java.awt.Point
- */
- public void setLocation(int x, int y)
- {
- move((double)x, (double)y);
- }
-
- /**
- * Moves the point to the supplied java.awt.Point
- * refer to java.awt.Point for description of this
- * @param p Point to move to
- * @see java.awt.Point
- */
- public void setLocation(Point p)
- {
- setLocation(p.x, p.y);
- }
-
-}
diff --git a/org/postgresql/geometric/PGpolygon.java b/org/postgresql/geometric/PGpolygon.java
deleted file mode 100644
index 034ed39..0000000
--- a/org/postgresql/geometric/PGpolygon.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.geometric;
-
-import org.postgresql.util.PGobject;
-import org.postgresql.util.PGtokenizer;
-import java.io.Serializable;
-import java.sql.SQLException;
-
-/**
- * This implements the polygon datatype within PostgreSQL.
- */
-public class PGpolygon extends PGobject implements Serializable, Cloneable
-{
- /**
- * The points defining the polygon
- */
- public PGpoint points[];
-
- /**
- * Creates a polygon using an array of PGpoints
- *
- * @param points the points defining the polygon
- */
- public PGpolygon(PGpoint[] points)
- {
- this();
- this.points = points;
- }
-
- /**
- * @param s definition of the polygon in PostgreSQL's syntax.
- * @exception SQLException on conversion failure
- */
- public PGpolygon(String s) throws SQLException
- {
- this();
- setValue(s);
- }
-
- /**
- * Required by the driver
- */
- public PGpolygon()
- {
- setType("polygon");
- }
-
- /**
- * @param s Definition of the polygon in PostgreSQL's syntax
- * @exception SQLException on conversion failure
- */
- public void setValue(String s) throws SQLException
- {
- PGtokenizer t = new PGtokenizer(PGtokenizer.removePara(s), ',');
- int npoints = t.getSize();
- points = new PGpoint[npoints];
- for (int p = 0;p < npoints;p++)
- points[p] = new PGpoint(t.getToken(p));
- }
-
- /**
- * @param obj Object to compare with
- * @return true if the two polygons are identical
- */
- public boolean equals(Object obj)
- {
- if (obj instanceof PGpolygon)
- {
- PGpolygon p = (PGpolygon)obj;
-
- if (p.points.length != points.length)
- return false;
-
- for (int i = 0;i < points.length;i++)
- if (!points[i].equals(p.points[i]))
- return false;
-
- return true;
- }
- return false;
- }
-
- public int hashCode() {
- // XXX not very good..
- int hash = 0;
- for (int i = 0; i < points.length && i < 5; ++i)
- {
- hash = hash ^ points[i].hashCode();
- }
- return hash;
- }
-
- public Object clone() throws CloneNotSupportedException
- {
- PGpolygon newPGpolygon = (PGpolygon) super.clone();
- if( newPGpolygon.points != null )
- {
- newPGpolygon.points = (PGpoint[]) newPGpolygon.points.clone();
- for( int i = 0; i < newPGpolygon.points.length; ++i )
- if( newPGpolygon.points[i] != null )
- newPGpolygon.points[i] = (PGpoint) newPGpolygon.points[i].clone();
- }
- return newPGpolygon;
- }
-
- /**
- * @return the PGpolygon in the syntax expected by org.postgresql
- */
- public String getValue()
- {
- StringBuffer b = new StringBuffer();
- b.append("(");
- for (int p = 0;p < points.length;p++)
- {
- if (p > 0)
- b.append(",");
- b.append(points[p].toString());
- }
- b.append(")");
- return b.toString();
- }
-}
diff --git a/org/postgresql/gss/GSSCallbackHandler.java b/org/postgresql/gss/GSSCallbackHandler.java
deleted file mode 100644
index 8ff08f9..0000000
--- a/org/postgresql/gss/GSSCallbackHandler.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2008-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-
-package org.postgresql.gss;
-
-import java.io.IOException;
-import javax.security.auth.callback.*;
-
-public class GSSCallbackHandler implements CallbackHandler {
-
- private final String user;
- private final String password;
-
- public GSSCallbackHandler(String user, String password)
- {
- this.user = user;
- this.password = password;
- }
-
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
- {
- for (int i=0; i<callbacks.length; i++) {
- if (callbacks[i] instanceof TextOutputCallback) {
- TextOutputCallback toc = (TextOutputCallback)callbacks[i];
- switch (toc.getMessageType()) {
- case TextOutputCallback.INFORMATION:
- System.out.println("INFO: " + toc.getMessage());
- break;
- case TextOutputCallback.ERROR:
- System.out.println("ERROR: " + toc.getMessage());
- break;
- case TextOutputCallback.WARNING:
- System.out.println("WARNING: " + toc.getMessage());
- break;
- default:
- throw new IOException("Unsupported message type: " + toc.getMessageType());
- }
- } else if (callbacks[i] instanceof NameCallback) {
- NameCallback nc = (NameCallback)callbacks[i];
- nc.setName(user);
- } else if (callbacks[i] instanceof PasswordCallback) {
- PasswordCallback pc = (PasswordCallback)callbacks[i];
- if (password == null) {
- throw new IOException("No cached kerberos ticket found and no password supplied.");
- }
- pc.setPassword(password.toCharArray());
- } else {
- throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback");
- }
- }
- }
-
-}
-
-
diff --git a/org/postgresql/gss/MakeGSS.java b/org/postgresql/gss/MakeGSS.java
deleted file mode 100644
index d8595c4..0000000
--- a/org/postgresql/gss/MakeGSS.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2008-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-
-package org.postgresql.gss;
-
-import org.ietf.jgss.*;
-import javax.security.auth.Subject;
-import javax.security.auth.login.LoginContext;
-import java.security.PrivilegedAction;
-
-import java.io.IOException;
-import java.sql.SQLException;
-
-import org.postgresql.core.PGStream;
-import org.postgresql.core.Logger;
-import org.postgresql.util.*;
-
-
-public class MakeGSS
-{
-
- public static void authenticate(PGStream pgStream, String host, String user, String password, String jaasApplicationName, String kerberosServerName, Logger logger, boolean useSpnego) throws IOException, SQLException
- {
- if (logger.logDebug())
- logger.debug(" <=BE AuthenticationReqGSS");
-
- Object result = null;
-
- if (jaasApplicationName == null)
- jaasApplicationName = "pgjdbc";
- if (kerberosServerName == null)
- kerberosServerName = "postgres";
-
- try {
- LoginContext lc = new LoginContext(jaasApplicationName, new GSSCallbackHandler(user, password));
- lc.login();
-
- Subject sub = lc.getSubject();
- PrivilegedAction action = new GssAction(pgStream, host, user, password, kerberosServerName, logger, useSpnego);
- result = Subject.doAs(sub, action);
- } catch (Exception e) {
- throw new PSQLException(GT.tr("GSS Authentication failed"), PSQLState.CONNECTION_FAILURE, e);
- }
-
- if (result instanceof IOException)
- throw (IOException)result;
- else if (result instanceof SQLException)
- throw (SQLException)result;
- else if (result != null)
- throw new PSQLException(GT.tr("GSS Authentication failed"), PSQLState.CONNECTION_FAILURE, (Exception)result);
-
- }
-
-}
-
-class GssAction implements PrivilegedAction
-{
- private final PGStream pgStream;
- private final String host;
- private final String user;
- private final String password;
- private final String kerberosServerName;
- private final Logger logger;
- private final boolean useSpnego;
-
- public GssAction(PGStream pgStream, String host, String user, String password, String kerberosServerName, Logger logger, boolean useSpnego)
- {
- this.pgStream = pgStream;
- this.host = host;
- this.user = user;
- this.password = password;
- this.kerberosServerName = kerberosServerName;
- this.logger = logger;
- this.useSpnego = useSpnego;
- }
-
- private static boolean hasSpnegoSupport(GSSManager manager) throws GSSException {
-
- org.ietf.jgss.Oid spnego = new org.ietf.jgss.Oid("1.3.6.1.5.5.2");
- org.ietf.jgss.Oid mechs[] = manager.getMechs();
-
- for (int i = 0; i < mechs.length; ++i) {
- if (mechs[i].equals(spnego)) {
- return true;
- }
- }
-
- return false;
- }
-
- public Object run() {
-
- try {
-
- GSSManager manager = GSSManager.getInstance();
-
- org.ietf.jgss.Oid desiredMechs[] = new org.ietf.jgss.Oid[1];
- if (useSpnego && hasSpnegoSupport(manager)) {
- desiredMechs[0] = new org.ietf.jgss.Oid("1.3.6.1.5.5.2");
- } else {
- desiredMechs[0] = new org.ietf.jgss.Oid("1.2.840.113554.1.2.2");
- }
-
- GSSName clientName = manager.createName(user, GSSName.NT_USER_NAME);
- GSSCredential clientCreds = manager.createCredential(clientName, 8*3600, desiredMechs, GSSCredential.INITIATE_ONLY);
-
- GSSName serverName = manager.createName(kerberosServerName + "@" + host, GSSName.NT_HOSTBASED_SERVICE);
-
- GSSContext secContext = manager.createContext(serverName, desiredMechs[0], clientCreds, GSSContext.DEFAULT_LIFETIME);
- secContext.requestMutualAuth(true);
-
- byte inToken[] = new byte[0];
- byte outToken[] = null;
-
- boolean established = false;
- while (!established) {
- outToken = secContext.initSecContext(inToken, 0, inToken.length);
-
-
- if (outToken != null) {
- if (logger.logDebug())
- logger.debug(" FE=> Password(GSS Authentication Token)");
-
- pgStream.SendChar('p');
- pgStream.SendInteger4(4 + outToken.length);
- pgStream.Send(outToken);
- pgStream.flush();
- }
-
- if (!secContext.isEstablished()) {
- int response = pgStream.ReceiveChar();
- // Error
- if (response == 'E') {
- int l_elen = pgStream.ReceiveInteger4();
- ServerErrorMessage l_errorMsg = new ServerErrorMessage(pgStream.ReceiveString(l_elen - 4), logger.getLogLevel());
-
- if (logger.logDebug())
- logger.debug(" <=BE ErrorMessage(" + l_errorMsg + ")");
-
- return new PSQLException(l_errorMsg);
-
- } else if (response == 'R') {
-
- if (logger.logDebug())
- logger.debug(" <=BE AuthenticationGSSContinue");
-
- int len = pgStream.ReceiveInteger4();
- int type = pgStream.ReceiveInteger4();
- // should check type = 8
- inToken = pgStream.Receive(len - 8);
- } else {
- // Unknown/unexpected message type.
- return new PSQLException(GT.tr("Protocol error. Session setup failed."), PSQLState.CONNECTION_UNABLE_TO_CONNECT);
- }
- } else {
- established = true;
- }
- }
-
- } catch (IOException e) {
- return e;
- } catch (GSSException gsse) {
- return new PSQLException(GT.tr("GSS Authentication failed"), PSQLState.CONNECTION_FAILURE, gsse);
- }
-
- return null;
- }
-}
-
diff --git a/org/postgresql/jdbc2/AbstractJdbc2Array.java b/org/postgresql/jdbc2/AbstractJdbc2Array.java
deleted file mode 100644
index 23bc4f7..0000000
--- a/org/postgresql/jdbc2/AbstractJdbc2Array.java
+++ /dev/null
@@ -1,911 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc2;
-
-import org.postgresql.core.*;
-import org.postgresql.util.ByteConverter;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.GT;
-
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Types;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Array is used collect one column of query result data.
- *
- * <p>
- * Read a field of type Array into either a natively-typed Java array object or
- * a ResultSet. Accessor methods provide the ability to capture array slices.
- *
- * <p>
- * Other than the constructor all methods are direct implementations of those
- * specified for java.sql.Array. Please refer to the javadoc for java.sql.Array
- * for detailed descriptions of the functionality and parameters of the methods
- * of this class.
- *
- * @see ResultSet#getArray
- */
-public abstract class AbstractJdbc2Array
-{
-
- /**
- * Array list implementation specific for storing PG array elements.
- */
- private static class PgArrayList extends ArrayList
- {
-
- private static final long serialVersionUID = 2052783752654562677L;
-
- /**
- * How many dimensions.
- */
- int dimensionsCount = 1;
-
- }
-
- /**
- * A database connection.
- */
- private BaseConnection connection = null;
-
- /**
- * The OID of this field.
- */
- private int oid;
-
- /**
- * Field value as String.
- */
- private String fieldString = null;
-
- /**
- * Whether Object[] should be used instead primitive arrays. Object[] can
- * contain null elements. It should be set to <Code>true</Code> if
- * {@link BaseConnection#haveMinimumCompatibleVersion(String)} returns
- * <Code>true</Code> for argument "8.3".
- */
- private final boolean useObjects;
-
- /**
- * Are we connected to an 8.2 or higher server? Only 8.2 or higher
- * supports null array elements.
- */
- private final boolean haveMinServer82;
-
- /**
- * Value of field as {@link PgArrayList}. Will be initialized only once
- * within {@link #buildArrayList()}.
- */
- private PgArrayList arrayList;
-
- private byte[] fieldBytes;
-
- private AbstractJdbc2Array(BaseConnection connection, int oid) throws SQLException {
- this.connection = connection;
- this.oid = oid;
- this.useObjects = connection.haveMinimumCompatibleVersion("8.3");
- this.haveMinServer82 = connection.haveMinimumServerVersion("8.2");
- }
-
- /**
- * Create a new Array.
- *
- * @param connection a database connection
- * @param oid the oid of the array datatype
- * @param fieldString the array data in string form
- */
- public AbstractJdbc2Array(BaseConnection connection, int oid, String fieldString) throws SQLException {
- this(connection, oid);
- this.fieldString = fieldString;
- }
-
- /**
- * Create a new Array.
- *
- * @param connection a database connection
- * @param oid the oid of the array datatype
- * @param fieldBytes the array data in byte form
- */
- public AbstractJdbc2Array(BaseConnection connection, int oid, byte[] fieldBytes) throws SQLException {
- this(connection, oid);
- this.fieldBytes = fieldBytes;
- }
-
- public Object getArray() throws SQLException
- {
- return getArrayImpl(1, 0, null);
- }
-
- public Object getArray(long index, int count) throws SQLException
- {
- return getArrayImpl(index, count, null);
- }
-
- public Object getArrayImpl(Map map) throws SQLException
- {
- return getArrayImpl(1, 0, map);
- }
-
- public Object getArrayImpl(long index, int count, Map map) throws SQLException
- {
-
- // for now maps aren't supported.
- if (map != null && !map.isEmpty())
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getArrayImpl(long,int,Map)");
- }
-
- // array index is out of range
- if (index < 1)
- {
- throw new PSQLException(GT.tr("The array index is out of range: {0}", new Long(index)), PSQLState.DATA_ERROR);
- }
-
- if (fieldBytes != null) {
- return readBinaryArray((int) index, count);
- }
-
- buildArrayList();
-
- if (count == 0)
- count = arrayList.size();
-
- // array index out of range
- if ((--index) + count > arrayList.size())
- {
- throw new PSQLException(GT.tr("The array index is out of range: {0}, number of elements: {1}.", new Object[] { new Long(index + count), new Long(arrayList.size()) }), PSQLState.DATA_ERROR);
- }
-
- return buildArray(arrayList, (int) index, count);
- }
-
- private Object readBinaryArray(int index, int count) throws SQLException {
- int dimensions = ByteConverter.int4(fieldBytes, 0);
- //int flags = ByteConverter.int4(fieldBytes, 4); // bit 0: 0=no-nulls, 1=has-nulls
- int elementOid = ByteConverter.int4(fieldBytes, 8);
- int pos = 12;
- int[] dims = new int[dimensions];
- for (int d = 0; d < dimensions; ++d) {
- dims[d] = ByteConverter.int4(fieldBytes, pos); pos += 4;
- /*int lbound = ByteConverter.int4(fieldBytes, pos);*/ pos += 4;
- }
- if (dimensions == 0) {
- return java.lang.reflect.Array.newInstance(elementOidToClass(elementOid), 0);
- }
- if (count > 0) {
- dims[0] = Math.min(count, dims[0]);
- }
- Object arr = java.lang.reflect.Array.newInstance(elementOidToClass(elementOid), dims);
- try {
- storeValues((Object[]) arr, elementOid, dims, pos, 0, index);
- }
- catch (IOException ioe)
- {
- throw new PSQLException(GT.tr("Invalid character data was found. This is most likely caused by stored data containing characters that are invalid for the character set the database was created in. The most common example of this is storing 8bit data in a SQL_ASCII database."), PSQLState.DATA_ERROR, ioe);
- }
- return arr;
- }
-
- private int storeValues(final Object[] arr, int elementOid, final int[] dims, int pos, final int thisDimension, int index) throws SQLException, IOException {
- if (thisDimension == dims.length - 1) {
- for (int i = 1; i < index; ++i) {
- int len = ByteConverter.int4(fieldBytes, pos); pos += 4;
- if (len != -1) {
- pos += len;
- }
- }
- for (int i = 0; i < dims[thisDimension]; ++i) {
- int len = ByteConverter.int4(fieldBytes, pos); pos += 4;
- if (len == -1) {
- continue;
- }
- switch (elementOid) {
- case Oid.INT2:
- arr[i] = new Short(ByteConverter.int2(fieldBytes, pos));
- break;
- case Oid.INT4:
- arr[i] = new Integer(ByteConverter.int4(fieldBytes, pos));
- break;
- case Oid.INT8:
- arr[i] = new Long(ByteConverter.int8(fieldBytes, pos));
- break;
- case Oid.FLOAT4:
- arr[i] = new Float(ByteConverter.float4(fieldBytes, pos));
- break;
- case Oid.FLOAT8:
- arr[i] = new Double(ByteConverter.float8(fieldBytes, pos));
- break;
- case Oid.TEXT:
- case Oid.VARCHAR:
- Encoding encoding = connection.getEncoding();
- arr[i] = encoding.decode(fieldBytes, pos, len);
- break;
- }
- pos += len;
- }
- } else {
- for (int i = 0; i < dims[thisDimension]; ++i) {
- pos = storeValues((Object[]) arr[i], elementOid, dims, pos, thisDimension + 1, 0);
- }
- }
- return pos;
- }
-
-
- private ResultSet readBinaryResultSet(int index, int count) throws SQLException {
- int dimensions = ByteConverter.int4(fieldBytes, 0);
- //int flags = ByteConverter.int4(fieldBytes, 4); // bit 0: 0=no-nulls, 1=has-nulls
- int elementOid = ByteConverter.int4(fieldBytes, 8);
- int pos = 12;
- int[] dims = new int[dimensions];
- for (int d = 0; d < dimensions; ++d) {
- dims[d] = ByteConverter.int4(fieldBytes, pos); pos += 4;
- /*int lbound = ByteConverter.int4(fieldBytes, pos); */ pos += 4;
- }
- if (count > 0 && dimensions > 0) {
- dims[0] = Math.min(count, dims[0]);
- }
- List rows = new ArrayList();
- Field[] fields = new Field[2];
- if (dimensions > 0) {
- storeValues(rows, fields, elementOid, dims, pos, 0, index);
- }
- BaseStatement stat = (BaseStatement) connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
- return stat.createDriverResultSet(fields, rows);
- }
-
- private int storeValues(List rows, Field[] fields, int elementOid, final int[] dims, int pos, final int thisDimension, int index) throws SQLException {
- if (thisDimension == dims.length - 1) {
- fields[0] = new Field("INDEX", Oid.INT4);
- fields[0].setFormat(Field.BINARY_FORMAT);
- fields[1] = new Field("VALUE", elementOid);
- fields[1].setFormat(Field.BINARY_FORMAT);
- for (int i = 1; i < index; ++i) {
- int len = ByteConverter.int4(fieldBytes, pos); pos += 4;
- if (len != -1) {
- pos += len;
- }
- }
- for (int i = 0; i < dims[thisDimension]; ++i) {
- byte[][] rowData = new byte[2][];
- rowData[0] = new byte[4];
- ByteConverter.int4(rowData[0], 0, i + index);
- rows.add(rowData);
- int len = ByteConverter.int4(fieldBytes, pos); pos += 4;
- if (len == -1) {
- continue;
- }
- rowData[1] = new byte[len];
- System.arraycopy(fieldBytes, pos, rowData[1], 0, rowData[1].length);
- pos += len;
- }
- } else {
- fields[0] = new Field("INDEX", Oid.INT4);
- fields[0].setFormat(Field.BINARY_FORMAT);
- fields[1] = new Field("VALUE", oid);
- fields[1].setFormat(Field.BINARY_FORMAT);
- int nextDimension = thisDimension + 1;
- int dimensionsLeft = dims.length - nextDimension;
- for (int i = 1; i < index; ++i) {
- pos = calcRemainingDataLength(dims, pos, elementOid, nextDimension);
- }
- for (int i = 0; i < dims[thisDimension]; ++i) {
- byte[][] rowData = new byte[2][];
- rowData[0] = new byte[4];
- ByteConverter.int4(rowData[0], 0, i + index);
- rows.add(rowData);
- int dataEndPos = calcRemainingDataLength(dims, pos, elementOid, nextDimension);
- int dataLength = dataEndPos - pos;
- rowData[1] = new byte[12 + 8 * dimensionsLeft + dataLength];
- ByteConverter.int4(rowData[1], 0, dimensionsLeft);
- System.arraycopy(fieldBytes, 4, rowData[1], 4, 8);
- System.arraycopy(fieldBytes, 12 + nextDimension * 8, rowData[1], 12, dimensionsLeft * 8);
- System.arraycopy(fieldBytes, pos, rowData[1], 12 + dimensionsLeft * 8, dataLength);
- pos = dataEndPos;
- }
- }
- return pos;
- }
-
- private int calcRemainingDataLength(int[] dims, int pos, int elementOid, int thisDimension) {
- if (thisDimension == dims.length - 1) {
- for (int i = 0; i < dims[thisDimension]; ++i) {
- int len = ByteConverter.int4(fieldBytes, pos); pos += 4;
- if (len == -1) {
- continue;
- }
- pos += len;
- }
- } else {
- pos = calcRemainingDataLength(dims, elementOid, pos, thisDimension + 1);
- }
- return pos;
- }
-
- private Class elementOidToClass(int oid)
- throws SQLException {
- switch (oid) {
- case Oid.INT2:
- return Short.class;
- case Oid.INT4:
- return Integer.class;
- case Oid.INT8:
- return Long.class;
- case Oid.FLOAT4:
- return Float.class;
- case Oid.FLOAT8:
- return Double.class;
- case Oid.TEXT:
- case Oid.VARCHAR:
- return String.class;
- default:
- throw org.postgresql.Driver.notImplemented(this.getClass(),
- "readBinaryArray(data,oid)");
- }
- }
-
- /**
- * Build {@link ArrayList} from field's string input. As a result
- * of this method {@link #arrayList} is build. Method can be called
- * many times in order to make sure that array list is ready to use, however
- * {@link #arrayList} will be set only once during first call.
- */
- private synchronized void buildArrayList() throws SQLException
- {
- if (arrayList != null)
- return;
-
- arrayList = new PgArrayList();
-
- char delim = connection.getTypeInfo().getArrayDelimiter(oid);
-
- if (fieldString != null)
- {
-
- char[] chars = fieldString.toCharArray();
- StringBuffer buffer = null;
- boolean insideString = false;
- boolean wasInsideString = false; // needed for checking if NULL
- // value occured
- List dims = new ArrayList(); // array dimension arrays
- PgArrayList curArray = arrayList; // currently processed array
-
- // Starting with 8.0 non-standard (beginning index
- // isn't 1) bounds the dimensions are returned in the
- // data formatted like so "[0:3]={0,1,2,3,4}".
- // Older versions simply do not return the bounds.
- //
- // Right now we ignore these bounds, but we could
- // consider allowing these index values to be used
- // even though the JDBC spec says 1 is the first
- // index. I'm not sure what a client would like
- // to see, so we just retain the old behavior.
- int startOffset = 0;
- {
- if (chars[0] == '[')
- {
- while (chars[startOffset] != '=')
- {
- startOffset++;
- }
- startOffset++; // skip =
- }
- }
-
- for (int i = startOffset; i < chars.length; i++)
- {
-
- // escape character that we need to skip
- if (chars[i] == '\\')
- i++;
-
- // subarray start
- else if (!insideString && chars[i] == '{')
- {
- if (dims.size() == 0)
- {
- dims.add(arrayList);
- }
- else
- {
- PgArrayList a = new PgArrayList();
- PgArrayList p = ((PgArrayList) dims.get(dims.size() - 1));
- p.add(a);
- dims.add(a);
- }
- curArray = (PgArrayList) dims.get(dims.size() - 1);
-
- // number of dimensions
- {
- for (int t = i + 1; t < chars.length; t++) {
- if (Character.isWhitespace(chars[t])) continue;
- else if (chars[t] == '{') curArray.dimensionsCount++;
- else break;
- }
- }
-
- buffer = new StringBuffer();
- continue;
- }
-
- // quoted element
- else if (chars[i] == '"')
- {
- insideString = !insideString;
- wasInsideString = true;
- continue;
- }
-
- // white space
- else if (!insideString && Character.isWhitespace(chars[i]))
- {
- continue;
- }
-
- // array end or element end
- else if ((!insideString && (chars[i] == delim || chars[i] == '}')) || i == chars.length - 1)
- {
-
- // when character that is a part of array element
- if (chars[i] != '"' && chars[i] != '}' && chars[i] != delim && buffer != null)
- {
- buffer.append(chars[i]);
- }
-
- String b = buffer == null ? null : buffer.toString();
-
- // add element to current array
- if (b != null && (b.length() > 0 || wasInsideString))
- {
- curArray.add(!wasInsideString && haveMinServer82 && b.equals("NULL") ? null : b);
- }
-
- wasInsideString = false;
- buffer = new StringBuffer();
-
- // when end of an array
- if (chars[i] == '}')
- {
- dims.remove(dims.size() - 1);
-
- // when multi-dimension
- if (dims.size() > 0)
- {
- curArray = (PgArrayList) dims.get(dims.size() - 1);
- }
-
- buffer = null;
- }
-
- continue;
- }
-
- if (buffer != null)
- buffer.append(chars[i]);
- }
- }
- }
-
- /**
- * Convert {@link ArrayList} to array.
- *
- * @param input list to be converted into array
- */
- private Object buildArray (PgArrayList input, int index, int count) throws SQLException
- {
-
- if (count < 0)
- count = input.size();
-
- // array to be returned
- Object ret = null;
-
- // how many dimensions
- int dims = input.dimensionsCount;
-
- // dimensions length array (to be used with java.lang.reflect.Array.newInstance(Class<?>, int[]))
- int[] dimsLength = dims > 1 ? new int[dims] : null;
- if (dims > 1) {
- for (int i = 0; i < dims; i++) {
- dimsLength[i] = (i == 0 ? count : 0);
- }
- }
-
- // array elements counter
- int length = 0;
-
- // array elements type
- final int type = connection.getTypeInfo().getSQLType(connection.getTypeInfo().getPGArrayElement(oid));
-
- if (type == Types.BIT)
- {
- boolean[] pa = null; // primitive array
- Object[] oa = null; // objects array
-
- if (dims > 1 || useObjects)
- {
-ret = oa = (dims > 1 ? (Object[]) java.lang.reflect.Array.newInstance(useObjects ? Boolean.class : boolean.class, dimsLength) : new Boolean[count]);
- }
- else
- {
- ret = pa = new boolean[count];
- }
-
- // add elements
- for (; count > 0; count--)
- {
- Object o = input.get(index++);
-
- if (dims > 1 || useObjects)
- {
- oa[length++] = o == null ? null : (dims > 1 ? buildArray((PgArrayList) o, 0, -1) : new Boolean(AbstractJdbc2ResultSet.toBoolean((String) o)));
- }
- else
- {
- pa[length++] = o == null ? false : AbstractJdbc2ResultSet.toBoolean((String) o);
- }
- }
- }
-
- else if (type == Types.SMALLINT || type == Types.INTEGER)
- {
- int[] pa = null;
- Object[] oa = null;
-
- if (dims > 1 || useObjects)
- {
-ret = oa = (dims > 1 ? (Object[]) java.lang.reflect.Array.newInstance(useObjects ? Integer.class : int.class, dimsLength) : new Integer[count]);
- }
- else
- {
- ret = pa = new int[count];
- }
-
- for (; count > 0; count--)
- {
- Object o = input.get(index++);
-
- if (dims > 1 || useObjects)
- {
- oa[length++] = o == null ? null : (dims > 1 ? buildArray((PgArrayList) o, 0, -1) : new Integer(AbstractJdbc2ResultSet.toInt((String) o)));
- }
- else
- {
- pa[length++] = o == null ? 0 : AbstractJdbc2ResultSet.toInt((String) o);
- }
- }
- }
-
- else if (type == Types.BIGINT)
- {
- long[] pa = null;
- Object[] oa = null;
-
- if (dims > 1 || useObjects)
- {
-ret = oa = (dims > 1 ? (Object[]) java.lang.reflect.Array.newInstance(useObjects ? Long.class : long.class, dimsLength) : new Long[count]);
- }
-
- else
- {
- ret = pa = new long[count];
- }
-
- for (; count > 0; count--)
- {
- Object o = input.get(index++);
-
- if (dims > 1 || useObjects)
- {
- oa[length++] = o == null ? null : (dims > 1 ? buildArray((PgArrayList) o, 0, -1) : new Long(AbstractJdbc2ResultSet.toLong((String) o)));
- }
- else
- {
- pa[length++] = o == null ? 0l : AbstractJdbc2ResultSet.toLong((String) o);
- }
- }
- }
-
- else if (type == Types.NUMERIC)
- {
- Object[] oa = null;
- ret = oa = (dims > 1 ? (Object[]) java.lang.reflect.Array.newInstance(BigDecimal.class, dimsLength) : new BigDecimal[count]);
-
- for (; count > 0; count--)
- {
- Object v = input.get(index++);
- oa[length++] = dims > 1 && v != null ? buildArray((PgArrayList) v, 0, -1) : (v == null ? null : AbstractJdbc2ResultSet.toBigDecimal((String) v, -1));
- }
- }
-
- else if (type == Types.REAL)
- {
- float[] pa = null;
- Object[] oa = null;
-
- if (dims > 1 || useObjects)
- {
-ret = oa = (dims > 1 ? (Object[]) java.lang.reflect.Array.newInstance(useObjects ? Float.class : float.class, dimsLength) : new Float[count]);
- }
- else
- {
- ret = pa = new float[count];
- }
-
- for (; count > 0; count--)
- {
- Object o = input.get(index++);
-
- if (dims > 1 || useObjects)
- {
- oa[length++] = o == null ? null : (dims > 1 ? buildArray((PgArrayList) o, 0, -1) : new Float(AbstractJdbc2ResultSet.toFloat((String) o)));
- }
- else
- {
- pa[length++] = o == null ? 0f : AbstractJdbc2ResultSet.toFloat((String) o);
- }
- }
- }
-
- else if (type == Types.DOUBLE)
- {
- double[] pa = null;
- Object[] oa = null;
-
- if (dims > 1 || useObjects)
- {
-ret = oa = (dims > 1 ? (Object[]) java.lang.reflect.Array.newInstance(useObjects ? Double.class : double.class, dimsLength) : new Double[count]);
- }
- else
- {
- ret = pa = new double[count];
- }
-
- for (; count > 0; count--)
- {
- Object o = input.get(index++);
-
- if (dims > 1 || useObjects)
- {
- oa[length++] = o == null ? null : (dims > 1 ? buildArray((PgArrayList) o, 0, -1) : new Double(AbstractJdbc2ResultSet.toDouble((String) o)));
- }
- else
- {
- pa[length++] = o == null ? 0d : AbstractJdbc2ResultSet.toDouble((String) o);
- }
- }
- }
-
- else if (type == Types.CHAR || type == Types.VARCHAR)
- {
- Object[] oa = null;
- ret = oa = (dims > 1 ? (Object[]) java.lang.reflect.Array.newInstance(String.class, dimsLength) : new String[count]);
-
- for (; count > 0; count--)
- {
- Object v = input.get(index++);
- oa[length++] = dims > 1 && v != null ? buildArray((PgArrayList) v, 0, -1) : v;
- }
- }
-
- else if (type == Types.DATE)
- {
- Object[] oa = null;
- ret = oa = (dims > 1 ? (Object[]) java.lang.reflect.Array.newInstance(java.sql.Date.class, dimsLength) : new java.sql.Date[count]);
-
- for (; count > 0; count--)
- {
- Object v = input.get(index++);
- oa[length++] = dims > 1 && v != null ? buildArray((PgArrayList) v, 0, -1) : (v == null ? null : connection.getTimestampUtils().toDate(null, (String) v));
- }
- }
-
- else if (type == Types.TIME)
- {
- Object[] oa = null;
- ret = oa = (dims > 1 ? (Object[]) java.lang.reflect.Array.newInstance(java.sql.Time.class, dimsLength) : new java.sql.Time[count]);
-
- for (; count > 0; count--)
- {
- Object v = input.get(index++);
- oa[length++] = dims > 1 && v != null ? buildArray((PgArrayList) v, 0, -1) : (v == null ? null : connection.getTimestampUtils().toTime(null, (String) v));
- }
- }
-
- else if (type == Types.TIMESTAMP)
- {
- Object[] oa = null;
- ret = oa = (dims > 1 ? (Object[]) java.lang.reflect.Array.newInstance(java.sql.Timestamp.class, dimsLength) : new java.sql.Timestamp[count]);
-
- for (; count > 0; count--)
- {
- Object v = input.get(index++);
- oa[length++] = dims > 1 && v != null ? buildArray((PgArrayList) v, 0, -1) : (v == null ? null : connection.getTimestampUtils().toTimestamp(null, (String) v));
- }
- }
-
- // other datatypes not currently supported
- else
- {
- if (connection.getLogger().logDebug())
- connection.getLogger().debug("getArrayImpl(long,int,Map) with " + getBaseTypeName());
-
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getArrayImpl(long,int,Map)");
- }
-
- return ret;
- }
-
- public int getBaseType() throws SQLException
- {
- return connection.getTypeInfo().getSQLType(getBaseTypeName());
- }
-
- public String getBaseTypeName() throws SQLException
- {
- buildArrayList();
- int elementOID = connection.getTypeInfo().getPGArrayElement(oid);
- return connection.getTypeInfo().getPGType(elementOID);
- }
-
- public java.sql.ResultSet getResultSet() throws SQLException
- {
- return getResultSetImpl(1, 0, null);
- }
-
- public java.sql.ResultSet getResultSet(long index, int count) throws SQLException
- {
- return getResultSetImpl(index, count, null);
- }
-
- public java.sql.ResultSet getResultSetImpl(Map map) throws SQLException
- {
- return getResultSetImpl(1, 0, map);
- }
-
- public ResultSet getResultSetImpl(long index, int count, Map map) throws SQLException
- {
-
- // for now maps aren't supported.
- if (map != null && !map.isEmpty())
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getResultSetImpl(long,int,Map)");
- }
-
- // array index is out of range
- if (index < 1)
- {
- throw new PSQLException(GT.tr("The array index is out of range: {0}", new Long(index)), PSQLState.DATA_ERROR);
- }
-
- if (fieldBytes != null) {
- return readBinaryResultSet((int) index, count);
- }
-
- buildArrayList();
-
- if (count == 0)
- {
- count = arrayList.size();
- }
-
- // array index out of range
- if ((--index) + count > arrayList.size())
- {
- throw new PSQLException(GT.tr("The array index is out of range: {0}, number of elements: {1}.", new Object[] { new Long(index + count), new Long(arrayList.size()) }), PSQLState.DATA_ERROR);
- }
-
- List rows = new ArrayList();
-
- Field[] fields = new Field[2];
-
- // one dimensional array
- if (arrayList.dimensionsCount <= 1)
- {
- // array element type
- final int baseOid = connection.getTypeInfo().getPGArrayElement(oid);
- fields[0] = new Field("INDEX", Oid.INT4);
- fields[1] = new Field("VALUE", baseOid);
-
- for (int i = 0; i < count; i++)
- {
- int offset = (int)index + i;
- byte[][] t = new byte[2][0];
- String v = (String) arrayList.get(offset);
- t[0] = connection.encodeString(Integer.toString(offset + 1));
- t[1] = v == null ? null : connection.encodeString(v);
- rows.add(t);
- }
- }
-
- // when multi-dimensional
- else
- {
- fields[0] = new Field("INDEX", Oid.INT4);
- fields[1] = new Field("VALUE", oid);
- for (int i = 0; i < count; i++)
- {
- int offset = (int)index + i;
- byte[][] t = new byte[2][0];
- Object v = arrayList.get(offset);
-
- t[0] = connection.encodeString(Integer.toString(offset + 1));
- t[1] = v == null ? null : connection.encodeString(toString((PgArrayList) v));
- rows.add(t);
- }
- }
-
- BaseStatement stat = (BaseStatement) connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
- return (ResultSet) stat.createDriverResultSet(fields, rows);
- }
-
- public String toString()
- {
- return fieldString;
- }
-
- /**
- * Convert array list to PG String representation (e.g. {0,1,2}).
- */
- private String toString(PgArrayList list) throws SQLException
- {
- StringBuffer b = new StringBuffer().append('{');
-
- char delim = connection.getTypeInfo().getArrayDelimiter(oid);
-
- for (int i = 0; i < list.size(); i++)
- {
- Object v = list.get(i);
-
- if (i > 0)
- b.append(delim);
-
- if (v == null)
- b.append("NULL");
-
- else if (v instanceof PgArrayList)
- b.append(toString((PgArrayList) v));
-
- else
- escapeArrayElement(b, (String)v);
- }
-
- b.append('}');
-
- return b.toString();
- }
-
- public static void escapeArrayElement(StringBuffer b, String s)
- {
- b.append('"');
- for (int j = 0; j < s.length(); j++) {
- char c = s.charAt(j);
- if (c == '"' || c == '\\') {
- b.append('\\');
- }
-
- b.append(c);
- }
- b.append('"');
- }
-
- public boolean isBinary() {
- return fieldBytes != null;
- }
-
- public byte[] toBytes() {
- return fieldBytes;
- }
-}
diff --git a/org/postgresql/jdbc2/AbstractJdbc2Blob.java b/org/postgresql/jdbc2/AbstractJdbc2Blob.java
deleted file mode 100644
index 1e2b180..0000000
--- a/org/postgresql/jdbc2/AbstractJdbc2Blob.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc2;
-
-import java.sql.SQLException;
-
-import org.postgresql.core.BaseConnection;
-
-public abstract class AbstractJdbc2Blob extends AbstractJdbc2BlobClob
-{
-
- public AbstractJdbc2Blob(BaseConnection conn, long oid) throws SQLException
- {
- super(conn, oid);
- }
-
-}
diff --git a/org/postgresql/jdbc2/AbstractJdbc2BlobClob.java b/org/postgresql/jdbc2/AbstractJdbc2BlobClob.java
deleted file mode 100644
index c92bb71..0000000
--- a/org/postgresql/jdbc2/AbstractJdbc2BlobClob.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2005-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc2;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.sql.Blob;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.postgresql.core.BaseConnection;
-import org.postgresql.largeobject.LargeObject;
-import org.postgresql.largeobject.LargeObjectManager;
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.PSQLException;
-
-/**
- * This class holds all of the methods common to both Blobs and Clobs.
- *
- * @author Michael Barker <mailto:mike at middlesoft.co.uk>
- *
- */
-public abstract class AbstractJdbc2BlobClob
-{
- protected BaseConnection conn;
- protected LargeObject lo;
-
- /**
- * We create separate LargeObjects for methods that use streams
- * so they won't interfere with each other.
- */
- private ArrayList subLOs;
-
- public AbstractJdbc2BlobClob(BaseConnection conn, long oid) throws SQLException
- {
- this.conn = conn;
- LargeObjectManager lom = conn.getLargeObjectAPI();
- this.lo = lom.open(oid);
- subLOs = new ArrayList();
- }
-
- public synchronized void free() throws SQLException
- {
- if (lo != null) {
- lo.close();
- lo = null;
- }
- Iterator i = subLOs.iterator();
- while (i.hasNext()) {
- LargeObject subLO = (LargeObject)i.next();
- subLO.close();
- }
- subLOs = null;
- }
-
- /**
- * For Blobs this should be in bytes while for Clobs it should be
- * in characters. Since we really haven't figured out how to handle
- * character sets for Clobs the current implementation uses bytes for
- * both Blobs and Clobs.
- */
- public synchronized void truncate(long len) throws SQLException
- {
- checkFreed();
- if (!conn.haveMinimumServerVersion("8.3"))
- throw new PSQLException(GT.tr("Truncation of large objects is only implemented in 8.3 and later servers."), PSQLState.NOT_IMPLEMENTED);
-
- if (len < 0)
- {
- throw new PSQLException(GT.tr("Cannot truncate LOB to a negative length."), PSQLState.INVALID_PARAMETER_VALUE);
- }
- if (len > Integer.MAX_VALUE)
- {
- throw new PSQLException(GT.tr("PostgreSQL LOBs can only index to: {0}", new Integer(Integer.MAX_VALUE)), PSQLState.INVALID_PARAMETER_VALUE);
- }
-
- lo.truncate((int)len);
- }
-
- public synchronized long length() throws SQLException
- {
- checkFreed();
- return lo.size();
- }
-
- public synchronized byte[] getBytes(long pos, int length) throws SQLException
- {
- assertPosition(pos);
- lo.seek((int)(pos-1), LargeObject.SEEK_SET);
- return lo.read(length);
- }
-
-
- public synchronized InputStream getBinaryStream() throws SQLException
- {
- checkFreed();
- LargeObject subLO = lo.copy();
- subLOs.add(subLO);
- subLO.seek(0, LargeObject.SEEK_SET);
- return subLO.getInputStream();
- }
-
- public synchronized OutputStream setBinaryStream(long pos) throws SQLException
- {
- assertPosition(pos);
- LargeObject subLO = lo.copy();
- subLOs.add(subLO);
- subLO.seek((int)(pos-1));
- return subLO.getOutputStream();
- }
-
- /**
- * Iterate over the buffer looking for the specified pattern
- *
- * @param pattern A pattern of bytes to search the blob for.
- * @param start The position to start reading from.
- */
- public synchronized long position(byte[] pattern, long start) throws SQLException
- {
- assertPosition(start, pattern.length);
-
- int position = 1;
- int patternIdx = 0;
- long result = -1;
- int tmpPosition = 1;
-
- for (LOIterator i = new LOIterator(start-1); i.hasNext(); position++)
- {
- byte b = i.next();
- if (b == pattern[patternIdx])
- {
- if (patternIdx == 0)
- {
- tmpPosition = position;
- }
- patternIdx++;
- if (patternIdx == pattern.length)
- {
- result = tmpPosition;
- break;
- }
- }
- else
- {
- patternIdx = 0;
- }
- }
-
- return result;
- }
-
- /**
- * Iterates over a large object returning byte values. Will buffer
- * the data from the large object.
- *
- *
- */
- private class LOIterator
- {
- private static final int BUFFER_SIZE = 8096;
- private byte buffer[] = new byte[BUFFER_SIZE];
- private int idx = BUFFER_SIZE;
- private int numBytes = BUFFER_SIZE;
-
- public LOIterator(long start) throws SQLException
- {
- lo.seek((int) start);
- }
-
- public boolean hasNext() throws SQLException
- {
- boolean result = false;
- if (idx < numBytes)
- {
- result = true;
- }
- else
- {
- numBytes = lo.read(buffer, 0, BUFFER_SIZE);
- idx = 0;
- result = (numBytes > 0);
- }
- return result;
- }
-
- private byte next()
- {
- return buffer[idx++];
- }
- }
-
-
- /**
- * This is simply passing the byte value of the pattern Blob
- */
- public synchronized long position(Blob pattern, long start) throws SQLException
- {
- return position(pattern.getBytes(1, (int)pattern.length()), start);
- }
-
- /**
- * Throws an exception if the pos value exceeds the max value by
- * which the large object API can index.
- *
- * @param pos Position to write at.
- */
- protected void assertPosition(long pos) throws SQLException
- {
- assertPosition(pos, 0);
- }
-
- /**
- * Throws an exception if the pos value exceeds the max value by
- * which the large object API can index.
- *
- * @param pos Position to write at.
- * @param len number of bytes to write.
- */
- protected void assertPosition(long pos, long len) throws SQLException
- {
- checkFreed();
- if (pos < 1)
- {
- throw new PSQLException(GT.tr("LOB positioning offsets start at 1."), PSQLState.INVALID_PARAMETER_VALUE);
- }
- if (pos + len - 1 > Integer.MAX_VALUE)
- {
- throw new PSQLException(GT.tr("PostgreSQL LOBs can only index to: {0}", new Integer(Integer.MAX_VALUE)), PSQLState.INVALID_PARAMETER_VALUE);
- }
- }
-
- /**
- * Checks that this LOB hasn't been free()d already.
- * @throws SQLException if LOB has been freed.
- */
- protected void checkFreed() throws SQLException
- {
- if (lo == null)
- throw new PSQLException(GT.tr("free() was called on this LOB previously"), PSQLState.OBJECT_NOT_IN_STATE);
- }
-
-}
diff --git a/org/postgresql/jdbc2/AbstractJdbc2Clob.java b/org/postgresql/jdbc2/AbstractJdbc2Clob.java
deleted file mode 100644
index e18bcd2..0000000
--- a/org/postgresql/jdbc2/AbstractJdbc2Clob.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc2;
-
-
-import org.postgresql.core.BaseConnection;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.sql.Clob;
-import java.sql.SQLException;
-
-public abstract class AbstractJdbc2Clob extends AbstractJdbc2BlobClob
-{
-
- public AbstractJdbc2Clob(BaseConnection conn, long oid) throws SQLException
- {
- super(conn, oid);
- }
-
- public synchronized InputStream getAsciiStream() throws SQLException
- {
- return getBinaryStream();
- }
-
- public synchronized Reader getCharacterStream() throws SQLException
- {
- return new InputStreamReader(getBinaryStream());
- }
-
- public synchronized String getSubString(long i, int j) throws SQLException
- {
- assertPosition(i, j);
- lo.seek((int)i - 1);
- return new String(lo.read(j));
- }
-
- /*
- * For now, this is not implemented.
- */
- public synchronized long position(String pattern, long start) throws SQLException
- {
- checkFreed();
- throw org.postgresql.Driver.notImplemented(this.getClass(), "position(String,long)");
- }
-
- /*
- * This should be simply passing the byte value of the pattern Blob
- */
- public synchronized long position(Clob pattern, long start) throws SQLException
- {
- checkFreed();
- throw org.postgresql.Driver.notImplemented(this.getClass(), "position(Clob,start)");
- }
-
-}
diff --git a/org/postgresql/jdbc2/AbstractJdbc2Connection.java b/org/postgresql/jdbc2/AbstractJdbc2Connection.java
deleted file mode 100644
index 2fb37f4..0000000
--- a/org/postgresql/jdbc2/AbstractJdbc2Connection.java
+++ /dev/null
@@ -1,1226 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc2;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.sql.*;
-import java.util.*;
-
-import org.postgresql.core.*;
-
-import org.postgresql.Driver;
-import org.postgresql.PGNotification;
-import org.postgresql.fastpath.Fastpath;
-import org.postgresql.largeobject.LargeObjectManager;
-import org.postgresql.util.*;
-import org.postgresql.util.HostSpec;
-import org.postgresql.copy.*;
-
-/**
- * This class defines methods of the jdbc2 specification.
- * The real Connection class (for jdbc2) is org.postgresql.jdbc2.Jdbc2Connection
- */
-public abstract class AbstractJdbc2Connection implements BaseConnection
-{
- //
- // Driver-wide connection ID counter, used for logging
- //
- private static int nextConnectionID = 1;
-
- //
- // Data initialized on construction:
- //
-
- // Per-connection logger
- private final Logger logger;
-
- /* URL we were created via */
- private final String creatingURL;
-
- private Throwable openStackTrace;
-
- /* Actual network handler */
- private final ProtocolConnection protoConnection;
- /* Compatibility version */
- private final String compatible;
- /* Actual server version */
- private final String dbVersionNumber;
-
- /* Query that runs COMMIT */
- private final Query commitQuery;
- /* Query that runs ROLLBACK */
- private final Query rollbackQuery;
-
- private TypeInfo _typeCache;
-
- // Default statement prepare threshold.
- protected int prepareThreshold;
- // Connection's autocommit state.
- public boolean autoCommit = true;
- // Connection's readonly state.
- public boolean readOnly = false;
-
- // Bind String to UNSPECIFIED or VARCHAR?
- public final boolean bindStringAsVarchar;
-
- // Current warnings; there might be more on protoConnection too.
- public SQLWarning firstWarning = null;
-
- /** Set of oids that use binary transfer when sending to server. */
- private Set<Integer> useBinarySendForOids;
- /** Set of oids that use binary transfer when receiving from server. */
- private Set<Integer> useBinaryReceiveForOids;
-
- public abstract DatabaseMetaData getMetaData() throws SQLException;
-
- //
- // Ctor.
- //
- protected AbstractJdbc2Connection(HostSpec[] hostSpecs, String user, String database, Properties info, String url) throws SQLException
- {
- this.creatingURL = url;
-
- // Read loglevel arg and set the loglevel based on this value;
- // In addition to setting the log level, enable output to
- // standard out if no other printwriter is set
-
- int logLevel = Driver.getLogLevel();
- String connectionLogLevel = info.getProperty("loglevel");
- if (connectionLogLevel != null) {
- try {
- logLevel = Integer.parseInt(connectionLogLevel);
- } catch (Exception l_e) {
- // XXX revisit
- // invalid value for loglevel; ignore it
- }
- }
-
- synchronized (AbstractJdbc2Connection.class) {
- logger = new Logger(nextConnectionID++);
- logger.setLogLevel(logLevel);
- }
-
- if (logLevel > 0)
- enableDriverManagerLogging();
-
- prepareThreshold = 5;
- try
- {
- prepareThreshold = Integer.parseInt(info.getProperty("prepareThreshold", "5"));
- if (prepareThreshold < 0)
- prepareThreshold = 0;
- }
- catch (Exception e)
- {
- }
- boolean binaryTransfer = true;
- try
- {
- binaryTransfer = Boolean.valueOf(info.getProperty("binaryTransfer", "true")).booleanValue();
- }
- catch (Exception e)
- {
- }
-
- //Print out the driver version number
- if (logger.logInfo())
- logger.info(Driver.getVersion());
-
- // Now make the initial connection and set up local state
- this.protoConnection = ConnectionFactory.openConnection(hostSpecs, user, database, info, logger);
- this.dbVersionNumber = protoConnection.getServerVersion();
- this.compatible = info.getProperty("compatible", Driver.MAJORVERSION + "." + Driver.MINORVERSION);
-
- // Formats that currently have binary protocol support
- Set<Integer> binaryOids = new HashSet<Integer>();
- if (binaryTransfer && protoConnection.getProtocolVersion() >= 3) {
- binaryOids.add(Oid.BYTEA);
- binaryOids.add(Oid.INT2);
- binaryOids.add(Oid.INT4);
- binaryOids.add(Oid.INT8);
- binaryOids.add(Oid.FLOAT4);
- binaryOids.add(Oid.FLOAT8);
- binaryOids.add(Oid.TIME);
- binaryOids.add(Oid.DATE);
- binaryOids.add(Oid.TIMETZ);
- binaryOids.add(Oid.TIMESTAMP);
- binaryOids.add(Oid.TIMESTAMPTZ);
- binaryOids.add(Oid.INT2_ARRAY);
- binaryOids.add(Oid.INT4_ARRAY);
- binaryOids.add(Oid.INT8_ARRAY);
- binaryOids.add(Oid.FLOAT4_ARRAY);
- binaryOids.add(Oid.FLOAT8_ARRAY);
- binaryOids.add(Oid.FLOAT8_ARRAY);
- binaryOids.add(Oid.VARCHAR_ARRAY);
- binaryOids.add(Oid.TEXT_ARRAY);
- binaryOids.add(Oid.POINT);
- binaryOids.add(Oid.BOX);
- binaryOids.add(Oid.UUID);
- }
- // the pre 8.0 servers do not disclose their internal encoding for
- // time fields so do not try to use them.
- if (!haveMinimumCompatibleVersion("8.0")) {
- binaryOids.remove(Oid.TIME);
- binaryOids.remove(Oid.TIMETZ);
- binaryOids.remove(Oid.TIMESTAMP);
- binaryOids.remove(Oid.TIMESTAMPTZ);
- }
- // driver supports only null-compatible arrays
- if (!haveMinimumCompatibleVersion("8.3")) {
- binaryOids.remove(Oid.INT2_ARRAY);
- binaryOids.remove(Oid.INT4_ARRAY);
- binaryOids.remove(Oid.INT8_ARRAY);
- binaryOids.remove(Oid.FLOAT4_ARRAY);
- binaryOids.remove(Oid.FLOAT8_ARRAY);
- binaryOids.remove(Oid.FLOAT8_ARRAY);
- binaryOids.remove(Oid.VARCHAR_ARRAY);
- binaryOids.remove(Oid.TEXT_ARRAY);
- }
-
- binaryOids.addAll(getOidSet(info.getProperty("binaryTransferEnable", "")));
- binaryOids.removeAll(getOidSet(info.getProperty("binaryTransferDisable", "")));
-
- // split for receive and send for better control
- useBinarySendForOids = new HashSet<Integer>();
- useBinarySendForOids.addAll(binaryOids);
- useBinaryReceiveForOids = new HashSet<Integer>();
- useBinaryReceiveForOids.addAll(binaryOids);
-
- /*
- * Does not pass unit tests because unit tests expect setDate to have
- * millisecond accuracy whereas the binary transfer only supports
- * date accuracy.
- */
- useBinarySendForOids.remove(Oid.DATE);
-
- protoConnection.setBinaryReceiveOids(useBinaryReceiveForOids);
-
- if (logger.logDebug())
- {
- logger.debug(" compatible = " + compatible);
- logger.debug(" loglevel = " + logLevel);
- logger.debug(" prepare threshold = " + prepareThreshold);
- logger.debug(" types using binary send = " + oidsToString(useBinarySendForOids));
- logger.debug(" types using binary receive = " + oidsToString(useBinaryReceiveForOids));
- logger.debug(" integer date/time = " + protoConnection.getIntegerDateTimes());
- }
-
- //
- // String -> text or unknown?
- //
-
- String stringType = info.getProperty("stringtype");
- if (stringType != null) {
- if (stringType.equalsIgnoreCase("unspecified"))
- bindStringAsVarchar = false;
- else if (stringType.equalsIgnoreCase("varchar"))
- bindStringAsVarchar = true;
- else
- throw new PSQLException(GT.tr("Unsupported value for stringtype parameter: {0}", stringType),
- PSQLState.INVALID_PARAMETER_VALUE);
- } else {
- bindStringAsVarchar = haveMinimumCompatibleVersion("8.0");
- }
-
- // Initialize timestamp stuff
- timestampUtils = new TimestampUtils(haveMinimumServerVersion("7.4"), haveMinimumServerVersion("8.2"),
- !protoConnection.getIntegerDateTimes());
-
- // Initialize common queries.
- commitQuery = getQueryExecutor().createSimpleQuery("COMMIT");
- rollbackQuery = getQueryExecutor().createSimpleQuery("ROLLBACK");
-
- int unknownLength = Integer.MAX_VALUE;
- String strLength = info.getProperty("unknownLength");
- if (strLength != null) {
- try {
- unknownLength = Integer.parseInt(strLength);
- } catch (NumberFormatException nfe) {
- throw new PSQLException(GT.tr("unknownLength parameter value must be an integer"), PSQLState.INVALID_PARAMETER_VALUE, nfe);
- }
- }
-
- // Initialize object handling
- _typeCache = createTypeInfo(this, unknownLength);
- initObjectTypes(info);
-
- if (Boolean.valueOf(info.getProperty("logUnclosedConnections")).booleanValue()) {
- openStackTrace = new Throwable("Connection was created at this point:");
- enableDriverManagerLogging();
- }
- }
-
- private Set<Integer> getOidSet(String oidList) throws PSQLException {
- Set oids = new HashSet();
- StringTokenizer tokenizer = new StringTokenizer(oidList, ",");
- while (tokenizer.hasMoreTokens()) {
- String oid = tokenizer.nextToken();
- oids.add(Oid.valueOf(oid));
- }
- return oids;
- }
-
- private String oidsToString(Set<Integer> oids) {
- StringBuffer sb = new StringBuffer();
- for (Integer oid : oids) {
- sb.append(Oid.toString(oid));
- sb.append(',');
- }
- if (sb.length() > 0) {
- sb.setLength(sb.length() - 1);
- } else {
- sb.append(" <none>");
- }
- return sb.toString();
- }
-
- private final TimestampUtils timestampUtils;
- public TimestampUtils getTimestampUtils() { return timestampUtils; }
-
- /*
- * The current type mappings
- */
- protected java.util.Map typemap;
-
- public java.sql.Statement createStatement() throws SQLException
- {
- // We now follow the spec and default to TYPE_FORWARD_ONLY.
- return createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY);
- }
-
- public abstract java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException;
-
- public java.sql.PreparedStatement prepareStatement(String sql) throws SQLException
- {
- return prepareStatement(sql, java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY);
- }
-
- public abstract java.sql.PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException;
-
- public java.sql.CallableStatement prepareCall(String sql) throws SQLException
- {
- return prepareCall(sql, java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY);
- }
-
- public abstract java.sql.CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException;
-
- public java.util.Map getTypeMap() throws SQLException
- {
- checkClosed();
- return typemap;
- }
-
- // Query executor associated with this connection.
- public QueryExecutor getQueryExecutor() {
- return protoConnection.getQueryExecutor();
- }
-
- /*
- * This adds a warning to the warning chain.
- * @param warn warning to add
- */
- public void addWarning(SQLWarning warn)
- {
- // Add the warning to the chain
- if (firstWarning != null)
- firstWarning.setNextWarning(warn);
- else
- firstWarning = warn;
-
- }
-
- public ResultSet execSQLQuery(String s) throws SQLException {
- return execSQLQuery(s, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
- }
-
- /**
- * Simple query execution.
- */
- public ResultSet execSQLQuery(String s, int resultSetType, int resultSetConcurrency) throws SQLException {
- BaseStatement stat = (BaseStatement) createStatement(resultSetType, resultSetConcurrency);
- boolean hasResultSet = stat.executeWithFlags(s, QueryExecutor.QUERY_SUPPRESS_BEGIN);
-
- while (!hasResultSet && stat.getUpdateCount() != -1)
- hasResultSet = stat.getMoreResults();
-
- if (!hasResultSet)
- throw new PSQLException(GT.tr("No results were returned by the query."), PSQLState.NO_DATA);
-
- // Transfer warnings to the connection, since the user never
- // has a chance to see the statement itself.
- SQLWarning warnings = stat.getWarnings();
- if (warnings != null)
- addWarning(warnings);
-
- return stat.getResultSet();
- }
-
- public void execSQLUpdate(String s) throws SQLException {
- BaseStatement stmt = (BaseStatement) createStatement();
- if (stmt.executeWithFlags(s, QueryExecutor.QUERY_NO_METADATA | QueryExecutor.QUERY_NO_RESULTS | QueryExecutor.QUERY_SUPPRESS_BEGIN))
- throw new PSQLException(GT.tr("A result was returned when none was expected."),
- PSQLState.TOO_MANY_RESULTS);
-
- // Transfer warnings to the connection, since the user never
- // has a chance to see the statement itself.
- SQLWarning warnings = stmt.getWarnings();
- if (warnings != null)
- addWarning(warnings);
-
- stmt.close();
- }
-
- /*
- * In SQL, a result table can be retrieved through a cursor that
- * is named. The current row of a result can be updated or deleted
- * using a positioned update/delete statement that references the
- * cursor name.
- *
- * We do not support positioned update/delete, so this is a no-op.
- *
- * @param cursor the cursor name
- * @exception SQLException if a database access error occurs
- */
- public void setCursorName(String cursor) throws SQLException
- {
- checkClosed();
- // No-op.
- }
-
- /*
- * getCursorName gets the cursor name.
- *
- * @return the current cursor name
- * @exception SQLException if a database access error occurs
- */
- public String getCursorName() throws SQLException
- {
- checkClosed();
- return null;
- }
-
- /*
- * We are required to bring back certain information by
- * the DatabaseMetaData class. These functions do that.
- *
- * Method getURL() brings back the URL (good job we saved it)
- *
- * @return the url
- * @exception SQLException just in case...
- */
- public String getURL() throws SQLException
- {
- return creatingURL;
- }
-
- /*
- * Method getUserName() brings back the User Name (again, we
- * saved it)
- *
- * @return the user name
- * @exception SQLException just in case...
- */
- public String getUserName() throws SQLException
- {
- return protoConnection.getUser();
- }
-
- /*
- * This returns the Fastpath API for the current connection.
- *
- * <p><b>NOTE:</b> This is not part of JDBC, but allows access to
- * functions on the org.postgresql backend itself.
- *
- * <p>It is primarily used by the LargeObject API
- *
- * <p>The best way to use this is as follows:
- *
- * <p><pre>
- * import org.postgresql.fastpath.*;
- * ...
- * Fastpath fp = ((org.postgresql.Connection)myconn).getFastpathAPI();
- * </pre>
- *
- * <p>where myconn is an open Connection to org.postgresql.
- *
- * @return Fastpath object allowing access to functions on the org.postgresql
- * backend.
- * @exception SQLException by Fastpath when initialising for first time
- */
- public Fastpath getFastpathAPI() throws SQLException
- {
- checkClosed();
- if (fastpath == null)
- fastpath = new Fastpath(this);
- return fastpath;
- }
-
- // This holds a reference to the Fastpath API if already open
- private Fastpath fastpath = null;
-
- /*
- * This returns the LargeObject API for the current connection.
- *
- * <p><b>NOTE:</b> This is not part of JDBC, but allows access to
- * functions on the org.postgresql backend itself.
- *
- * <p>The best way to use this is as follows:
- *
- * <p><pre>
- * import org.postgresql.largeobject.*;
- * ...
- * LargeObjectManager lo = ((org.postgresql.Connection)myconn).getLargeObjectAPI();
- * </pre>
- *
- * <p>where myconn is an open Connection to org.postgresql.
- *
- * @return LargeObject object that implements the API
- * @exception SQLException by LargeObject when initialising for first time
- */
- public LargeObjectManager getLargeObjectAPI() throws SQLException
- {
- checkClosed();
- if (largeobject == null)
- largeobject = new LargeObjectManager(this);
- return largeobject;
- }
-
- // This holds a reference to the LargeObject API if already open
- private LargeObjectManager largeobject = null;
-
- /*
- * This method is used internally to return an object based around
- * org.postgresql's more unique data types.
- *
- * <p>It uses an internal HashMap to get the handling class. If the
- * type is not supported, then an instance of org.postgresql.util.PGobject
- * is returned.
- *
- * You can use the getValue() or setValue() methods to handle the returned
- * object. Custom objects can have their own methods.
- *
- * @return PGobject for this type, and set to value
- * @exception SQLException if value is not correct for this type
- */
- public Object getObject(String type, String value, byte[] byteValue) throws SQLException
- {
- if (typemap != null)
- {
- Class c = (Class) typemap.get(type);
- if (c != null)
- {
- // Handle the type (requires SQLInput & SQLOutput classes to be implemented)
- throw new PSQLException(GT.tr("Custom type maps are not supported."), PSQLState.NOT_IMPLEMENTED);
- }
- }
-
- PGobject obj = null;
-
- if (logger.logDebug())
- logger.debug("Constructing object from type=" + type + " value=<" + value + ">");
-
- try
- {
- Class klass = _typeCache.getPGobject(type);
-
- // If className is not null, then try to instantiate it,
- // It must be basetype PGobject
-
- // This is used to implement the org.postgresql unique types (like lseg,
- // point, etc).
-
- if (klass != null)
- {
- obj = (PGobject) (klass.newInstance());
- obj.setType(type);
- if (byteValue != null && obj instanceof PGBinaryObject) {
- PGBinaryObject binObj = (PGBinaryObject) obj;
- binObj.setByteValue(byteValue, 0);
- } else {
- obj.setValue(value);
- }
- }
- else
- {
- // If className is null, then the type is unknown.
- // so return a PGobject with the type set, and the value set
- obj = new PGobject();
- obj.setType( type );
- obj.setValue( value );
- }
-
- return obj;
- }
- catch (SQLException sx)
- {
- // rethrow the exception. Done because we capture any others next
- throw sx;
- }
- catch (Exception ex)
- {
- throw new PSQLException(GT.tr("Failed to create object for: {0}.", type), PSQLState.CONNECTION_FAILURE, ex);
- }
- }
-
- protected TypeInfo createTypeInfo(BaseConnection conn, int unknownLength)
- {
- return new TypeInfoCache(conn, unknownLength);
- }
-
- public TypeInfo getTypeInfo()
- {
- return _typeCache;
- }
-
- public void addDataType(String type, String name)
- {
- try
- {
- addDataType(type, Class.forName(name));
- }
- catch (Exception e)
- {
- throw new RuntimeException("Cannot register new type: " + e);
- }
- }
-
- public void addDataType(String type, Class klass) throws SQLException
- {
- checkClosed();
- _typeCache.addDataType(type, klass);
- }
-
- // This initialises the objectTypes hash map
- private void initObjectTypes(Properties info) throws SQLException
- {
- // Add in the types that come packaged with the driver.
- // These can be overridden later if desired.
- addDataType("box", org.postgresql.geometric.PGbox.class);
- addDataType("circle", org.postgresql.geometric.PGcircle.class);
- addDataType("line", org.postgresql.geometric.PGline.class);
- addDataType("lseg", org.postgresql.geometric.PGlseg.class);
- addDataType("path", org.postgresql.geometric.PGpath.class);
- addDataType("point", org.postgresql.geometric.PGpoint.class);
- addDataType("polygon", org.postgresql.geometric.PGpolygon.class);
- addDataType("money", org.postgresql.util.PGmoney.class);
- addDataType("interval", org.postgresql.util.PGInterval.class);
-
- for (Enumeration e = info.propertyNames(); e.hasMoreElements(); )
- {
- String propertyName = (String)e.nextElement();
- if (propertyName.startsWith("datatype."))
- {
- String typeName = propertyName.substring(9);
- String className = info.getProperty(propertyName);
- Class klass;
-
- try
- {
- klass = Class.forName(className);
- }
- catch (ClassNotFoundException cnfe)
- {
- throw new PSQLException(GT.tr("Unable to load the class {0} responsible for the datatype {1}", new Object[] { className, typeName }),
- PSQLState.SYSTEM_ERROR, cnfe);
- }
-
- addDataType(typeName, klass);
- }
- }
- }
-
- /**
- * In some cases, it is desirable to immediately release a Connection's
- * database and JDBC resources instead of waiting for them to be
- * automatically released.
- *
- * <B>Note:</B> A Connection is automatically closed when it is
- * garbage collected. Certain fatal errors also result in a closed
- * connection.
- *
- * @exception SQLException if a database access error occurs
- */
- public void close()
- {
- protoConnection.close();
- openStackTrace = null;
- }
-
- /*
- * A driver may convert the JDBC sql grammar into its system's
- * native SQL grammar prior to sending it; nativeSQL returns the
- * native form of the statement that the driver would have sent.
- *
- * @param sql a SQL statement that may contain one or more '?'
- * parameter placeholders
- * @return the native form of this statement
- * @exception SQLException if a database access error occurs
- */
- public String nativeSQL(String sql) throws SQLException
- {
- checkClosed();
- StringBuffer buf = new StringBuffer(sql.length());
- AbstractJdbc2Statement.parseSql(sql,0,buf,false,getStandardConformingStrings());
- return buf.toString();
- }
-
- /*
- * The first warning reported by calls on this Connection is
- * returned.
- *
- * <B>Note:</B> Sebsequent warnings will be changed to this
- * SQLWarning
- *
- * @return the first SQLWarning or null
- * @exception SQLException if a database access error occurs
- */
- public synchronized SQLWarning getWarnings()
- throws SQLException
- {
- checkClosed();
- SQLWarning newWarnings = protoConnection.getWarnings(); // NB: also clears them.
- if (firstWarning == null)
- firstWarning = newWarnings;
- else
- firstWarning.setNextWarning(newWarnings); // Chain them on.
-
- return firstWarning;
- }
-
- /*
- * After this call, getWarnings returns null until a new warning
- * is reported for this connection.
- *
- * @exception SQLException if a database access error occurs
- */
- public synchronized void clearWarnings()
- throws SQLException
- {
- checkClosed();
- protoConnection.getWarnings(); // Clear and discard.
- firstWarning = null;
- }
-
-
- /*
- * You can put a connection in read-only mode as a hunt to enable
- * database optimizations
- *
- * <B>Note:</B> setReadOnly cannot be called while in the middle
- * of a transaction
- *
- * @param readOnly - true enables read-only mode; false disables it
- * @exception SQLException if a database access error occurs
- */
- public void setReadOnly(boolean readOnly) throws SQLException
- {
- checkClosed();
- if (protoConnection.getTransactionState() != ProtocolConnection.TRANSACTION_IDLE)
- throw new PSQLException(GT.tr("Cannot change transaction read-only property in the middle of a transaction."),
- PSQLState.ACTIVE_SQL_TRANSACTION);
-
- if (haveMinimumServerVersion("7.4") && readOnly != this.readOnly)
- {
- String readOnlySql = "SET SESSION CHARACTERISTICS AS TRANSACTION " + (readOnly ? "READ ONLY" : "READ WRITE");
- execSQLUpdate(readOnlySql); // nb: no BEGIN triggered.
- }
-
- this.readOnly = readOnly;
- }
-
- /*
- * Tests to see if the connection is in Read Only Mode.
- *
- * @return true if the connection is read only
- * @exception SQLException if a database access error occurs
- */
- public boolean isReadOnly() throws SQLException
- {
- checkClosed();
- return readOnly;
- }
-
- /*
- * If a connection is in auto-commit mode, than all its SQL
- * statements will be executed and committed as individual
- * transactions. Otherwise, its SQL statements are grouped
- * into transactions that are terminated by either commit()
- * or rollback(). By default, new connections are in auto-
- * commit mode. The commit occurs when the statement completes
- * or the next execute occurs, whichever comes first. In the
- * case of statements returning a ResultSet, the statement
- * completes when the last row of the ResultSet has been retrieved
- * or the ResultSet has been closed. In advanced cases, a single
- * statement may return multiple results as well as output parameter
- * values. Here the commit occurs when all results and output param
- * values have been retrieved.
- *
- * @param autoCommit - true enables auto-commit; false disables it
- * @exception SQLException if a database access error occurs
- */
- public void setAutoCommit(boolean autoCommit) throws SQLException
- {
- checkClosed();
-
- if (this.autoCommit == autoCommit)
- return ;
-
- if (!this.autoCommit)
- commit();
-
- this.autoCommit = autoCommit;
- }
-
- /*
- * gets the current auto-commit state
- *
- * @return Current state of the auto-commit mode
- * @see setAutoCommit
- */
- public boolean getAutoCommit() throws SQLException
- {
- checkClosed();
- return this.autoCommit;
- }
-
- private void executeTransactionCommand(Query query) throws SQLException {
- getQueryExecutor().execute(query, null, new TransactionCommandHandler(),
- 0, 0, QueryExecutor.QUERY_NO_METADATA | QueryExecutor.QUERY_NO_RESULTS | QueryExecutor.QUERY_SUPPRESS_BEGIN);
- }
-
- /*
- * The method commit() makes all changes made since the previous
- * commit/rollback permanent and releases any database locks currently
- * held by the Connection. This method should only be used when
- * auto-commit has been disabled.
- *
- * @exception SQLException if a database access error occurs,
- * this method is called on a closed connection or
- * this Connection object is in auto-commit mode
- * @see setAutoCommit
- */
- public void commit() throws SQLException
- {
- checkClosed();
-
- if (autoCommit)
- throw new PSQLException(GT.tr("Cannot commit when autoCommit is enabled."),
- PSQLState.NO_ACTIVE_SQL_TRANSACTION);
-
- if (protoConnection.getTransactionState() != ProtocolConnection.TRANSACTION_IDLE)
- executeTransactionCommand(commitQuery);
- }
-
- protected void checkClosed() throws SQLException {
- if (isClosed())
- throw new PSQLException(GT.tr("This connection has been closed."),
- PSQLState.CONNECTION_DOES_NOT_EXIST);
- }
-
-
- /*
- * The method rollback() drops all changes made since the previous
- * commit/rollback and releases any database locks currently held by
- * the Connection.
- *
- * @exception SQLException if a database access error occurs,
- * this method is called on a closed connection or
- * this Connection object is in auto-commit mode
- * @see commit
- */
- public void rollback() throws SQLException
- {
- checkClosed();
-
- if (autoCommit)
- throw new PSQLException(GT.tr("Cannot rollback when autoCommit is enabled."),
- PSQLState.NO_ACTIVE_SQL_TRANSACTION);
-
- if (protoConnection.getTransactionState() != ProtocolConnection.TRANSACTION_IDLE)
- executeTransactionCommand(rollbackQuery);
- }
-
- public int getTransactionState() {
- return protoConnection.getTransactionState();
- }
-
- /*
- * Get this Connection's current transaction isolation mode.
- *
- * @return the current TRANSACTION_* mode value
- * @exception SQLException if a database access error occurs
- */
- public int getTransactionIsolation() throws SQLException
- {
- checkClosed();
-
- String level = null;
-
- if (haveMinimumServerVersion("7.3"))
- {
- // 7.3+ returns the level as a query result.
- ResultSet rs = execSQLQuery("SHOW TRANSACTION ISOLATION LEVEL"); // nb: no BEGIN triggered
- if (rs.next())
- level = rs.getString(1);
- rs.close();
- }
- else
- {
- // 7.2 returns the level as an INFO message. Ew.
- // We juggle the warning chains a bit here.
-
- // Swap out current warnings.
- SQLWarning saveWarnings = getWarnings();
- clearWarnings();
-
- // Run the query any examine any resulting warnings.
- execSQLUpdate("SHOW TRANSACTION ISOLATION LEVEL"); // nb: no BEGIN triggered
- SQLWarning warning = getWarnings();
- if (warning != null)
- level = warning.getMessage();
-
- // Swap original warnings back.
- clearWarnings();
- if (saveWarnings != null)
- addWarning(saveWarnings);
- }
-
- // XXX revisit: throw exception instead of silently eating the error in unkwon cases?
- if (level == null)
- return Connection.TRANSACTION_READ_COMMITTED; // Best guess.
-
- level = level.toUpperCase(Locale.US);
- if (level.indexOf("READ COMMITTED") != -1)
- return Connection.TRANSACTION_READ_COMMITTED;
- if (level.indexOf("READ UNCOMMITTED") != -1)
- return Connection.TRANSACTION_READ_UNCOMMITTED;
- if (level.indexOf("REPEATABLE READ") != -1)
- return Connection.TRANSACTION_REPEATABLE_READ;
- if (level.indexOf("SERIALIZABLE") != -1)
- return Connection.TRANSACTION_SERIALIZABLE;
-
- return Connection.TRANSACTION_READ_COMMITTED; // Best guess.
- }
-
- /*
- * You can call this method to try to change the transaction
- * isolation level using one of the TRANSACTION_* values.
- *
- * <B>Note:</B> setTransactionIsolation cannot be called while
- * in the middle of a transaction
- *
- * @param level one of the TRANSACTION_* isolation values with
- * the exception of TRANSACTION_NONE; some databases may
- * not support other values
- * @exception SQLException if a database access error occurs
- * @see java.sql.DatabaseMetaData#supportsTransactionIsolationLevel
- */
- public void setTransactionIsolation(int level) throws SQLException
- {
- checkClosed();
-
- if (protoConnection.getTransactionState() != ProtocolConnection.TRANSACTION_IDLE)
- throw new PSQLException(GT.tr("Cannot change transaction isolation level in the middle of a transaction."),
- PSQLState.ACTIVE_SQL_TRANSACTION);
-
- String isolationLevelName = getIsolationLevelName(level);
- if (isolationLevelName == null)
- throw new PSQLException(GT.tr("Transaction isolation level {0} not supported.", new Integer(level)), PSQLState.NOT_IMPLEMENTED);
-
- String isolationLevelSQL = "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL " + isolationLevelName;
- execSQLUpdate(isolationLevelSQL); // nb: no BEGIN triggered
- }
-
- protected String getIsolationLevelName(int level)
- {
- boolean pg80 = haveMinimumServerVersion("8.0");
-
- if (level == Connection.TRANSACTION_READ_COMMITTED)
- {
- return "READ COMMITTED";
- }
- else if (level == Connection.TRANSACTION_SERIALIZABLE)
- {
- return "SERIALIZABLE";
- }
- else if (pg80 && level == Connection.TRANSACTION_READ_UNCOMMITTED)
- {
- return "READ UNCOMMITTED";
- }
- else if (pg80 && level == Connection.TRANSACTION_REPEATABLE_READ)
- {
- return "REPEATABLE READ";
- }
-
- return null;
- }
-
- /*
- * A sub-space of this Connection's database may be selected by
- * setting a catalog name. If the driver does not support catalogs,
- * it will silently ignore this request
- *
- * @exception SQLException if a database access error occurs
- */
- public void setCatalog(String catalog) throws SQLException
- {
- checkClosed();
- //no-op
- }
-
- /*
- * Return the connections current catalog name, or null if no
- * catalog name is set, or we dont support catalogs.
- *
- * @return the current catalog name or null
- * @exception SQLException if a database access error occurs
- */
- public String getCatalog() throws SQLException
- {
- checkClosed();
- return protoConnection.getDatabase();
- }
-
- /*
- * Overides finalize(). If called, it closes the connection.
- *
- * This was done at the request of Rachel Greenham
- * <rachel at enlarion.demon.co.uk> who hit a problem where multiple
- * clients didn't close the connection, and once a fortnight enough
- * clients were open to kill the postgres server.
- */
- protected void finalize() throws Throwable
- {
- if (openStackTrace != null)
- logger.log(GT.tr("Finalizing a Connection that was never closed:"), openStackTrace);
-
- close();
- }
-
- /*
- * Get server version number
- */
- public String getDBVersionNumber()
- {
- return dbVersionNumber;
- }
-
- // Parse a "dirty" integer surrounded by non-numeric characters
- private static int integerPart(String dirtyString)
- {
- int start, end;
-
- for (start = 0; start < dirtyString.length() && !Character.isDigit(dirtyString.charAt(start)); ++start)
- ;
-
- for (end = start; end < dirtyString.length() && Character.isDigit(dirtyString.charAt(end)); ++end)
- ;
-
- if (start == end)
- return 0;
-
- return Integer.parseInt(dirtyString.substring(start, end));
- }
-
- /*
- * Get server major version
- */
- public int getServerMajorVersion()
- {
- try
- {
- StringTokenizer versionTokens = new StringTokenizer(dbVersionNumber, "."); // aaXbb.ccYdd
- return integerPart(versionTokens.nextToken()); // return X
- }
- catch (NoSuchElementException e)
- {
- return 0;
- }
- }
-
- /*
- * Get server minor version
- */
- public int getServerMinorVersion()
- {
- try
- {
- StringTokenizer versionTokens = new StringTokenizer(dbVersionNumber, "."); // aaXbb.ccYdd
- versionTokens.nextToken(); // Skip aaXbb
- return integerPart(versionTokens.nextToken()); // return Y
- }
- catch (NoSuchElementException e)
- {
- return 0;
- }
- }
-
- /**
- * Is the server we are connected to running at least this version?
- * This comparison method will fail whenever a major or minor version
- * goes to two digits (10.3.0) or (7.10.1).
- */
- public boolean haveMinimumServerVersion(String ver)
- {
- return (dbVersionNumber.compareTo(ver) >= 0);
- }
-
- /*
- * This method returns true if the compatible level set in the connection
- * (which can be passed into the connection or specified in the URL)
- * is at least the value passed to this method. This is used to toggle
- * between different functionality as it changes across different releases
- * of the jdbc driver code. The values here are versions of the jdbc client
- * and not server versions. For example in 7.1 get/setBytes worked on
- * LargeObject values, in 7.2 these methods were changed to work on bytea
- * values. This change in functionality could be disabled by setting the
- * "compatible" level to be 7.1, in which case the driver will revert to
- * the 7.1 functionality.
- */
- public boolean haveMinimumCompatibleVersion(String ver)
- {
- return (compatible.compareTo(ver) >= 0);
- }
-
-
- public Encoding getEncoding() {
- return protoConnection.getEncoding();
- }
-
- public byte[] encodeString(String str) throws SQLException {
- try
- {
- return getEncoding().encode(str);
- }
- catch (IOException ioe)
- {
- throw new PSQLException(GT.tr("Unable to translate data into the desired encoding."), PSQLState.DATA_ERROR, ioe);
- }
- }
-
- public String escapeString(String str) throws SQLException {
- return Utils.appendEscapedLiteral(null, str,
- protoConnection.getStandardConformingStrings()).toString();
- }
-
- public boolean getStandardConformingStrings() {
- return protoConnection.getStandardConformingStrings();
- }
-
- // This is a cache of the DatabaseMetaData instance for this connection
- protected java.sql.DatabaseMetaData metadata;
-
- /*
- * Tests to see if a Connection is closed
- *
- * @return the status of the connection
- * @exception SQLException (why?)
- */
- public boolean isClosed() throws SQLException
- {
- return protoConnection.isClosed();
- }
-
- public void cancelQuery() throws SQLException
- {
- checkClosed();
- protoConnection.sendQueryCancel();
- }
-
- public PGNotification[] getNotifications() throws SQLException
- {
- checkClosed();
- getQueryExecutor().processNotifies();
- // Backwards-compatibility hand-holding.
- PGNotification[] notifications = protoConnection.getNotifications();
- return (notifications.length == 0 ? null : notifications);
- }
-
- //
- // Handler for transaction queries
- //
- private class TransactionCommandHandler implements ResultHandler {
- private SQLException error;
-
- public void handleResultRows(Query fromQuery, Field[] fields, List tuples, ResultCursor cursor) {
- }
- public void handleCommandStatus(String status, int updateCount, long insertOID) {
- }
-
- public void handleWarning(SQLWarning warning) {
- AbstractJdbc2Connection.this.addWarning(warning);
- }
-
- public void handleError(SQLException newError) {
- if (error == null)
- error = newError;
- else
- error.setNextException(newError);
- }
-
- public void handleCompletion() throws SQLException {
- if (error != null)
- throw error;
- }
- }
-
- public int getPrepareThreshold() {
- return prepareThreshold;
- }
-
- public void setPrepareThreshold(int newThreshold) {
- this.prepareThreshold = (newThreshold <= 0 ? 0 : newThreshold);
- }
-
-
- public void setTypeMapImpl(java.util.Map map) throws SQLException
- {
- typemap = map;
- }
-
- public Logger getLogger()
- {
- return logger;
- }
-
-
- //Because the get/setLogStream methods are deprecated in JDBC2
- //we use the get/setLogWriter methods here for JDBC2 by overriding
- //the base version of this method
- protected void enableDriverManagerLogging()
- {
- if (DriverManager.getLogWriter() == null)
- {
- DriverManager.setLogWriter(new PrintWriter(System.out, true));
- }
- }
-
- public int getProtocolVersion()
- {
- return protoConnection.getProtocolVersion();
- }
-
- public boolean getStringVarcharFlag()
- {
- return bindStringAsVarchar;
- }
-
- private CopyManager copyManager = null;
- public CopyManager getCopyAPI() throws SQLException
- {
- checkClosed();
- if (copyManager == null)
- copyManager = new CopyManager(this);
- return copyManager;
- }
-
- public boolean binaryTransferSend(int oid) {
- return useBinarySendForOids.contains(oid);
- }
-}
diff --git a/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java b/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java
deleted file mode 100644
index b1a5f5e..0000000
--- a/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java
+++ /dev/null
@@ -1,4448 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc2;
-
-import java.sql.*;
-import java.util.*;
-
-import org.postgresql.core.*;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-import org.postgresql.Driver;
-import org.postgresql.util.GT;
-
-public abstract class AbstractJdbc2DatabaseMetaData
-{
-
- public AbstractJdbc2DatabaseMetaData(AbstractJdbc2Connection conn)
- {
- this.connection = conn;
- }
-
-
- private static final String keywords = "abort,acl,add,aggregate,append,archive," +
- "arch_store,backward,binary,boolean,change,cluster," +
- "copy,database,delimiter,delimiters,do,extend," +
- "explain,forward,heavy,index,inherits,isnull," +
- "light,listen,load,merge,nothing,notify," +
- "notnull,oids,purge,rename,replace,retrieve," +
- "returns,rule,recipe,setof,stdin,stdout,store," +
- "vacuum,verbose,version";
-
- protected final AbstractJdbc2Connection connection; // The connection association
-
- private int NAMEDATALEN = 0; // length for name datatype
- private int INDEX_MAX_KEYS = 0; // maximum number of keys in an index.
-
- protected int getMaxIndexKeys() throws SQLException {
- if (INDEX_MAX_KEYS == 0)
- {
- String sql;
- if (connection.haveMinimumServerVersion("8.0")) {
- sql = "SELECT setting FROM pg_catalog.pg_settings WHERE name='max_index_keys'";
- } else {
- String from;
- if (connection.haveMinimumServerVersion("7.3"))
- {
- from = "pg_catalog.pg_namespace n, pg_catalog.pg_type t1, pg_catalog.pg_type t2 WHERE t1.typnamespace=n.oid AND n.nspname='pg_catalog' AND ";
- }
- else
- {
- from = "pg_type t1, pg_type t2 WHERE ";
- }
- sql = "SELECT t1.typlen/t2.typlen FROM " + from + " t1.typelem=t2.oid AND t1.typname='oidvector'";
- }
- ResultSet rs = connection.createStatement().executeQuery(sql);
- if (!rs.next())
- {
- throw new PSQLException(GT.tr("Unable to determine a value for MaxIndexKeys due to missing system catalog data."), PSQLState.UNEXPECTED_ERROR);
- }
- INDEX_MAX_KEYS = rs.getInt(1);
- rs.close();
- }
- return INDEX_MAX_KEYS;
- }
-
- protected int getMaxNameLength() throws SQLException {
- if (NAMEDATALEN == 0)
- {
- String sql;
- if (connection.haveMinimumServerVersion("7.3"))
- {
- sql = "SELECT t.typlen FROM pg_catalog.pg_type t, pg_catalog.pg_namespace n WHERE t.typnamespace=n.oid AND t.typname='name' AND n.nspname='pg_catalog'";
- }
- else
- {
- sql = "SELECT typlen FROM pg_type WHERE typname='name'";
- }
- ResultSet rs = connection.createStatement().executeQuery(sql);
- if (!rs.next())
- {
- throw new PSQLException(GT.tr("Unable to find name datatype in the system catalogs."), PSQLState.UNEXPECTED_ERROR);
- }
- NAMEDATALEN = rs.getInt("typlen");
- rs.close();
- }
- return NAMEDATALEN - 1;
- }
-
-
- /*
- * Can all the procedures returned by getProcedures be called
- * by the current user?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean allProceduresAreCallable() throws SQLException
- {
- return true; // For now...
- }
-
- /*
- * Can all the tables returned by getTable be SELECTed by
- * the current user?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean allTablesAreSelectable() throws SQLException
- {
- return true; // For now...
- }
-
- /*
- * What is the URL for this database?
- *
- * @return the url or null if it cannott be generated
- * @exception SQLException if a database access error occurs
- */
- public String getURL() throws SQLException
- {
- return connection.getURL();
- }
-
- /*
- * What is our user name as known to the database?
- *
- * @return our database user name
- * @exception SQLException if a database access error occurs
- */
- public String getUserName() throws SQLException
- {
- return connection.getUserName();
- }
-
- /*
- * Is the database in read-only mode?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean isReadOnly() throws SQLException
- {
- return connection.isReadOnly();
- }
-
- /*
- * Are NULL values sorted high?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean nullsAreSortedHigh() throws SQLException
- {
- return connection.haveMinimumServerVersion("7.2");
- }
-
- /*
- * Are NULL values sorted low?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean nullsAreSortedLow() throws SQLException
- {
- return false;
- }
-
- /*
- * Are NULL values sorted at the start regardless of sort order?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean nullsAreSortedAtStart() throws SQLException
- {
- return false;
- }
-
- /*
- * Are NULL values sorted at the end regardless of sort order?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean nullsAreSortedAtEnd() throws SQLException
- {
- return !connection.haveMinimumServerVersion("7.2");
- }
-
- /*
- * What is the name of this database product - we hope that it is
- * PostgreSQL, so we return that explicitly.
- *
- * @return the database product name
- * @exception SQLException if a database access error occurs
- */
- public String getDatabaseProductName() throws SQLException
- {
- return "PostgreSQL";
- }
-
- /*
- * What is the version of this database product.
- *
- * @return the database version
- * @exception SQLException if a database access error occurs
- */
- public String getDatabaseProductVersion() throws SQLException
- {
- return connection.getDBVersionNumber();
- }
-
- /*
- * What is the name of this JDBC driver? If we don't know this
- * we are doing something wrong!
- *
- * @return the JDBC driver name
- * @exception SQLException why?
- */
- public String getDriverName() throws SQLException
- {
- return "PostgreSQL Native Driver";
- }
-
- /*
- * What is the version string of this JDBC driver? Again, this is
- * static.
- *
- * @return the JDBC driver name.
- * @exception SQLException why?
- */
- public String getDriverVersion() throws SQLException
- {
- return Driver.getVersion();
- }
-
- /*
- * What is this JDBC driver's major version number?
- *
- * @return the JDBC driver major version
- */
- public int getDriverMajorVersion()
- {
- return Driver.MAJORVERSION;
- }
-
- /*
- * What is this JDBC driver's minor version number?
- *
- * @return the JDBC driver minor version
- */
- public int getDriverMinorVersion()
- {
- return Driver.MINORVERSION;
- }
-
- /*
- * Does the database store tables in a local file? No - it
- * stores them in a file on the server.
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean usesLocalFiles() throws SQLException
- {
- return false;
- }
-
- /*
- * Does the database use a file for each table? Well, not really,
- * since it doesnt use local files.
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean usesLocalFilePerTable() throws SQLException
- {
- return false;
- }
-
- /*
- * Does the database treat mixed case unquoted SQL identifiers
- * as case sensitive and as a result store them in mixed case?
- * A JDBC-Compliant driver will always return false.
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsMixedCaseIdentifiers() throws SQLException
- {
- return false;
- }
-
- /*
- * Does the database treat mixed case unquoted SQL identifiers as
- * case insensitive and store them in upper case?
- *
- * @return true if so
- */
- public boolean storesUpperCaseIdentifiers() throws SQLException
- {
- return false;
- }
-
- /*
- * Does the database treat mixed case unquoted SQL identifiers as
- * case insensitive and store them in lower case?
- *
- * @return true if so
- */
- public boolean storesLowerCaseIdentifiers() throws SQLException
- {
- return true;
- }
-
- /*
- * Does the database treat mixed case unquoted SQL identifiers as
- * case insensitive and store them in mixed case?
- *
- * @return true if so
- */
- public boolean storesMixedCaseIdentifiers() throws SQLException
- {
- return false;
- }
-
- /*
- * Does the database treat mixed case quoted SQL identifiers as
- * case sensitive and as a result store them in mixed case? A
- * JDBC compliant driver will always return true.
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException
- {
- return true;
- }
-
- /*
- * Does the database treat mixed case quoted SQL identifiers as
- * case insensitive and store them in upper case?
- *
- * @return true if so
- */
- public boolean storesUpperCaseQuotedIdentifiers() throws SQLException
- {
- return false;
- }
-
- /*
- * Does the database treat mixed case quoted SQL identifiers as case
- * insensitive and store them in lower case?
- *
- * @return true if so
- */
- public boolean storesLowerCaseQuotedIdentifiers() throws SQLException
- {
- return false;
- }
-
- /*
- * Does the database treat mixed case quoted SQL identifiers as case
- * insensitive and store them in mixed case?
- *
- * @return true if so
- */
- public boolean storesMixedCaseQuotedIdentifiers() throws SQLException
- {
- return false;
- }
-
- /*
- * What is the string used to quote SQL identifiers? This returns
- * a space if identifier quoting isn't supported. A JDBC Compliant
- * driver will always use a double quote character.
- *
- * @return the quoting string
- * @exception SQLException if a database access error occurs
- */
- public String getIdentifierQuoteString() throws SQLException
- {
- return "\"";
- }
-
- /*
- * Get a comma separated list of all a database's SQL keywords that
- * are NOT also SQL92 keywords.
- *
- * <p>Within PostgreSQL, the keywords are found in
- * src/backend/parser/keywords.c
- *
- * <p>For SQL Keywords, I took the list provided at
- * <a href="http://web.dementia.org/~shadow/sql/sql3bnf.sep93.txt">
- * http://web.dementia.org/~shadow/sql/sql3bnf.sep93.txt</a>
- * which is for SQL3, not SQL-92, but it is close enough for
- * this purpose.
- *
- * @return a comma separated list of keywords we use
- * @exception SQLException if a database access error occurs
- */
- public String getSQLKeywords() throws SQLException
- {
- return keywords;
- }
-
- /**
- * get supported escaped numeric functions
- * @return a comma separated list of function names
- */
- public String getNumericFunctions() throws SQLException
- {
- return EscapedFunctions.ABS+','+EscapedFunctions.ACOS+
- ','+EscapedFunctions.ASIN+','+EscapedFunctions.ATAN+
- ','+EscapedFunctions.ATAN2+','+EscapedFunctions.CEILING+
- ','+EscapedFunctions.COS+','+EscapedFunctions.COT+
- ','+EscapedFunctions.DEGREES+','+EscapedFunctions.EXP+
- ','+EscapedFunctions.FLOOR+','+EscapedFunctions.LOG+
- ','+EscapedFunctions.LOG10+','+EscapedFunctions.MOD+
- ','+EscapedFunctions.PI+','+EscapedFunctions.POWER+
- ','+EscapedFunctions.RADIANS+
- ','+EscapedFunctions.ROUND+','+EscapedFunctions.SIGN+
- ','+EscapedFunctions.SIN+','+EscapedFunctions.SQRT+
- ','+EscapedFunctions.TAN+','+EscapedFunctions.TRUNCATE;
-
- }
-
- public String getStringFunctions() throws SQLException
- {
- String funcs = EscapedFunctions.ASCII+','+EscapedFunctions.CHAR+
- ','+EscapedFunctions.CONCAT+
- ','+EscapedFunctions.LCASE+','+EscapedFunctions.LEFT+
- ','+EscapedFunctions.LENGTH+
- ','+EscapedFunctions.LTRIM+','+EscapedFunctions.REPEAT+
- ','+EscapedFunctions.RTRIM+
- ','+EscapedFunctions.SPACE+','+EscapedFunctions.SUBSTRING+
- ','+EscapedFunctions.UCASE;
-
- // Currently these don't work correctly with parameterized
- // arguments, so leave them out. They reorder the arguments
- // when rewriting the query, but no translation layer is provided,
- // so a setObject(N, obj) will not go to the correct parameter.
- //','+EscapedFunctions.INSERT+','+EscapedFunctions.LOCATE+
- //','+EscapedFunctions.RIGHT+
-
- if (connection.haveMinimumServerVersion("7.3")) {
- funcs += ','+EscapedFunctions.REPLACE;
- }
-
- return funcs;
- }
-
- public String getSystemFunctions() throws SQLException
- {
- if (connection.haveMinimumServerVersion("7.3")){
- return EscapedFunctions.DATABASE+','+EscapedFunctions.IFNULL+
- ','+EscapedFunctions.USER;
- } else {
- return EscapedFunctions.IFNULL+
- ','+EscapedFunctions.USER;
- }
- }
-
- public String getTimeDateFunctions() throws SQLException
- {
- String timeDateFuncs = EscapedFunctions.CURDATE+','+EscapedFunctions.CURTIME+
- ','+EscapedFunctions.DAYNAME+','+EscapedFunctions.DAYOFMONTH+
- ','+EscapedFunctions.DAYOFWEEK+','+EscapedFunctions.DAYOFYEAR+
- ','+EscapedFunctions.HOUR+','+EscapedFunctions.MINUTE+
- ','+EscapedFunctions.MONTH+
- ','+EscapedFunctions.MONTHNAME+','+EscapedFunctions.NOW+
- ','+EscapedFunctions.QUARTER+','+EscapedFunctions.SECOND+
- ','+EscapedFunctions.WEEK+','+EscapedFunctions.YEAR;
-
- if (connection.haveMinimumServerVersion("8.0")) {
- timeDateFuncs += ','+EscapedFunctions.TIMESTAMPADD;
- }
-
- //+','+EscapedFunctions.TIMESTAMPDIFF;
-
- return timeDateFuncs;
- }
-
- /*
- * This is the string that can be used to escape '_' and '%' in
- * a search string pattern style catalog search parameters
- *
- * @return the string used to escape wildcard characters
- * @exception SQLException if a database access error occurs
- */
- public String getSearchStringEscape() throws SQLException
- {
- // This method originally returned "\\\\" assuming that it
- // would be fed directly into pg's input parser so it would
- // need two backslashes. This isn't how it's supposed to be
- // used though. If passed as a PreparedStatement parameter
- // or fed to a DatabaseMetaData method then double backslashes
- // are incorrect. If you're feeding something directly into
- // a query you are responsible for correctly escaping it.
- // With 8.2+ this escaping is a little trickier because you
- // must know the setting of standard_conforming_strings, but
- // that's not our problem.
-
- return "\\";
- }
-
- /*
- * Get all the "extra" characters that can be used in unquoted
- * identifier names (those beyond a-zA-Z0-9 and _)
- *
- * <p>Postgresql allows any high-bit character to be used
- * in an unquoted identifer, so we can't possibly list them all.
- *
- * From the file src/backend/parser/scan.l, an identifier is
- * ident_start [A-Za-z\200-\377_]
- * ident_cont [A-Za-z\200-\377_0-9\$]
- * identifier {ident_start}{ident_cont}*
- *
- * @return a string containing the extra characters
- * @exception SQLException if a database access error occurs
- */
- public String getExtraNameCharacters() throws SQLException
- {
- return "";
- }
-
- /*
- * Is "ALTER TABLE" with an add column supported?
- * Yes for PostgreSQL 6.1
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsAlterTableWithAddColumn() throws SQLException
- {
- return true;
- }
-
- /*
- * Is "ALTER TABLE" with a drop column supported?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsAlterTableWithDropColumn() throws SQLException
- {
- return connection.haveMinimumServerVersion("7.3");
- }
-
- /*
- * Is column aliasing supported?
- *
- * <p>If so, the SQL AS clause can be used to provide names for
- * computed columns or to provide alias names for columns as
- * required. A JDBC Compliant driver always returns true.
- *
- * <p>e.g.
- *
- * <br><pre>
- * select count(C) as C_COUNT from T group by C;
- *
- * </pre><br>
- * should return a column named as C_COUNT instead of count(C)
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsColumnAliasing() throws SQLException
- {
- return true;
- }
-
- /*
- * Are concatenations between NULL and non-NULL values NULL? A
- * JDBC Compliant driver always returns true
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean nullPlusNonNullIsNull() throws SQLException
- {
- return true;
- }
-
- public boolean supportsConvert() throws SQLException
- {
- return false;
- }
-
- public boolean supportsConvert(int fromType, int toType) throws SQLException
- {
- return false;
- }
-
- /*
- * Are table correlation names supported? A JDBC Compliant
- * driver always returns true.
- *
- * @return true if so; false otherwise
- * @exception SQLException - if a database access error occurs
- */
- public boolean supportsTableCorrelationNames() throws SQLException
- {
- return true;
- }
-
- /*
- * If table correlation names are supported, are they restricted to
- * be different from the names of the tables?
- *
- * @return true if so; false otherwise
- * @exception SQLException - if a database access error occurs
- */
- public boolean supportsDifferentTableCorrelationNames() throws SQLException
- {
- return false;
- }
-
- /*
- * Are expressions in "ORDER BY" lists supported?
- *
- * <br>e.g. select * from t order by a + b;
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsExpressionsInOrderBy() throws SQLException
- {
- return true;
- }
-
- /*
- * Can an "ORDER BY" clause use columns not in the SELECT?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsOrderByUnrelated() throws SQLException
- {
- return connection.haveMinimumServerVersion("6.4");
- }
-
- /*
- * Is some form of "GROUP BY" clause supported?
- * I checked it, and yes it is.
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsGroupBy() throws SQLException
- {
- return true;
- }
-
- /*
- * Can a "GROUP BY" clause use columns not in the SELECT?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsGroupByUnrelated() throws SQLException
- {
- return connection.haveMinimumServerVersion("6.4");
- }
-
- /*
- * Can a "GROUP BY" clause add columns not in the SELECT provided
- * it specifies all the columns in the SELECT? Does anyone actually
- * understand what they mean here?
- *
- * (I think this is a subset of the previous function. -- petere)
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsGroupByBeyondSelect() throws SQLException
- {
- return connection.haveMinimumServerVersion("6.4");
- }
-
- /*
- * Is the escape character in "LIKE" clauses supported? A
- * JDBC compliant driver always returns true.
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsLikeEscapeClause() throws SQLException
- {
- return connection.haveMinimumServerVersion("7.1");
- }
-
- /*
- * Are multiple ResultSets from a single execute supported?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsMultipleResultSets() throws SQLException
- {
- return true;
- }
-
- /*
- * Can we have multiple transactions open at once (on different
- * connections?)
- * I guess we can have, since Im relying on it.
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsMultipleTransactions() throws SQLException
- {
- return true;
- }
-
- /*
- * Can columns be defined as non-nullable. A JDBC Compliant driver
- * always returns true.
- *
- * <p>This changed from false to true in v6.2 of the driver, as this
- * support was added to the backend.
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsNonNullableColumns() throws SQLException
- {
- return true;
- }
-
- /*
- * Does this driver support the minimum ODBC SQL grammar. This
- * grammar is defined at:
- *
- * <p><a href="http://www.microsoft.com/msdn/sdk/platforms/doc/odbc/src/intropr.htm">http://www.microsoft.com/msdn/sdk/platforms/doc/odbc/src/intropr.htm</a>
- *
- * <p>In Appendix C. From this description, we seem to support the
- * ODBC minimal (Level 0) grammar.
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsMinimumSQLGrammar() throws SQLException
- {
- return true;
- }
-
- /*
- * Does this driver support the Core ODBC SQL grammar. We need
- * SQL-92 conformance for this.
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsCoreSQLGrammar() throws SQLException
- {
- return false;
- }
-
- /*
- * Does this driver support the Extended (Level 2) ODBC SQL
- * grammar. We don't conform to the Core (Level 1), so we can't
- * conform to the Extended SQL Grammar.
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsExtendedSQLGrammar() throws SQLException
- {
- return false;
- }
-
- /*
- * Does this driver support the ANSI-92 entry level SQL grammar?
- * All JDBC Compliant drivers must return true. We currently
- * report false until 'schema' support is added. Then this
- * should be changed to return true, since we will be mostly
- * compliant (probably more compliant than many other databases)
- * And since this is a requirement for all JDBC drivers we
- * need to get to the point where we can return true.
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsANSI92EntryLevelSQL() throws SQLException
- {
- return connection.haveMinimumServerVersion("7.3");
- }
-
- /*
- * Does this driver support the ANSI-92 intermediate level SQL
- * grammar?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsANSI92IntermediateSQL() throws SQLException
- {
- return false;
- }
-
- /*
- * Does this driver support the ANSI-92 full SQL grammar?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsANSI92FullSQL() throws SQLException
- {
- return false;
- }
-
- /*
- * Is the SQL Integrity Enhancement Facility supported?
- * Our best guess is that this means support for constraints
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsIntegrityEnhancementFacility() throws SQLException
- {
- return true;
- }
-
- /*
- * Is some form of outer join supported?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsOuterJoins() throws SQLException
- {
- return connection.haveMinimumServerVersion("7.1");
- }
-
- /*
- * Are full nexted outer joins supported?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsFullOuterJoins() throws SQLException
- {
- return connection.haveMinimumServerVersion("7.1");
- }
-
- /*
- * Is there limited support for outer joins?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsLimitedOuterJoins() throws SQLException
- {
- return connection.haveMinimumServerVersion("7.1");
- }
-
- /*
- * What is the database vendor's preferred term for "schema"?
- * PostgreSQL doesn't have schemas, but when it does, we'll use the
- * term "schema".
- *
- * @return the vendor term
- * @exception SQLException if a database access error occurs
- */
- public String getSchemaTerm() throws SQLException
- {
- return "schema";
- }
-
- /*
- * What is the database vendor's preferred term for "procedure"?
- * Traditionally, "function" has been used.
- *
- * @return the vendor term
- * @exception SQLException if a database access error occurs
- */
- public String getProcedureTerm() throws SQLException
- {
- return "function";
- }
-
- /*
- * What is the database vendor's preferred term for "catalog"?
- *
- * @return the vendor term
- * @exception SQLException if a database access error occurs
- */
- public String getCatalogTerm() throws SQLException
- {
- return "database";
- }
-
- /*
- * Does a catalog appear at the start of a qualified table name?
- * (Otherwise it appears at the end).
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean isCatalogAtStart() throws SQLException
- {
- return true;
- }
-
- /*
- * What is the Catalog separator.
- *
- * @return the catalog separator string
- * @exception SQLException if a database access error occurs
- */
- public String getCatalogSeparator() throws SQLException
- {
- return ".";
- }
-
- /*
- * Can a schema name be used in a data manipulation statement?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsSchemasInDataManipulation() throws SQLException
- {
- return connection.haveMinimumServerVersion("7.3");
- }
-
- /*
- * Can a schema name be used in a procedure call statement?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsSchemasInProcedureCalls() throws SQLException
- {
- return connection.haveMinimumServerVersion("7.3");
- }
-
- /*
- * Can a schema be used in a table definition statement?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsSchemasInTableDefinitions() throws SQLException
- {
- return connection.haveMinimumServerVersion("7.3");
- }
-
- /*
- * Can a schema name be used in an index definition statement?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsSchemasInIndexDefinitions() throws SQLException
- {
- return connection.haveMinimumServerVersion("7.3");
- }
-
- /*
- * Can a schema name be used in a privilege definition statement?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException
- {
- return connection.haveMinimumServerVersion("7.3");
- }
-
- /*
- * Can a catalog name be used in a data manipulation statement?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsCatalogsInDataManipulation() throws SQLException
- {
- return false;
- }
-
- /*
- * Can a catalog name be used in a procedure call statement?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsCatalogsInProcedureCalls() throws SQLException
- {
- return false;
- }
-
- /*
- * Can a catalog name be used in a table definition statement?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsCatalogsInTableDefinitions() throws SQLException
- {
- return false;
- }
-
- /*
- * Can a catalog name be used in an index definition?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsCatalogsInIndexDefinitions() throws SQLException
- {
- return false;
- }
-
- /*
- * Can a catalog name be used in a privilege definition statement?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException
- {
- return false;
- }
-
- /*
- * We support cursors for gets only it seems. I dont see a method
- * to get a positioned delete.
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsPositionedDelete() throws SQLException
- {
- return false; // For now...
- }
-
- /*
- * Is positioned UPDATE supported?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsPositionedUpdate() throws SQLException
- {
- return false; // For now...
- }
-
- /*
- * Is SELECT for UPDATE supported?
- *
- * @return true if so; false otherwise
- * @exception SQLException - if a database access error occurs
- */
- public boolean supportsSelectForUpdate() throws SQLException
- {
- return connection.haveMinimumServerVersion("6.5");
- }
-
- /*
- * Are stored procedure calls using the stored procedure escape
- * syntax supported?
- *
- * @return true if so; false otherwise
- * @exception SQLException - if a database access error occurs
- */
- public boolean supportsStoredProcedures() throws SQLException
- {
- return true;
- }
-
- /*
- * Are subqueries in comparison expressions supported? A JDBC
- * Compliant driver always returns true.
- *
- * @return true if so; false otherwise
- * @exception SQLException - if a database access error occurs
- */
- public boolean supportsSubqueriesInComparisons() throws SQLException
- {
- return true;
- }
-
- /*
- * Are subqueries in 'exists' expressions supported? A JDBC
- * Compliant driver always returns true.
- *
- * @return true if so; false otherwise
- * @exception SQLException - if a database access error occurs
- */
- public boolean supportsSubqueriesInExists() throws SQLException
- {
- return true;
- }
-
- /*
- * Are subqueries in 'in' statements supported? A JDBC
- * Compliant driver always returns true.
- *
- * @return true if so; false otherwise
- * @exception SQLException - if a database access error occurs
- */
- public boolean supportsSubqueriesInIns() throws SQLException
- {
- return true;
- }
-
- /*
- * Are subqueries in quantified expressions supported? A JDBC
- * Compliant driver always returns true.
- *
- * (No idea what this is, but we support a good deal of
- * subquerying.)
- *
- * @return true if so; false otherwise
- * @exception SQLException - if a database access error occurs
- */
- public boolean supportsSubqueriesInQuantifieds() throws SQLException
- {
- return true;
- }
-
- /*
- * Are correlated subqueries supported? A JDBC Compliant driver
- * always returns true.
- *
- * (a.k.a. subselect in from?)
- *
- * @return true if so; false otherwise
- * @exception SQLException - if a database access error occurs
- */
- public boolean supportsCorrelatedSubqueries() throws SQLException
- {
- return connection.haveMinimumServerVersion("7.1");
- }
-
- /*
- * Is SQL UNION supported?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsUnion() throws SQLException
- {
- return true; // since 6.3
- }
-
- /*
- * Is SQL UNION ALL supported?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsUnionAll() throws SQLException
- {
- return connection.haveMinimumServerVersion("7.1");
- }
-
- /*
- * In PostgreSQL, Cursors are only open within transactions.
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsOpenCursorsAcrossCommit() throws SQLException
- {
- return false;
- }
-
- /*
- * Do we support open cursors across multiple transactions?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsOpenCursorsAcrossRollback() throws SQLException
- {
- return false;
- }
-
- /*
- * Can statements remain open across commits? They may, but
- * this driver cannot guarentee that. In further reflection.
- * we are talking a Statement object here, so the answer is
- * yes, since the Statement is only a vehicle to ExecSQL()
- *
- * @return true if they always remain open; false otherwise
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsOpenStatementsAcrossCommit() throws SQLException
- {
- return true;
- }
-
- /*
- * Can statements remain open across rollbacks? They may, but
- * this driver cannot guarentee that. In further contemplation,
- * we are talking a Statement object here, so the answer is yes,
- * since the Statement is only a vehicle to ExecSQL() in Connection
- *
- * @return true if they always remain open; false otherwise
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsOpenStatementsAcrossRollback() throws SQLException
- {
- return true;
- }
-
- /*
- * How many hex characters can you have in an inline binary literal
- *
- * @return the max literal length
- * @exception SQLException if a database access error occurs
- */
- public int getMaxBinaryLiteralLength() throws SQLException
- {
- return 0; // no limit
- }
-
- /*
- * What is the maximum length for a character literal
- * I suppose it is 8190 (8192 - 2 for the quotes)
- *
- * @return the max literal length
- * @exception SQLException if a database access error occurs
- */
- public int getMaxCharLiteralLength() throws SQLException
- {
- return 0; // no limit
- }
-
- /*
- * Whats the limit on column name length.
- *
- * @return the maximum column name length
- * @exception SQLException if a database access error occurs
- */
- public int getMaxColumnNameLength() throws SQLException
- {
- return getMaxNameLength();
- }
-
- /*
- * What is the maximum number of columns in a "GROUP BY" clause?
- *
- * @return the max number of columns
- * @exception SQLException if a database access error occurs
- */
- public int getMaxColumnsInGroupBy() throws SQLException
- {
- return 0; // no limit
- }
-
- /*
- * What's the maximum number of columns allowed in an index?
- *
- * @return max number of columns
- * @exception SQLException if a database access error occurs
- */
- public int getMaxColumnsInIndex() throws SQLException
- {
- return getMaxIndexKeys();
- }
-
- /*
- * What's the maximum number of columns in an "ORDER BY clause?
- *
- * @return the max columns
- * @exception SQLException if a database access error occurs
- */
- public int getMaxColumnsInOrderBy() throws SQLException
- {
- return 0; // no limit
- }
-
- /*
- * What is the maximum number of columns in a "SELECT" list?
- *
- * @return the max columns
- * @exception SQLException if a database access error occurs
- */
- public int getMaxColumnsInSelect() throws SQLException
- {
- return 0; // no limit
- }
-
- /*
- * What is the maximum number of columns in a table? From the
- * CREATE TABLE reference page...
- *
- * <p>"The new class is created as a heap with no initial data. A
- * class can have no more than 1600 attributes (realistically,
- * this is limited by the fact that tuple sizes must be less than
- * 8192 bytes)..."
- *
- * @return the max columns
- * @exception SQLException if a database access error occurs
- */
- public int getMaxColumnsInTable() throws SQLException
- {
- return 1600;
- }
-
- /*
- * How many active connection can we have at a time to this
- * database? Well, since it depends on postmaster, which just
- * does a listen() followed by an accept() and fork(), its
- * basically very high. Unless the system runs out of processes,
- * it can be 65535 (the number of aux. ports on a TCP/IP system).
- * I will return 8192 since that is what even the largest system
- * can realistically handle,
- *
- * @return the maximum number of connections
- * @exception SQLException if a database access error occurs
- */
- public int getMaxConnections() throws SQLException
- {
- return 8192;
- }
-
- /*
- * What is the maximum cursor name length
- *
- * @return max cursor name length in bytes
- * @exception SQLException if a database access error occurs
- */
- public int getMaxCursorNameLength() throws SQLException
- {
- return getMaxNameLength();
- }
-
- /*
- * Retrieves the maximum number of bytes for an index, including all
- * of the parts of the index.
- *
- * @return max index length in bytes, which includes the composite
- * of all the constituent parts of the index; a result of zero means
- * that there is no limit or the limit is not known
- * @exception SQLException if a database access error occurs
- */
- public int getMaxIndexLength() throws SQLException
- {
- return 0; // no limit (larger than an int anyway)
- }
-
- public int getMaxSchemaNameLength() throws SQLException
- {
- return getMaxNameLength();
- }
-
- /*
- * What is the maximum length of a procedure name
- *
- * @return the max name length in bytes
- * @exception SQLException if a database access error occurs
- */
- public int getMaxProcedureNameLength() throws SQLException
- {
- return getMaxNameLength();
- }
-
- public int getMaxCatalogNameLength() throws SQLException
- {
- return getMaxNameLength();
- }
-
- /*
- * What is the maximum length of a single row?
- *
- * @return max row size in bytes
- * @exception SQLException if a database access error occurs
- */
- public int getMaxRowSize() throws SQLException
- {
- if (connection.haveMinimumServerVersion("7.1"))
- return 1073741824; // 1 GB
- else
- return 8192; // XXX could be altered
- }
-
- /*
- * Did getMaxRowSize() include LONGVARCHAR and LONGVARBINARY
- * blobs? We don't handle blobs yet
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean doesMaxRowSizeIncludeBlobs() throws SQLException
- {
- return false;
- }
-
- /*
- * What is the maximum length of a SQL statement?
- *
- * @return max length in bytes
- * @exception SQLException if a database access error occurs
- */
- public int getMaxStatementLength() throws SQLException
- {
- if (connection.haveMinimumServerVersion("7.0"))
- return 0; // actually whatever fits in size_t
- else
- return 16384;
- }
-
- /*
- * How many active statements can we have open at one time to
- * this database? We're only limited by Java heap space really.
- *
- * @return the maximum
- * @exception SQLException if a database access error occurs
- */
- public int getMaxStatements() throws SQLException
- {
- return 0;
- }
-
- /*
- * What is the maximum length of a table name
- *
- * @return max name length in bytes
- * @exception SQLException if a database access error occurs
- */
- public int getMaxTableNameLength() throws SQLException
- {
- return getMaxNameLength();
- }
-
- /*
- * What is the maximum number of tables that can be specified
- * in a SELECT?
- *
- * @return the maximum
- * @exception SQLException if a database access error occurs
- */
- public int getMaxTablesInSelect() throws SQLException
- {
- return 0; // no limit
- }
-
- /*
- * What is the maximum length of a user name
- *
- * @return the max name length in bytes
- * @exception SQLException if a database access error occurs
- */
- public int getMaxUserNameLength() throws SQLException
- {
- return getMaxNameLength();
- }
-
-
- /*
- * What is the database's default transaction isolation level?
- *
- * @return the default isolation level
- * @exception SQLException if a database access error occurs
- * @see Connection
- */
- public int getDefaultTransactionIsolation() throws SQLException
- {
- return Connection.TRANSACTION_READ_COMMITTED;
- }
-
- /*
- * Are transactions supported? If not, commit and rollback are noops
- * and the isolation level is TRANSACTION_NONE. We do support
- * transactions.
- *
- * @return true if transactions are supported
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsTransactions() throws SQLException
- {
- return true;
- }
-
- /*
- * Does the database support the given transaction isolation level?
- * We only support TRANSACTION_SERIALIZABLE and TRANSACTION_READ_COMMITTED
- * before 8.0; from 8.0 READ_UNCOMMITTED and REPEATABLE_READ are accepted aliases
- * for READ_COMMITTED.
- *
- * @param level the values are defined in java.sql.Connection
- * @return true if so
- * @exception SQLException if a database access error occurs
- * @see Connection
- */
- public boolean supportsTransactionIsolationLevel(int level) throws SQLException
- {
- if (level == Connection.TRANSACTION_SERIALIZABLE ||
- level == Connection.TRANSACTION_READ_COMMITTED)
- return true;
- else if (connection.haveMinimumServerVersion("8.0") && (level == Connection.TRANSACTION_READ_UNCOMMITTED || level == Connection.TRANSACTION_REPEATABLE_READ))
- return true;
- else
- return false;
- }
-
- /*
- * Are both data definition and data manipulation transactions
- * supported?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException
- {
- return true;
- }
-
- /*
- * Are only data manipulation statements withing a transaction
- * supported?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean supportsDataManipulationTransactionsOnly() throws SQLException
- {
- return false;
- }
-
- /*
- * Does a data definition statement within a transaction force
- * the transaction to commit? I think this means something like:
- *
- * <p><pre>
- * CREATE TABLE T (A INT);
- * INSERT INTO T (A) VALUES (2);
- * BEGIN;
- * UPDATE T SET A = A + 1;
- * CREATE TABLE X (A INT);
- * SELECT A FROM T INTO X;
- * COMMIT;
- * </pre><p>
- *
- * does the CREATE TABLE call cause a commit? The answer is no.
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean dataDefinitionCausesTransactionCommit() throws SQLException
- {
- return false;
- }
-
- /*
- * Is a data definition statement within a transaction ignored?
- *
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean dataDefinitionIgnoredInTransactions() throws SQLException
- {
- return false;
- }
-
- /**
- * Turn the provided value into a valid string literal for
- * direct inclusion into a query. This includes the single quotes
- * needed around it.
- */
- protected String escapeQuotes(String s) throws SQLException {
- StringBuffer sb = new StringBuffer();
- if (!connection.getStandardConformingStrings() && connection.haveMinimumServerVersion("8.1")) {
- sb.append("E");
- }
- sb.append("'");
- sb.append(connection.escapeString(s));
- sb.append("'");
- return sb.toString();
- }
-
- /*
- * Get a description of stored procedures available in a catalog
- *
- * <p>Only procedure descriptions matching the schema and procedure
- * name criteria are returned. They are ordered by PROCEDURE_SCHEM
- * and PROCEDURE_NAME
- *
- * <p>Each procedure description has the following columns:
- * <ol>
- * <li><b>PROCEDURE_CAT</b> String => procedure catalog (may be null)
- * <li><b>PROCEDURE_SCHEM</b> String => procedure schema (may be null)
- * <li><b>PROCEDURE_NAME</b> String => procedure name
- * <li><b>Field 4</b> reserved (make it null)
- * <li><b>Field 5</b> reserved (make it null)
- * <li><b>Field 6</b> reserved (make it null)
- * <li><b>REMARKS</b> String => explanatory comment on the procedure
- * <li><b>PROCEDURE_TYPE</b> short => kind of procedure
- * <ul>
- * <li> procedureResultUnknown - May return a result
- * <li> procedureNoResult - Does not return a result
- * <li> procedureReturnsResult - Returns a result
- * </ul>
- * </ol>
- *
- * @param catalog - a catalog name; "" retrieves those without a
- * catalog; null means drop catalog name from criteria
- * @param schemaParrern - a schema name pattern; "" retrieves those
- * without a schema - we ignore this parameter
- * @param procedureNamePattern - a procedure name pattern
- * @return ResultSet - each row is a procedure description
- * @exception SQLException if a database access error occurs
- */
- public java.sql.ResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern) throws SQLException
- {
- return getProcedures(2, catalog, schemaPattern, procedureNamePattern);
- }
-
- protected java.sql.ResultSet getProcedures(int jdbcVersion, String catalog, String schemaPattern, String procedureNamePattern) throws SQLException
- {
- String sql;
- if (connection.haveMinimumServerVersion("7.3"))
- {
- sql = "SELECT NULL AS PROCEDURE_CAT, n.nspname AS PROCEDURE_SCHEM, p.proname AS PROCEDURE_NAME, NULL, NULL, NULL, d.description AS REMARKS, " + java.sql.DatabaseMetaData.procedureReturnsResult + " AS PROCEDURE_TYPE ";
- if (jdbcVersion >= 4) {
- sql += ", p.proname || '_' || p.oid AS SPECIFIC_NAME ";
- }
- sql += " FROM pg_catalog.pg_namespace n, pg_catalog.pg_proc p " +
- " LEFT JOIN pg_catalog.pg_description d ON (p.oid=d.objoid) " +
- " LEFT JOIN pg_catalog.pg_class c ON (d.classoid=c.oid AND c.relname='pg_proc') " +
- " LEFT JOIN pg_catalog.pg_namespace pn ON (c.relnamespace=pn.oid AND pn.nspname='pg_catalog') " +
- " WHERE p.pronamespace=n.oid ";
- if (schemaPattern != null && !"".equals(schemaPattern))
- {
- sql += " AND n.nspname LIKE " + escapeQuotes(schemaPattern);
- }
- if (procedureNamePattern != null)
- {
- sql += " AND p.proname LIKE " + escapeQuotes(procedureNamePattern);
- }
- sql += " ORDER BY PROCEDURE_SCHEM, PROCEDURE_NAME, p.oid::text ";
- }
- else if (connection.haveMinimumServerVersion("7.1"))
- {
- sql = "SELECT NULL AS PROCEDURE_CAT, NULL AS PROCEDURE_SCHEM, p.proname AS PROCEDURE_NAME, NULL, NULL, NULL, d.description AS REMARKS, " + java.sql.DatabaseMetaData.procedureReturnsResult + " AS PROCEDURE_TYPE ";
- if (jdbcVersion >= 4) {
- sql += ", p.proname || '_' || p.oid AS SPECIFIC_NAME ";
- }
- sql += " FROM pg_proc p " +
- " LEFT JOIN pg_description d ON (p.oid=d.objoid) ";
- if (connection.haveMinimumServerVersion("7.2"))
- {
- sql += " LEFT JOIN pg_class c ON (d.classoid=c.oid AND c.relname='pg_proc') ";
- }
- if (procedureNamePattern != null)
- {
- sql += " WHERE p.proname LIKE " + escapeQuotes(procedureNamePattern);
- }
- sql += " ORDER BY PROCEDURE_NAME, p.oid::text ";
- }
- else
- {
- sql = "SELECT NULL AS PROCEDURE_CAT, NULL AS PROCEDURE_SCHEM, p.proname AS PROCEDURE_NAME, NULL, NULL, NULL, NULL AS REMARKS, " + java.sql.DatabaseMetaData.procedureReturnsResult + " AS PROCEDURE_TYPE ";
- if (jdbcVersion >= 4) {
- sql += ", p.proname || '_' || p.oid AS SPECIFIC_NAME ";
- }
- sql += " FROM pg_proc p ";
- if (procedureNamePattern != null)
- {
- sql += " WHERE p.proname LIKE " + escapeQuotes(procedureNamePattern);
- }
- sql += " ORDER BY PROCEDURE_NAME, p.oid::text ";
- }
- return createMetaDataStatement().executeQuery(sql);
- }
-
- /*
- * Get a description of a catalog's stored procedure parameters
- * and result columns.
- *
- * <p>Only descriptions matching the schema, procedure and parameter
- * name criteria are returned. They are ordered by PROCEDURE_SCHEM
- * and PROCEDURE_NAME. Within this, the return value, if any, is
- * first. Next are the parameter descriptions in call order. The
- * column descriptions follow in column number order.
- *
- * <p>Each row in the ResultSet is a parameter description or column
- * description with the following fields:
- * <ol>
- * <li><b>PROCEDURE_CAT</b> String => procedure catalog (may be null)
- * <li><b>PROCEDURE_SCHE</b>M String => procedure schema (may be null)
- * <li><b>PROCEDURE_NAME</b> String => procedure name
- * <li><b>COLUMN_NAME</b> String => column/parameter name
- * <li><b>COLUMN_TYPE</b> Short => kind of column/parameter:
- * <ul><li>procedureColumnUnknown - nobody knows
- * <li>procedureColumnIn - IN parameter
- * <li>procedureColumnInOut - INOUT parameter
- * <li>procedureColumnOut - OUT parameter
- * <li>procedureColumnReturn - procedure return value
- * <li>procedureColumnResult - result column in ResultSet
- * </ul>
- * <li><b>DATA_TYPE</b> short => SQL type from java.sql.Types
- * <li><b>TYPE_NAME</b> String => Data source specific type name
- * <li><b>PRECISION</b> int => precision
- * <li><b>LENGTH</b> int => length in bytes of data
- * <li><b>SCALE</b> short => scale
- * <li><b>RADIX</b> short => radix
- * <li><b>NULLABLE</b> short => can it contain NULL?
- * <ul><li>procedureNoNulls - does not allow NULL values
- * <li>procedureNullable - allows NULL values
- * <li>procedureNullableUnknown - nullability unknown
- * <li><b>REMARKS</b> String => comment describing parameter/column
- * </ol>
- * @param catalog This is ignored in org.postgresql, advise this is set to null
- * @param schemaPattern
- * @param procedureNamePattern a procedure name pattern
- * @param columnNamePattern a column name pattern, this is currently ignored because postgresql does not name procedure parameters.
- * @return each row is a stored procedure parameter or column description
- * @exception SQLException if a database-access error occurs
- * @see #getSearchStringEscape
- */
- // Implementation note: This is required for Borland's JBuilder to work
- public java.sql.ResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) throws SQLException
- {
- return getProcedureColumns(2, catalog, schemaPattern, procedureNamePattern, columnNamePattern);
- }
-
- protected java.sql.ResultSet getProcedureColumns(int jdbcVersion, String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) throws SQLException
- {
- int columns = 13;
- if (jdbcVersion >= 4) {
- columns += 7;
- }
- Field f[] = new Field[columns];
- List v = new ArrayList(); // The new ResultSet tuple stuff
-
- f[0] = new Field("PROCEDURE_CAT", Oid.VARCHAR);
- f[1] = new Field("PROCEDURE_SCHEM", Oid.VARCHAR);
- f[2] = new Field("PROCEDURE_NAME", Oid.VARCHAR);
- f[3] = new Field("COLUMN_NAME", Oid.VARCHAR);
- f[4] = new Field("COLUMN_TYPE", Oid.INT2);
- f[5] = new Field("DATA_TYPE", Oid.INT2);
- f[6] = new Field("TYPE_NAME", Oid.VARCHAR);
- f[7] = new Field("PRECISION", Oid.INT4);
- f[8] = new Field("LENGTH", Oid.INT4);
- f[9] = new Field("SCALE", Oid.INT2);
- f[10] = new Field("RADIX", Oid.INT2);
- f[11] = new Field("NULLABLE", Oid.INT2);
- f[12] = new Field("REMARKS", Oid.VARCHAR);
- if (jdbcVersion >= 4) {
- f[13] = new Field("COLUMN_DEF", Oid.VARCHAR);
- f[14] = new Field("SQL_DATA_TYPE", Oid.INT4);
- f[15] = new Field("SQL_DATETIME_SUB", Oid.INT4);
- f[16] = new Field("CHAR_OCTECT_LENGTH", Oid.INT4);
- f[17] = new Field("ORDINAL_POSITION", Oid.INT4);
- f[18] = new Field("IS_NULLABLE", Oid.VARCHAR);
- f[19] = new Field("SPECIFIC_NAME", Oid.VARCHAR);
- }
-
- String sql;
- if (connection.haveMinimumServerVersion("7.3"))
- {
- sql = "SELECT n.nspname,p.proname,p.prorettype,p.proargtypes, t.typtype,t.typrelid ";
-
- if (connection.haveMinimumServerVersion("8.1"))
- sql += ", p.proargnames, p.proargmodes, p.proallargtypes ";
- else if (connection.haveMinimumServerVersion("8.0"))
- sql += ", p.proargnames, NULL AS proargmodes, NULL AS proallargtypes ";
- else
- sql += ", NULL AS proargnames, NULL AS proargmodes, NULL AS proallargtypes ";
- sql += ", p.oid "
- + " FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n, pg_catalog.pg_type t "
- + " WHERE p.pronamespace=n.oid AND p.prorettype=t.oid ";
- if (schemaPattern != null && !"".equals(schemaPattern))
- {
- sql += " AND n.nspname LIKE " + escapeQuotes(schemaPattern);
- }
- if (procedureNamePattern != null)
- {
- sql += " AND p.proname LIKE " + escapeQuotes(procedureNamePattern);
- }
- sql += " ORDER BY n.nspname, p.proname, p.oid::text ";
- }
- else
- {
- sql = "SELECT NULL AS nspname,p.proname,p.prorettype,p.proargtypes,t.typtype,t.typrelid, NULL AS proargnames, NULL AS proargmodes, NULL AS proallargtypes, p.oid " +
- " FROM pg_proc p,pg_type t " +
- " WHERE p.prorettype=t.oid ";
- if (procedureNamePattern != null)
- {
- sql += " AND p.proname LIKE " + escapeQuotes(procedureNamePattern);
- }
- sql += " ORDER BY p.proname, p.oid::text ";
- }
-
- byte isnullableUnknown[] = new byte[0];
-
- ResultSet rs = connection.createStatement().executeQuery(sql);
- while (rs.next())
- {
- byte schema[] = rs.getBytes("nspname");
- byte procedureName[] = rs.getBytes("proname");
- byte specificName[] = connection.encodeString(rs.getString("proname") + "_" + rs.getString("oid"));
- int returnType = (int)rs.getLong("prorettype");
- String returnTypeType = rs.getString("typtype");
- int returnTypeRelid = (int)rs.getLong("typrelid");
-
- String strArgTypes = rs.getString("proargtypes");
- StringTokenizer st = new StringTokenizer(strArgTypes);
- List argTypes = new ArrayList();
- while (st.hasMoreTokens())
- {
- argTypes.add(new Long(st.nextToken()));
- }
-
- String argNames[] = null;
- Array argNamesArray = rs.getArray("proargnames");
- if (argNamesArray != null)
- argNames = (String[])argNamesArray.getArray();
-
- String argModes[] = null;
- Array argModesArray = rs.getArray("proargmodes");
- if (argModesArray != null)
- argModes = (String[])argModesArray.getArray();
-
- int numArgs = argTypes.size();
-
- Long allArgTypes[] = null;
- Array allArgTypesArray = rs.getArray("proallargtypes");
- if (allArgTypesArray != null) {
- // Depending on what the user has selected we'll get
- // either long[] or Long[] back, and there's no
- // obvious way for the driver to override this for
- // it's own usage.
- if (connection.haveMinimumCompatibleVersion("8.3")) {
- allArgTypes = (Long[])allArgTypesArray.getArray();
- } else {
- long tempAllArgTypes[] = (long[])allArgTypesArray.getArray();
- allArgTypes = new Long[tempAllArgTypes.length];
- for (int i=0; i<tempAllArgTypes.length; i++) {
- allArgTypes[i] = new Long(tempAllArgTypes[i]);
- }
- }
- numArgs = allArgTypes.length;
- }
-
- // decide if we are returning a single column result.
- if (returnTypeType.equals("b") || returnTypeType.equals("d") || (returnTypeType.equals("p") && argModesArray == null))
- {
- byte[][] tuple = new byte[columns][];
- tuple[0] = null;
- tuple[1] = schema;
- tuple[2] = procedureName;
- tuple[3] = connection.encodeString("returnValue");
- tuple[4] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnReturn));
- tuple[5] = connection.encodeString(Integer.toString(connection.getTypeInfo().getSQLType(returnType)));
- tuple[6] = connection.encodeString(connection.getTypeInfo().getPGType(returnType));
- tuple[7] = null;
- tuple[8] = null;
- tuple[9] = null;
- tuple[10] = null;
- tuple[11] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureNullableUnknown));
- tuple[12] = null;
- if (jdbcVersion >= 4) {
- tuple[17] = connection.encodeString(Integer.toString(0));
- tuple[18] = isnullableUnknown;
- tuple[19] = specificName;
- }
- v.add(tuple);
- }
-
- // Add a row for each argument.
- for (int i = 0; i < numArgs; i++)
- {
- byte[][] tuple = new byte[columns][];
- tuple[0] = null;
- tuple[1] = schema;
- tuple[2] = procedureName;
-
- if (argNames != null)
- tuple[3] = connection.encodeString(argNames[i]);
- else
- tuple[3] = connection.encodeString("$" + (i + 1));
-
- int columnMode = DatabaseMetaData.procedureColumnIn;
- if (argModes != null && argModes[i].equals("o"))
- columnMode = DatabaseMetaData.procedureColumnOut;
- else if (argModes != null && argModes[i].equals("b"))
- columnMode = DatabaseMetaData.procedureColumnInOut;
-
- tuple[4] = connection.encodeString(Integer.toString(columnMode));
-
- int argOid;
- if (allArgTypes != null)
- argOid = allArgTypes[i].intValue();
- else
- argOid = ((Long)argTypes.get(i)).intValue();
-
- tuple[5] = connection.encodeString(Integer.toString(connection.getTypeInfo().getSQLType(argOid)));
- tuple[6] = connection.encodeString(connection.getTypeInfo().getPGType(argOid));
- tuple[7] = null;
- tuple[8] = null;
- tuple[9] = null;
- tuple[10] = null;
- tuple[11] = connection.encodeString(Integer.toString(DatabaseMetaData.procedureNullableUnknown));
- tuple[12] = null;
- if (jdbcVersion >= 4) {
- tuple[17] = connection.encodeString(Integer.toString(i+1));
- tuple[18] = isnullableUnknown;
- tuple[19] = specificName;
- }
- v.add(tuple);
- }
-
- // if we are returning a multi-column result.
- if (returnTypeType.equals("c") || (returnTypeType.equals("p") && argModesArray != null))
- {
- String columnsql = "SELECT a.attname,a.atttypid FROM ";
- if (connection.haveMinimumServerVersion("7.3")) {
- columnsql += "pg_catalog.";
- }
- columnsql += "pg_attribute a WHERE a.attrelid = " + returnTypeRelid + " AND a.attnum > 0 ORDER BY a.attnum ";
- ResultSet columnrs = connection.createStatement().executeQuery(columnsql);
- while (columnrs.next())
- {
- int columnTypeOid = (int)columnrs.getLong("atttypid");
- byte[][] tuple = new byte[columns][];
- tuple[0] = null;
- tuple[1] = schema;
- tuple[2] = procedureName;
- tuple[3] = columnrs.getBytes("attname");
- tuple[4] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnResult));
- tuple[5] = connection.encodeString(Integer.toString(connection.getTypeInfo().getSQLType(columnTypeOid)));
- tuple[6] = connection.encodeString(connection.getTypeInfo().getPGType(columnTypeOid));
- tuple[7] = null;
- tuple[8] = null;
- tuple[9] = null;
- tuple[10] = null;
- tuple[11] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureNullableUnknown));
- tuple[12] = null;
- if (jdbcVersion >= 4) {
- tuple[17] = connection.encodeString(Integer.toString(0));
- tuple[18] = isnullableUnknown;
- tuple[19] = specificName;
- }
- v.add(tuple);
- }
- columnrs.close();
- }
- }
- rs.close();
-
- return (ResultSet)((BaseStatement)createMetaDataStatement()).createDriverResultSet(f, v);
- }
-
- /*
- * Get a description of tables available in a catalog.
- *
- * <p>Only table descriptions matching the catalog, schema, table
- * name and type criteria are returned. They are ordered by
- * TABLE_TYPE, TABLE_SCHEM and TABLE_NAME.
- *
- * <p>Each table description has the following columns:
- *
- * <ol>
- * <li><b>TABLE_CAT</b> String => table catalog (may be null)
- * <li><b>TABLE_SCHEM</b> String => table schema (may be null)
- * <li><b>TABLE_NAME</b> String => table name
- * <li><b>TABLE_TYPE</b> String => table type. Typical types are "TABLE",
- * "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL
- * TEMPORARY", "ALIAS", "SYNONYM".
- * <li><b>REMARKS</b> String => explanatory comment on the table
- * </ol>
- *
- * <p>The valid values for the types parameter are:
- * "TABLE", "INDEX", "SEQUENCE", "VIEW", "TYPE"
- * "SYSTEM TABLE", "SYSTEM INDEX", "SYSTEM VIEW",
- * "SYSTEM TOAST TABLE", "SYSTEM TOAST INDEX",
- * "TEMPORARY TABLE", "TEMPORARY VIEW", "TEMPORARY INDEX",
- * "TEMPORARY SEQUENCE", "FOREIGN TABLE".
- *
- * @param catalog a catalog name; For org.postgresql, this is ignored, and
- * should be set to null
- * @param schemaPattern a schema name pattern
- * @param tableNamePattern a table name pattern. For all tables this should be "%"
- * @param types a list of table types to include; null returns
- * all types
- * @return each row is a table description
- * @exception SQLException if a database-access error occurs.
- */
- public java.sql.ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String types[]) throws SQLException
- {
- String select;
- String orderby;
- String useSchemas;
- if (connection.haveMinimumServerVersion("7.3"))
- {
- useSchemas = "SCHEMAS";
- select = "SELECT NULL AS TABLE_CAT, n.nspname AS TABLE_SCHEM, c.relname AS TABLE_NAME, " +
- " CASE n.nspname ~ '^pg_' OR n.nspname = 'information_schema' " +
- " WHEN true THEN CASE " +
- " WHEN n.nspname = 'pg_catalog' OR n.nspname = 'information_schema' THEN CASE c.relkind " +
- " WHEN 'r' THEN 'SYSTEM TABLE' " +
- " WHEN 'v' THEN 'SYSTEM VIEW' " +
- " WHEN 'i' THEN 'SYSTEM INDEX' " +
- " ELSE NULL " +
- " END " +
- " WHEN n.nspname = 'pg_toast' THEN CASE c.relkind " +
- " WHEN 'r' THEN 'SYSTEM TOAST TABLE' " +
- " WHEN 'i' THEN 'SYSTEM TOAST INDEX' " +
- " ELSE NULL " +
- " END " +
- " ELSE CASE c.relkind " +
- " WHEN 'r' THEN 'TEMPORARY TABLE' " +
- " WHEN 'i' THEN 'TEMPORARY INDEX' " +
- " WHEN 'S' THEN 'TEMPORARY SEQUENCE' " +
- " WHEN 'v' THEN 'TEMPORARY VIEW' " +
- " ELSE NULL " +
- " END " +
- " END " +
- " WHEN false THEN CASE c.relkind " +
- " WHEN 'r' THEN 'TABLE' " +
- " WHEN 'i' THEN 'INDEX' " +
- " WHEN 'S' THEN 'SEQUENCE' " +
- " WHEN 'v' THEN 'VIEW' " +
- " WHEN 'c' THEN 'TYPE' " +
- " WHEN 'f' THEN 'FOREIGN TABLE' " +
- " ELSE NULL " +
- " END " +
- " ELSE NULL " +
- " END " +
- " AS TABLE_TYPE, d.description AS REMARKS " +
- " FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c " +
- " LEFT JOIN pg_catalog.pg_description d ON (c.oid = d.objoid AND d.objsubid = 0) " +
- " LEFT JOIN pg_catalog.pg_class dc ON (d.classoid=dc.oid AND dc.relname='pg_class') " +
- " LEFT JOIN pg_catalog.pg_namespace dn ON (dn.oid=dc.relnamespace AND dn.nspname='pg_catalog') " +
- " WHERE c.relnamespace = n.oid ";
- if (schemaPattern != null && !"".equals(schemaPattern))
- {
- select += " AND n.nspname LIKE " + escapeQuotes(schemaPattern);
- }
- orderby = " ORDER BY TABLE_TYPE,TABLE_SCHEM,TABLE_NAME ";
- }
- else
- {
- useSchemas = "NOSCHEMAS";
- String tableType = "" +
- " CASE c.relname ~ '^pg_' " +
- " WHEN true THEN CASE c.relname ~ '^pg_toast_' " +
- " WHEN true THEN CASE c.relkind " +
- " WHEN 'r' THEN 'SYSTEM TOAST TABLE' " +
- " WHEN 'i' THEN 'SYSTEM TOAST INDEX' " +
- " ELSE NULL " +
- " END " +
- " WHEN false THEN CASE c.relname ~ '^pg_temp_' " +
- " WHEN true THEN CASE c.relkind " +
- " WHEN 'r' THEN 'TEMPORARY TABLE' " +
- " WHEN 'i' THEN 'TEMPORARY INDEX' " +
- " WHEN 'S' THEN 'TEMPORARY SEQUENCE' " +
- " WHEN 'v' THEN 'TEMPORARY VIEW' " +
- " ELSE NULL " +
- " END " +
- " WHEN false THEN CASE c.relkind " +
- " WHEN 'r' THEN 'SYSTEM TABLE' " +
- " WHEN 'v' THEN 'SYSTEM VIEW' " +
- " WHEN 'i' THEN 'SYSTEM INDEX' " +
- " ELSE NULL " +
- " END " +
- " ELSE NULL " +
- " END " +
- " ELSE NULL " +
- " END " +
- " WHEN false THEN CASE c.relkind " +
- " WHEN 'r' THEN 'TABLE' " +
- " WHEN 'i' THEN 'INDEX' " +
- " WHEN 'S' THEN 'SEQUENCE' " +
- " WHEN 'v' THEN 'VIEW' " +
- " WHEN 'c' THEN 'TYPE' " +
- " ELSE NULL " +
- " END " +
- " ELSE NULL " +
- " END ";
- orderby = " ORDER BY TABLE_TYPE,TABLE_NAME ";
- if (connection.haveMinimumServerVersion("7.2"))
- {
- select = "SELECT NULL AS TABLE_CAT, NULL AS TABLE_SCHEM, c.relname AS TABLE_NAME, " + tableType + " AS TABLE_TYPE, d.description AS REMARKS " +
- " FROM pg_class c " +
- " LEFT JOIN pg_description d ON (c.oid=d.objoid AND d.objsubid = 0) " +
- " LEFT JOIN pg_class dc ON (d.classoid = dc.oid AND dc.relname='pg_class') " +
- " WHERE true ";
- }
- else if (connection.haveMinimumServerVersion("7.1"))
- {
- select = "SELECT NULL AS TABLE_CAT, NULL AS TABLE_SCHEM, c.relname AS TABLE_NAME, " + tableType + " AS TABLE_TYPE, d.description AS REMARKS " +
- " FROM pg_class c " +
- " LEFT JOIN pg_description d ON (c.oid=d.objoid) " +
- " WHERE true ";
- }
- else
- {
- select = "SELECT NULL AS TABLE_CAT, NULL AS TABLE_SCHEM, c.relname AS TABLE_NAME, " + tableType + " AS TABLE_TYPE, NULL AS REMARKS " +
- " FROM pg_class c " +
- " WHERE true ";
- }
- }
-
- if (tableNamePattern != null && !"".equals(tableNamePattern))
- {
- select += " AND c.relname LIKE " + escapeQuotes(tableNamePattern);
- }
- if (types != null) {
- select += " AND (false ";
- for (int i = 0; i < types.length; i++)
- {
- Map clauses = (Map)tableTypeClauses.get(types[i]);
- if (clauses != null)
- {
- String clause = (String)clauses.get(useSchemas);
- select += " OR ( " + clause + " ) ";
- }
- }
- select += ") ";
- }
- String sql = select + orderby;
-
- return createMetaDataStatement().executeQuery(sql);
- }
-
- private static final Map tableTypeClauses;
- static {
- tableTypeClauses = new HashMap();
- Map ht = new HashMap();
- tableTypeClauses.put("TABLE", ht);
- ht.put("SCHEMAS", "c.relkind = 'r' AND n.nspname !~ '^pg_' AND n.nspname <> 'information_schema'");
- ht.put("NOSCHEMAS", "c.relkind = 'r' AND c.relname !~ '^pg_'");
- ht = new HashMap();
- tableTypeClauses.put("VIEW", ht);
- ht.put("SCHEMAS", "c.relkind = 'v' AND n.nspname <> 'pg_catalog' AND n.nspname <> 'information_schema'");
- ht.put("NOSCHEMAS", "c.relkind = 'v' AND c.relname !~ '^pg_'");
- ht = new HashMap();
- tableTypeClauses.put("INDEX", ht);
- ht.put("SCHEMAS", "c.relkind = 'i' AND n.nspname !~ '^pg_' AND n.nspname <> 'information_schema'");
- ht.put("NOSCHEMAS", "c.relkind = 'i' AND c.relname !~ '^pg_'");
- ht = new HashMap();
- tableTypeClauses.put("SEQUENCE", ht);
- ht.put("SCHEMAS", "c.relkind = 'S'");
- ht.put("NOSCHEMAS", "c.relkind = 'S'");
- ht = new HashMap();
- tableTypeClauses.put("TYPE", ht);
- ht.put("SCHEMAS", "c.relkind = 'c' AND n.nspname !~ '^pg_' AND n.nspname <> 'information_schema'");
- ht.put("NOSCHEMAS", "c.relkind = 'c' AND c.relname !~ '^pg_'");
- ht = new HashMap();
- tableTypeClauses.put("SYSTEM TABLE", ht);
- ht.put("SCHEMAS", "c.relkind = 'r' AND (n.nspname = 'pg_catalog' OR n.nspname = 'information_schema')");
- ht.put("NOSCHEMAS", "c.relkind = 'r' AND c.relname ~ '^pg_' AND c.relname !~ '^pg_toast_' AND c.relname !~ '^pg_temp_'");
- ht = new HashMap();
- tableTypeClauses.put("SYSTEM TOAST TABLE", ht);
- ht.put("SCHEMAS", "c.relkind = 'r' AND n.nspname = 'pg_toast'");
- ht.put("NOSCHEMAS", "c.relkind = 'r' AND c.relname ~ '^pg_toast_'");
- ht = new HashMap();
- tableTypeClauses.put("SYSTEM TOAST INDEX", ht);
- ht.put("SCHEMAS", "c.relkind = 'i' AND n.nspname = 'pg_toast'");
- ht.put("NOSCHEMAS", "c.relkind = 'i' AND c.relname ~ '^pg_toast_'");
- ht = new HashMap();
- tableTypeClauses.put("SYSTEM VIEW", ht);
- ht.put("SCHEMAS", "c.relkind = 'v' AND (n.nspname = 'pg_catalog' OR n.nspname = 'information_schema') ");
- ht.put("NOSCHEMAS", "c.relkind = 'v' AND c.relname ~ '^pg_'");
- ht = new HashMap();
- tableTypeClauses.put("SYSTEM INDEX", ht);
- ht.put("SCHEMAS", "c.relkind = 'i' AND (n.nspname = 'pg_catalog' OR n.nspname = 'information_schema') ");
- ht.put("NOSCHEMAS", "c.relkind = 'v' AND c.relname ~ '^pg_' AND c.relname !~ '^pg_toast_' AND c.relname !~ '^pg_temp_'");
- ht = new HashMap();
- tableTypeClauses.put("TEMPORARY TABLE", ht);
- ht.put("SCHEMAS", "c.relkind = 'r' AND n.nspname ~ '^pg_temp_' ");
- ht.put("NOSCHEMAS", "c.relkind = 'r' AND c.relname ~ '^pg_temp_' ");
- ht = new HashMap();
- tableTypeClauses.put("TEMPORARY INDEX", ht);
- ht.put("SCHEMAS", "c.relkind = 'i' AND n.nspname ~ '^pg_temp_' ");
- ht.put("NOSCHEMAS", "c.relkind = 'i' AND c.relname ~ '^pg_temp_' ");
- ht = new HashMap();
- tableTypeClauses.put("TEMPORARY VIEW", ht);
- ht.put("SCHEMAS", "c.relkind = 'v' AND n.nspname ~ '^pg_temp_' ");
- ht.put("NOSCHEMAS", "c.relkind = 'v' AND c.relname ~ '^pg_temp_' ");
- ht = new HashMap();
- tableTypeClauses.put("TEMPORARY SEQUENCE", ht);
- ht.put("SCHEMAS", "c.relkind = 'S' AND n.nspname ~ '^pg_temp_' ");
- ht.put("NOSCHEMAS", "c.relkind = 'S' AND c.relname ~ '^pg_temp_' ");
- ht = new HashMap();
- tableTypeClauses.put("FOREIGN TABLE", ht);
- ht.put("SCHEMAS", "c.relkind = 'f'");
- ht.put("NOSCHEMAS", "c.relkind = 'f'");
- }
-
- /*
- * Get the schema names available in this database. The results
- * are ordered by schema name.
- *
- * <P>The schema column is:
- * <OL>
- * <LI><B>TABLE_SCHEM</B> String => schema name
- * </OL>
- *
- * @return ResultSet each row has a single String column that is a
- * schema name
- */
- public java.sql.ResultSet getSchemas() throws SQLException
- {
- return getSchemas(2, null, null);
- }
-
- protected ResultSet getSchemas(int jdbcVersion, String catalog, String schemaPattern) throws SQLException {
- String sql;
- // Show only the users temp schemas, but not other peoples
- // because they can't access any objects in them.
- if (connection.haveMinimumServerVersion("7.3"))
- {
- // 7.3 can't extract elements from an array returned by
- // a function, so we've got to coerce it to text and then
- // hack it up with a regex.
- String tempSchema = "substring(textin(array_out(pg_catalog.current_schemas(true))) from '{(pg_temp_[0-9]+),')";
- if (connection.haveMinimumServerVersion("7.4")) {
- tempSchema = "(pg_catalog.current_schemas(true))[1]";
- }
- sql = "SELECT nspname AS TABLE_SCHEM ";
- if (jdbcVersion >= 3)
- sql += ", NULL AS TABLE_CATALOG ";
- sql += " FROM pg_catalog.pg_namespace WHERE nspname <> 'pg_toast' AND (nspname !~ '^pg_temp_' OR nspname = " + tempSchema + ") AND (nspname !~ '^pg_toast_temp_' OR nspname = replace(" + tempSchema + ", 'pg_temp_', 'pg_toast_temp_')) ";
- if (schemaPattern != null && !"".equals(schemaPattern))
- {
- sql += " AND nspname LIKE " + escapeQuotes(schemaPattern);
- }
- sql += " ORDER BY TABLE_SCHEM";
- }
- else
- {
- sql = "SELECT ''::text AS TABLE_SCHEM ";
- if (jdbcVersion >= 3) {
- sql += ", NULL AS TABLE_CATALOG ";
- }
- if (schemaPattern != null)
- {
- sql += " WHERE ''::text LIKE " + escapeQuotes(schemaPattern);
- }
- }
- return createMetaDataStatement().executeQuery(sql);
- }
-
- /*
- * Get the catalog names available in this database. The results
- * are ordered by catalog name.
- *
- * Postgresql does not support multiple catalogs from a single
- * connection, so to reduce confusion we only return the current
- * catalog.
- *
- * <P>The catalog column is:
- * <OL>
- * <LI><B>TABLE_CAT</B> String => catalog name
- * </OL>
- *
- * @return ResultSet each row has a single String column that is a
- * catalog name
- */
- public java.sql.ResultSet getCatalogs() throws SQLException
- {
- Field f[] = new Field[1];
- List v = new ArrayList();
- f[0] = new Field("TABLE_CAT", Oid.VARCHAR);
- byte[][] tuple = new byte[1][];
- tuple[0] = connection.encodeString(connection.getCatalog());
- v.add(tuple);
-
- return (ResultSet) ((BaseStatement)createMetaDataStatement()).createDriverResultSet(f, v);
- }
-
- /*
- * Get the table types available in this database. The results
- * are ordered by table type.
- *
- * <P>The table type is:
- * <OL>
- * <LI><B>TABLE_TYPE</B> String => table type. Typical types are "TABLE",
- * "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY",
- * "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
- * </OL>
- *
- * @return ResultSet each row has a single String column that is a
- * table type
- */
- public java.sql.ResultSet getTableTypes() throws SQLException
- {
- String types[] = new String[tableTypeClauses.size()];
- Iterator e = tableTypeClauses.keySet().iterator();
- int i = 0;
- while (e.hasNext())
- {
- types[i++] = (String)e.next();
- }
- sortStringArray(types);
-
- Field f[] = new Field[1];
- List v = new ArrayList();
- f[0] = new Field("TABLE_TYPE", Oid.VARCHAR);
- for (i = 0; i < types.length; i++)
- {
- byte[][] tuple = new byte[1][];
- tuple[0] = connection.encodeString(types[i]);
- v.add(tuple);
- }
-
- return (ResultSet) ((BaseStatement)createMetaDataStatement()).createDriverResultSet(f, v);
- }
-
- protected java.sql.ResultSet getColumns(int jdbcVersion, String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException
- {
- int numberOfFields;
- if (jdbcVersion >= 4) {
- numberOfFields = 23;
- } else if (jdbcVersion >= 3) {
- numberOfFields = 22;
- } else {
- numberOfFields = 18;
- }
- List v = new ArrayList(); // The new ResultSet tuple stuff
- Field f[] = new Field[numberOfFields]; // The field descriptors for the new ResultSet
-
- f[0] = new Field("TABLE_CAT", Oid.VARCHAR);
- f[1] = new Field("TABLE_SCHEM", Oid.VARCHAR);
- f[2] = new Field("TABLE_NAME", Oid.VARCHAR);
- f[3] = new Field("COLUMN_NAME", Oid.VARCHAR);
- f[4] = new Field("DATA_TYPE", Oid.INT2);
- f[5] = new Field("TYPE_NAME", Oid.VARCHAR);
- f[6] = new Field("COLUMN_SIZE", Oid.INT4);
- f[7] = new Field("BUFFER_LENGTH", Oid.VARCHAR);
- f[8] = new Field("DECIMAL_DIGITS", Oid.INT4);
- f[9] = new Field("NUM_PREC_RADIX", Oid.INT4);
- f[10] = new Field("NULLABLE", Oid.INT4);
- f[11] = new Field("REMARKS", Oid.VARCHAR);
- f[12] = new Field("COLUMN_DEF", Oid.VARCHAR);
- f[13] = new Field("SQL_DATA_TYPE", Oid.INT4);
- f[14] = new Field("SQL_DATETIME_SUB", Oid.INT4);
- f[15] = new Field("CHAR_OCTET_LENGTH", Oid.VARCHAR);
- f[16] = new Field("ORDINAL_POSITION", Oid.INT4);
- f[17] = new Field("IS_NULLABLE", Oid.VARCHAR);
-
- if (jdbcVersion >= 3) {
- f[18] = new Field("SCOPE_CATLOG", Oid.VARCHAR);
- f[19] = new Field("SCOPE_SCHEMA", Oid.VARCHAR);
- f[20] = new Field("SCOPE_TABLE", Oid.VARCHAR);
- f[21] = new Field("SOURCE_DATA_TYPE", Oid.INT2);
- }
-
- if (jdbcVersion >= 4) {
- f[22] = new Field("IS_AUTOINCREMENT", Oid.VARCHAR);
- }
-
- String sql;
- if (connection.haveMinimumServerVersion("7.3"))
- {
- // a.attnum isn't decremented when preceding columns are dropped,
- // so the only way to calculate the correct column number is with
- // window functions, new in 8.4.
- //
- // We want to push as much predicate information below the window
- // function as possible (schema/table names), but must leave
- // column name outside so we correctly count the other columns.
- //
- if (connection.haveMinimumServerVersion("8.4"))
- sql = "SELECT * FROM (";
- else
- sql = "";
-
- sql += "SELECT n.nspname,c.relname,a.attname,a.atttypid,a.attnotnull OR (t.typtype = 'd' AND t.typnotnull) AS attnotnull,a.atttypmod,a.attlen,";
-
- if (connection.haveMinimumServerVersion("8.4"))
- sql += "row_number() OVER (PARTITION BY a.attrelid ORDER BY a.attnum) AS attnum, ";
- else
- sql += "a.attnum,";
-
- sql += "pg_catalog.pg_get_expr(def.adbin, def.adrelid) AS adsrc,dsc.description,t.typbasetype,t.typtype " +
- " FROM pg_catalog.pg_namespace n " +
- " JOIN pg_catalog.pg_class c ON (c.relnamespace = n.oid) " +
- " JOIN pg_catalog.pg_attribute a ON (a.attrelid=c.oid) " +
- " JOIN pg_catalog.pg_type t ON (a.atttypid = t.oid) " +
- " LEFT JOIN pg_catalog.pg_attrdef def ON (a.attrelid=def.adrelid AND a.attnum = def.adnum) " +
- " LEFT JOIN pg_catalog.pg_description dsc ON (c.oid=dsc.objoid AND a.attnum = dsc.objsubid) " +
- " LEFT JOIN pg_catalog.pg_class dc ON (dc.oid=dsc.classoid AND dc.relname='pg_class') " +
- " LEFT JOIN pg_catalog.pg_namespace dn ON (dc.relnamespace=dn.oid AND dn.nspname='pg_catalog') " +
- " WHERE a.attnum > 0 AND NOT a.attisdropped ";
-
- if (schemaPattern != null && !"".equals(schemaPattern))
- {
- sql += " AND n.nspname LIKE " + escapeQuotes(schemaPattern);
- }
-
- if (tableNamePattern != null && !"".equals(tableNamePattern))
- {
- sql += " AND c.relname LIKE " + escapeQuotes(tableNamePattern);
- }
-
- if (connection.haveMinimumServerVersion("8.4"))
- sql += ") c WHERE true ";
-
- }
- else if (connection.haveMinimumServerVersion("7.2"))
- {
- sql = "SELECT NULL::text AS nspname,c.relname,a.attname,a.atttypid,a.attnotnull,a.atttypmod,a.attlen,a.attnum,pg_get_expr(def.adbin,def.adrelid) AS adsrc,dsc.description,NULL::oid AS typbasetype,t.typtype " +
- " FROM pg_class c " +
- " JOIN pg_attribute a ON (a.attrelid=c.oid) " +
- " JOIN pg_type t ON (a.atttypid = t.oid) " +
- " LEFT JOIN pg_attrdef def ON (a.attrelid=def.adrelid AND a.attnum = def.adnum) " +
- " LEFT JOIN pg_description dsc ON (c.oid=dsc.objoid AND a.attnum = dsc.objsubid) " +
- " LEFT JOIN pg_class dc ON (dc.oid=dsc.classoid AND dc.relname='pg_class') " +
- " WHERE a.attnum > 0 ";
- }
- else if (connection.haveMinimumServerVersion("7.1"))
- {
- sql = "SELECT NULL::text AS nspname,c.relname,a.attname,a.atttypid,a.attnotnull,a.atttypmod,a.attlen,a.attnum,def.adsrc,dsc.description,NULL::oid AS typbasetype, 'b' AS typtype " +
- " FROM pg_class c " +
- " JOIN pg_attribute a ON (a.attrelid=c.oid) " +
- " LEFT JOIN pg_attrdef def ON (a.attrelid=def.adrelid AND a.attnum = def.adnum) " +
- " LEFT JOIN pg_description dsc ON (a.oid=dsc.objoid) " +
- " WHERE a.attnum > 0 ";
- }
- else
- {
- // if < 7.1 then don't get defaults or descriptions.
- sql = "SELECT NULL::text AS nspname,c.relname,a.attname,a.atttypid,a.attnotnull,a.atttypmod,a.attlen,a.attnum,NULL AS adsrc,NULL AS description,NULL AS typbasetype, 'b' AS typtype " +
- " FROM pg_class c, pg_attribute a " +
- " WHERE a.attrelid=c.oid AND a.attnum > 0 ";
- }
-
- if (!connection.haveMinimumServerVersion("7.3") && tableNamePattern != null && !"".equals(tableNamePattern))
- {
- sql += " AND c.relname LIKE " + escapeQuotes(tableNamePattern);
- }
- if (columnNamePattern != null && !"".equals(columnNamePattern))
- {
- sql += " AND attname LIKE " + escapeQuotes(columnNamePattern);
- }
- sql += " ORDER BY nspname,c.relname,attnum ";
-
- ResultSet rs = connection.createStatement().executeQuery(sql);
- while (rs.next())
- {
- byte[][] tuple = new byte[numberOfFields][];
- int typeOid = (int)rs.getLong("atttypid");
- int typeMod = rs.getInt("atttypmod");
-
- tuple[0] = null; // Catalog name, not supported
- tuple[1] = rs.getBytes("nspname"); // Schema
- tuple[2] = rs.getBytes("relname"); // Table name
- tuple[3] = rs.getBytes("attname"); // Column name
-
- String typtype = rs.getString("typtype");
- int sqlType;
- if ("c".equals(typtype)) {
- sqlType = Types.STRUCT;
- } else if ("d".equals(typtype)) {
- sqlType = Types.DISTINCT;
- } else {
- sqlType = connection.getTypeInfo().getSQLType(typeOid);
- }
-
- tuple[4] = connection.encodeString(Integer.toString(sqlType));
- String pgType = connection.getTypeInfo().getPGType(typeOid);
- tuple[5] = connection.encodeString(pgType); // Type name
- tuple[7] = null; // Buffer length
-
-
- String defval = rs.getString("adsrc");
-
- if ( defval != null )
- {
- if ( pgType.equals("int4") )
- {
- if (defval.indexOf("nextval(") != -1)
- tuple[5] = connection.encodeString("serial"); // Type name == serial
- }
- else if ( pgType.equals("int8") )
- {
- if (defval.indexOf("nextval(") != -1)
- tuple[5] = connection.encodeString("bigserial"); // Type name == bigserial
- }
- }
-
- int decimalDigits = connection.getTypeInfo().getScale(typeOid, typeMod);
- int columnSize = connection.getTypeInfo().getPrecision(typeOid, typeMod);
- if (columnSize == 0) {
- columnSize = connection.getTypeInfo().getDisplaySize(typeOid, typeMod);
- }
-
- tuple[6] = connection.encodeString(Integer.toString(columnSize));
- tuple[8] = connection.encodeString(Integer.toString(decimalDigits));
-
- // Everything is base 10 unless we override later.
- tuple[9] = connection.encodeString("10");
-
- if (pgType.equals("bit") || pgType.equals("varbit"))
- {
- tuple[9] = connection.encodeString("2");
- }
-
- tuple[10] = connection.encodeString(Integer.toString(rs.getBoolean("attnotnull") ? java.sql.DatabaseMetaData.columnNoNulls : java.sql.DatabaseMetaData.columnNullable)); // Nullable
- tuple[11] = rs.getBytes("description"); // Description (if any)
- tuple[12] = rs.getBytes("adsrc"); // Column default
- tuple[13] = null; // sql data type (unused)
- tuple[14] = null; // sql datetime sub (unused)
- tuple[15] = tuple[6]; // char octet length
- tuple[16] = connection.encodeString(String.valueOf(rs.getInt("attnum"))); // ordinal position
- tuple[17] = connection.encodeString(rs.getBoolean("attnotnull") ? "NO" : "YES"); // Is nullable
-
- if (jdbcVersion >= 3) {
- int baseTypeOid = (int) rs.getLong("typbasetype");
-
- tuple[18] = null; // SCOPE_CATLOG
- tuple[19] = null; // SCOPE_SCHEMA
- tuple[20] = null; // SCOPE_TABLE
- tuple[21] = baseTypeOid == 0 ? null : connection.encodeString(Integer.toString(connection.getTypeInfo().getSQLType(baseTypeOid))); // SOURCE_DATA_TYPE
- }
-
- if (jdbcVersion >= 4) {
- String autoinc = "NO";
- if (defval != null && defval.indexOf("nextval(") != -1) {
- autoinc = "YES";
- }
- tuple[22] = connection.encodeString(autoinc);
- }
-
- v.add(tuple);
- }
- rs.close();
-
- return (ResultSet) ((BaseStatement)createMetaDataStatement()).createDriverResultSet(f, v);
- }
-
- /*
- * Get a description of table columns available in a catalog.
- *
- * <P>Only column descriptions matching the catalog, schema, table
- * and column name criteria are returned. They are ordered by
- * TABLE_SCHEM, TABLE_NAME and ORDINAL_POSITION.
- *
- * <P>Each column description has the following columns:
- * <OL>
- * <LI><B>TABLE_CAT</B> String => table catalog (may be null)
- * <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
- * <LI><B>TABLE_NAME</B> String => table name
- * <LI><B>COLUMN_NAME</B> String => column name
- * <LI><B>DATA_TYPE</B> short => SQL type from java.sql.Types
- * <LI><B>TYPE_NAME</B> String => Data source dependent type name
- * <LI><B>COLUMN_SIZE</B> int => column size. For char or date
- * types this is the maximum number of characters, for numeric or
- * decimal types this is precision.
- * <LI><B>BUFFER_LENGTH</B> is not used.
- * <LI><B>DECIMAL_DIGITS</B> int => the number of fractional digits
- * <LI><B>NUM_PREC_RADIX</B> int => Radix (typically either 10 or 2)
- * <LI><B>NULLABLE</B> int => is NULL allowed?
- * <UL>
- * <LI> columnNoNulls - might not allow NULL values
- * <LI> columnNullable - definitely allows NULL values
- * <LI> columnNullableUnknown - nullability unknown
- * </UL>
- * <LI><B>REMARKS</B> String => comment describing column (may be null)
- * <LI><B>COLUMN_DEF</B> String => default value (may be null)
- * <LI><B>SQL_DATA_TYPE</B> int => unused
- * <LI><B>SQL_DATETIME_SUB</B> int => unused
- * <LI><B>CHAR_OCTET_LENGTH</B> int => for char types the
- * maximum number of bytes in the column
- * <LI><B>ORDINAL_POSITION</B> int => index of column in table
- * (starting at 1)
- * <LI><B>IS_NULLABLE</B> String => "NO" means column definitely
- * does not allow NULL values; "YES" means the column might
- * allow NULL values. An empty string means nobody knows.
- * </OL>
- *
- * @param catalog a catalog name; "" retrieves those without a catalog
- * @param schemaPattern a schema name pattern; "" retrieves those
- * without a schema
- * @param tableNamePattern a table name pattern
- * @param columnNamePattern a column name pattern
- * @return ResultSet each row is a column description
- * @see #getSearchStringEscape
- */
- public java.sql.ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException
- {
- return getColumns(2, catalog, schemaPattern, tableNamePattern, columnNamePattern);
- }
-
- /*
- * Get a description of the access rights for a table's columns.
- *
- * <P>Only privileges matching the column name criteria are
- * returned. They are ordered by COLUMN_NAME and PRIVILEGE.
- *
- * <P>Each privilige description has the following columns:
- * <OL>
- * <LI><B>TABLE_CAT</B> String => table catalog (may be null)
- * <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
- * <LI><B>TABLE_NAME</B> String => table name
- * <LI><B>COLUMN_NAME</B> String => column name
- * <LI><B>GRANTOR</B> => grantor of access (may be null)
- * <LI><B>GRANTEE</B> String => grantee of access
- * <LI><B>PRIVILEGE</B> String => name of access (SELECT,
- * INSERT, UPDATE, REFRENCES, ...)
- * <LI><B>IS_GRANTABLE</B> String => "YES" if grantee is permitted
- * to grant to others; "NO" if not; null if unknown
- * </OL>
- *
- * @param catalog a catalog name; "" retrieves those without a catalog
- * @param schema a schema name; "" retrieves those without a schema
- * @param table a table name
- * @param columnNamePattern a column name pattern
- * @return ResultSet each row is a column privilege description
- * @see #getSearchStringEscape
- */
- public java.sql.ResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern) throws SQLException
- {
- Field f[] = new Field[8];
- List v = new ArrayList();
-
- if (table == null)
- table = "%";
-
- if (columnNamePattern == null)
- columnNamePattern = "%";
-
- f[0] = new Field("TABLE_CAT", Oid.VARCHAR);
- f[1] = new Field("TABLE_SCHEM", Oid.VARCHAR);
- f[2] = new Field("TABLE_NAME", Oid.VARCHAR);
- f[3] = new Field("COLUMN_NAME", Oid.VARCHAR);
- f[4] = new Field("GRANTOR", Oid.VARCHAR);
- f[5] = new Field("GRANTEE", Oid.VARCHAR);
- f[6] = new Field("PRIVILEGE", Oid.VARCHAR);
- f[7] = new Field("IS_GRANTABLE", Oid.VARCHAR);
-
- String sql;
- if (connection.haveMinimumServerVersion("8.4"))
- {
- sql = "SELECT n.nspname,c.relname,r.rolname,c.relacl,a.attacl,a.attname " +
- " FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c, pg_catalog.pg_roles r, pg_catalog.pg_attribute a " +
- " WHERE c.relnamespace = n.oid " +
- " AND c.relowner = r.oid " +
- " AND c.oid = a.attrelid " +
- " AND c.relkind = 'r' " +
- " AND a.attnum > 0 AND NOT a.attisdropped ";
- if (schema != null && !"".equals(schema))
- {
- sql += " AND n.nspname = " + escapeQuotes(schema);
- }
- }
- else if (connection.haveMinimumServerVersion("7.3"))
- {
- sql = "SELECT n.nspname,c.relname,r.rolname,c.relacl,a.attname " +
- " FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c, pg_catalog.pg_roles r, pg_catalog.pg_attribute a " +
- " WHERE c.relnamespace = n.oid " +
- " AND c.relowner = r.oid " +
- " AND c.oid = a.attrelid " +
- " AND c.relkind = 'r' " +
- " AND a.attnum > 0 AND NOT a.attisdropped ";
- if (schema != null && !"".equals(schema))
- {
- sql += " AND n.nspname = " + escapeQuotes(schema);
- }
- }
- else
- {
- sql = "SELECT NULL::text AS nspname,c.relname,u.usename,c.relacl,a.attname " +
- "FROM pg_class c, pg_user u,pg_attribute a " +
- " WHERE u.usesysid = c.relowner " +
- " AND c.oid = a.attrelid " +
- " AND a.attnum > 0 " +
- " AND c.relkind = 'r' ";
- }
-
- sql += " AND c.relname = " + escapeQuotes(table);
- if (columnNamePattern != null && !"".equals(columnNamePattern))
- {
- sql += " AND a.attname LIKE " + escapeQuotes(columnNamePattern);
- }
- sql += " ORDER BY attname ";
-
- ResultSet rs = connection.createStatement().executeQuery(sql);
- while (rs.next())
- {
- byte schemaName[] = rs.getBytes("nspname");
- byte tableName[] = rs.getBytes("relname");
- byte column[] = rs.getBytes("attname");
- String owner = rs.getString("rolname");
- String relAcl = rs.getString("relacl");
-
- Map permissions = parseACL(relAcl, owner);
-
- if (connection.haveMinimumServerVersion("8.4"))
- {
- String acl = rs.getString("attacl");
- Map relPermissions = parseACL(acl, owner);
- permissions.putAll(relPermissions);
- }
- String permNames[] = new String[permissions.size()];
- Iterator e = permissions.keySet().iterator();
- int i = 0;
- while (e.hasNext())
- {
- permNames[i++] = (String)e.next();
- }
- sortStringArray(permNames);
- for (i = 0; i < permNames.length; i++)
- {
- byte[] privilege = connection.encodeString(permNames[i]);
- Map grantees = (Map)permissions.get(permNames[i]);
- String granteeUsers[] = new String[grantees.size()];
- Iterator g = grantees.keySet().iterator();
- int k = 0;
- while (g.hasNext()){
- granteeUsers[k++] = (String)g.next();
- }
- for (int j = 0; j < grantees.size(); j++)
- {
- List grantor = (List)grantees.get(granteeUsers[j]);
- String grantee = (String)granteeUsers[j];
- for (int l = 0; l < grantor.size(); l++) {
- String[] grants = (String[])grantor.get(l);
- String grantable = owner.equals(grantee) ? "YES" : grants[1];
- byte[][] tuple = new byte[8][];
- tuple[0] = null;
- tuple[1] = schemaName;
- tuple[2] = tableName;
- tuple[3] = column;
- tuple[4] = connection.encodeString(grants[0]);
- tuple[5] = connection.encodeString(grantee);
- tuple[6] = privilege;
- tuple[7] = connection.encodeString(grantable);
- v.add(tuple);
- }
- }
- }
- }
- rs.close();
-
- return (ResultSet) ((BaseStatement)createMetaDataStatement()).createDriverResultSet(f, v);
- }
-
- /*
- * Get a description of the access rights for each table available
- * in a catalog.
- *
- * This method is currently unimplemented.
- *
- * <P>Only privileges matching the schema and table name
- * criteria are returned. They are ordered by TABLE_SCHEM,
- * TABLE_NAME, and PRIVILEGE.
- *
- * <P>Each privilege description has the following columns:
- * <OL>
- * <LI><B>TABLE_CAT</B> String => table catalog (may be null)
- * <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
- * <LI><B>TABLE_NAME</B> String => table name
- * <LI><B>GRANTOR</B> => grantor of access (may be null)
- * <LI><B>GRANTEE</B> String => grantee of access
- * <LI><B>PRIVILEGE</B> String => name of access (SELECT,
- * INSERT, UPDATE, REFRENCES, ...)
- * <LI><B>IS_GRANTABLE</B> String => "YES" if grantee is permitted
- * to grant to others; "NO" if not; null if unknown
- * </OL>
- *
- * @param catalog a catalog name; "" retrieves those without a catalog
- * @param schemaPattern a schema name pattern; "" retrieves those
- * without a schema
- * @param tableNamePattern a table name pattern
- * @return ResultSet each row is a table privilege description
- * @see #getSearchStringEscape
- */
- public java.sql.ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) throws SQLException
- {
- Field f[] = new Field[7];
- List v = new ArrayList();
-
- f[0] = new Field("TABLE_CAT", Oid.VARCHAR);
- f[1] = new Field("TABLE_SCHEM", Oid.VARCHAR);
- f[2] = new Field("TABLE_NAME", Oid.VARCHAR);
- f[3] = new Field("GRANTOR", Oid.VARCHAR);
- f[4] = new Field("GRANTEE", Oid.VARCHAR);
- f[5] = new Field("PRIVILEGE", Oid.VARCHAR);
- f[6] = new Field("IS_GRANTABLE", Oid.VARCHAR);
-
- String sql;
- if (connection.haveMinimumServerVersion("7.3"))
- {
- sql = "SELECT n.nspname,c.relname,r.rolname,c.relacl " +
- " FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c, pg_catalog.pg_roles r " +
- " WHERE c.relnamespace = n.oid " +
- " AND c.relowner = r.oid " +
- " AND c.relkind = 'r' ";
- if (schemaPattern != null && !"".equals(schemaPattern))
- {
- sql += " AND n.nspname LIKE " + escapeQuotes(schemaPattern);
- }
- }
- else
- {
- sql = "SELECT NULL::text AS nspname,c.relname,u.usename,c.relacl " +
- "FROM pg_class c, pg_user u " +
- " WHERE u.usesysid = c.relowner " +
- " AND c.relkind = 'r' ";
- }
-
- if (tableNamePattern != null && !"".equals(tableNamePattern))
- {
- sql += " AND c.relname LIKE " + escapeQuotes(tableNamePattern);
- }
- sql += " ORDER BY nspname, relname ";
-
- ResultSet rs = connection.createStatement().executeQuery(sql);
- while (rs.next())
- {
- byte schema[] = rs.getBytes("nspname");
- byte table[] = rs.getBytes("relname");
- String owner = rs.getString("rolname");
- String acl = rs.getString("relacl");
- Map permissions = parseACL(acl, owner);
- String permNames[] = new String[permissions.size()];
- Iterator e = permissions.keySet().iterator();
- int i = 0;
- while (e.hasNext())
- {
- permNames[i++] = (String)e.next();
- }
- sortStringArray(permNames);
- for (i = 0; i < permNames.length; i++)
- {
- byte[] privilege = connection.encodeString(permNames[i]);
- Map grantees = (Map)permissions.get(permNames[i]);
- String granteeUsers[] = new String[grantees.size()];
- Iterator g = grantees.keySet().iterator();
- int k = 0;
- while (g.hasNext()){
- granteeUsers[k++] = (String)g.next();
- }
- for (int j = 0; j < granteeUsers.length; j++)
- {
- List grants = (List)grantees.get(granteeUsers[j]);
- String grantee = (String)granteeUsers[j];
- for (int l = 0; l < grants.size(); l++) {
- String[] grantTuple = (String[])grants.get(l);
- // report the owner as grantor if it's missing
- String grantor = grantTuple[0].equals(null) ? owner : grantTuple[0];
- // owner always has grant privileges
- String grantable = owner.equals(grantee) ? "YES" : grantTuple[1];
- byte[][] tuple = new byte[7][];
- tuple[0] = null;
- tuple[1] = schema;
- tuple[2] = table;
- tuple[3] = connection.encodeString(grantor);
- tuple[4] = connection.encodeString(grantee);
- tuple[5] = privilege;
- tuple[6] = connection.encodeString(grantable);
- v.add(tuple);
-
- }
- }
- }
- }
- rs.close();
-
- return (ResultSet) ((BaseStatement)createMetaDataStatement()).createDriverResultSet(f, v);
- }
-
- private static void sortStringArray(String s[]) {
- for (int i = 0; i < s.length - 1; i++)
- {
- for (int j = i + 1; j < s.length; j++)
- {
- if (s[i].compareTo(s[j]) > 0)
- {
- String tmp = s[i];
- s[i] = s[j];
- s[j] = tmp;
- }
- }
- }
- }
-
- /**
- * Parse an String of ACLs into a List of ACLs.
- */
- private static List parseACLArray(String aclString) {
- List acls = new ArrayList();
- if (aclString == null || aclString.length() == 0)
- {
- return acls;
- }
- boolean inQuotes = false;
- // start at 1 because of leading "{"
- int beginIndex = 1;
- char prevChar = ' ';
- for (int i = beginIndex; i < aclString.length(); i++)
- {
-
- char c = aclString.charAt(i);
- if (c == '"' && prevChar != '\\')
- {
- inQuotes = !inQuotes;
- }
- else if (c == ',' && !inQuotes)
- {
- acls.add(aclString.substring(beginIndex, i));
- beginIndex = i + 1;
- }
- prevChar = c;
- }
- // add last element removing the trailing "}"
- acls.add(aclString.substring(beginIndex, aclString.length() - 1));
-
- // Strip out enclosing quotes, if any.
- for (int i = 0; i < acls.size(); i++)
- {
- String acl = (String)acls.get(i);
- if (acl.startsWith("\"") && acl.endsWith("\""))
- {
- acl = acl.substring(1, acl.length() - 1);
- acls.set(i, acl);
- }
- }
- return acls;
- }
-
- /**
- * Add the user described by the given acl to the Lists of users
- * with the privileges described by the acl.
- */
- private void addACLPrivileges(String acl, Map privileges) {
- int equalIndex = acl.lastIndexOf("=");
- int slashIndex = acl.lastIndexOf("/");
- if (equalIndex == -1)
- return;
-
- String user = acl.substring(0, equalIndex);
- String grantor = null;
- if (user.length() == 0)
- {
- user = "PUBLIC";
- }
- String privs;
- if (slashIndex != -1) {
- privs = acl.substring(equalIndex + 1, slashIndex);
- grantor = acl.substring(slashIndex + 1, acl.length());
- } else {
- privs = acl.substring(equalIndex + 1, acl.length());
- }
-
- for (int i = 0; i < privs.length(); i++)
- {
- char c = privs.charAt(i);
- if (c != '*') {
- String sqlpriv;
- String grantable;
- if ( i < privs.length()-1 && privs.charAt(i + 1) == '*') {
- grantable = "YES";
- } else {
- grantable = "NO";
- }
- switch (c)
- {
- case 'a':
- sqlpriv = "INSERT";
- break;
- case 'r':
- sqlpriv = "SELECT";
- break;
- case 'w':
- sqlpriv = "UPDATE";
- break;
- case 'd':
- sqlpriv = "DELETE";
- break;
- case 'D':
- sqlpriv = "TRUNCATE";
- break;
- case 'R':
- sqlpriv = "RULE";
- break;
- case 'x':
- sqlpriv = "REFERENCES";
- break;
- case 't':
- sqlpriv = "TRIGGER";
- break;
- // the following can't be granted to a table, but
- // we'll keep them for completeness.
- case 'X':
- sqlpriv = "EXECUTE";
- break;
- case 'U':
- sqlpriv = "USAGE";
- break;
- case 'C':
- sqlpriv = "CREATE";
- break;
- case 'T':
- sqlpriv = "CREATE TEMP";
- break;
- default:
- sqlpriv = "UNKNOWN";
- }
-
- Map usersWithPermission = (Map)privileges.get(sqlpriv);
- String[] grant = {grantor, grantable};
-
- if (usersWithPermission == null) {
- usersWithPermission = new HashMap();
- List permissionByGrantor = new ArrayList();
- permissionByGrantor.add(grant);
- usersWithPermission.put(user, permissionByGrantor);
- privileges.put(sqlpriv, usersWithPermission);
- } else {
- List permissionByGrantor = (List)usersWithPermission.get(user);
- if (permissionByGrantor == null) {
- permissionByGrantor = new ArrayList();
- permissionByGrantor.add(grant);
- usersWithPermission.put(user,permissionByGrantor);
- } else {
- permissionByGrantor.add(grant);
- }
- }
- }
- }
- }
-
- /**
- * Take the a String representing an array of ACLs and return
- * a Map mapping the SQL permission name to a List of
- * usernames who have that permission.
- */
- public Map parseACL(String aclArray, String owner) {
- if (aclArray == null)
- {
- //null acl is a shortcut for owner having full privs
- String perms = "arwdRxt";
- if (connection.haveMinimumServerVersion("8.2")) {
- // 8.2 Removed the separate RULE permission
- perms = "arwdxt";
- } else if (connection.haveMinimumServerVersion("8.4")) {
- // 8.4 Added a separate TRUNCATE permission
- perms = "arwdDxt";
- }
- aclArray = "{" + owner + "=" + perms + "/" + owner + "}";
- }
-
- List acls = parseACLArray(aclArray);
- Map privileges = new HashMap();
- for (int i = 0; i < acls.size(); i++)
- {
- String acl = (String)acls.get(i);
- addACLPrivileges(acl, privileges);
- }
- return privileges;
- }
-
- /*
- * Get a description of a table's optimal set of columns that
- * uniquely identifies a row. They are ordered by SCOPE.
- *
- * <P>Each column description has the following columns:
- * <OL>
- * <LI><B>SCOPE</B> short => actual scope of result
- * <UL>
- * <LI> bestRowTemporary - very temporary, while using row
- * <LI> bestRowTransaction - valid for remainder of current transaction
- * <LI> bestRowSession - valid for remainder of current session
- * </UL>
- * <LI><B>COLUMN_NAME</B> String => column name
- * <LI><B>DATA_TYPE</B> short => SQL data type from java.sql.Types
- * <LI><B>TYPE_NAME</B> String => Data source dependent type name
- * <LI><B>COLUMN_SIZE</B> int => precision
- * <LI><B>BUFFER_LENGTH</B> int => not used
- * <LI><B>DECIMAL_DIGITS</B> short => scale
- * <LI><B>PSEUDO_COLUMN</B> short => is this a pseudo column
- * like an Oracle ROWID
- * <UL>
- * <LI> bestRowUnknown - may or may not be pseudo column
- * <LI> bestRowNotPseudo - is NOT a pseudo column
- * <LI> bestRowPseudo - is a pseudo column
- * </UL>
- * </OL>
- *
- * @param catalog a catalog name; "" retrieves those without a catalog
- * @param schema a schema name; "" retrieves those without a schema
- * @param table a table name
- * @param scope the scope of interest; use same values as SCOPE
- * @param nullable include columns that are nullable?
- * @return ResultSet each row is a column description
- */
- // Implementation note: This is required for Borland's JBuilder to work
- public java.sql.ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) throws SQLException
- {
- Field f[] = new Field[8];
- List v = new ArrayList(); // The new ResultSet tuple stuff
-
- f[0] = new Field("SCOPE", Oid.INT2);
- f[1] = new Field("COLUMN_NAME", Oid.VARCHAR);
- f[2] = new Field("DATA_TYPE", Oid.INT2);
- f[3] = new Field("TYPE_NAME", Oid.VARCHAR);
- f[4] = new Field("COLUMN_SIZE", Oid.INT4);
- f[5] = new Field("BUFFER_LENGTH", Oid.INT4);
- f[6] = new Field("DECIMAL_DIGITS", Oid.INT2);
- f[7] = new Field("PSEUDO_COLUMN", Oid.INT2);
-
- /* At the moment this simply returns a table's primary key,
- * if there is one. I believe other unique indexes, ctid,
- * and oid should also be considered. -KJ
- */
-
- String sql;
- if (connection.haveMinimumServerVersion("8.1"))
- {
- sql = "SELECT a.attname, a.atttypid, atttypmod "
- + "FROM pg_catalog.pg_class ct "
- + " JOIN pg_catalog.pg_attribute a ON (ct.oid = a.attrelid) "
- + " JOIN pg_catalog.pg_namespace n ON (ct.relnamespace = n.oid) "
- + " JOIN (SELECT i.indexrelid, i.indrelid, i.indisprimary, "
- + " information_schema._pg_expandarray(i.indkey) AS keys "
- + " FROM pg_catalog.pg_index i) i "
- + " ON (a.attnum = (i.keys).x AND a.attrelid = i.indrelid) "
- + "WHERE true ";
- if (schema != null && !"".equals(schema))
- {
- sql += " AND n.nspname = " + escapeQuotes(schema);
- }
- }
- else
- {
- String from;
- String where = "";
- if (connection.haveMinimumServerVersion("7.3"))
- {
- from = " FROM pg_catalog.pg_namespace n, pg_catalog.pg_class ct, pg_catalog.pg_class ci, pg_catalog.pg_attribute a, pg_catalog.pg_index i ";
- where = " AND ct.relnamespace = n.oid ";
- if (schema != null && !"".equals(schema))
- {
- where += " AND n.nspname = " + escapeQuotes(schema);
- }
- }
- else
- {
- from = " FROM pg_class ct, pg_class ci, pg_attribute a, pg_index i ";
- }
- sql = "SELECT a.attname, a.atttypid, a.atttypmod " +
- from +
- " WHERE ct.oid=i.indrelid AND ci.oid=i.indexrelid " +
- " AND a.attrelid=ci.oid " +
- where;
- }
-
- sql += " AND ct.relname = " + escapeQuotes(table) +
- " AND i.indisprimary " +
- " ORDER BY a.attnum ";
-
- ResultSet rs = connection.createStatement().executeQuery(sql);
- while (rs.next())
- {
- byte tuple[][] = new byte[8][];
- int typeOid = (int)rs.getLong("atttypid");
- int typeMod = rs.getInt("atttypmod");
- int decimalDigits = connection.getTypeInfo().getScale(typeOid, typeMod);
- int columnSize = connection.getTypeInfo().getPrecision(typeOid, typeMod);
- if (columnSize == 0) {
- columnSize = connection.getTypeInfo().getDisplaySize(typeOid, typeMod);
- }
- tuple[0] = connection.encodeString(Integer.toString(scope));
- tuple[1] = rs.getBytes("attname");
- tuple[2] = connection.encodeString(Integer.toString(connection.getTypeInfo().getSQLType(typeOid)));
- tuple[3] = connection.encodeString(connection.getTypeInfo().getPGType(typeOid));
- tuple[4] = connection.encodeString(Integer.toString(columnSize));
- tuple[5] = null; // unused
- tuple[6] = connection.encodeString(Integer.toString(decimalDigits));
- tuple[7] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.bestRowNotPseudo));
- v.add(tuple);
- }
-
- return (ResultSet) ((BaseStatement)createMetaDataStatement()).createDriverResultSet(f, v);
- }
-
- /*
- * Get a description of a table's columns that are automatically
- * updated when any value in a row is updated. They are
- * unordered.
- *
- * <P>Each column description has the following columns:
- * <OL>
- * <LI><B>SCOPE</B> short => is not used
- * <LI><B>COLUMN_NAME</B> String => column name
- * <LI><B>DATA_TYPE</B> short => SQL data type from java.sql.Types
- * <LI><B>TYPE_NAME</B> String => Data source dependent type name
- * <LI><B>COLUMN_SIZE</B> int => precision
- * <LI><B>BUFFER_LENGTH</B> int => length of column value in bytes
- * <LI><B>DECIMAL_DIGITS</B> short => scale
- * <LI><B>PSEUDO_COLUMN</B> short => is this a pseudo column
- * like an Oracle ROWID
- * <UL>
- * <LI> versionColumnUnknown - may or may not be pseudo column
- * <LI> versionColumnNotPseudo - is NOT a pseudo column
- * <LI> versionColumnPseudo - is a pseudo column
- * </UL>
- * </OL>
- *
- * @param catalog a catalog name; "" retrieves those without a catalog
- * @param schema a schema name; "" retrieves those without a schema
- * @param table a table name
- * @return ResultSet each row is a column description
- */
- public java.sql.ResultSet getVersionColumns(String catalog, String schema, String table) throws SQLException
- {
- Field f[] = new Field[8];
- List v = new ArrayList(); // The new ResultSet tuple stuff
-
- f[0] = new Field("SCOPE", Oid.INT2);
- f[1] = new Field("COLUMN_NAME", Oid.VARCHAR);
- f[2] = new Field("DATA_TYPE", Oid.INT2);
- f[3] = new Field("TYPE_NAME", Oid.VARCHAR);
- f[4] = new Field("COLUMN_SIZE", Oid.INT4);
- f[5] = new Field("BUFFER_LENGTH", Oid.INT4);
- f[6] = new Field("DECIMAL_DIGITS", Oid.INT2);
- f[7] = new Field("PSEUDO_COLUMN", Oid.INT2);
-
- byte tuple[][] = new byte[8][];
-
- /* Postgresql does not have any column types that are
- * automatically updated like some databases' timestamp type.
- * We can't tell what rules or triggers might be doing, so we
- * are left with the system columns that change on an update.
- * An update may change all of the following system columns:
- * ctid, xmax, xmin, cmax, and cmin. Depending on if we are
- * in a transaction and wether we roll it back or not the
- * only guaranteed change is to ctid. -KJ
- */
-
- tuple[0] = null;
- tuple[1] = connection.encodeString("ctid");
- tuple[2] = connection.encodeString(Integer.toString(connection.getTypeInfo().getSQLType("tid")));
- tuple[3] = connection.encodeString("tid");
- tuple[4] = null;
- tuple[5] = null;
- tuple[6] = null;
- tuple[7] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.versionColumnPseudo));
- v.add(tuple);
-
- /* Perhaps we should check that the given
- * catalog.schema.table actually exists. -KJ
- */
- return (ResultSet) ((BaseStatement)createMetaDataStatement()).createDriverResultSet(f, v);
- }
-
- /*
- * Get a description of a table's primary key columns. They
- * are ordered by COLUMN_NAME.
- *
- * <P>Each column description has the following columns:
- * <OL>
- * <LI><B>TABLE_CAT</B> String => table catalog (may be null)
- * <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
- * <LI><B>TABLE_NAME</B> String => table name
- * <LI><B>COLUMN_NAME</B> String => column name
- * <LI><B>KEY_SEQ</B> short => sequence number within primary key
- * <LI><B>PK_NAME</B> String => primary key name (may be null)
- * </OL>
- *
- * @param catalog a catalog name; "" retrieves those without a catalog
- * @param schema a schema name pattern; "" retrieves those
- * without a schema
- * @param table a table name
- * @return ResultSet each row is a primary key column description
- */
- public java.sql.ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException
- {
- String sql;
- if (connection.haveMinimumServerVersion("8.1"))
- {
- sql = "SELECT NULL AS TABLE_CAT, n.nspname AS TABLE_SCHEM, "
- + " ct.relname AS TABLE_NAME, a.attname AS COLUMN_NAME, "
- + " (i.keys).n AS KEY_SEQ, ci.relname AS PK_NAME "
- + "FROM pg_catalog.pg_class ct "
- + " JOIN pg_catalog.pg_attribute a ON (ct.oid = a.attrelid) "
- + " JOIN pg_catalog.pg_namespace n ON (ct.relnamespace = n.oid) "
- + " JOIN (SELECT i.indexrelid, i.indrelid, i.indisprimary, "
- + " information_schema._pg_expandarray(i.indkey) AS keys "
- + " FROM pg_catalog.pg_index i) i "
- + " ON (a.attnum = (i.keys).x AND a.attrelid = i.indrelid) "
- + " JOIN pg_catalog.pg_class ci ON (ci.oid = i.indexrelid) "
- + "WHERE true ";
- if (schema != null && !"".equals(schema))
- {
- sql += " AND n.nspname = " + escapeQuotes(schema);
- }
- } else {
- String select;
- String from;
- String where = "";
-
- if (connection.haveMinimumServerVersion("7.3"))
- {
- select = "SELECT NULL AS TABLE_CAT, n.nspname AS TABLE_SCHEM, ";
- from = " FROM pg_catalog.pg_namespace n, pg_catalog.pg_class ct, pg_catalog.pg_class ci, pg_catalog.pg_attribute a, pg_catalog.pg_index i ";
- where = " AND ct.relnamespace = n.oid ";
- if (schema != null && !"".equals(schema))
- {
- where += " AND n.nspname = " + escapeQuotes(schema);
- }
- }
- else
- {
- select = "SELECT NULL AS TABLE_CAT, NULL AS TABLE_SCHEM, ";
- from = " FROM pg_class ct, pg_class ci, pg_attribute a, pg_index i ";
- }
-
- sql = select +
- " ct.relname AS TABLE_NAME, " +
- " a.attname AS COLUMN_NAME, " +
- " a.attnum AS KEY_SEQ, " +
- " ci.relname AS PK_NAME " +
- from +
- " WHERE ct.oid=i.indrelid AND ci.oid=i.indexrelid " +
- " AND a.attrelid=ci.oid " +
- where;
- }
-
- if (table != null && !"".equals(table))
- {
- sql += " AND ct.relname = " + escapeQuotes(table);
- }
-
- sql += " AND i.indisprimary " +
- " ORDER BY table_name, pk_name, key_seq";
-
- return createMetaDataStatement().executeQuery(sql);
- }
-
- /**
- *
- * @param primaryCatalog
- * @param primarySchema
- * @param primaryTable if provided will get the keys exported by this table
- * @param foreignTable if provided will get the keys imported by this table
- * @return ResultSet
- * @throws SQLException
- */
-
- protected java.sql.ResultSet getImportedExportedKeys(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException
- {
- Field f[] = new Field[14];
-
- f[0] = new Field("PKTABLE_CAT", Oid.VARCHAR);
- f[1] = new Field("PKTABLE_SCHEM", Oid.VARCHAR);
- f[2] = new Field("PKTABLE_NAME", Oid.VARCHAR);
- f[3] = new Field("PKCOLUMN_NAME", Oid.VARCHAR);
- f[4] = new Field("FKTABLE_CAT", Oid.VARCHAR);
- f[5] = new Field("FKTABLE_SCHEM", Oid.VARCHAR);
- f[6] = new Field("FKTABLE_NAME", Oid.VARCHAR);
- f[7] = new Field("FKCOLUMN_NAME", Oid.VARCHAR);
- f[8] = new Field("KEY_SEQ", Oid.INT2);
- f[9] = new Field("UPDATE_RULE", Oid.INT2);
- f[10] = new Field("DELETE_RULE", Oid.INT2);
- f[11] = new Field("FK_NAME", Oid.VARCHAR);
- f[12] = new Field("PK_NAME", Oid.VARCHAR);
- f[13] = new Field("DEFERRABILITY", Oid.INT2);
-
-
- String select;
- String from;
- String where = "";
-
- /*
- * The addition of the pg_constraint in 7.3 table should have really
- * helped us out here, but it comes up just a bit short.
- * - The conkey, confkey columns aren't really useful without
- * contrib/array unless we want to issues separate queries.
- * - Unique indexes that can support foreign keys are not necessarily
- * added to pg_constraint. Also multiple unique indexes covering
- * the same keys can be created which make it difficult to determine
- * the PK_NAME field.
- */
-
- if (connection.haveMinimumServerVersion("7.4"))
- {
- String sql = "SELECT NULL::text AS PKTABLE_CAT, pkn.nspname AS PKTABLE_SCHEM, pkc.relname AS PKTABLE_NAME, pka.attname AS PKCOLUMN_NAME, " +
- "NULL::text AS FKTABLE_CAT, fkn.nspname AS FKTABLE_SCHEM, fkc.relname AS FKTABLE_NAME, fka.attname AS FKCOLUMN_NAME, " +
- "pos.n AS KEY_SEQ, " +
- "CASE con.confupdtype " +
- " WHEN 'c' THEN " + DatabaseMetaData.importedKeyCascade +
- " WHEN 'n' THEN " + DatabaseMetaData.importedKeySetNull +
- " WHEN 'd' THEN " + DatabaseMetaData.importedKeySetDefault +
- " WHEN 'r' THEN " + DatabaseMetaData.importedKeyRestrict +
- " WHEN 'a' THEN " + DatabaseMetaData.importedKeyNoAction +
- " ELSE NULL END AS UPDATE_RULE, " +
- "CASE con.confdeltype " +
- " WHEN 'c' THEN " + DatabaseMetaData.importedKeyCascade +
- " WHEN 'n' THEN " + DatabaseMetaData.importedKeySetNull +
- " WHEN 'd' THEN " + DatabaseMetaData.importedKeySetDefault +
- " WHEN 'r' THEN " + DatabaseMetaData.importedKeyRestrict +
- " WHEN 'a' THEN " + DatabaseMetaData.importedKeyNoAction +
- " ELSE NULL END AS DELETE_RULE, " +
- "con.conname AS FK_NAME, pkic.relname AS PK_NAME, " +
- "CASE " +
- " WHEN con.condeferrable AND con.condeferred THEN " + DatabaseMetaData.importedKeyInitiallyDeferred +
- " WHEN con.condeferrable THEN " + DatabaseMetaData.importedKeyInitiallyImmediate +
- " ELSE " + DatabaseMetaData.importedKeyNotDeferrable +
- " END AS DEFERRABILITY " +
- " FROM " +
- " pg_catalog.pg_namespace pkn, pg_catalog.pg_class pkc, pg_catalog.pg_attribute pka, " +
- " pg_catalog.pg_namespace fkn, pg_catalog.pg_class fkc, pg_catalog.pg_attribute fka, " +
- " pg_catalog.pg_constraint con, ";
- if (connection.haveMinimumServerVersion("8.0")) {
- sql += " pg_catalog.generate_series(1, " + getMaxIndexKeys() + ") pos(n), ";
- } else {
- sql += " information_schema._pg_keypositions() pos(n), ";
- }
- sql += " pg_catalog.pg_depend dep, pg_catalog.pg_class pkic " +
- " WHERE pkn.oid = pkc.relnamespace AND pkc.oid = pka.attrelid AND pka.attnum = con.confkey[pos.n] AND con.confrelid = pkc.oid " +
- " AND fkn.oid = fkc.relnamespace AND fkc.oid = fka.attrelid AND fka.attnum = con.conkey[pos.n] AND con.conrelid = fkc.oid " +
- " AND con.contype = 'f' AND con.oid = dep.objid AND pkic.oid = dep.refobjid AND pkic.relkind = 'i' AND dep.classid = 'pg_constraint'::regclass::oid AND dep.refclassid = 'pg_class'::regclass::oid ";
- if (primarySchema != null && !"".equals(primarySchema))
- {
- sql += " AND pkn.nspname = " + escapeQuotes(primarySchema);
- }
- if (foreignSchema != null && !"".equals(foreignSchema))
- {
- sql += " AND fkn.nspname = " + escapeQuotes(foreignSchema);
- }
- if (primaryTable != null && !"".equals(primaryTable))
- {
- sql += " AND pkc.relname = " + escapeQuotes(primaryTable);
- }
- if (foreignTable != null && !"".equals(foreignTable))
- {
- sql += " AND fkc.relname = " + escapeQuotes(foreignTable);
- }
-
- if (primaryTable != null)
- {
- sql += " ORDER BY fkn.nspname,fkc.relname,con.conname,pos.n";
- }
- else
- {
- sql += " ORDER BY pkn.nspname,pkc.relname,con.conname,pos.n";
- }
-
- return createMetaDataStatement().executeQuery(sql);
- }
- else if (connection.haveMinimumServerVersion("7.3"))
- {
- select = "SELECT DISTINCT n1.nspname as pnspname,n2.nspname as fnspname, ";
- from = " FROM pg_catalog.pg_namespace n1 " +
- " JOIN pg_catalog.pg_class c1 ON (c1.relnamespace = n1.oid) " +
- " JOIN pg_catalog.pg_index i ON (c1.oid=i.indrelid) " +
- " JOIN pg_catalog.pg_class ic ON (i.indexrelid=ic.oid) " +
- " JOIN pg_catalog.pg_attribute a ON (ic.oid=a.attrelid), " +
- " pg_catalog.pg_namespace n2 " +
- " JOIN pg_catalog.pg_class c2 ON (c2.relnamespace=n2.oid), " +
- " pg_catalog.pg_trigger t1 " +
- " JOIN pg_catalog.pg_proc p1 ON (t1.tgfoid=p1.oid), " +
- " pg_catalog.pg_trigger t2 " +
- " JOIN pg_catalog.pg_proc p2 ON (t2.tgfoid=p2.oid) ";
- if (primarySchema != null && !"".equals(primarySchema))
- {
- where += " AND n1.nspname = " + escapeQuotes(primarySchema);
- }
- if (foreignSchema != null && !"".equals(foreignSchema))
- {
- where += " AND n2.nspname = " + escapeQuotes(foreignSchema);
- }
- }
- else
- {
- select = "SELECT DISTINCT NULL::text as pnspname, NULL::text as fnspname, ";
- from = " FROM pg_class c1 " +
- " JOIN pg_index i ON (c1.oid=i.indrelid) " +
- " JOIN pg_class ic ON (i.indexrelid=ic.oid) " +
- " JOIN pg_attribute a ON (ic.oid=a.attrelid), " +
- " pg_class c2, " +
- " pg_trigger t1 " +
- " JOIN pg_proc p1 ON (t1.tgfoid=p1.oid), " +
- " pg_trigger t2 " +
- " JOIN pg_proc p2 ON (t2.tgfoid=p2.oid) ";
- }
-
- String sql = select
- + "c1.relname as prelname, "
- + "c2.relname as frelname, "
- + "t1.tgconstrname, "
- + "a.attnum as keyseq, "
- + "ic.relname as fkeyname, "
- + "t1.tgdeferrable, "
- + "t1.tginitdeferred, "
- + "t1.tgnargs,t1.tgargs, "
- + "p1.proname as updaterule, "
- + "p2.proname as deleterule "
- + from
- + "WHERE "
- // isolate the update rule
- + "(t1.tgrelid=c1.oid "
- + "AND t1.tgisconstraint "
- + "AND t1.tgconstrrelid=c2.oid "
- + "AND p1.proname ~ '^RI_FKey_.*_upd$') "
-
- + "AND "
- // isolate the delete rule
- + "(t2.tgrelid=c1.oid "
- + "AND t2.tgisconstraint "
- + "AND t2.tgconstrrelid=c2.oid "
- + "AND p2.proname ~ '^RI_FKey_.*_del$') "
-
- + "AND i.indisprimary "
- + where;
-
- if (primaryTable != null)
- {
- sql += "AND c1.relname=" + escapeQuotes(primaryTable);
- }
- if (foreignTable != null)
- {
- sql += "AND c2.relname=" + escapeQuotes(foreignTable);
- }
-
- sql += "ORDER BY ";
-
- // orderby is as follows getExported, orders by FKTABLE,
- // getImported orders by PKTABLE
- // getCrossReference orders by FKTABLE, so this should work for both,
- // since when getting crossreference, primaryTable will be defined
-
- if (primaryTable != null)
- {
- if (connection.haveMinimumServerVersion("7.3"))
- {
- sql += "fnspname,";
- }
- sql += "frelname";
- }
- else
- {
- if (connection.haveMinimumServerVersion("7.3"))
- {
- sql += "pnspname,";
- }
- sql += "prelname";
- }
-
- sql += ",keyseq";
-
- ResultSet rs = connection.createStatement().executeQuery(sql);
-
- // returns the following columns
- // and some example data with a table defined as follows
-
- // create table people ( id int primary key);
- // create table policy ( id int primary key);
- // create table users ( id int primary key, people_id int references people(id), policy_id int references policy(id))
-
- // prelname | frelname | tgconstrname | keyseq | fkeyName | tgdeferrable | tginitdeferred
- // 1 | 2 | 3 | 4 | 5 | 6 | 7
-
- // people | users | <unnamed> | 1 | people_pkey | f | f
-
- // | tgnargs | tgargs | updaterule | deleterule
- // | 8 | 9 | 10 | 11
- // | 6 | <unnamed>\000users\000people\000UNSPECIFIED\000people_id\000id\000 | RI_FKey_noaction_upd | RI_FKey_noaction_del
-
- List tuples = new ArrayList();
-
- while ( rs.next() )
- {
- byte tuple[][] = new byte[14][];
-
- tuple[1] = rs.getBytes(1); //PKTABLE_SCHEM
- tuple[5] = rs.getBytes(2); //FKTABLE_SCHEM
- tuple[2] = rs.getBytes(3); //PKTABLE_NAME
- tuple[6] = rs.getBytes(4); //FKTABLE_NAME
- String fKeyName = rs.getString(5);
- String updateRule = rs.getString(12);
-
- if (updateRule != null )
- {
- // Rules look like this RI_FKey_noaction_del so we want to pull out the part between the 'Key_' and the last '_' s
-
- String rule = updateRule.substring(8, updateRule.length() - 4);
-
- int action = java.sql.DatabaseMetaData.importedKeyNoAction;
-
- if ( rule == null || "noaction".equals(rule) )
- action = java.sql.DatabaseMetaData.importedKeyNoAction;
- if ("cascade".equals(rule))
- action = java.sql.DatabaseMetaData.importedKeyCascade;
- else if ("setnull".equals(rule))
- action = java.sql.DatabaseMetaData.importedKeySetNull;
- else if ("setdefault".equals(rule))
- action = java.sql.DatabaseMetaData.importedKeySetDefault;
- else if ("restrict".equals(rule))
- action = java.sql.DatabaseMetaData.importedKeyRestrict;
-
- tuple[9] = connection.encodeString(Integer.toString(action));
-
- }
-
- String deleteRule = rs.getString(13);
-
- if ( deleteRule != null )
- {
-
- String rule = deleteRule.substring(8, deleteRule.length() - 4);
-
- int action = java.sql.DatabaseMetaData.importedKeyNoAction;
- if ("cascade".equals(rule))
- action = java.sql.DatabaseMetaData.importedKeyCascade;
- else if ("setnull".equals(rule))
- action = java.sql.DatabaseMetaData.importedKeySetNull;
- else if ("setdefault".equals(rule))
- action = java.sql.DatabaseMetaData.importedKeySetDefault;
- else if ("restrict".equals(rule))
- action = java.sql.DatabaseMetaData.importedKeyRestrict;
- tuple[10] = connection.encodeString(Integer.toString(action));
- }
-
-
- int keySequence = rs.getInt(6); //KEY_SEQ
-
- // Parse the tgargs data
- String fkeyColumn = "";
- String pkeyColumn = "";
- String fkName = "";
- // Note, I am guessing at most of this, but it should be close
- // if not, please correct
- // the keys are in pairs and start after the first four arguments
- // the arguments are seperated by \000
-
- String targs = rs.getString(11);
-
- // args look like this
- //<unnamed>\000ww\000vv\000UNSPECIFIED\000m\000a\000n\000b\000
- // we are primarily interested in the column names which are the last items in the string
-
- List tokens = tokenize(targs, "\\000");
- if (tokens.size() > 0)
- {
- fkName = (String)tokens.get(0);
- }
-
- if (fkName.startsWith("<unnamed>"))
- {
- fkName = targs;
- }
-
- int element = 4 + (keySequence - 1) * 2;
- if (tokens.size() > element)
- {
- fkeyColumn = (String)tokens.get(element);
- }
-
- element++;
- if (tokens.size() > element)
- {
- pkeyColumn = (String)tokens.get(element);
- }
-
- tuple[3] = connection.encodeString(pkeyColumn); //PKCOLUMN_NAME
- tuple[7] = connection.encodeString(fkeyColumn); //FKCOLUMN_NAME
-
- tuple[8] = rs.getBytes(6); //KEY_SEQ
- tuple[11] = connection.encodeString(fkName); //FK_NAME this will give us a unique name for the foreign key
- tuple[12] = rs.getBytes(7); //PK_NAME
-
- // DEFERRABILITY
- int deferrability = java.sql.DatabaseMetaData.importedKeyNotDeferrable;
- boolean deferrable = rs.getBoolean(8);
- boolean initiallyDeferred = rs.getBoolean(9);
- if (deferrable)
- {
- if (initiallyDeferred)
- deferrability = java.sql.DatabaseMetaData.importedKeyInitiallyDeferred;
- else
- deferrability = java.sql.DatabaseMetaData.importedKeyInitiallyImmediate;
- }
- tuple[13] = connection.encodeString(Integer.toString(deferrability));
-
- tuples.add(tuple);
- }
-
- return (ResultSet) ((BaseStatement)createMetaDataStatement()).createDriverResultSet(f, tuples);
- }
-
- /*
- * Get a description of the primary key columns that are
- * referenced by a table's foreign key columns (the primary keys
- * imported by a table). They are ordered by PKTABLE_CAT,
- * PKTABLE_SCHEM, PKTABLE_NAME, and KEY_SEQ.
- *
- * <P>Each primary key column description has the following columns:
- * <OL>
- * <LI><B>PKTABLE_CAT</B> String => primary key table catalog
- * being imported (may be null)
- * <LI><B>PKTABLE_SCHEM</B> String => primary key table schema
- * being imported (may be null)
- * <LI><B>PKTABLE_NAME</B> String => primary key table name
- * being imported
- * <LI><B>PKCOLUMN_NAME</B> String => primary key column name
- * being imported
- * <LI><B>FKTABLE_CAT</B> String => foreign key table catalog (may be null)
- * <LI><B>FKTABLE_SCHEM</B> String => foreign key table schema (may be null)
- * <LI><B>FKTABLE_NAME</B> String => foreign key table name
- * <LI><B>FKCOLUMN_NAME</B> String => foreign key column name
- * <LI><B>KEY_SEQ</B> short => sequence number within foreign key
- * <LI><B>UPDATE_RULE</B> short => What happens to
- * foreign key when primary is updated:
- * <UL>
- * <LI> importedKeyCascade - change imported key to agree
- * with primary key update
- * <LI> importedKeyRestrict - do not allow update of primary
- * key if it has been imported
- * <LI> importedKeySetNull - change imported key to NULL if
- * its primary key has been updated
- * </UL>
- * <LI><B>DELETE_RULE</B> short => What happens to
- * the foreign key when primary is deleted.
- * <UL>
- * <LI> importedKeyCascade - delete rows that import a deleted key
- * <LI> importedKeyRestrict - do not allow delete of primary
- * key if it has been imported
- * <LI> importedKeySetNull - change imported key to NULL if
- * its primary key has been deleted
- * </UL>
- * <LI><B>FK_NAME</B> String => foreign key name (may be null)
- * <LI><B>PK_NAME</B> String => primary key name (may be null)
- * </OL>
- *
- * @param catalog a catalog name; "" retrieves those without a catalog
- * @param schema a schema name pattern; "" retrieves those
- * without a schema
- * @param table a table name
- * @return ResultSet each row is a primary key column description
- * @see #getExportedKeys
- */
- public java.sql.ResultSet getImportedKeys(String catalog, String schema, String table) throws SQLException
- {
- return getImportedExportedKeys(null, null, null, catalog, schema, table);
- }
-
- /*
- * Get a description of a foreign key columns that reference a
- * table's primary key columns (the foreign keys exported by a
- * table). They are ordered by FKTABLE_CAT, FKTABLE_SCHEM,
- * FKTABLE_NAME, and KEY_SEQ.
- *
- * This method is currently unimplemented.
- *
- * <P>Each foreign key column description has the following columns:
- * <OL>
- * <LI><B>PKTABLE_CAT</B> String => primary key table catalog (may be null)
- * <LI><B>PKTABLE_SCHEM</B> String => primary key table schema (may be null)
- * <LI><B>PKTABLE_NAME</B> String => primary key table name
- * <LI><B>PKCOLUMN_NAME</B> String => primary key column name
- * <LI><B>FKTABLE_CAT</B> String => foreign key table catalog (may be null)
- * being exported (may be null)
- * <LI><B>FKTABLE_SCHEM</B> String => foreign key table schema (may be null)
- * being exported (may be null)
- * <LI><B>FKTABLE_NAME</B> String => foreign key table name
- * being exported
- * <LI><B>FKCOLUMN_NAME</B> String => foreign key column name
- * being exported
- * <LI><B>KEY_SEQ</B> short => sequence number within foreign key
- * <LI><B>UPDATE_RULE</B> short => What happens to
- * foreign key when primary is updated:
- * <UL>
- * <LI> importedKeyCascade - change imported key to agree
- * with primary key update
- * <LI> importedKeyRestrict - do not allow update of primary
- * key if it has been imported
- * <LI> importedKeySetNull - change imported key to NULL if
- * its primary key has been updated
- * </UL>
- * <LI><B>DELETE_RULE</B> short => What happens to
- * the foreign key when primary is deleted.
- * <UL>
- * <LI> importedKeyCascade - delete rows that import a deleted key
- * <LI> importedKeyRestrict - do not allow delete of primary
- * key if it has been imported
- * <LI> importedKeySetNull - change imported key to NULL if
- * its primary key has been deleted
- * </UL>
- * <LI><B>FK_NAME</B> String => foreign key identifier (may be null)
- * <LI><B>PK_NAME</B> String => primary key identifier (may be null)
- * </OL>
- *
- * @param catalog a catalog name; "" retrieves those without a catalog
- * @param schema a schema name pattern; "" retrieves those
- * without a schema
- * @param table a table name
- * @return ResultSet each row is a foreign key column description
- * @see #getImportedKeys
- */
- public java.sql.ResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException
- {
- return getImportedExportedKeys(catalog, schema, table, null, null, null);
- }
-
- /*
- * Get a description of the foreign key columns in the foreign key
- * table that reference the primary key columns of the primary key
- * table (describe how one table imports another's key.) This
- * should normally return a single foreign key/primary key pair
- * (most tables only import a foreign key from a table once.) They
- * are ordered by FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, and
- * KEY_SEQ.
- *
- * This method is currently unimplemented.
- *
- * <P>Each foreign key column description has the following columns:
- * <OL>
- * <LI><B>PKTABLE_CAT</B> String => primary key table catalog (may be null)
- * <LI><B>PKTABLE_SCHEM</B> String => primary key table schema (may be null)
- * <LI><B>PKTABLE_NAME</B> String => primary key table name
- * <LI><B>PKCOLUMN_NAME</B> String => primary key column name
- * <LI><B>FKTABLE_CAT</B> String => foreign key table catalog (may be null)
- * being exported (may be null)
- * <LI><B>FKTABLE_SCHEM</B> String => foreign key table schema (may be null)
- * being exported (may be null)
- * <LI><B>FKTABLE_NAME</B> String => foreign key table name
- * being exported
- * <LI><B>FKCOLUMN_NAME</B> String => foreign key column name
- * being exported
- * <LI><B>KEY_SEQ</B> short => sequence number within foreign key
- * <LI><B>UPDATE_RULE</B> short => What happens to
- * foreign key when primary is updated:
- * <UL>
- * <LI> importedKeyCascade - change imported key to agree
- * with primary key update
- * <LI> importedKeyRestrict - do not allow update of primary
- * key if it has been imported
- * <LI> importedKeySetNull - change imported key to NULL if
- * its primary key has been updated
- * </UL>
- * <LI><B>DELETE_RULE</B> short => What happens to
- * the foreign key when primary is deleted.
- * <UL>
- * <LI> importedKeyCascade - delete rows that import a deleted key
- * <LI> importedKeyRestrict - do not allow delete of primary
- * key if it has been imported
- * <LI> importedKeySetNull - change imported key to NULL if
- * its primary key has been deleted
- * </UL>
- * <LI><B>FK_NAME</B> String => foreign key identifier (may be null)
- * <LI><B>PK_NAME</B> String => primary key identifier (may be null)
- * </OL>
- *
- * @param catalog a catalog name; "" retrieves those without a catalog
- * @param schema a schema name pattern; "" retrieves those
- * without a schema
- * @param table a table name
- * @return ResultSet each row is a foreign key column description
- * @see #getImportedKeys
- */
- public java.sql.ResultSet getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException
- {
- return getImportedExportedKeys(primaryCatalog, primarySchema, primaryTable, foreignCatalog, foreignSchema, foreignTable);
- }
-
- /*
- * Get a description of all the standard SQL types supported by
- * this database. They are ordered by DATA_TYPE and then by how
- * closely the data type maps to the corresponding JDBC SQL type.
- *
- * <P>Each type description has the following columns:
- * <OL>
- * <LI><B>TYPE_NAME</B> String => Type name
- * <LI><B>DATA_TYPE</B> short => SQL data type from java.sql.Types
- * <LI><B>PRECISION</B> int => maximum precision
- * <LI><B>LITERAL_PREFIX</B> String => prefix used to quote a literal
- * (may be null)
- * <LI><B>LITERAL_SUFFIX</B> String => suffix used to quote a literal
- (may be null)
- * <LI><B>CREATE_PARAMS</B> String => parameters used in creating
- * the type (may be null)
- * <LI><B>NULLABLE</B> short => can you use NULL for this type?
- * <UL>
- * <LI> typeNoNulls - does not allow NULL values
- * <LI> typeNullable - allows NULL values
- * <LI> typeNullableUnknown - nullability unknown
- * </UL>
- * <LI><B>CASE_SENSITIVE</B> boolean=> is it case sensitive?
- * <LI><B>SEARCHABLE</B> short => can you use "WHERE" based on this type:
- * <UL>
- * <LI> typePredNone - No support
- * <LI> typePredChar - Only supported with WHERE .. LIKE
- * <LI> typePredBasic - Supported except for WHERE .. LIKE
- * <LI> typeSearchable - Supported for all WHERE ..
- * </UL>
- * <LI><B>UNSIGNED_ATTRIBUTE</B> boolean => is it unsigned?
- * <LI><B>FIXED_PREC_SCALE</B> boolean => can it be a money value?
- * <LI><B>AUTO_INCREMENT</B> boolean => can it be used for an
- * auto-increment value?
- * <LI><B>LOCAL_TYPE_NAME</B> String => localized version of type name
- * (may be null)
- * <LI><B>MINIMUM_SCALE</B> short => minimum scale supported
- * <LI><B>MAXIMUM_SCALE</B> short => maximum scale supported
- * <LI><B>SQL_DATA_TYPE</B> int => unused
- * <LI><B>SQL_DATETIME_SUB</B> int => unused
- * <LI><B>NUM_PREC_RADIX</B> int => usually 2 or 10
- * </OL>
- *
- * @return ResultSet each row is a SQL type description
- */
- public java.sql.ResultSet getTypeInfo() throws SQLException
- {
-
- Field f[] = new Field[18];
- List v = new ArrayList(); // The new ResultSet tuple stuff
-
- f[0] = new Field("TYPE_NAME", Oid.VARCHAR);
- f[1] = new Field("DATA_TYPE", Oid.INT2);
- f[2] = new Field("PRECISION", Oid.INT4);
- f[3] = new Field("LITERAL_PREFIX", Oid.VARCHAR);
- f[4] = new Field("LITERAL_SUFFIX", Oid.VARCHAR);
- f[5] = new Field("CREATE_PARAMS", Oid.VARCHAR);
- f[6] = new Field("NULLABLE", Oid.INT2);
- f[7] = new Field("CASE_SENSITIVE", Oid.BOOL);
- f[8] = new Field("SEARCHABLE", Oid.INT2);
- f[9] = new Field("UNSIGNED_ATTRIBUTE", Oid.BOOL);
- f[10] = new Field("FIXED_PREC_SCALE", Oid.BOOL);
- f[11] = new Field("AUTO_INCREMENT", Oid.BOOL);
- f[12] = new Field("LOCAL_TYPE_NAME", Oid.VARCHAR);
- f[13] = new Field("MINIMUM_SCALE", Oid.INT2);
- f[14] = new Field("MAXIMUM_SCALE", Oid.INT2);
- f[15] = new Field("SQL_DATA_TYPE", Oid.INT4);
- f[16] = new Field("SQL_DATETIME_SUB", Oid.INT4);
- f[17] = new Field("NUM_PREC_RADIX", Oid.INT4);
-
- String sql;
- if (connection.haveMinimumServerVersion("7.3"))
- {
- sql = "SELECT t.typname,t.oid FROM pg_catalog.pg_type t"
- + " JOIN pg_catalog.pg_namespace n ON (t.typnamespace = n.oid) "
- + " WHERE n.nspname != 'pg_toast'";
- }
- else
- {
- sql = "SELECT typname,oid FROM pg_type" +
- " WHERE NOT (typname ~ '^pg_toast_') ";
- }
-
- ResultSet rs = connection.createStatement().executeQuery(sql);
- // cache some results, this will keep memory useage down, and speed
- // things up a little.
- byte bZero[] = connection.encodeString("0");
- byte b10[] = connection.encodeString("10");
- byte bf[] = connection.encodeString("f");
- byte bt[] = connection.encodeString("t");
- byte bliteral[] = connection.encodeString("'");
- byte bNullable[] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.typeNullable));
- byte bSearchable[] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.typeSearchable));
-
- while (rs.next())
- {
- byte[][] tuple = new byte[18][];
- String typname = rs.getString(1);
- int typeOid = (int)rs.getLong(2);
-
- tuple[0] = connection.encodeString(typname);
- tuple[1] = connection.encodeString(Integer.toString(connection.getTypeInfo().getSQLType(typname)));
- tuple[2] = connection.encodeString(Integer.toString(connection.getTypeInfo().getMaximumPrecision(typeOid)));
-
- if (connection.getTypeInfo().requiresQuoting(typeOid))
- {
- tuple[3] = bliteral;
- tuple[4] = bliteral;
- }
-
- tuple[6] = bNullable; // all types can be null
- tuple[7] = connection.getTypeInfo().isCaseSensitive(typeOid) ? bt : bf;
- tuple[8] = bSearchable; // any thing can be used in the WHERE clause
- tuple[9] = connection.getTypeInfo().isSigned(typeOid) ? bf : bt;
- tuple[10] = bf; // false for now - must handle money
- tuple[11] = bf; // false - it isn't autoincrement
- tuple[13] = bZero; // min scale is zero
- // only numeric can supports a scale.
- tuple[14] = (typeOid == Oid.NUMERIC) ? connection.encodeString("1000") : bZero;
-
- // 12 - LOCAL_TYPE_NAME is null
- // 15 & 16 are unused so we return null
- tuple[17] = b10; // everything is base 10
- v.add(tuple);
-
- // add pseudo-type serial, bigserial
- if ( typname.equals("int4") )
- {
- byte[][] tuple1 = (byte[][])tuple.clone();
-
- tuple1[0] = connection.encodeString("serial");
- tuple1[11] = bt;
- v.add(tuple1);
- }
- else if ( typname.equals("int8") )
- {
- byte[][] tuple1 = (byte[][])tuple.clone();
-
- tuple1[0] = connection.encodeString("bigserial");
- tuple1[11] = bt;
- v.add(tuple1);
- }
-
- }
- rs.close();
-
- return (ResultSet) ((BaseStatement)createMetaDataStatement()).createDriverResultSet(f, v);
- }
-
- /*
- * Get a description of a table's indices and statistics. They are
- * ordered by NON_UNIQUE, TYPE, INDEX_NAME, and ORDINAL_POSITION.
- *
- * <P>Each index column description has the following columns:
- * <OL>
- * <LI><B>TABLE_CAT</B> String => table catalog (may be null)
- * <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
- * <LI><B>TABLE_NAME</B> String => table name
- * <LI><B>NON_UNIQUE</B> boolean => Can index values be non-unique?
- * false when TYPE is tableIndexStatistic
- * <LI><B>INDEX_QUALIFIER</B> String => index catalog (may be null);
- * null when TYPE is tableIndexStatistic
- * <LI><B>INDEX_NAME</B> String => index name; null when TYPE is
- * tableIndexStatistic
- * <LI><B>TYPE</B> short => index type:
- * <UL>
- * <LI> tableIndexStatistic - this identifies table statistics that are
- * returned in conjuction with a table's index descriptions
- * <LI> tableIndexClustered - this is a clustered index
- * <LI> tableIndexHashed - this is a hashed index
- * <LI> tableIndexOther - this is some other style of index
- * </UL>
- * <LI><B>ORDINAL_POSITION</B> short => column sequence number
- * within index; zero when TYPE is tableIndexStatistic
- * <LI><B>COLUMN_NAME</B> String => column name; null when TYPE is
- * tableIndexStatistic
- * <LI><B>ASC_OR_DESC</B> String => column sort sequence, "A" => ascending
- * "D" => descending, may be null if sort sequence is not supported;
- * null when TYPE is tableIndexStatistic
- * <LI><B>CARDINALITY</B> int => When TYPE is tableIndexStatisic then
- * this is the number of rows in the table; otherwise it is the
- * number of unique values in the index.
- * <LI><B>PAGES</B> int => When TYPE is tableIndexStatisic then
- * this is the number of pages used for the table, otherwise it
- * is the number of pages used for the current index.
- * <LI><B>FILTER_CONDITION</B> String => Filter condition, if any.
- * (may be null)
- * </OL>
- *
- * @param catalog a catalog name; "" retrieves those without a catalog
- * @param schema a schema name pattern; "" retrieves those without a schema
- * @param table a table name
- * @param unique when true, return only indices for unique values;
- * when false, return indices regardless of whether unique or not
- * @param approximate when true, result is allowed to reflect approximate
- * or out of data values; when false, results are requested to be
- * accurate
- * @return ResultSet each row is an index column description
- */
- // Implementation note: This is required for Borland's JBuilder to work
- public java.sql.ResultSet getIndexInfo(String catalog, String schema, String tableName, boolean unique, boolean approximate) throws SQLException
- {
- /* This is a complicated function because we have three possible
- * situations:
- * <= 7.2 no schemas, single column functional index
- * 7.3 schemas, single column functional index
- * >= 7.4 schemas, multi-column expressional index
- * >= 8.3 supports ASC/DESC column info
- * >= 9.0 no longer renames index columns on a table column rename,
- * so we must look at the table attribute names
- *
- * with the single column functional index we need an extra
- * join to the table's pg_attribute data to get the column
- * the function operates on.
- */
- String sql;
- if (connection.haveMinimumServerVersion("8.3"))
- {
- sql = "SELECT NULL AS TABLE_CAT, n.nspname AS TABLE_SCHEM, "
- + " ct.relname AS TABLE_NAME, NOT i.indisunique AS NON_UNIQUE, "
- + " NULL AS INDEX_QUALIFIER, ci.relname AS INDEX_NAME, "
- + " CASE i.indisclustered "
- + " WHEN true THEN " + java.sql.DatabaseMetaData.tableIndexClustered
- + " ELSE CASE am.amname "
- + " WHEN 'hash' THEN " + java.sql.DatabaseMetaData.tableIndexHashed
- + " ELSE " + java.sql.DatabaseMetaData.tableIndexOther
- + " END "
- + " END AS TYPE, "
- + " (i.keys).n AS ORDINAL_POSITION, "
- + " pg_catalog.pg_get_indexdef(ci.oid, (i.keys).n, false) AS COLUMN_NAME, "
- + " CASE am.amcanorder "
- + " WHEN true THEN CASE i.indoption[(i.keys).n - 1] & 1 "
- + " WHEN 1 THEN 'D' "
- + " ELSE 'A' "
- + " END "
- + " ELSE NULL "
- + " END AS ASC_OR_DESC, "
- + " ci.reltuples AS CARDINALITY, "
- + " ci.relpages AS PAGES, "
- + " pg_catalog.pg_get_expr(i.indpred, i.indrelid) AS FILTER_CONDITION "
- + "FROM pg_catalog.pg_class ct "
- + " JOIN pg_catalog.pg_namespace n ON (ct.relnamespace = n.oid) "
- + " JOIN (SELECT i.indexrelid, i.indrelid, i.indoption, "
- + " i.indisunique, i.indisclustered, i.indpred, "
- + " i.indexprs, "
- + " information_schema._pg_expandarray(i.indkey) AS keys "
- + " FROM pg_catalog.pg_index i) i "
- + " ON (ct.oid = i.indrelid) "
- + " JOIN pg_catalog.pg_class ci ON (ci.oid = i.indexrelid) "
- + " JOIN pg_catalog.pg_am am ON (ci.relam = am.oid) "
- + "WHERE true ";
-
- if (schema != null && !"".equals(schema))
- {
- sql += " AND n.nspname = " + escapeQuotes(schema);
- }
- } else {
- String select;
- String from;
- String where = "";
-
- if (connection.haveMinimumServerVersion("7.3"))
- {
- select = "SELECT NULL AS TABLE_CAT, n.nspname AS TABLE_SCHEM, ";
- from = " FROM pg_catalog.pg_namespace n, pg_catalog.pg_class ct, pg_catalog.pg_class ci, pg_catalog.pg_attribute a, pg_catalog.pg_am am ";
- where = " AND n.oid = ct.relnamespace ";
-
- if (!connection.haveMinimumServerVersion("7.4")) {
- from += ", pg_catalog.pg_attribute ai, pg_catalog.pg_index i LEFT JOIN pg_catalog.pg_proc ip ON (i.indproc = ip.oid) ";
- where += " AND ai.attnum = i.indkey[0] AND ai.attrelid = ct.oid ";
- } else {
- from += ", pg_catalog.pg_index i ";
- }
- if (schema != null && ! "".equals(schema))
- {
- where += " AND n.nspname = " + escapeQuotes(schema);
- }
- }
- else
- {
- select = "SELECT NULL AS TABLE_CAT, NULL AS TABLE_SCHEM, ";
- from = " FROM pg_class ct, pg_class ci, pg_attribute a, pg_am am, pg_attribute ai, pg_index i LEFT JOIN pg_proc ip ON (i.indproc = ip.oid) ";
- where = " AND ai.attnum = i.indkey[0] AND ai.attrelid = ct.oid ";
- }
-
- sql = select +
- " ct.relname AS TABLE_NAME, NOT i.indisunique AS NON_UNIQUE, NULL AS INDEX_QUALIFIER, ci.relname AS INDEX_NAME, " +
- " CASE i.indisclustered " +
- " WHEN true THEN " + java.sql.DatabaseMetaData.tableIndexClustered +
- " ELSE CASE am.amname " +
- " WHEN 'hash' THEN " + java.sql.DatabaseMetaData.tableIndexHashed +
- " ELSE " + java.sql.DatabaseMetaData.tableIndexOther +
- " END " +
- " END AS TYPE, " +
- " a.attnum AS ORDINAL_POSITION, ";
-
- if( connection.haveMinimumServerVersion("7.4"))
- {
- sql += " CASE WHEN i.indexprs IS NULL THEN a.attname ELSE pg_catalog.pg_get_indexdef(ci.oid,a.attnum,false) END AS COLUMN_NAME, ";
- }
- else
- {
- sql += " CASE i.indproc WHEN 0 THEN a.attname ELSE ip.proname || '(' || ai.attname || ')' END AS COLUMN_NAME, ";
- }
-
-
- sql += " NULL AS ASC_OR_DESC, " +
- " ci.reltuples AS CARDINALITY, " +
- " ci.relpages AS PAGES, ";
-
- if( connection.haveMinimumServerVersion("7.3"))
- {
- sql += " pg_catalog.pg_get_expr(i.indpred, i.indrelid) AS FILTER_CONDITION ";
- }
- else if( connection.haveMinimumServerVersion("7.2"))
- {
- sql += " pg_get_expr(i.indpred, i.indrelid) AS FILTER_CONDITION ";
- }
- else
- {
- sql += " NULL AS FILTER_CONDITION ";
- }
-
- sql += from +
- " WHERE ct.oid=i.indrelid AND ci.oid=i.indexrelid AND a.attrelid=ci.oid AND ci.relam=am.oid " +
- where;
- }
-
- sql += " AND ct.relname = " + escapeQuotes(tableName);
-
- if (unique)
- {
- sql += " AND i.indisunique ";
- }
- sql += " ORDER BY NON_UNIQUE, TYPE, INDEX_NAME, ORDINAL_POSITION ";
- return createMetaDataStatement().executeQuery(sql);
- }
-
- /**
- * Tokenize based on words not on single characters.
- */
- private static List tokenize(String input, String delimiter) {
- List result = new ArrayList();
- int start = 0;
- int end = input.length();
- int delimiterSize = delimiter.length();
-
- while (start < end)
- {
- int delimiterIndex = input.indexOf(delimiter, start);
- if (delimiterIndex < 0)
- {
- result.add(input.substring(start));
- break;
- }
- else
- {
- String token = input.substring(start, delimiterIndex);
- result.add(token);
- start = delimiterIndex + delimiterSize;
- }
- }
- return result;
- }
-
- // ** JDBC 2 Extensions **
-
- /*
- * Does the database support the given result set type?
- *
- * @param type - defined in java.sql.ResultSet
- * @return true if so; false otherwise
- * @exception SQLException - if a database access error occurs
- */
- public boolean supportsResultSetType(int type) throws SQLException
- {
- // The only type we don't support
- return type != java.sql.ResultSet.TYPE_SCROLL_SENSITIVE;
- }
-
-
- /*
- * Does the database support the concurrency type in combination
- * with the given result set type?
- *
- * @param type - defined in java.sql.ResultSet
- * @param concurrency - type defined in java.sql.ResultSet
- * @return true if so; false otherwise
- * @exception SQLException - if a database access error occurs
- */
- public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException
- {
- // These combinations are not supported!
- if (type == java.sql.ResultSet.TYPE_SCROLL_SENSITIVE)
- return false;
-
- // We do support Updateable ResultSets
- if (concurrency == java.sql.ResultSet.CONCUR_UPDATABLE)
- return true;
-
- // Everything else we do
- return true;
- }
-
-
- /* lots of unsupported stuff... */
- public boolean ownUpdatesAreVisible(int type) throws SQLException
- {
- return true;
- }
-
- public boolean ownDeletesAreVisible(int type) throws SQLException
- {
- return true;
- }
-
- public boolean ownInsertsAreVisible(int type) throws SQLException
- {
- // indicates that
- return true;
- }
-
- public boolean othersUpdatesAreVisible(int type) throws SQLException
- {
- return false;
- }
-
- public boolean othersDeletesAreVisible(int i) throws SQLException
- {
- return false;
- }
-
- public boolean othersInsertsAreVisible(int type) throws SQLException
- {
- return false;
- }
-
- public boolean updatesAreDetected(int type) throws SQLException
- {
- return false;
- }
-
- public boolean deletesAreDetected(int i) throws SQLException
- {
- return false;
- }
-
- public boolean insertsAreDetected(int type) throws SQLException
- {
- return false;
- }
-
- /*
- * Indicates whether the driver supports batch updates.
- */
- public boolean supportsBatchUpdates() throws SQLException
- {
- return true;
- }
-
- /**
- *
- * @param catalog String
- * @param schemaPattern String
- * @param typeNamePattern String
- * @param types int[]
- * @throws SQLException
- * @return ResultSet
- */
- public java.sql.ResultSet getUDTs(String catalog,
- String schemaPattern,
- String typeNamePattern,
- int[] types
- ) throws SQLException
- {
- String sql = "select "
- + "null as type_cat, n.nspname as type_schem, t.typname as type_name, null as class_name, "
- + "CASE WHEN t.typtype='c' then " + java.sql.Types.STRUCT + " else " + java.sql.Types.DISTINCT + " end as data_type, pg_catalog.obj_description(t.oid, 'pg_type') "
- + "as remarks, CASE WHEN t.typtype = 'd' then (select CASE";
-
- for (Iterator i = connection.getTypeInfo().getPGTypeNamesWithSQLTypes(); i.hasNext();) {
- String pgType = (String)i.next();
- int sqlType = connection.getTypeInfo().getSQLType(pgType);
- sql += " when typname = " + escapeQuotes(pgType) + " then " + sqlType;
- }
-
- sql += " else " + java.sql.Types.OTHER + " end from pg_type where oid=t.typbasetype) "
- + "else null end as base_type "
- + "from pg_catalog.pg_type t, pg_catalog.pg_namespace n where t.typnamespace = n.oid and n.nspname != 'pg_catalog' and n.nspname != 'pg_toast'";
-
-
-
- String toAdd = "";
- if ( types != null )
- {
- toAdd += " and (false ";
- for (int i = 0; i < types.length; i++)
- {
- switch (types[i] )
- {
- case java.sql.Types.STRUCT:
- toAdd += " or t.typtype = 'c'";
- break;
- case java.sql.Types.DISTINCT:
- toAdd += " or t.typtype = 'd'";
- break;
- }
- }
- toAdd += " ) ";
- }
- else
- {
- toAdd += " and t.typtype IN ('c','d') ";
- }
- // spec says that if typeNamePattern is a fully qualified name
- // then the schema and catalog are ignored
-
- if (typeNamePattern != null)
- {
- // search for qualifier
- int firstQualifier = typeNamePattern.indexOf('.') ;
- int secondQualifier = typeNamePattern.lastIndexOf('.');
-
- if ( firstQualifier != -1 ) // if one of them is -1 they both will be
- {
- if ( firstQualifier != secondQualifier )
- {
- // we have a catalog.schema.typename, ignore catalog
- schemaPattern = typeNamePattern.substring(firstQualifier + 1, secondQualifier);
- }
- else
- {
- // we just have a schema.typename
- schemaPattern = typeNamePattern.substring(0, firstQualifier);
- }
- // strip out just the typeName
- typeNamePattern = typeNamePattern.substring(secondQualifier + 1);
- }
- toAdd += " and t.typname like " + escapeQuotes(typeNamePattern);
- }
-
- // schemaPattern may have been modified above
- if ( schemaPattern != null)
- {
- toAdd += " and n.nspname like " + escapeQuotes(schemaPattern);
- }
- sql += toAdd;
- sql += " order by data_type, type_schem, type_name";
- java.sql.ResultSet rs = createMetaDataStatement().executeQuery(sql);
-
- return rs;
- }
-
-
- /*
- * Retrieves the connection that produced this metadata object.
- *
- * @return the connection that produced this metadata object
- */
- public java.sql.Connection getConnection() throws SQLException
- {
- return (java.sql.Connection)connection;
- }
-
- /* I don't find these in the spec!?! */
-
- public boolean rowChangesAreDetected(int type) throws SQLException
- {
- return false;
- }
-
- public boolean rowChangesAreVisible(int type) throws SQLException
- {
- return false;
- }
-
- protected java.sql.Statement createMetaDataStatement() throws SQLException
- {
- return ((AbstractJdbc2Connection)connection).createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE, java.sql.ResultSet.CONCUR_READ_ONLY);
- }
-
-}
diff --git a/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java b/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
deleted file mode 100644
index edbfdb1..0000000
--- a/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
+++ /dev/null
@@ -1,3270 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc2;
-
-import java.io.CharArrayReader;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.io.ByteArrayInputStream;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.sql.*;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.TimeZone;
-import java.util.Calendar;
-import java.util.Locale;
-import org.postgresql.core.*;
-import org.postgresql.largeobject.*;
-import org.postgresql.util.ByteConverter;
-import org.postgresql.util.HStoreConverter;
-import org.postgresql.util.PGobject;
-import org.postgresql.util.PGbytea;
-import org.postgresql.util.PGtokenizer;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.GT;
-import org.postgresql.PGResultSetMetaData;
-
-
-public abstract class AbstractJdbc2ResultSet implements BaseResultSet, org.postgresql.PGRefCursorResultSet
-{
-
- //needed for updateable result set support
- private boolean updateable = false;
- private boolean doingUpdates = false;
- private HashMap updateValues = null;
- private boolean usingOID = false; // are we using the OID for the primary key?
- private List primaryKeys; // list of primary keys
- private boolean singleTable = false;
- private String onlyTable = "";
- private String tableName = null;
- private PreparedStatement updateStatement = null;
- private PreparedStatement insertStatement = null;
- private PreparedStatement deleteStatement = null;
- private PreparedStatement selectStatement = null;
- private final int resultsettype;
- private final int resultsetconcurrency;
- private int fetchdirection = ResultSet.FETCH_UNKNOWN;
- protected final BaseConnection connection; // the connection we belong to
- protected final BaseStatement statement; // the statement we belong to
- private Statement realStatement; // the real statement we belong to (when using forced binary prepared statement test hack)
- protected final Field fields[]; // Field metadata for this resultset.
- protected final Query originalQuery; // Query we originated from
-
- protected final int maxRows; // Maximum rows in this resultset (might be 0).
- protected final int maxFieldSize; // Maximum field size in this resultset (might be 0).
-
- protected List rows; // Current page of results.
- protected int current_row = -1; // Index into 'rows' of our currrent row (0-based)
- protected int row_offset; // Offset of row 0 in the actual resultset
- protected byte[][] this_row; // copy of the current result row
- protected SQLWarning warnings = null; // The warning chain
- /**
- * True if the last obtained column value was SQL NULL as specified by
- * {@link #wasNull}. The value is always updated by the
- * {@link #checkResultSet} method.
- */
- protected boolean wasNullFlag = false;
- protected boolean onInsertRow = false; // are we on the insert row (for JDBC2 updatable resultsets)?
-
- private byte[][] rowBuffer = null; // updateable rowbuffer
-
- protected int fetchSize; // Current fetch size (might be 0).
- protected ResultCursor cursor; // Cursor for fetching additional data.
-
- private HashMap columnNameIndexMap; // Speed up findColumn by caching lookups
-
- private ResultSetMetaData rsMetaData;
-
- protected abstract ResultSetMetaData createMetaData() throws SQLException;
-
- public ResultSetMetaData getMetaData() throws SQLException
- {
- checkClosed();
- if (rsMetaData == null) {
- rsMetaData = createMetaData();
- }
- return rsMetaData;
- }
-
- public AbstractJdbc2ResultSet(Query originalQuery, BaseStatement statement, Field[] fields, List tuples,
- ResultCursor cursor, int maxRows, int maxFieldSize,
- int rsType, int rsConcurrency) throws SQLException
- {
- this.originalQuery = originalQuery;
- this.connection = (BaseConnection) statement.getConnection();
- this.statement = statement;
- this.fields = fields;
- this.rows = tuples;
- this.cursor = cursor;
- this.maxRows = maxRows;
- this.maxFieldSize = maxFieldSize;
- this.resultsettype = rsType;
- this.resultsetconcurrency = rsConcurrency;
- }
-
- public java.net.URL getURL(int columnIndex) throws SQLException
- {
- checkClosed();
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getURL(int)");
- }
-
-
- public java.net.URL getURL(String columnName) throws SQLException
- {
- return getURL(findColumn(columnName));
- }
-
- protected Object internalGetObject(int columnIndex, Field field) throws SQLException
- {
- switch (getSQLType(columnIndex))
- {
- case Types.BIT:
- // Also Types.BOOLEAN in JDBC3
- return getBoolean(columnIndex) ? Boolean.TRUE : Boolean.FALSE;
- case Types.TINYINT:
- case Types.SMALLINT:
- case Types.INTEGER:
- return new Integer(getInt(columnIndex));
- case Types.BIGINT:
- return new Long(getLong(columnIndex));
- case Types.NUMERIC:
- case Types.DECIMAL:
- return getBigDecimal
- (columnIndex, (field.getMod() == -1) ? -1 : ((field.getMod() - 4) & 0xffff));
- case Types.REAL:
- return new Float(getFloat(columnIndex));
- case Types.FLOAT:
- case Types.DOUBLE:
- return new Double(getDouble(columnIndex));
- case Types.CHAR:
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- return getString(columnIndex);
- case Types.DATE:
- return getDate(columnIndex);
- case Types.TIME:
- return getTime(columnIndex);
- case Types.TIMESTAMP:
- return getTimestamp(columnIndex, null);
- case Types.BINARY:
- case Types.VARBINARY:
- case Types.LONGVARBINARY:
- return getBytes(columnIndex);
- case Types.ARRAY:
- return getArray(columnIndex);
- case Types.CLOB:
- return getClob(columnIndex);
- case Types.BLOB:
- return getBlob(columnIndex);
-
- default:
- String type = getPGType(columnIndex);
-
- // if the backend doesn't know the type then coerce to String
- if (type.equals("unknown"))
- return getString(columnIndex);
-
- if (type.equals("uuid")) {
- if (isBinary(columnIndex)) {
- return getUUID(this_row[columnIndex - 1]);
- }
- return getUUID(getString(columnIndex));
- }
-
- // Specialized support for ref cursors is neater.
- if (type.equals("refcursor"))
- {
- // Fetch all results.
- String cursorName = getString(columnIndex);
-
- StringBuffer sb = new StringBuffer("FETCH ALL IN ");
- Utils.appendEscapedIdentifier(sb, cursorName);
-
- // nb: no BEGIN triggered here. This is fine. If someone
- // committed, and the cursor was not holdable (closing the
- // cursor), we avoid starting a new xact and promptly causing
- // it to fail. If the cursor *was* holdable, we don't want a
- // new xact anyway since holdable cursor state isn't affected
- // by xact boundaries. If our caller didn't commit at all, or
- // autocommit was on, then we wouldn't issue a BEGIN anyway.
- //
- // We take the scrollability from the statement, but until
- // we have updatable cursors it must be readonly.
- ResultSet rs = connection.execSQLQuery(sb.toString(), resultsettype, ResultSet.CONCUR_READ_ONLY);
- //
- // In long running transactions these backend cursors take up memory space
- // we could close in rs.close(), but if the transaction is closed before the result set, then
- // the cursor no longer exists
-
- sb.setLength(0);
- sb.append("CLOSE ");
- Utils.appendEscapedIdentifier(sb, cursorName);
- connection.execSQLUpdate(sb.toString());
- ((AbstractJdbc2ResultSet)rs).setRefCursor(cursorName);
- return rs;
- }
- if ("hstore".equals(type)) {
- if (isBinary(columnIndex)) {
- return HStoreConverter.fromBytes(this_row[columnIndex - 1], connection.getEncoding());
- }
- return HStoreConverter.fromString(getString(columnIndex));
- }
-
- // Caller determines what to do (JDBC3 overrides in this case)
- return null;
- }
- }
-
- private void checkScrollable() throws SQLException
- {
- checkClosed();
- if (resultsettype == ResultSet.TYPE_FORWARD_ONLY)
- throw new PSQLException(GT.tr("Operation requires a scrollable ResultSet, but this ResultSet is FORWARD_ONLY."),
- PSQLState.INVALID_CURSOR_STATE);
- }
-
- public boolean absolute(int index) throws SQLException
- {
- checkScrollable();
-
- // index is 1-based, but internally we use 0-based indices
- int internalIndex;
-
- if (index == 0)
- {
- beforeFirst();
- return false;
- }
-
- final int rows_size = rows.size();
-
- //if index<0, count from the end of the result set, but check
- //to be sure that it is not beyond the first index
- if (index < 0)
- {
- if (index >= -rows_size)
- internalIndex = rows_size + index;
- else
- {
- beforeFirst();
- return false;
- }
- }
- else
- {
- //must be the case that index>0,
- //find the correct place, assuming that
- //the index is not too large
- if (index <= rows_size)
- internalIndex = index - 1;
- else
- {
- afterLast();
- return false;
- }
- }
-
- current_row = internalIndex;
- initRowBuffer();
- onInsertRow = false;
-
- return true;
- }
-
-
- public void afterLast() throws SQLException
- {
- checkScrollable();
-
- final int rows_size = rows.size();
- if (rows_size > 0)
- current_row = rows_size;
-
- onInsertRow = false;
- this_row = null;
- rowBuffer = null;
- }
-
-
- public void beforeFirst() throws SQLException
- {
- checkScrollable();
-
- if (rows.size() > 0)
- current_row = -1;
-
- onInsertRow = false;
- this_row = null;
- rowBuffer = null;
- }
-
-
- public boolean first() throws SQLException
- {
- checkScrollable();
-
- if (rows.size() <= 0)
- return false;
-
- current_row = 0;
- initRowBuffer();
- onInsertRow = false;
-
- return true;
- }
-
-
- public java.sql.Array getArray(String colName) throws SQLException
- {
- return getArray(findColumn(colName));
- }
-
- protected abstract Array makeArray(int oid, byte[] value) throws SQLException;
- protected abstract Array makeArray(int oid, String value) throws SQLException;
-
- public java.sql.Array getArray(int i) throws SQLException
- {
- checkResultSet( i );
- if (wasNullFlag)
- return null;
-
- int oid = fields[i - 1].getOID();
- if (isBinary(i)) {
- return makeArray(oid, this_row[i - 1]);
- }
- return makeArray(oid, getFixedString(i));
- }
-
-
- public java.math.BigDecimal getBigDecimal(int columnIndex) throws SQLException
- {
- return getBigDecimal(columnIndex, -1);
- }
-
-
- public java.math.BigDecimal getBigDecimal(String columnName) throws SQLException
- {
- return getBigDecimal(findColumn(columnName));
- }
-
-
- public Blob getBlob(String columnName) throws SQLException
- {
- return getBlob(findColumn(columnName));
- }
-
-
- protected abstract Blob makeBlob(long oid) throws SQLException;
-
- public Blob getBlob(int i) throws SQLException
- {
- checkResultSet(i);
- if (wasNullFlag)
- return null;
-
- return makeBlob(getLong(i));
- }
-
-
- public java.io.Reader getCharacterStream(String columnName) throws SQLException
- {
- return getCharacterStream(findColumn(columnName));
- }
-
-
- public java.io.Reader getCharacterStream(int i) throws SQLException
- {
- checkResultSet( i );
- if (wasNullFlag)
- return null;
-
- if (((AbstractJdbc2Connection) connection).haveMinimumCompatibleVersion("7.2"))
- {
- //Version 7.2 supports AsciiStream for all the PG text types
- //As the spec/javadoc for this method indicate this is to be used for
- //large text values (i.e. LONGVARCHAR) PG doesn't have a separate
- //long string datatype, but with toast the text datatype is capable of
- //handling very large values. Thus the implementation ends up calling
- //getString() since there is no current way to stream the value from the server
- return new CharArrayReader(getString(i).toCharArray());
- }
- else
- {
- // In 7.1 Handle as BLOBS so return the LargeObject input stream
- Encoding encoding = connection.getEncoding();
- InputStream input = getBinaryStream(i);
-
- try
- {
- return encoding.getDecodingReader(input);
- }
- catch (IOException ioe)
- {
- throw new PSQLException(GT.tr("Unexpected error while decoding character data from a large object."), PSQLState.UNEXPECTED_ERROR, ioe);
- }
- }
- }
-
-
- public Clob getClob(String columnName) throws SQLException
- {
- return getClob(findColumn(columnName));
- }
-
-
- protected abstract Clob makeClob(long oid) throws SQLException;
-
- public Clob getClob(int i) throws SQLException
- {
- checkResultSet(i);
- if (wasNullFlag)
- return null;
-
- return makeClob(getLong(i));
- }
-
- public int getConcurrency() throws SQLException
- {
- checkClosed();
- return resultsetconcurrency;
- }
-
-
- public java.sql.Date getDate(int i, java.util.Calendar cal) throws SQLException
- {
- checkResultSet(i);
- if (wasNullFlag)
- return null;
-
- if (isBinary(i)) {
- int col = i - 1;
- int oid = fields[col].getOID();
- TimeZone tz = cal == null ? null : cal.getTimeZone();
- if (oid == Oid.DATE) {
- return connection.getTimestampUtils().toDateBin(tz, this_row[col]);
- } else if (oid == Oid.TIMESTAMP || oid == Oid.TIMESTAMPTZ) {
- // JDBC spec says getDate of Timestamp must be supported
- return connection.getTimestampUtils().convertToDate(getTimestamp(i, cal), tz);
- } else {
- throw new PSQLException (GT.tr("Cannot convert the column of type {0} to requested type {1}.",
- new Object[]{Oid.toString(oid), "date"}),
- PSQLState.DATA_TYPE_MISMATCH);
- }
- }
-
- if (cal != null)
- cal = (Calendar)cal.clone();
-
- return connection.getTimestampUtils().toDate(cal, getString(i));
- }
-
-
- public Time getTime(int i, java.util.Calendar cal) throws SQLException
- {
- checkResultSet(i);
- if (wasNullFlag)
- return null;
-
- if (isBinary(i)) {
- int col = i - 1;
- int oid = fields[col].getOID();
- TimeZone tz = cal == null ? null : cal.getTimeZone();
- if (oid == Oid.TIME || oid == Oid.TIMETZ) {
- return connection.getTimestampUtils().toTimeBin(tz, this_row[col]);
- } else if (oid == Oid.TIMESTAMP || oid == Oid.TIMESTAMPTZ) {
- // JDBC spec says getTime of Timestamp must be supported
- return connection.getTimestampUtils().convertToTime(getTimestamp(i, cal), tz);
- } else {
- throw new PSQLException (GT.tr("Cannot convert the column of type {0} to requested type {1}.",
- new Object[]{Oid.toString(oid), "time"}),
- PSQLState.DATA_TYPE_MISMATCH);
- }
- }
-
- if (cal != null)
- cal = (Calendar)cal.clone();
-
- return connection.getTimestampUtils().toTime(cal, getString(i));
- }
-
-
- public Timestamp getTimestamp(int i, java.util.Calendar cal) throws SQLException
- {
- checkResultSet(i);
- if (wasNullFlag)
- return null;
-
- if (isBinary(i)) {
- int col = i - 1;
- int oid = fields[col].getOID();
- if (oid == Oid.TIMESTAMPTZ || oid == Oid.TIMESTAMP) {
- boolean hasTimeZone = oid == Oid.TIMESTAMPTZ;
- TimeZone tz = cal == null ? null : cal.getTimeZone();
- return connection.getTimestampUtils().toTimestampBin(tz, this_row[col], hasTimeZone);
- } else {
- // JDBC spec says getTimestamp of Time and Date must be supported
- long millis;
- if (oid == Oid.TIME || oid == Oid.TIMETZ) {
- millis = getTime(i, cal).getTime();
- } else if (oid == Oid.DATE) {
- millis = getDate(i, cal).getTime();
- } else {
- throw new PSQLException (GT.tr("Cannot convert the column of type {0} to requested type {1}.",
- new Object[]{Oid.toString(oid), "timestamp"}),
- PSQLState.DATA_TYPE_MISMATCH);
- }
- return new Timestamp(millis);
- }
- }
-
- if (cal != null)
- cal = (Calendar)cal.clone();
-
- // If this is actually a timestamptz, the server-provided timezone will override
- // the one we pass in, which is the desired behaviour. Otherwise, we'll
- // interpret the timezone-less value in the provided timezone.
- return connection.getTimestampUtils().toTimestamp(cal, getString(i));
- }
-
-
- public java.sql.Date getDate(String c, java.util.Calendar cal) throws SQLException
- {
- return getDate(findColumn(c), cal);
- }
-
-
- public Time getTime(String c, java.util.Calendar cal) throws SQLException
- {
- return getTime(findColumn(c), cal);
- }
-
-
- public Timestamp getTimestamp(String c, java.util.Calendar cal) throws SQLException
- {
- return getTimestamp(findColumn(c), cal);
- }
-
-
- public int getFetchDirection() throws SQLException
- {
- checkClosed();
- return fetchdirection;
- }
-
-
- public Object getObjectImpl(String columnName, java.util.Map map) throws SQLException
- {
- return getObjectImpl(findColumn(columnName), map);
- }
-
-
- /*
- * This checks against map for the type of column i, and if found returns
- * an object based on that mapping. The class must implement the SQLData
- * interface.
- */
- public Object getObjectImpl(int i, java.util.Map map) throws SQLException
- {
- checkClosed();
- if (map == null || map.isEmpty()) {
- return getObject(i);
- }
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getObjectImpl(int,Map)");
- }
-
-
- public Ref getRef(String columnName) throws SQLException
- {
- return getRef(findColumn(columnName));
- }
-
-
- public Ref getRef(int i) throws SQLException
- {
- checkClosed();
- //The backend doesn't yet have SQL3 REF types
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getRef(int)");
- }
-
-
- public int getRow() throws SQLException
- {
- checkClosed();
-
- if (onInsertRow)
- return 0;
-
- final int rows_size = rows.size();
-
- if (current_row < 0 || current_row >= rows_size)
- return 0;
-
- return row_offset + current_row + 1;
- }
-
-
- // This one needs some thought, as not all ResultSets come from a statement
- public Statement getStatement() throws SQLException
- {
- checkClosed();
- return (Statement) statement;
- }
-
-
- public int getType() throws SQLException
- {
- checkClosed();
- return resultsettype;
- }
-
-
- public boolean isAfterLast() throws SQLException
- {
- checkClosed();
- if (onInsertRow)
- return false;
-
- final int rows_size = rows.size();
- return (current_row >= rows_size && rows_size > 0);
- }
-
-
- public boolean isBeforeFirst() throws SQLException
- {
- checkClosed();
- if (onInsertRow)
- return false;
-
- return ((row_offset + current_row) < 0 && rows.size() > 0);
- }
-
-
- public boolean isFirst() throws SQLException
- {
- checkClosed();
- if (onInsertRow)
- return false;
-
- return ((row_offset + current_row) == 0);
- }
-
-
- public boolean isLast() throws SQLException
- {
- checkClosed();
- if (onInsertRow)
- return false;
-
- final int rows_size = rows.size();
-
- if (rows_size == 0)
- return false; // No rows.
-
- if (current_row != (rows_size - 1))
- return false; // Not on the last row of this block.
-
- // We are on the last row of the current block.
-
- if (cursor == null)
- {
- // This is the last block and therefore the last row.
- return true;
- }
-
- if (maxRows > 0 && row_offset + current_row == maxRows)
- {
- // We are implicitly limited by maxRows.
- return true;
- }
-
- // Now the more painful case begins.
- // We are on the last row of the current block, but we don't know if the
- // current block is the last block; we must try to fetch some more data to
- // find out.
-
- // We do a fetch of the next block, then prepend the current row to that
- // block (so current_row == 0). This works as the current row
- // must be the last row of the current block if we got this far.
-
- row_offset += rows_size - 1; // Discarding all but one row.
-
- // Work out how many rows maxRows will let us fetch.
- int fetchRows = fetchSize;
- if (maxRows != 0)
- {
- if (fetchRows == 0 || row_offset + fetchRows > maxRows) // Fetch would exceed maxRows, limit it.
- fetchRows = maxRows - row_offset;
- }
-
- // Do the actual fetch.
- connection.getQueryExecutor().fetch(cursor, new CursorResultHandler(), fetchRows);
-
- // Now prepend our one saved row and move to it.
- rows.add(0, this_row);
- current_row = 0;
-
- // Finally, now we can tell if we're the last row or not.
- return (rows.size() == 1);
- }
-
- public boolean last() throws SQLException
- {
- checkScrollable();
-
- final int rows_size = rows.size();
- if (rows_size <= 0)
- return false;
-
- current_row = rows_size - 1;
- initRowBuffer();
- onInsertRow = false;
-
- return true;
- }
-
-
- public boolean previous() throws SQLException
- {
- checkScrollable();
-
- if (onInsertRow)
- throw new PSQLException(GT.tr("Can''t use relative move methods while on the insert row."),
- PSQLState.INVALID_CURSOR_STATE);
-
- if (current_row -1 < 0)
- {
- current_row = -1;
- this_row = null;
- rowBuffer = null;
- return false;
- }
- else
- {
- current_row--;
- }
- initRowBuffer();
- return true;
- }
-
-
- public boolean relative(int rows) throws SQLException
- {
- checkScrollable();
-
- if (onInsertRow)
- throw new PSQLException(GT.tr("Can''t use relative move methods while on the insert row."),
- PSQLState.INVALID_CURSOR_STATE);
-
- //have to add 1 since absolute expects a 1-based index
- return absolute(current_row + 1 + rows);
- }
-
-
- public void setFetchDirection(int direction) throws SQLException
- {
- checkClosed();
- switch (direction)
- {
- case ResultSet.FETCH_FORWARD:
- break;
- case ResultSet.FETCH_REVERSE:
- case ResultSet.FETCH_UNKNOWN:
- checkScrollable();
- break;
- default:
- throw new PSQLException(GT.tr("Invalid fetch direction constant: {0}.", new Integer(direction)),
- PSQLState.INVALID_PARAMETER_VALUE);
- }
-
- this.fetchdirection = direction;
- }
-
-
- public synchronized void cancelRowUpdates()
- throws SQLException
- {
- checkClosed();
- if (onInsertRow)
- {
- throw new PSQLException(GT.tr("Cannot call cancelRowUpdates() when on the insert row."),
- PSQLState.INVALID_CURSOR_STATE);
- }
-
- if (doingUpdates)
- {
- doingUpdates = false;
-
- clearRowBuffer(true);
- }
- }
-
-
- public synchronized void deleteRow()
- throws SQLException
- {
- checkUpdateable();
-
- if (onInsertRow)
- {
- throw new PSQLException(GT.tr("Cannot call deleteRow() when on the insert row."),
- PSQLState.INVALID_CURSOR_STATE);
- }
-
- if (isBeforeFirst())
- {
- throw new PSQLException(GT.tr("Currently positioned before the start of the ResultSet. You cannot call deleteRow() here."),
- PSQLState.INVALID_CURSOR_STATE);
- }
- if (isAfterLast())
- {
- throw new PSQLException(GT.tr("Currently positioned after the end of the ResultSet. You cannot call deleteRow() here."),
- PSQLState.INVALID_CURSOR_STATE);
- }
- if (rows.size() == 0)
- {
- throw new PSQLException(GT.tr("There are no rows in this ResultSet."),
- PSQLState.INVALID_CURSOR_STATE);
- }
-
-
- int numKeys = primaryKeys.size();
- if ( deleteStatement == null )
- {
-
-
- StringBuffer deleteSQL = new StringBuffer("DELETE FROM " ).append(onlyTable).append(tableName).append(" where " );
-
- for ( int i = 0; i < numKeys; i++ )
- {
- Utils.appendEscapedIdentifier(deleteSQL, ((PrimaryKey)primaryKeys.get(i)).name);
- deleteSQL.append(" = ?");
- if ( i < numKeys - 1 )
- {
- deleteSQL.append( " and " );
- }
- }
-
- deleteStatement = ((java.sql.Connection) connection).prepareStatement(deleteSQL.toString());
- }
- deleteStatement.clearParameters();
-
- for ( int i = 0; i < numKeys; i++ )
- {
- deleteStatement.setObject(i + 1, ((PrimaryKey) primaryKeys.get(i)).getValue());
- }
-
-
- deleteStatement.executeUpdate();
-
- rows.remove(current_row);
- current_row--;
- moveToCurrentRow();
- }
-
-
- public synchronized void insertRow()
- throws SQLException
- {
- checkUpdateable();
-
- if (!onInsertRow)
- {
- throw new PSQLException(GT.tr("Not on the insert row."), PSQLState.INVALID_CURSOR_STATE);
- }
- else if (updateValues.size() == 0)
- {
- throw new PSQLException(GT.tr("You must specify at least one column value to insert a row."),
- PSQLState.INVALID_PARAMETER_VALUE);
- }
- else
- {
-
- // loop through the keys in the insertTable and create the sql statement
- // we have to create the sql every time since the user could insert different
- // columns each time
-
- StringBuffer insertSQL = new StringBuffer("INSERT INTO ").append(tableName).append(" (");
- StringBuffer paramSQL = new StringBuffer(") values (" );
-
- Iterator columnNames = updateValues.keySet().iterator();
- int numColumns = updateValues.size();
-
- for ( int i = 0; columnNames.hasNext(); i++ )
- {
- String columnName = (String) columnNames.next();
-
- Utils.appendEscapedIdentifier(insertSQL, columnName);
- if ( i < numColumns - 1 )
- {
- insertSQL.append(", ");
- paramSQL.append("?,");
- }
- else
- {
- paramSQL.append("?)");
- }
-
- }
-
- insertSQL.append(paramSQL.toString());
- insertStatement = ((java.sql.Connection) connection).prepareStatement(insertSQL.toString());
-
- Iterator keys = updateValues.keySet().iterator();
-
- for ( int i = 1; keys.hasNext(); i++)
- {
- String key = (String) keys.next();
- Object o = updateValues.get(key);
- insertStatement.setObject(i, o);
- }
-
- insertStatement.executeUpdate();
-
- if ( usingOID )
- {
- // we have to get the last inserted OID and put it in the resultset
-
- long insertedOID = ((AbstractJdbc2Statement) insertStatement).getLastOID();
-
- updateValues.put("oid", new Long(insertedOID) );
-
- }
-
- // update the underlying row to the new inserted data
- updateRowBuffer();
-
- rows.add(rowBuffer);
-
- // we should now reflect the current data in this_row
- // that way getXXX will get the newly inserted data
- this_row = rowBuffer;
-
- // need to clear this in case of another insert
- clearRowBuffer(false);
-
-
- }
- }
-
-
- public synchronized void moveToCurrentRow()
- throws SQLException
- {
- checkUpdateable();
-
- if (current_row < 0 || current_row >= rows.size())
- {
- this_row = null;
- rowBuffer = null;
- }
- else
- {
- initRowBuffer();
- }
-
- onInsertRow = false;
- doingUpdates = false;
- }
-
-
- public synchronized void moveToInsertRow()
- throws SQLException
- {
- checkUpdateable();
-
- if (insertStatement != null)
- {
- insertStatement = null;
- }
-
-
- // make sure the underlying data is null
- clearRowBuffer(false);
-
- onInsertRow = true;
- doingUpdates = false;
-
- }
-
-
- private synchronized void clearRowBuffer(boolean copyCurrentRow)
- throws SQLException
- {
- // rowBuffer is the temporary storage for the row
- rowBuffer = new byte[fields.length][];
-
- // inserts want an empty array while updates want a copy of the current row
- if (copyCurrentRow)
- {
- System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length);
- }
-
- // clear the updateValues hash map for the next set of updates
- updateValues.clear();
-
- }
-
-
- public boolean rowDeleted() throws SQLException
- {
- checkClosed();
- return false;
- }
-
-
- public boolean rowInserted() throws SQLException
- {
- checkClosed();
- return false;
- }
-
-
- public boolean rowUpdated() throws SQLException
- {
- checkClosed();
- return false;
- }
-
-
- public synchronized void updateAsciiStream(int columnIndex,
- java.io.InputStream x,
- int length
- )
- throws SQLException
- {
- if (x == null)
- {
- updateNull(columnIndex);
- return ;
- }
-
- try
- {
- InputStreamReader reader = new InputStreamReader(x, "ASCII");
- char data[] = new char[length];
- int numRead = 0;
- while (true)
- {
- int n = reader.read(data, numRead, length - numRead);
- if (n == -1)
- break;
-
- numRead += n;
-
- if (numRead == length)
- break;
- }
- updateString(columnIndex, new String(data, 0, numRead));
- }
- catch (UnsupportedEncodingException uee)
- {
- throw new PSQLException(GT.tr("The JVM claims not to support the encoding: {0}","ASCII"), PSQLState.UNEXPECTED_ERROR, uee);
- }
- catch (IOException ie)
- {
- throw new PSQLException(GT.tr("Provided InputStream failed."), null, ie);
- }
- }
-
-
- public synchronized void updateBigDecimal(int columnIndex,
- java.math.BigDecimal x )
- throws SQLException
- {
- updateValue(columnIndex, x);
- }
-
-
- public synchronized void updateBinaryStream(int columnIndex,
- java.io.InputStream x,
- int length
- )
- throws SQLException
- {
- if (x == null)
- {
- updateNull(columnIndex);
- return ;
- }
-
- byte data[] = new byte[length];
- int numRead = 0;
- try
- {
- while (true)
- {
- int n = x.read(data, numRead, length - numRead);
- if (n == -1)
- break;
-
- numRead += n;
-
- if (numRead == length)
- break;
- }
- }
- catch (IOException ie)
- {
- throw new PSQLException(GT.tr("Provided InputStream failed."), null, ie);
- }
-
- if (numRead == length)
- {
- updateBytes(columnIndex, data);
- }
- else
- {
- // the stream contained less data than they said
- // perhaps this is an error?
- byte data2[] = new byte[numRead];
- System.arraycopy(data, 0, data2, 0, numRead);
- updateBytes(columnIndex, data2);
- }
- }
-
-
- public synchronized void updateBoolean(int columnIndex, boolean x)
- throws SQLException
- {
- updateValue(columnIndex, new Boolean(x));
- }
-
-
- public synchronized void updateByte(int columnIndex, byte x)
- throws SQLException
- {
- updateValue(columnIndex, String.valueOf(x));
- }
-
-
- public synchronized void updateBytes(int columnIndex, byte[] x)
- throws SQLException
- {
- updateValue(columnIndex, x);
- }
-
-
- public synchronized void updateCharacterStream(int columnIndex,
- java.io.Reader x,
- int length
- )
- throws SQLException
- {
- if (x == null)
- {
- updateNull(columnIndex);
- return ;
- }
-
- try
- {
- char data[] = new char[length];
- int numRead = 0;
- while (true)
- {
- int n = x.read(data, numRead, length - numRead);
- if (n == -1)
- break;
-
- numRead += n;
-
- if (numRead == length)
- break;
- }
- updateString(columnIndex, new String(data, 0, numRead));
- }
- catch (IOException ie)
- {
- throw new PSQLException(GT.tr("Provided Reader failed."), null, ie);
- }
- }
-
-
- public synchronized void updateDate(int columnIndex, java.sql.Date x)
- throws SQLException
- {
- updateValue(columnIndex, x);
- }
-
-
- public synchronized void updateDouble(int columnIndex, double x)
- throws SQLException
- {
- updateValue(columnIndex, new Double(x));
- }
-
-
- public synchronized void updateFloat(int columnIndex, float x)
- throws SQLException
- {
- updateValue(columnIndex, new Float(x));
- }
-
-
- public synchronized void updateInt(int columnIndex, int x)
- throws SQLException
- {
- updateValue(columnIndex, new Integer(x));
- }
-
-
- public synchronized void updateLong(int columnIndex, long x)
- throws SQLException
- {
- updateValue(columnIndex, new Long(x));
- }
-
-
- public synchronized void updateNull(int columnIndex)
- throws SQLException
- {
- checkColumnIndex(columnIndex);
- String columnTypeName = connection.getTypeInfo().getPGType(fields[columnIndex - 1].getOID());
- updateValue(columnIndex, new NullObject(columnTypeName));
- }
-
-
- public synchronized void updateObject(int columnIndex, Object x)
- throws SQLException
- {
- updateValue(columnIndex, x);
- }
-
-
- public synchronized void updateObject(int columnIndex, Object x, int scale)
- throws SQLException
- {
- this.updateObject(columnIndex, x);
-
- }
-
-
- public void refreshRow() throws SQLException
- {
- checkUpdateable();
- if (onInsertRow)
- throw new PSQLException(GT.tr("Can''t refresh the insert row."),
- PSQLState.INVALID_CURSOR_STATE);
-
- if (isBeforeFirst() || isAfterLast() || rows.size() == 0)
- return ;
-
- StringBuffer selectSQL = new StringBuffer( "select ");
-
- ResultSetMetaData rsmd = getMetaData();
- PGResultSetMetaData pgmd = (PGResultSetMetaData)rsmd;
- for (int i=1; i <= rsmd.getColumnCount(); i++) {
- if (i > 1) {
- selectSQL.append(", ");
- }
- selectSQL.append( pgmd.getBaseColumnName(i) );
- }
- selectSQL.append(" from " ).append(onlyTable).append(tableName).append(" where ");
-
- int numKeys = primaryKeys.size();
-
- for ( int i = 0; i < numKeys; i++ )
- {
-
- PrimaryKey primaryKey = ((PrimaryKey) primaryKeys.get(i));
- selectSQL.append(primaryKey.name).append("= ?");
-
- if ( i < numKeys - 1 )
- {
- selectSQL.append(" and ");
- }
- }
- if ( connection.getLogger().logDebug() )
- connection.getLogger().debug("selecting " + selectSQL.toString());
- // because updateable result sets do not yet support binary transfers we must request refresh with updateable result set to get field data in correct format
- selectStatement = ((java.sql.Connection) connection).prepareStatement(selectSQL.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
-
-
- for ( int j = 0, i = 1; j < numKeys; j++, i++)
- {
- selectStatement.setObject( i, ((PrimaryKey) primaryKeys.get(j)).getValue() );
- }
-
- AbstractJdbc2ResultSet rs = (AbstractJdbc2ResultSet) selectStatement.executeQuery();
-
- if ( rs.next() )
- {
- rowBuffer = rs.this_row;
- }
-
- rows.set( current_row, rowBuffer );
- this_row = rowBuffer;
-
- connection.getLogger().debug("done updates");
-
- rs.close();
- selectStatement.close();
- selectStatement = null;
-
- }
-
-
- public synchronized void updateRow()
- throws SQLException
- {
- checkUpdateable();
-
- if (onInsertRow)
- {
- throw new PSQLException(GT.tr("Cannot call updateRow() when on the insert row."),
- PSQLState.INVALID_CURSOR_STATE);
- }
-
- if (isBeforeFirst() || isAfterLast() || rows.size() == 0)
- {
- throw new PSQLException(GT.tr("Cannot update the ResultSet because it is either before the start or after the end of the results."),
- PSQLState.INVALID_CURSOR_STATE);
- }
-
- if (!doingUpdates)
- return; // No work pending.
-
- StringBuffer updateSQL = new StringBuffer("UPDATE " + onlyTable + tableName + " SET ");
-
- int numColumns = updateValues.size();
- Iterator columns = updateValues.keySet().iterator();
-
- for (int i = 0; columns.hasNext(); i++ )
- {
- String column = (String) columns.next();
- Utils.appendEscapedIdentifier(updateSQL, column);
- updateSQL.append(" = ?");
-
- if ( i < numColumns - 1 )
- updateSQL.append(", ");
- }
-
- updateSQL.append( " WHERE " );
-
- int numKeys = primaryKeys.size();
-
- for ( int i = 0; i < numKeys; i++ )
- {
- PrimaryKey primaryKey = ((PrimaryKey) primaryKeys.get(i));
- Utils.appendEscapedIdentifier(updateSQL, primaryKey.name);
- updateSQL.append(" = ?");
-
- if ( i < numKeys - 1 )
- updateSQL.append(" and ");
- }
-
- if ( connection.getLogger().logDebug() )
- connection.getLogger().debug("updating " + updateSQL.toString());
- updateStatement = ((java.sql.Connection) connection).prepareStatement(updateSQL.toString());
-
- int i = 0;
- Iterator iterator = updateValues.values().iterator();
- for (; iterator.hasNext(); i++)
- {
- Object o = iterator.next();
- updateStatement.setObject( i + 1, o );
- }
-
- for ( int j = 0; j < numKeys; j++, i++)
- {
- updateStatement.setObject( i + 1, ((PrimaryKey) primaryKeys.get(j)).getValue() );
- }
-
- updateStatement.executeUpdate();
- updateStatement.close();
- updateStatement = null;
-
- updateRowBuffer();
-
- connection.getLogger().debug("copying data");
- System.arraycopy(rowBuffer, 0, this_row, 0, rowBuffer.length);
- rows.set( current_row, rowBuffer );
-
- connection.getLogger().debug("done updates");
- updateValues.clear();
- doingUpdates = false;
- }
-
-
- public synchronized void updateShort(int columnIndex, short x)
- throws SQLException
- {
- updateValue(columnIndex, new Short(x));
- }
-
-
- public synchronized void updateString(int columnIndex, String x)
- throws SQLException
- {
- updateValue(columnIndex, x);
- }
-
-
- public synchronized void updateTime(int columnIndex, Time x)
- throws SQLException
- {
- updateValue(columnIndex, x);
- }
-
-
- public synchronized void updateTimestamp(int columnIndex, Timestamp x)
- throws SQLException
- {
- updateValue(columnIndex, x);
-
- }
-
-
- public synchronized void updateNull(String columnName)
- throws SQLException
- {
- updateNull(findColumn(columnName));
- }
-
-
- public synchronized void updateBoolean(String columnName, boolean x)
- throws SQLException
- {
- updateBoolean(findColumn(columnName), x);
- }
-
-
- public synchronized void updateByte(String columnName, byte x)
- throws SQLException
- {
- updateByte(findColumn(columnName), x);
- }
-
-
- public synchronized void updateShort(String columnName, short x)
- throws SQLException
- {
- updateShort(findColumn(columnName), x);
- }
-
-
- public synchronized void updateInt(String columnName, int x)
- throws SQLException
- {
- updateInt(findColumn(columnName), x);
- }
-
-
- public synchronized void updateLong(String columnName, long x)
- throws SQLException
- {
- updateLong(findColumn(columnName), x);
- }
-
-
- public synchronized void updateFloat(String columnName, float x)
- throws SQLException
- {
- updateFloat(findColumn(columnName), x);
- }
-
-
- public synchronized void updateDouble(String columnName, double x)
- throws SQLException
- {
- updateDouble(findColumn(columnName), x);
- }
-
-
- public synchronized void updateBigDecimal(String columnName, BigDecimal x)
- throws SQLException
- {
- updateBigDecimal(findColumn(columnName), x);
- }
-
-
- public synchronized void updateString(String columnName, String x)
- throws SQLException
- {
- updateString(findColumn(columnName), x);
- }
-
-
- public synchronized void updateBytes(String columnName, byte x[])
- throws SQLException
- {
- updateBytes(findColumn(columnName), x);
- }
-
-
- public synchronized void updateDate(String columnName, java.sql.Date x)
- throws SQLException
- {
- updateDate(findColumn(columnName), x);
- }
-
-
- public synchronized void updateTime(String columnName, java.sql.Time x)
- throws SQLException
- {
- updateTime(findColumn(columnName), x);
- }
-
-
- public synchronized void updateTimestamp(String columnName, java.sql.Timestamp x)
- throws SQLException
- {
- updateTimestamp(findColumn(columnName), x);
- }
-
-
- public synchronized void updateAsciiStream(
- String columnName,
- java.io.InputStream x,
- int length)
- throws SQLException
- {
- updateAsciiStream(findColumn(columnName), x, length);
- }
-
-
- public synchronized void updateBinaryStream(
- String columnName,
- java.io.InputStream x,
- int length)
- throws SQLException
- {
- updateBinaryStream(findColumn(columnName), x, length);
- }
-
-
- public synchronized void updateCharacterStream(
- String columnName,
- java.io.Reader reader,
- int length)
- throws SQLException
- {
- updateCharacterStream(findColumn(columnName), reader, length);
- }
-
-
- public synchronized void updateObject(String columnName, Object x, int scale)
- throws SQLException
- {
- updateObject(findColumn(columnName), x);
- }
-
-
- public synchronized void updateObject(String columnName, Object x)
- throws SQLException
- {
- updateObject(findColumn(columnName), x);
- }
-
-
- /**
- * Is this ResultSet updateable?
- */
-
- boolean isUpdateable() throws SQLException
- {
- checkClosed();
-
- if (resultsetconcurrency == ResultSet.CONCUR_READ_ONLY)
- throw new PSQLException(GT.tr("ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."),
- PSQLState.INVALID_CURSOR_STATE);
-
- if (updateable)
- return true;
-
- connection.getLogger().debug("checking if rs is updateable");
-
- parseQuery();
-
- if ( singleTable == false )
- {
- connection.getLogger().debug("not a single table");
- return false;
- }
-
- connection.getLogger().debug("getting primary keys");
-
- //
- // Contains the primary key?
- //
-
- primaryKeys = new ArrayList();
-
- // this is not stricty jdbc spec, but it will make things much faster if used
- // the user has to select oid, * from table and then we will just use oid
-
-
- usingOID = false;
- int oidIndex = findColumnIndex( "oid" ); // 0 if not present
-
- int i = 0;
-
- // if we find the oid then just use it
-
- //oidIndex will be >0 if the oid was in the select list
- if ( oidIndex > 0 )
- {
- i++;
- primaryKeys.add( new PrimaryKey( oidIndex, "oid" ) );
- usingOID = true;
- }
- else
- {
- // otherwise go and get the primary keys and create a list of keys
- String[] s = quotelessTableName(tableName);
- String quotelessTableName = s[0];
- String quotelessSchemaName = s[1];
- java.sql.ResultSet rs = ((java.sql.Connection) connection).getMetaData().getPrimaryKeys("", quotelessSchemaName, quotelessTableName);
- for (; rs.next(); i++ )
- {
- String columnName = rs.getString(4); // get the columnName
- int index = findColumn( columnName );
-
- if ( index > 0 )
- {
- primaryKeys.add( new PrimaryKey(index, columnName ) ); // get the primary key information
- }
- }
-
- rs.close();
- }
-
- if ( connection.getLogger().logDebug() )
- connection.getLogger().debug( "no of keys=" + i );
-
- if ( i < 1 )
- {
- throw new PSQLException(GT.tr("No primary key found for table {0}.", tableName),
- PSQLState.DATA_ERROR);
- }
-
- updateable = primaryKeys.size() > 0;
-
- if ( connection.getLogger().logDebug() )
- connection.getLogger().debug( "checking primary key " + updateable );
-
- return updateable;
- }
-
- /** Cracks out the table name and schema (if it exists) from a fully
- * qualified table name.
- * @param fullname string that we are trying to crack. Test cases:<pre>
- * Table: table ()
- * "Table": Table ()
- * Schema.Table: table (schema)
- * "Schema"."Table": Table (Schema)
- * "Schema"."Dot.Table": Dot.Table (Schema)
- * Schema."Dot.Table": Dot.Table (schema)
- * </pre>
- * @return String array with element zero always being the tablename and
- * element 1 the schema name which may be a zero length string.
- */
- public static String[] quotelessTableName(String fullname) {
- StringBuffer buf = new StringBuffer(fullname);
- String[] parts = new String[] {null, ""};
- StringBuffer acc = new StringBuffer();
- boolean betweenQuotes = false;
- for (int i = 0; i < buf.length(); i++)
- {
- char c = buf.charAt(i);
- switch (c)
- {
- case '"':
- if ((i < buf.length() - 1) && (buf.charAt(i + 1) == '"'))
- {
- // two consecutive quotes - keep one
- i++;
- acc.append(c); // keep the quote
- }
- else
- { // Discard it
- betweenQuotes = !betweenQuotes;
- }
- break;
- case '.':
- if (betweenQuotes)
- { // Keep it
- acc.append(c);
- }
- else
- { // Have schema name
- parts[1] = acc.toString();
- acc = new StringBuffer();
- }
- break;
- default:
- acc.append((betweenQuotes) ? c : Character.toLowerCase(c));
- break;
- }
- }
- // Always put table in slot 0
- parts[0] = acc.toString();
- return parts;
- }
-
- private void parseQuery()
- {
- String l_sql = originalQuery.toString(null);
- StringTokenizer st = new StringTokenizer(l_sql, " \r\t\n");
- boolean tableFound = false, tablesChecked = false;
- String name = "";
-
- singleTable = true;
-
- while ( !tableFound && !tablesChecked && st.hasMoreTokens() )
- {
- name = st.nextToken();
- if ( !tableFound )
- {
- if ("from".equalsIgnoreCase(name))
- {
- tableName = st.nextToken();
- if ("only".equalsIgnoreCase(tableName)) {
- tableName = st.nextToken();
- onlyTable = "ONLY ";
- }
- tableFound = true;
- }
- }
- else
- {
- tablesChecked = true;
- // if the very next token is , then there are multiple tables
- singleTable = !name.equalsIgnoreCase(",");
- }
- }
- }
-
-
- private void updateRowBuffer() throws SQLException
- {
-
- Iterator columns = updateValues.keySet().iterator();
-
- while ( columns.hasNext() )
- {
- String columnName = (String) columns.next();
- int columnIndex = findColumn( columnName ) - 1;
-
- Object valueObject = updateValues.get(columnName);
- if (valueObject instanceof NullObject)
- {
- rowBuffer[columnIndex] = null;
- }
- else
- {
- switch ( getSQLType(columnIndex + 1) )
- {
-
- //
- // toString() isn't enough for date and time types; we must format it correctly
- // or we won't be able to re-parse it.
- //
-
- case Types.DATE:
- rowBuffer[columnIndex] =
- connection.encodeString(connection.getTimestampUtils().toString(null, (Date)valueObject));
- break;
-
- case Types.TIME:
- rowBuffer[columnIndex] =
- connection.encodeString(connection.getTimestampUtils().toString(null, (Time)valueObject));
- break;
-
- case Types.TIMESTAMP:
- rowBuffer[columnIndex] =
- connection.encodeString(connection.getTimestampUtils().toString(null, (Timestamp)valueObject));
- break;
-
- case Types.NULL:
- // Should never happen?
- break;
-
- case Types.BINARY:
- case Types.LONGVARBINARY:
- case Types.VARBINARY:
- if (isBinary(columnIndex + 1)) {
- rowBuffer[columnIndex] = (byte[]) valueObject;
- } else {
- try {
- rowBuffer[columnIndex] = PGbytea.toPGString((byte[]) valueObject).getBytes("ISO-8859-1");
- } catch (UnsupportedEncodingException e) {
- throw new PSQLException(GT.tr("The JVM claims not to support the encoding: {0}", "ISO-8859-1"), PSQLState.UNEXPECTED_ERROR, e);
- }
- }
- break;
-
- default:
- rowBuffer[columnIndex] = connection.encodeString(String.valueOf( valueObject));
- break;
- }
-
- }
- }
- }
-
- public class CursorResultHandler implements ResultHandler {
- private SQLException error;
-
- public void handleResultRows(Query fromQuery, Field[] fields, List tuples, ResultCursor cursor) {
- AbstractJdbc2ResultSet.this.rows = tuples;
- AbstractJdbc2ResultSet.this.cursor = cursor;
- }
-
- public void handleCommandStatus(String status, int updateCount, long insertOID) {
- handleError(new PSQLException(GT.tr("Unexpected command status: {0}.", status),
- PSQLState.PROTOCOL_VIOLATION));
- }
-
- public void handleWarning(SQLWarning warning) {
- AbstractJdbc2ResultSet.this.addWarning(warning);
- }
-
- public void handleError(SQLException newError) {
- if (error == null)
- error = newError;
- else
- error.setNextException(newError);
- }
-
- public void handleCompletion() throws SQLException {
- if (error != null)
- throw error;
- }
- };
-
-
- public BaseStatement getPGStatement() {
- return statement;
- }
-
- //
- // Backwards compatibility with PGRefCursorResultSet
- //
-
- private String refCursorName;
-
- public String getRefCursor() {
- // Can't check this because the PGRefCursorResultSet
- // interface doesn't allow throwing a SQLException
- //
- // checkClosed();
- return refCursorName;
- }
-
- private void setRefCursor(String refCursorName) {
- this.refCursorName = refCursorName;
- }
-
- public void setFetchSize(int rows) throws SQLException
- {
- checkClosed();
- if (rows < 0)
- throw new PSQLException(GT.tr("Fetch size must be a value greater to or equal to 0."),
- PSQLState.INVALID_PARAMETER_VALUE);
- fetchSize = rows;
- }
-
- public int getFetchSize() throws SQLException
- {
- checkClosed();
- return fetchSize;
- }
-
- public boolean next() throws SQLException
- {
- checkClosed();
-
- if (onInsertRow)
- throw new PSQLException(GT.tr("Can''t use relative move methods while on the insert row."),
- PSQLState.INVALID_CURSOR_STATE);
-
- if (current_row + 1 >= rows.size())
- {
- if (cursor == null || (maxRows > 0 && row_offset + rows.size() >= maxRows))
- {
- current_row = rows.size();
- this_row = null;
- rowBuffer = null;
- return false; // End of the resultset.
- }
-
- // Ask for some more data.
- row_offset += rows.size(); // We are discarding some data.
-
- int fetchRows = fetchSize;
- if (maxRows != 0)
- {
- if (fetchRows == 0 || row_offset + fetchRows > maxRows) // Fetch would exceed maxRows, limit it.
- fetchRows = maxRows - row_offset;
- }
-
- // Execute the fetch and update this resultset.
- connection.getQueryExecutor().fetch(cursor, new CursorResultHandler(), fetchRows);
-
- current_row = 0;
-
- // Test the new rows array.
- if (rows.size() == 0)
- {
- this_row = null;
- rowBuffer = null;
- return false;
- }
- }
- else
- {
- current_row++;
- }
-
- initRowBuffer();
- return true;
- }
-
- public void close() throws SQLException
- {
- //release resources held (memory for tuples)
- rows = null;
- if (cursor != null) {
- cursor.close();
- cursor = null;
- }
- }
-
- public boolean wasNull() throws SQLException
- {
- checkClosed();
- return wasNullFlag;
- }
-
- public String getString(int columnIndex) throws SQLException
- {
- checkResultSet( columnIndex );
- if (wasNullFlag)
- return null;
-
- // varchar in binary is same as text, other binary fields are converted to their text format
- if (isBinary(columnIndex) && getSQLType(columnIndex) != Types.VARCHAR) {
- Object obj = internalGetObject(columnIndex, fields[columnIndex - 1]);
- if (obj == null) {
- return null;
- }
- // hack to be compatible with text protocol
- if (obj instanceof java.util.Date) {
- return connection.getTimestampUtils().timeToString((java.util.Date) obj);
- }
- if ("hstore".equals(getPGType(columnIndex))) {
- return HStoreConverter.toString((Map) obj);
- }
- return trimString(columnIndex, obj.toString());
- }
-
- Encoding encoding = connection.getEncoding();
- try
- {
- return trimString(columnIndex, encoding.decode(this_row[columnIndex - 1]));
- }
- catch (IOException ioe)
- {
- throw new PSQLException(GT.tr("Invalid character data was found. This is most likely caused by stored data containing characters that are invalid for the character set the database was created in. The most common example of this is storing 8bit data in a SQL_ASCII database."), PSQLState.DATA_ERROR, ioe);
- }
- }
-
- public boolean getBoolean(int columnIndex) throws SQLException
- {
- checkResultSet(columnIndex);
- if (wasNullFlag)
- return false; // SQL NULL
-
- if (isBinary(columnIndex)) {
- int col = columnIndex - 1;
- return readDoubleValue(this_row[col], fields[col].getOID(),
- "boolean") == 1;
- }
-
- return toBoolean( getString(columnIndex) );
- }
-
- private static final BigInteger BYTEMAX = new BigInteger(Byte.toString(Byte.MAX_VALUE));
- private static final BigInteger BYTEMIN = new BigInteger(Byte.toString(Byte.MIN_VALUE));
-
- public byte getByte(int columnIndex) throws SQLException
- {
- checkResultSet(columnIndex);
- if (wasNullFlag)
- return 0; // SQL NULL
-
- if (isBinary(columnIndex)) {
- int col = columnIndex - 1;
- // there is no Oid for byte so must always do conversion from
- // some other numeric type
- return (byte)
- readLongValue(this_row[col], fields[col].getOID(), Byte.MIN_VALUE,
- Byte.MAX_VALUE, "byte");
- }
-
- String s = getString(columnIndex);
-
- if (s != null )
- {
- s = s.trim();
- if ( s.length() == 0 )
- return 0;
- try
- {
- // try the optimal parse
- return Byte.parseByte(s);
- }
- catch (NumberFormatException e)
- {
- // didn't work, assume the column is not a byte
- try
- {
- BigDecimal n = new BigDecimal(s);
- BigInteger i = n.toBigInteger();
-
- int gt = i.compareTo(BYTEMAX);
- int lt = i.compareTo(BYTEMIN);
-
- if ( gt > 0 || lt < 0 )
- {
- throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"byte",s}),
- PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
- }
- return i.byteValue();
- }
- catch ( NumberFormatException ex )
- {
- throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"byte",s}),
- PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
- }
- }
- }
- return 0; // SQL NULL
- }
-
- private static final BigInteger SHORTMAX = new BigInteger(Short.toString(Short.MAX_VALUE));
- private static final BigInteger SHORTMIN = new BigInteger(Short.toString(Short.MIN_VALUE));
-
- public short getShort(int columnIndex) throws SQLException
- {
- checkResultSet(columnIndex);
- if (wasNullFlag)
- return 0; // SQL NULL
-
- if (isBinary(columnIndex)) {
- int col = columnIndex - 1;
- int oid = fields[col].getOID();
- if (oid == Oid.INT2) {
- return ByteConverter.int2(this_row[col], 0);
- }
- return (short) readLongValue(this_row[col], oid, Short.MIN_VALUE,
- Short.MAX_VALUE, "short");
- }
-
- String s = getFixedString(columnIndex);
-
- if (s != null)
- {
- s = s.trim();
- try
- {
- return Short.parseShort(s);
- }
- catch (NumberFormatException e)
- {
- try
- {
- BigDecimal n = new BigDecimal(s);
- BigInteger i = n.toBigInteger();
- int gt = i.compareTo(SHORTMAX);
- int lt = i.compareTo(SHORTMIN);
-
- if ( gt > 0 || lt < 0 )
- {
- throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"short",s}),
- PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
- }
- return i.shortValue();
-
- }
- catch ( NumberFormatException ne )
- {
- throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"short",s}),
- PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
- }
- }
- }
- return 0; // SQL NULL
- }
-
- public int getInt(int columnIndex) throws SQLException
- {
- checkResultSet(columnIndex);
- if (wasNullFlag)
- return 0; // SQL NULL
-
- if (isBinary(columnIndex)) {
- int col = columnIndex - 1;
- int oid = fields[col].getOID();
- if (oid == Oid.INT4) {
- return ByteConverter.int4(this_row[col], 0);
- }
- return (int) readLongValue(this_row[col], oid, Integer.MIN_VALUE,
- Integer.MAX_VALUE, "int");
- }
-
- Encoding encoding = connection.getEncoding();
- if (encoding.hasAsciiNumbers()) {
- try {
- return getFastInt(columnIndex);
- } catch (NumberFormatException ex) {
- }
- }
- return toInt( getFixedString(columnIndex) );
- }
-
- public long getLong(int columnIndex) throws SQLException
- {
- checkResultSet(columnIndex);
- if (wasNullFlag)
- return 0; // SQL NULL
-
- if (isBinary(columnIndex)) {
- int col = columnIndex - 1;
- int oid = fields[col].getOID();
- if (oid == Oid.INT8) {
- return ByteConverter.int8(this_row[col], 0);
- }
- return readLongValue(this_row[col], oid, Long.MIN_VALUE,
- Long.MAX_VALUE, "long");
- }
-
- Encoding encoding = connection.getEncoding();
- if (encoding.hasAsciiNumbers()) {
- try {
- return getFastLong(columnIndex);
- } catch (NumberFormatException ex) {
- }
- }
- return toLong( getFixedString(columnIndex) );
- }
-
- /**
- * A dummy exception thrown when fast byte[] to number parsing fails and
- * no value can be returned. The exact stack trace does not matter because
- * the exception is always caught and is not visible to users.
- */
- private static final NumberFormatException FAST_NUMBER_FAILED =
- new NumberFormatException();
-
- /**
- * Optimised byte[] to number parser. This code does not
- * handle null values, so the caller must do checkResultSet
- * and handle null values prior to calling this function.
- *
- * @param columnIndex The column to parse.
- * @return The parsed number.
- * @throws SQLException If an error occurs while fetching column.
- * @throws NumberFormatException If the number is invalid or the
- * out of range for fast parsing. The value must then be parsed by
- * {@link #toLong(String)}.
- */
- private long getFastLong(int columnIndex) throws SQLException,
- NumberFormatException {
-
- byte[] bytes = this_row[columnIndex - 1];
-
- if (bytes.length == 0) {
- throw FAST_NUMBER_FAILED;
- }
-
- long val = 0;
- int start;
- boolean neg;
- if (bytes[0] == '-') {
- neg = true;
- start = 1;
- if (bytes.length == 1 || bytes.length > 19) {
- throw FAST_NUMBER_FAILED;
- }
- } else {
- start = 0;
- neg = false;
- if (bytes.length > 18) {
- throw FAST_NUMBER_FAILED;
- }
- }
-
- while (start < bytes.length) {
- byte b = bytes[start++];
- if (b < '0' || b > '9') {
- throw FAST_NUMBER_FAILED;
- }
-
- val *= 10;
- val += b - '0';
- }
-
- if (neg) {
- val = -val;
- }
-
- return val;
- }
-
- /**
- * Optimised byte[] to number parser. This code does not
- * handle null values, so the caller must do checkResultSet
- * and handle null values prior to calling this function.
- *
- * @param columnIndex The column to parse.
- * @return The parsed number.
- * @throws SQLException If an error occurs while fetching column.
- * @throws NumberFormatException If the number is invalid or the
- * out of range for fast parsing. The value must then be parsed by
- * {@link #toInt(String)}.
- */
- private int getFastInt(int columnIndex) throws SQLException,
- NumberFormatException {
-
- byte[] bytes = this_row[columnIndex - 1];
-
- if (bytes.length == 0) {
- throw FAST_NUMBER_FAILED;
- }
-
- int val = 0;
- int start;
- boolean neg;
- if (bytes[0] == '-') {
- neg = true;
- start = 1;
- if (bytes.length == 1 || bytes.length > 10) {
- throw FAST_NUMBER_FAILED;
- }
- } else {
- start = 0;
- neg = false;
- if (bytes.length > 9) {
- throw FAST_NUMBER_FAILED;
- }
- }
-
- while (start < bytes.length) {
- byte b = bytes[start++];
- if (b < '0' || b > '9') {
- throw FAST_NUMBER_FAILED;
- }
-
- val *= 10;
- val += b - '0';
- }
-
- if (neg) {
- val = -val;
- }
-
- return val;
- }
-
- /**
- * Optimised byte[] to number parser. This code does not
- * handle null values, so the caller must do checkResultSet
- * and handle null values prior to calling this function.
- *
- * @param columnIndex The column to parse.
- * @return The parsed number.
- * @throws SQLException If an error occurs while fetching column.
- * @throws NumberFormatException If the number is invalid or the
- * out of range for fast parsing. The value must then be parsed by
- * {@link #toBigDecimal(String)}.
- */
- private BigDecimal getFastBigDecimal(int columnIndex) throws SQLException,
- NumberFormatException {
-
- byte[] bytes = this_row[columnIndex - 1];
-
- if (bytes.length == 0) {
- throw FAST_NUMBER_FAILED;
- }
-
- int scale = 0;
- long val = 0;
- int start;
- boolean neg;
- if (bytes[0] == '-') {
- neg = true;
- start = 1;
- if (bytes.length == 1 || bytes.length > 19) {
- throw FAST_NUMBER_FAILED;
- }
- } else {
- start = 0;
- neg = false;
- if (bytes.length > 18) {
- throw FAST_NUMBER_FAILED;
- }
- }
-
- int periodsSeen = 0;
- while (start < bytes.length) {
- byte b = bytes[start++];
- if (b < '0' || b > '9') {
- if (b == '.') {
- scale = bytes.length - start;
- periodsSeen++;
- continue;
- } else
- throw FAST_NUMBER_FAILED;
- }
- val *= 10;
- val += b - '0';
- }
-
- int numNonSignChars = neg ? bytes.length - 1 : bytes.length;
- if (periodsSeen > 1 || periodsSeen == numNonSignChars)
- throw FAST_NUMBER_FAILED;
-
- if (neg) {
- val = -val;
- }
-
- return BigDecimal.valueOf(val, scale);
- }
-
- public float getFloat(int columnIndex) throws SQLException
- {
- checkResultSet(columnIndex);
- if (wasNullFlag)
- return 0; // SQL NULL
-
- if (isBinary(columnIndex)) {
- int col = columnIndex - 1;
- int oid = fields[col].getOID();
- if (oid == Oid.FLOAT4) {
- return ByteConverter.float4(this_row[col], 0);
- }
- return (float) readDoubleValue(this_row[col], oid, "float");
- }
-
- return toFloat( getFixedString(columnIndex) );
- }
-
- public double getDouble(int columnIndex) throws SQLException
- {
- checkResultSet(columnIndex);
- if (wasNullFlag)
- return 0; // SQL NULL
-
- if (isBinary(columnIndex)) {
- int col = columnIndex - 1;
- int oid = fields[col].getOID();
- if (oid == Oid.FLOAT8) {
- return ByteConverter.float8(this_row[col], 0);
- }
- return readDoubleValue(this_row[col], oid, "double");
- }
-
- return toDouble( getFixedString(columnIndex) );
- }
-
- public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException
- {
- checkResultSet(columnIndex);
- if (wasNullFlag)
- return null;
-
- Encoding encoding = connection.getEncoding();
- if (encoding.hasAsciiNumbers()) {
- try {
- return getFastBigDecimal(columnIndex);
- } catch (NumberFormatException ex) {
- }
- }
-
- return toBigDecimal( getFixedString(columnIndex), scale );
- }
-
- /*
- * Get the value of a column in the current row as a Java byte array.
- *
- * <p>In normal use, the bytes represent the raw values returned by the
- * backend. However, if the column is an OID, then it is assumed to
- * refer to a Large Object, and that object is returned as a byte array.
- *
- * <p><b>Be warned</b> If the large object is huge, then you may run out
- * of memory.
- *
- * @param columnIndex the first column is 1, the second is 2, ...
- * @return the column value; if the value is SQL NULL, the result
- * is null
- * @exception SQLException if a database access error occurs
- */
- public byte[] getBytes(int columnIndex) throws SQLException
- {
- checkResultSet( columnIndex );
- if (wasNullFlag)
- return null;
-
- if (isBinary(columnIndex))
- {
- //If the data is already binary then just return it
- return this_row[columnIndex - 1];
- }
- else if (connection.haveMinimumCompatibleVersion("7.2"))
- {
- //Version 7.2 supports the bytea datatype for byte arrays
- if (fields[columnIndex - 1].getOID() == Oid.BYTEA)
- {
- return trimBytes(columnIndex, PGbytea.toBytes(this_row[columnIndex - 1]));
- }
- else
- {
- return trimBytes(columnIndex, this_row[columnIndex - 1]);
- }
- }
- else
- {
- //Version 7.1 and earlier supports LargeObjects for byte arrays
- // Handle OID's as BLOBS
- if ( fields[columnIndex - 1].getOID() == Oid.OID)
- {
- LargeObjectManager lom = connection.getLargeObjectAPI();
- LargeObject lob = lom.open(getLong(columnIndex));
- byte buf[] = lob.read(lob.size());
- lob.close();
- return trimBytes(columnIndex, buf);
- }
- else
- {
- return trimBytes(columnIndex, this_row[columnIndex - 1]);
- }
- }
- }
-
- public java.sql.Date getDate(int columnIndex) throws SQLException
- {
- return getDate(columnIndex, null);
- }
-
- public Time getTime(int columnIndex) throws SQLException
- {
- return getTime(columnIndex, null);
- }
-
- public Timestamp getTimestamp(int columnIndex) throws SQLException
- {
- return getTimestamp(columnIndex, null);
- }
-
- public InputStream getAsciiStream(int columnIndex) throws SQLException
- {
- checkResultSet( columnIndex );
- if (wasNullFlag)
- return null;
-
- if (connection.haveMinimumCompatibleVersion("7.2"))
- {
- //Version 7.2 supports AsciiStream for all the PG text types
- //As the spec/javadoc for this method indicate this is to be used for
- //large text values (i.e. LONGVARCHAR) PG doesn't have a separate
- //long string datatype, but with toast the text datatype is capable of
- //handling very large values. Thus the implementation ends up calling
- //getString() since there is no current way to stream the value from the server
- try
- {
- return new ByteArrayInputStream(getString(columnIndex).getBytes("ASCII"));
- }
- catch (UnsupportedEncodingException l_uee)
- {
- throw new PSQLException(GT.tr("The JVM claims not to support the encoding: {0}","ASCII"), PSQLState.UNEXPECTED_ERROR, l_uee);
- }
- }
- else
- {
- // In 7.1 Handle as BLOBS so return the LargeObject input stream
- return getBinaryStream(columnIndex);
- }
- }
-
- public InputStream getUnicodeStream(int columnIndex) throws SQLException
- {
- checkResultSet( columnIndex );
- if (wasNullFlag)
- return null;
-
- if (connection.haveMinimumCompatibleVersion("7.2"))
- {
- //Version 7.2 supports AsciiStream for all the PG text types
- //As the spec/javadoc for this method indicate this is to be used for
- //large text values (i.e. LONGVARCHAR) PG doesn't have a separate
- //long string datatype, but with toast the text datatype is capable of
- //handling very large values. Thus the implementation ends up calling
- //getString() since there is no current way to stream the value from the server
- try
- {
- return new ByteArrayInputStream(getString(columnIndex).getBytes("UTF-8"));
- }
- catch (UnsupportedEncodingException l_uee)
- {
- throw new PSQLException(GT.tr("The JVM claims not to support the encoding: {0}","UTF-8"), PSQLState.UNEXPECTED_ERROR, l_uee);
- }
- }
- else
- {
- // In 7.1 Handle as BLOBS so return the LargeObject input stream
- return getBinaryStream(columnIndex);
- }
- }
-
- public InputStream getBinaryStream(int columnIndex) throws SQLException
- {
- checkResultSet( columnIndex );
- if (wasNullFlag)
- return null;
-
- if (connection.haveMinimumCompatibleVersion("7.2"))
- {
- //Version 7.2 supports BinaryStream for all PG bytea type
- //As the spec/javadoc for this method indicate this is to be used for
- //large binary values (i.e. LONGVARBINARY) PG doesn't have a separate
- //long binary datatype, but with toast the bytea datatype is capable of
- //handling very large values. Thus the implementation ends up calling
- //getBytes() since there is no current way to stream the value from the server
- byte b[] = getBytes(columnIndex);
- if (b != null)
- return new ByteArrayInputStream(b);
- }
- else
- {
- // In 7.1 Handle as BLOBS so return the LargeObject input stream
- if ( fields[columnIndex - 1].getOID() == Oid.OID)
- {
- LargeObjectManager lom = connection.getLargeObjectAPI();
- LargeObject lob = lom.open(getLong(columnIndex));
- return lob.getInputStream();
- }
- }
- return null;
- }
-
- public String getString(String columnName) throws SQLException
- {
- return getString(findColumn(columnName));
- }
-
- public boolean getBoolean(String columnName) throws SQLException
- {
- return getBoolean(findColumn(columnName));
- }
-
- public byte getByte(String columnName) throws SQLException
- {
-
- return getByte(findColumn(columnName));
- }
-
- public short getShort(String columnName) throws SQLException
- {
- return getShort(findColumn(columnName));
- }
-
- public int getInt(String columnName) throws SQLException
- {
- return getInt(findColumn(columnName));
- }
-
- public long getLong(String columnName) throws SQLException
- {
- return getLong(findColumn(columnName));
- }
-
- public float getFloat(String columnName) throws SQLException
- {
- return getFloat(findColumn(columnName));
- }
-
- public double getDouble(String columnName) throws SQLException
- {
- return getDouble(findColumn(columnName));
- }
-
- public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException
- {
- return getBigDecimal(findColumn(columnName), scale);
- }
-
- public byte[] getBytes(String columnName) throws SQLException
- {
- return getBytes(findColumn(columnName));
- }
-
- public java.sql.Date getDate(String columnName) throws SQLException
- {
- return getDate(findColumn(columnName), null);
- }
-
- public Time getTime(String columnName) throws SQLException
- {
- return getTime(findColumn(columnName), null);
- }
-
- public Timestamp getTimestamp(String columnName) throws SQLException
- {
- return getTimestamp(findColumn(columnName), null);
- }
-
- public InputStream getAsciiStream(String columnName) throws SQLException
- {
- return getAsciiStream(findColumn(columnName));
- }
-
- public InputStream getUnicodeStream(String columnName) throws SQLException
- {
- return getUnicodeStream(findColumn(columnName));
- }
-
- public InputStream getBinaryStream(String columnName) throws SQLException
- {
- return getBinaryStream(findColumn(columnName));
- }
-
- public SQLWarning getWarnings() throws SQLException
- {
- checkClosed();
- return warnings;
- }
-
- public void clearWarnings() throws SQLException
- {
- checkClosed();
- warnings = null;
- }
-
- protected void addWarning(SQLWarning warnings)
- {
- if (this.warnings != null)
- this.warnings.setNextWarning(warnings);
- else
- this.warnings = warnings;
- }
-
- public String getCursorName() throws SQLException
- {
- checkClosed();
- return null;
- }
-
- /*
- * Get the value of a column in the current row as a Java object
- *
- * <p>This method will return the value of the given column as a
- * Java object. The type of the Java object will be the default
- * Java Object type corresponding to the column's SQL type, following
- * the mapping specified in the JDBC specification.
- *
- * <p>This method may also be used to read database specific abstract
- * data types.
- *
- * @param columnIndex the first column is 1, the second is 2...
- * @return a Object holding the column value
- * @exception SQLException if a database access error occurs
- */
- public Object getObject(int columnIndex) throws SQLException {
- Field field;
-
- checkResultSet(columnIndex);
- if (wasNullFlag)
- return null;
-
- field = fields[columnIndex - 1];
-
- // some fields can be null, mainly from those returned by MetaData methods
- if (field == null)
- {
- wasNullFlag = true;
- return null;
- }
-
- Object result = internalGetObject(columnIndex, field);
- if (result != null)
- return result;
-
- if (isBinary(columnIndex)) {
- return connection.getObject(getPGType(columnIndex), null, this_row[columnIndex - 1]);
- }
- return connection.getObject(getPGType(columnIndex), getString(columnIndex), null);
- }
-
- public Object getObject(String columnName) throws SQLException
- {
- return getObject(findColumn(columnName));
- }
-
- /*
- * Map a ResultSet column name to a ResultSet column index
- */
- public int findColumn(String columnName) throws SQLException
- {
- checkClosed();
-
- int col = findColumnIndex(columnName);
- if (col == 0)
- throw new PSQLException (GT.tr("The column name {0} was not found in this ResultSet.", columnName),
- PSQLState.UNDEFINED_COLUMN);
- return col;
- }
-
- private int findColumnIndex(String columnName)
- {
- if (columnNameIndexMap == null)
- {
- columnNameIndexMap = new HashMap(fields.length * 2);
- // The JDBC spec says when you have duplicate columns names,
- // the first one should be returned. So load the map in
- // reverse order so the first ones will overwrite later ones.
- for (int i = fields.length - 1; i >= 0; i--)
- {
- columnNameIndexMap.put(fields[i].getColumnLabel().toLowerCase(Locale.US), new Integer(i + 1));
- }
- }
-
- Integer index = (Integer)columnNameIndexMap.get(columnName);
- if (index != null)
- {
- return index.intValue();
- }
-
- index = (Integer)columnNameIndexMap.get(columnName.toLowerCase(Locale.US));
- if (index != null)
- {
- columnNameIndexMap.put(columnName, index);
- return index.intValue();
- }
-
- return 0;
- }
-
- /*
- * returns the OID of a field.<p>
- * It is used internally by the driver.
- */
- public int getColumnOID(int field)
- {
- return fields[field -1].getOID();
- }
-
- /*
- * This is used to fix get*() methods on Money fields. It should only be
- * used by those methods!
- *
- * It converts ($##.##) to -##.## and $##.## to ##.##
- */
- public String getFixedString(int col) throws SQLException
- {
- String s = getString(col);
- if (s == null)
- return null;
-
- // if we don't have at least 2 characters it can't be money.
- if (s.length() < 2)
- return s;
-
- // Handle Money
- char ch = s.charAt(0);
-
- // optimise for non-money type: return immediately with one check
- // if the first char cannot be '(', '$' or '-'
- if (ch > '-') {
- return s;
- }
-
- if (ch == '(')
- {
- s = "-" + PGtokenizer.removePara(s).substring(1);
- }
- else if (ch == '$')
- {
- s = s.substring(1);
- }
- else if (ch == '-' && s.charAt(1) == '$')
- {
- s = "-" + s.substring(2);
- }
-
- return s;
- }
-
- protected String getPGType( int column ) throws SQLException
- {
- return connection.getTypeInfo().getPGType(fields[column - 1].getOID());
- }
-
- protected int getSQLType( int column ) throws SQLException
- {
- return connection.getTypeInfo().getSQLType(fields[column - 1].getOID());
- }
-
- private void checkUpdateable() throws SQLException
- {
- checkClosed();
-
- if (!isUpdateable())
- throw new PSQLException(GT.tr("ResultSet is not updateable. The query that generated this result set must select only one table, and must select all primary keys from that table. See the JDBC 2.1 API Specification, section 5.6 for more details."),
- PSQLState.INVALID_CURSOR_STATE);
-
- if (updateValues == null)
- {
- // allow every column to be updated without a rehash.
- updateValues = new HashMap((int)(fields.length / 0.75), 0.75f);
- }
- }
-
- protected void checkClosed() throws SQLException {
- if (rows == null)
- throw new PSQLException(GT.tr("This ResultSet is closed."), PSQLState.OBJECT_NOT_IN_STATE);
- }
-
- protected void checkColumnIndex(int column) throws SQLException
- {
- if ( column < 1 || column > fields.length )
- throw new PSQLException(GT.tr("The column index is out of range: {0}, number of columns: {1}.", new Object[]{new Integer(column), new Integer(fields.length)}), PSQLState.INVALID_PARAMETER_VALUE );
- }
-
- /**
- * Checks that the result set is not closed, it's positioned on a
- * valid row and that the given column number is valid. Also
- * updates the {@link #wasNullFlag} to correct value.
- *
- * @param column The column number to check. Range starts from 1.
- * @throws SQLException If state or column is invalid.
- */
- protected void checkResultSet( int column ) throws SQLException
- {
- checkClosed();
- if ( this_row == null )
- throw new PSQLException(GT.tr("ResultSet not positioned properly, perhaps you need to call next."),
- PSQLState.INVALID_CURSOR_STATE);
- checkColumnIndex(column);
- wasNullFlag = (this_row[column - 1] == null);
- }
-
- /**
- * Returns true if the value of the given column is in binary format.
- *
- * @param column The column to check. Range starts from 1.
- * @return True if the column is in binary format.
- */
- protected boolean isBinary(int column) {
- return fields[column - 1].getFormat() == Field.BINARY_FORMAT;
- }
-
- //----------------- Formatting Methods -------------------
-
- public static boolean toBoolean(String s)
- {
- if (s != null)
- {
- s = s.trim();
-
- if (s.equalsIgnoreCase("t") || s.equalsIgnoreCase("true") || s.equals("1"))
- return true;
-
- if (s.equalsIgnoreCase("f") || s.equalsIgnoreCase("false") || s.equals("0"))
- return false;
-
- try
- {
- if (Double.valueOf(s).doubleValue() == 1)
- return true;
- }
- catch (NumberFormatException e)
- {
- }
- }
- return false; // SQL NULL
- }
-
- private static final BigInteger INTMAX = new BigInteger(Integer.toString(Integer.MAX_VALUE));
- private static final BigInteger INTMIN = new BigInteger(Integer.toString(Integer.MIN_VALUE));
-
- public static int toInt(String s) throws SQLException
- {
- if (s != null)
- {
- try
- {
- s = s.trim();
- return Integer.parseInt(s);
- }
- catch (NumberFormatException e)
- {
- try
- {
- BigDecimal n = new BigDecimal(s);
- BigInteger i = n.toBigInteger();
-
- int gt = i.compareTo(INTMAX);
- int lt = i.compareTo(INTMIN);
-
- if (gt > 0 || lt < 0)
- {
- throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"int",s}),
- PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
- }
- return i.intValue();
-
- }
- catch ( NumberFormatException ne )
- {
- throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"int",s}),
- PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
- }
- }
- }
- return 0; // SQL NULL
- }
- private final static BigInteger LONGMAX = new BigInteger(Long.toString(Long.MAX_VALUE));
- private final static BigInteger LONGMIN = new BigInteger(Long.toString(Long.MIN_VALUE));
-
- public static long toLong(String s) throws SQLException
- {
- if (s != null)
- {
- try
- {
- s = s.trim();
- return Long.parseLong(s);
- }
- catch (NumberFormatException e)
- {
- try
- {
- BigDecimal n = new BigDecimal(s);
- BigInteger i = n.toBigInteger();
- int gt = i.compareTo(LONGMAX);
- int lt = i.compareTo(LONGMIN);
-
- if ( gt > 0 || lt < 0 )
- {
- throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"long",s}),
- PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
- }
- return i.longValue();
- }
- catch ( NumberFormatException ne )
- {
- throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"long",s}),
- PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
- }
- }
- }
- return 0; // SQL NULL
- }
-
- public static BigDecimal toBigDecimal(String s, int scale) throws SQLException
- {
- BigDecimal val;
- if (s != null)
- {
- try
- {
- s = s.trim();
- val = new BigDecimal(s);
- }
- catch (NumberFormatException e)
- {
- throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"BigDecimal",s}),
- PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
- }
- if (scale == -1)
- return val;
- try
- {
- return val.setScale(scale);
- }
- catch (ArithmeticException e)
- {
- throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"BigDecimal",s}),
- PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
- }
- }
- return null; // SQL NULL
- }
-
- public static float toFloat(String s) throws SQLException
- {
- if (s != null)
- {
- try
- {
- s = s.trim();
- return Float.parseFloat(s);
- }
- catch (NumberFormatException e)
- {
- throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"float",s}),
- PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
- }
- }
- return 0; // SQL NULL
- }
-
- public static double toDouble(String s) throws SQLException
- {
- if (s != null)
- {
- try
- {
- s = s.trim();
- return Double.parseDouble(s);
- }
- catch (NumberFormatException e)
- {
- throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"double",s}),
- PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
- }
- }
- return 0; // SQL NULL
- }
-
- private void initRowBuffer()
- {
- this_row = (byte[][]) rows.get(current_row);
- // We only need a copy of the current row if we're going to
- // modify it via an updatable resultset.
- if (resultsetconcurrency == ResultSet.CONCUR_UPDATABLE) {
- rowBuffer = new byte[this_row.length][];
- System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length);
- } else {
- rowBuffer = null;
- }
- }
-
- private boolean isColumnTrimmable(int columnIndex) throws SQLException
- {
- switch (getSQLType(columnIndex))
- {
- case Types.CHAR:
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- case Types.BINARY:
- case Types.VARBINARY:
- case Types.LONGVARBINARY:
- return true;
- }
- return false;
- }
-
- private byte[] trimBytes(int p_columnIndex, byte[] p_bytes) throws SQLException
- {
- //we need to trim if maxsize is set and the length is greater than maxsize and the
- //type of this column is a candidate for trimming
- if (maxFieldSize > 0 && p_bytes.length > maxFieldSize && isColumnTrimmable(p_columnIndex))
- {
- byte[] l_bytes = new byte[maxFieldSize];
- System.arraycopy (p_bytes, 0, l_bytes, 0, maxFieldSize);
- return l_bytes;
- }
- else
- {
- return p_bytes;
- }
- }
-
- private String trimString(int p_columnIndex, String p_string) throws SQLException
- {
- //we need to trim if maxsize is set and the length is greater than maxsize and the
- //type of this column is a candidate for trimming
- if (maxFieldSize > 0 && p_string.length() > maxFieldSize && isColumnTrimmable(p_columnIndex))
- {
- return p_string.substring(0, maxFieldSize);
- }
- else
- {
- return p_string;
- }
- }
-
- /**
- * Converts any numeric binary field to double value. This method
- * does no overflow checking.
- *
- * @param bytes The bytes of the numeric field.
- * @param oid The oid of the field.
- * @param targetType The target type. Used for error reporting.
- * @return The value as double.
- * @throws PSQLException If the field type is not supported numeric type.
- */
- private double readDoubleValue(byte[] bytes, int oid,
- String targetType) throws PSQLException {
- // currently implemented binary encoded fields
- switch (oid) {
- case Oid.INT2:
- return ByteConverter.int2(bytes, 0);
- case Oid.INT4:
- return ByteConverter.int4(bytes, 0);
- case Oid.INT8:
- // might not fit but there still should be no overflow checking
- return ByteConverter.int8(bytes, 0);
- case Oid.FLOAT4:
- return ByteConverter.float4(bytes, 0);
- case Oid.FLOAT8:
- return ByteConverter.float8(bytes, 0);
- }
- throw new PSQLException (GT.tr("Cannot convert the column of type {0} to requested type {1}.",
- new Object[]{Oid.toString(oid), targetType}),
- PSQLState.DATA_TYPE_MISMATCH);
- }
-
- /**
- * Converts any numeric binary field to long value.
- * <p>
- * This method is used by getByte,getShort,getInt and getLong.
- * It must support a subset of the following java types that use Binary
- * encoding. (fields that use text encoding use a different code path).
- * <p>
- * <code>byte,short,int,long,float,double,BigDecimal,boolean,string</code>.
-
- * @param bytes The bytes of the numeric field.
- * @param oid The oid of the field.
- * @param minVal the minimum value allowed.
- * @param minVal the maximum value allowed.
- * @param targetType The target type. Used for error reporting.
- * @return The value as long.
- * @throws PSQLException If the field type is not supported numeric type
- * or if the value is out of range.
- */
- private long readLongValue(byte[] bytes, int oid, long minVal, long maxVal,
- String targetType)
- throws PSQLException {
- long val;
- // currently implemented binary encoded fields
- switch (oid) {
- case Oid.INT2:
- val = ByteConverter.int2(bytes, 0);
- break;
- case Oid.INT4:
- val = ByteConverter.int4(bytes, 0);
- break;
- case Oid.INT8:
- val = ByteConverter.int8(bytes, 0);
- break;
- case Oid.FLOAT4:
- val = (long) ByteConverter.float4(bytes, 0);
- break;
- case Oid.FLOAT8:
- val = (long) ByteConverter.float8(bytes, 0);
- break;
- default:
- throw new PSQLException (GT.tr("Cannot convert the column of type {0} to requested type {1}.",
- new Object[]{Oid.toString(oid), targetType}),
- PSQLState.DATA_TYPE_MISMATCH);
- }
- if (val < minVal || val > maxVal) {
- throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{targetType, new Long(val)}),
- PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
- }
- return val;
- }
-
- protected void updateValue(int columnIndex, Object value) throws SQLException {
- checkUpdateable();
-
- if (!onInsertRow && (isBeforeFirst() || isAfterLast() || rows.size() == 0))
- {
- throw new PSQLException(GT.tr("Cannot update the ResultSet because it is either before the start or after the end of the results."),
- PSQLState.INVALID_CURSOR_STATE);
- }
-
- checkColumnIndex(columnIndex);
-
- doingUpdates = !onInsertRow;
- if (value == null) {
- updateNull(columnIndex);
- } else {
- PGResultSetMetaData md = (PGResultSetMetaData)getMetaData();
- updateValues.put(md.getBaseColumnName(columnIndex), value);
- }
- }
-
- /**
- * Newer JVMs will return a java.util.UUID object, but it isn't
- * available in older versions.
- */
- protected Object getUUID(String data) throws SQLException
- {
- return data;
- }
-
- /**
- * Newer JVMs will return a java.util.UUID object, but it isn't
- * available in older versions.
- */
- protected Object getUUID(byte[] data) throws SQLException
- {
- return data;
- }
-
- private class PrimaryKey
- {
- int index; // where in the result set is this primaryKey
- String name; // what is the columnName of this primary Key
-
- PrimaryKey( int index, String name)
- {
- this.index = index;
- this.name = name;
- }
- Object getValue() throws SQLException
- {
- return getObject(index);
- }
- };
-
- //
- // We need to specify the type of NULL when updating a column to NULL, so
- // NullObject is a simple extension of PGobject that always returns null
- // values but retains column type info.
- //
-
- static class NullObject extends PGobject {
- NullObject(String type) {
- setType(type);
- }
-
- public String getValue() {
- return null;
- }
- };
-
- /**
- * Used to add rows to an already existing ResultSet that exactly
- * match the existing rows. Currently only used for assembling
- * generated keys from batch statement execution.
- */
- void addRows(List tuples) {
- rows.addAll(tuples);
- }
-
-
- public void registerRealStatement(Statement realStatement) {
- this.realStatement = realStatement;
- }
-
-}
-
diff --git a/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java b/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java
deleted file mode 100644
index 160f2d1..0000000
--- a/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java
+++ /dev/null
@@ -1,473 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc2;
-
-import org.postgresql.PGResultSetMetaData;
-import org.postgresql.core.*;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-import java.sql.*;
-import org.postgresql.util.GT;
-
-public abstract class AbstractJdbc2ResultSetMetaData implements PGResultSetMetaData
-{
- protected final BaseConnection connection;
- protected final Field[] fields;
-
- private boolean fieldInfoFetched;
-
- /*
- * Initialise for a result with a tuple set and
- * a field descriptor set
- *
- * @param fields the array of field descriptors
- */
- public AbstractJdbc2ResultSetMetaData(BaseConnection connection, Field[] fields)
- {
- this.connection = connection;
- this.fields = fields;
- fieldInfoFetched = false;
- }
-
- /*
- * Whats the number of columns in the ResultSet?
- *
- * @return the number
- * @exception SQLException if a database access error occurs
- */
- public int getColumnCount() throws SQLException
- {
- return fields.length;
- }
-
- /*
- * Is the column automatically numbered (and thus read-only)
- * I believe that PostgreSQL does not support this feature.
- *
- * @param column the first column is 1, the second is 2...
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean isAutoIncrement(int column) throws SQLException
- {
- fetchFieldMetaData();
- Field field = getField(column);
- return field.getAutoIncrement();
- }
-
- /*
- * Does a column's case matter? ASSUMPTION: Any field that is
- * not obviously case insensitive is assumed to be case sensitive
- *
- * @param column the first column is 1, the second is 2...
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean isCaseSensitive(int column) throws SQLException
- {
- Field field = getField(column);
- return connection.getTypeInfo().isCaseSensitive(field.getOID());
- }
-
- /*
- * Can the column be used in a WHERE clause? Basically for
- * this, I split the functions into two types: recognised
- * types (which are always useable), and OTHER types (which
- * may or may not be useable). The OTHER types, for now, I
- * will assume they are useable. We should really query the
- * catalog to see if they are useable.
- *
- * @param column the first column is 1, the second is 2...
- * @return true if they can be used in a WHERE clause
- * @exception SQLException if a database access error occurs
- */
- public boolean isSearchable(int column) throws SQLException
- {
- return true;
- }
-
- /*
- * Is the column a cash value? 6.1 introduced the cash/money
- * type, which haven't been incorporated as of 970414, so I
- * just check the type name for both 'cash' and 'money'
- *
- * @param column the first column is 1, the second is 2...
- * @return true if its a cash column
- * @exception SQLException if a database access error occurs
- */
- public boolean isCurrency(int column) throws SQLException
- {
- String type_name = getPGType(column);
-
- return type_name.equals("cash") || type_name.equals("money");
- }
-
- /*
- * Indicates the nullability of values in the designated column.
- *
- * @param column the first column is 1, the second is 2...
- * @return one of the columnNullable values
- * @exception SQLException if a database access error occurs
- */
- public int isNullable(int column) throws SQLException
- {
- fetchFieldMetaData();
- Field field = getField(column);
- return field.getNullable();
- }
-
- /*
- * Is the column a signed number? In PostgreSQL, all numbers
- * are signed, so this is trivial. However, strings are not
- * signed (duh!)
- *
- * @param column the first column is 1, the second is 2...
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean isSigned(int column) throws SQLException
- {
- Field field = getField(column);
- return connection.getTypeInfo().isSigned(field.getOID());
- }
-
- /*
- * What is the column's normal maximum width in characters?
- *
- * @param column the first column is 1, the second is 2, etc.
- * @return the maximum width
- * @exception SQLException if a database access error occurs
- */
- public int getColumnDisplaySize(int column) throws SQLException
- {
- Field field = getField(column);
- return connection.getTypeInfo().getDisplaySize(field.getOID(), field.getMod());
- }
-
- /*
- * @param column the first column is 1, the second is 2, etc.
- * @return the column label
- * @exception SQLException if a database access error occurs
- */
- public String getColumnLabel(int column) throws SQLException
- {
- Field field = getField(column);
- return field.getColumnLabel();
- }
-
- /*
- * What's a column's name?
- *
- * @param column the first column is 1, the second is 2, etc.
- * @return the column name
- * @exception SQLException if a database access error occurs
- */
- public String getColumnName(int column) throws SQLException
- {
- return getColumnLabel(column);
- }
-
- public String getBaseColumnName(int column) throws SQLException {
- fetchFieldMetaData();
- Field field = getField(column);
- return field.getColumnName();
- }
-
- /*
- * @param column the first column is 1, the second is 2...
- * @return the Schema Name
- * @exception SQLException if a database access error occurs
- */
- public String getSchemaName(int column) throws SQLException
- {
- return "";
- }
-
- private void fetchFieldMetaData() throws SQLException {
- if (fieldInfoFetched)
- return;
-
- fieldInfoFetched = true;
-
- StringBuffer sql = new StringBuffer();
- sql.append("SELECT c.oid, a.attnum, a.attname, c.relname, n.nspname, ");
- sql.append("a.attnotnull OR (t.typtype = 'd' AND t.typnotnull), ");
- sql.append("pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%nextval(%' ");
- sql.append("FROM pg_catalog.pg_class c ");
- sql.append("JOIN pg_catalog.pg_namespace n ON (c.relnamespace = n.oid) ");
- sql.append("JOIN pg_catalog.pg_attribute a ON (c.oid = a.attrelid) ");
- sql.append("JOIN pg_catalog.pg_type t ON (a.atttypid = t.oid) ");
- sql.append("LEFT JOIN pg_catalog.pg_attrdef d ON (d.adrelid = a.attrelid AND d.adnum = a.attnum) ");
- sql.append("JOIN (");
-
- // 7.4 servers don't support row IN operations (a,b) IN ((c,d),(e,f))
- // so we've got to fake that with a JOIN here.
- //
- boolean hasSourceInfo = false;
- for (int i=0; i<fields.length; i++) {
- if (fields[i].getTableOid() == 0)
- continue;
-
- if (hasSourceInfo)
- sql.append(" UNION ALL ");
-
- sql.append("SELECT ");
- sql.append(fields[i].getTableOid());
- if (!hasSourceInfo)
- sql.append(" AS oid ");
- sql.append(", ");
- sql.append(fields[i].getPositionInTable());
- if (!hasSourceInfo)
- sql.append(" AS attnum");
-
- if (!hasSourceInfo)
- hasSourceInfo = true;
- }
- sql.append(") vals ON (c.oid = vals.oid AND a.attnum = vals.attnum) ");
-
- if (!hasSourceInfo)
- return;
-
- Statement stmt = connection.createStatement();
- ResultSet rs = stmt.executeQuery(sql.toString());
- while (rs.next()) {
- int table = (int)rs.getLong(1);
- int column = (int)rs.getLong(2);
- String columnName = rs.getString(3);
- String tableName = rs.getString(4);
- String schemaName = rs.getString(5);
- int nullable = rs.getBoolean(6) ? ResultSetMetaData.columnNoNulls : ResultSetMetaData.columnNullable;
- boolean autoIncrement = rs.getBoolean(7);
- for (int i=0; i<fields.length; i++) {
- if (fields[i].getTableOid() == table && fields[i].getPositionInTable() == column) {
- fields[i].setColumnName(columnName);
- fields[i].setTableName(tableName);
- fields[i].setSchemaName(schemaName);
- fields[i].setNullable(nullable);
- fields[i].setAutoIncrement(autoIncrement);
- }
- }
- }
- }
-
- public String getBaseSchemaName(int column) throws SQLException
- {
- fetchFieldMetaData();
- Field field = getField(column);
- return field.getSchemaName();
- }
-
- /*
- * What is a column's number of decimal digits.
- *
- * @param column the first column is 1, the second is 2...
- * @return the precision
- * @exception SQLException if a database access error occurs
- */
- public int getPrecision(int column) throws SQLException
- {
- Field field = getField(column);
- return connection.getTypeInfo().getPrecision(field.getOID(), field.getMod());
- }
-
- /*
- * What is a column's number of digits to the right of the
- * decimal point?
- *
- * @param column the first column is 1, the second is 2...
- * @return the scale
- * @exception SQLException if a database access error occurs
- */
- public int getScale(int column) throws SQLException
- {
- Field field = getField(column);
- return connection.getTypeInfo().getScale(field.getOID(), field.getMod());
- }
-
- /*
- * @param column the first column is 1, the second is 2...
- * @return column name, or "" if not applicable
- * @exception SQLException if a database access error occurs
- */
- public String getTableName(int column) throws SQLException
- {
- return "";
- }
-
- public String getBaseTableName(int column) throws SQLException
- {
- fetchFieldMetaData();
- Field field = getField(column);
- return field.getTableName();
- }
-
- /*
- * What's a column's table's catalog name? As with getSchemaName(),
- * we can say that if getTableName() returns n/a, then we can too -
- * otherwise, we need to work on it.
- *
- * @param column the first column is 1, the second is 2...
- * @return catalog name, or "" if not applicable
- * @exception SQLException if a database access error occurs
- */
- public String getCatalogName(int column) throws SQLException
- {
- return "";
- }
-
- /*
- * What is a column's SQL Type? (java.sql.Type int)
- *
- * @param column the first column is 1, the second is 2, etc.
- * @return the java.sql.Type value
- * @exception SQLException if a database access error occurs
- * @see org.postgresql.Field#getSQLType
- * @see java.sql.Types
- */
- public int getColumnType(int column) throws SQLException
- {
- return getSQLType(column);
- }
-
- /*
- * Whats is the column's data source specific type name?
- *
- * @param column the first column is 1, the second is 2, etc.
- * @return the type name
- * @exception SQLException if a database access error occurs
- */
- public String getColumnTypeName(int column) throws SQLException
- {
- String type = getPGType(column);
- if (isAutoIncrement(column)) {
- if ("int4".equals(type)) {
- return "serial";
- } else if ("int8".equals(type)) {
- return "bigserial";
- }
- }
-
- return type;
- }
-
- /*
- * Is the column definitely not writable? In reality, we would
- * have to check the GRANT/REVOKE stuff for this to be effective,
- * and I haven't really looked into that yet, so this will get
- * re-visited.
- *
- * @param column the first column is 1, the second is 2, etc.
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean isReadOnly(int column) throws SQLException
- {
- return false;
- }
-
- /*
- * Is it possible for a write on the column to succeed? Again, we
- * would in reality have to check the GRANT/REVOKE stuff, which
- * I haven't worked with as yet. However, if it isn't ReadOnly, then
- * it is obviously writable.
- *
- * @param column the first column is 1, the second is 2, etc.
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean isWritable(int column) throws SQLException
- {
- return !isReadOnly(column);
- }
-
- /*
- * Will a write on this column definately succeed? Hmmm...this
- * is a bad one, since the two preceding functions have not been
- * really defined. I cannot tell is the short answer. I thus
- * return isWritable() just to give us an idea.
- *
- * @param column the first column is 1, the second is 2, etc..
- * @return true if so
- * @exception SQLException if a database access error occurs
- */
- public boolean isDefinitelyWritable(int column) throws SQLException
- {
- return false;
- }
-
- // ********************************************************
- // END OF PUBLIC INTERFACE
- // ********************************************************
-
- /*
- * For several routines in this package, we need to convert
- * a columnIndex into a Field[] descriptor. Rather than do
- * the same code several times, here it is.
- *
- * @param columnIndex the first column is 1, the second is 2...
- * @return the Field description
- * @exception SQLException if a database access error occurs
- */
- protected Field getField(int columnIndex) throws SQLException
- {
- if (columnIndex < 1 || columnIndex > fields.length)
- throw new PSQLException(GT.tr("The column index is out of range: {0}, number of columns: {1}.", new Object[]{new Integer(columnIndex), new Integer(fields.length)}), PSQLState.INVALID_PARAMETER_VALUE );
- return fields[columnIndex - 1];
- }
-
- protected String getPGType(int columnIndex) throws SQLException
- {
- return connection.getTypeInfo().getPGType(getField(columnIndex).getOID());
- }
-
- protected int getSQLType(int columnIndex) throws SQLException
- {
- return connection.getTypeInfo().getSQLType(getField(columnIndex).getOID());
- }
-
-
- // ** JDBC 2 Extensions **
-
- // This can hook into our PG_Object mechanism
- /**
- * Returns the fully-qualified name of the Java class whose instances
- * are manufactured if the method <code>ResultSet.getObject</code>
- * is called to retrieve a value from the column.
- *
- * <code>ResultSet.getObject</code> may return a subclass of the class
- * returned by this method.
- *
- * @param column the first column is 1, the second is 2, ...
- * @return the fully-qualified name of the class in the Java programming
- * language that would be used by the method
- * <code>ResultSet.getObject</code> to retrieve the value in the specified
- * column. This is the class name used for custom mapping.
- * @exception SQLException if a database access error occurs
- */
- public String getColumnClassName(int column) throws SQLException
- {
- Field field = getField(column);
- String result = connection.getTypeInfo().getJavaClass(field.getOID());
-
- if (result != null)
- return result;
-
- int sqlType = getSQLType(column);
- switch(sqlType) {
- case Types.ARRAY:
- return ("java.sql.Array");
- default:
- String type = getPGType(column);
- if ("unknown".equals(type)) {
- return ("java.lang.String");
- }
- return ("java.lang.Object");
- }
- }
-}
-
diff --git a/org/postgresql/jdbc2/AbstractJdbc2Statement.java b/org/postgresql/jdbc2/AbstractJdbc2Statement.java
deleted file mode 100644
index bf710b9..0000000
--- a/org/postgresql/jdbc2/AbstractJdbc2Statement.java
+++ /dev/null
@@ -1,3427 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc2;
-
-
-import java.io.*;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.math.*;
-import java.sql.*;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.TimerTask;
-import java.util.TimeZone;
-import java.util.Calendar;
-
-import org.postgresql.Driver;
-import org.postgresql.largeobject.*;
-import org.postgresql.core.*;
-import org.postgresql.core.types.*;
-import org.postgresql.util.ByteConverter;
-import org.postgresql.util.HStoreConverter;
-import org.postgresql.util.PGBinaryObject;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.PGobject;
-import org.postgresql.util.GT;
-
-/**
- * This class defines methods of the jdbc2 specification.
- * The real Statement class (for jdbc2) is org.postgresql.jdbc2.Jdbc2Statement
- */
-public abstract class AbstractJdbc2Statement implements BaseStatement
-{
- // only for testing purposes. even single shot statements will use binary transfers
- public static final boolean ForceBinaryTransfers = Boolean.getBoolean("org.postgresql.forcebinary");
-
- protected ArrayList batchStatements = null;
- protected ArrayList batchParameters = null;
- protected final int resultsettype; // the resultset type to return (ResultSet.TYPE_xxx)
- protected final int concurrency; // is it updateable or not? (ResultSet.CONCUR_xxx)
- protected int fetchdirection = ResultSet.FETCH_FORWARD; // fetch direction hint (currently ignored)
- private volatile TimerTask cancelTimer=null;
-
- /**
- * Does the caller of execute/executeUpdate want generated keys for this
- * execution? This is set by Statement methods that have generated keys
- * arguments and cleared after execution is complete.
- */
- protected boolean wantsGeneratedKeysOnce = false;
-
- /**
- * Was this PreparedStatement created to return generated keys for every
- * execution? This is set at creation time and never cleared by
- * execution.
- */
- public boolean wantsGeneratedKeysAlways = false;
-
- // The connection who created us
- protected BaseConnection connection;
-
- /** The warnings chain. */
- protected SQLWarning warnings = null;
- /** The last warning of the warning chain. */
- protected SQLWarning lastWarning = null;
-
- /** Maximum number of rows to return, 0 = unlimited */
- protected int maxrows = 0;
-
- /** Number of rows to get in a batch. */
- protected int fetchSize = 0;
-
- /** Timeout (in seconds) for a query (not used) */
- protected int timeout = 0;
-
- protected boolean replaceProcessingEnabled = true;
-
- /** The current results. */
- protected ResultWrapper result = null;
-
- /** The first unclosed result. */
- protected ResultWrapper firstUnclosedResult = null;
-
- /** Results returned by a statement that wants generated keys. */
- protected ResultWrapper generatedKeys = null;
-
- /** used to differentiate between new function call
- * logic and old function call logic
- * will be set to true if the server is < 8.1 or
- * if we are using v2 protocol
- * There is an exception to this where we are using v3, and the
- * call does not have an out parameter before the call
- */
- protected boolean adjustIndex = false;
-
- /*
- * Used to set adjustIndex above
- */
- protected boolean outParmBeforeFunc=false;
-
- // Static variables for parsing SQL when replaceProcessing is true.
- private static final short IN_SQLCODE = 0;
- private static final short IN_STRING = 1;
- private static final short IN_IDENTIFIER = 6;
- private static final short BACKSLASH = 2;
- private static final short ESC_TIMEDATE = 3;
- private static final short ESC_FUNCTION = 4;
- private static final short ESC_OUTERJOIN = 5;
- private static final short ESC_ESCAPECHAR = 7;
-
- protected final Query preparedQuery; // Query fragments for prepared statement.
- protected final ParameterList preparedParameters; // Parameter values for prepared statement.
- protected Query lastSimpleQuery;
-
- protected int m_prepareThreshold; // Reuse threshold to enable use of PREPARE
- protected int m_useCount = 0; // Number of times this statement has been used
-
- //Used by the callablestatement style methods
- private boolean isFunction;
- // functionReturnType contains the user supplied value to check
- // testReturn contains a modified version to make it easier to
- // check the getXXX methods..
- private int []functionReturnType;
- private int []testReturn;
- // returnTypeSet is true when a proper call to registerOutParameter has been made
- private boolean returnTypeSet;
- protected Object []callResult;
- protected int maxfieldSize = 0;
-
- public ResultSet createDriverResultSet(Field[] fields, List tuples)
- throws SQLException
- {
- return createResultSet(null, fields, tuples, null);
- }
-
- public AbstractJdbc2Statement (AbstractJdbc2Connection c, int rsType, int rsConcurrency) throws SQLException
- {
- this.connection = c;
- this.preparedQuery = null;
- this.preparedParameters = null;
- this.lastSimpleQuery = null;
- resultsettype = rsType;
- concurrency = rsConcurrency;
- }
-
- public AbstractJdbc2Statement(AbstractJdbc2Connection connection, String sql, boolean isCallable, int rsType, int rsConcurrency) throws SQLException
- {
- this.connection = connection;
- this.lastSimpleQuery = null;
-
- String parsed_sql = replaceProcessing(sql);
- if (isCallable)
- parsed_sql = modifyJdbcCall(parsed_sql);
-
- this.preparedQuery = connection.getQueryExecutor().createParameterizedQuery(parsed_sql);
- this.preparedParameters = preparedQuery.createParameterList();
-
- int inParamCount = preparedParameters.getInParameterCount() + 1;
- this.testReturn = new int[inParamCount];
- this.functionReturnType = new int[inParamCount];
-
-
- resultsettype = rsType;
- concurrency = rsConcurrency;
- }
-
- public abstract ResultSet createResultSet(Query originalQuery, Field[] fields, List tuples, ResultCursor cursor)
- throws SQLException;
-
-
- public BaseConnection getPGConnection() {
- return connection;
- }
-
- public String getFetchingCursorName() {
- return null;
- }
-
- public int getFetchSize() {
- return fetchSize;
- }
-
- protected boolean wantsScrollableResultSet() {
- return resultsettype != ResultSet.TYPE_FORWARD_ONLY;
- }
-
- protected boolean wantsHoldableResultSet() {
- return false;
- }
-
- //
- // ResultHandler implementations for updates, queries, and either-or.
- //
-
- public class StatementResultHandler implements ResultHandler {
- private SQLException error;
- private ResultWrapper results;
-
- ResultWrapper getResults() {
- return results;
- }
-
- private void append(ResultWrapper newResult) {
- if (results == null)
- results = newResult;
- else
- results.append(newResult);
- }
-
- public void handleResultRows(Query fromQuery, Field[] fields, List tuples, ResultCursor cursor) {
- try
- {
- ResultSet rs = AbstractJdbc2Statement.this.createResultSet(fromQuery, fields, tuples, cursor);
- append(new ResultWrapper(rs));
- }
- catch (SQLException e)
- {
- handleError(e);
- }
- }
-
- public void handleCommandStatus(String status, int updateCount, long insertOID) {
- append(new ResultWrapper(updateCount, insertOID));
- }
-
- public void handleWarning(SQLWarning warning) {
- AbstractJdbc2Statement.this.addWarning(warning);
- }
-
- public void handleError(SQLException newError) {
- if (error == null)
- error = newError;
- else
- error.setNextException(newError);
- }
-
- public void handleCompletion() throws SQLException {
- if (error != null)
- throw error;
- }
- }
-
- /*
- * Execute a SQL statement that retruns a single ResultSet
- *
- * @param sql typically a static SQL SELECT statement
- * @return a ResulSet that contains the data produced by the query
- * @exception SQLException if a database access error occurs
- */
- public java.sql.ResultSet executeQuery(String p_sql) throws SQLException
- {
- if (preparedQuery != null)
- throw new PSQLException(GT.tr("Can''t use query methods that take a query string on a PreparedStatement."),
- PSQLState.WRONG_OBJECT_TYPE);
-
- if (ForceBinaryTransfers) {
- clearWarnings();
- // Close any existing resultsets associated with this statement.
- while (firstUnclosedResult != null)
- {
- if (firstUnclosedResult.getResultSet() != null)
- firstUnclosedResult.getResultSet().close();
- firstUnclosedResult = firstUnclosedResult.getNext();
- }
-
- PreparedStatement ps = connection.prepareStatement(p_sql, resultsettype, concurrency, getResultSetHoldability());
- ps.setMaxFieldSize(getMaxFieldSize());
- ps.setFetchSize(getFetchSize());
- ps.setFetchDirection(getFetchDirection());
- AbstractJdbc2ResultSet rs = (AbstractJdbc2ResultSet) ps.executeQuery();
- rs.registerRealStatement(this);
-
- result = firstUnclosedResult = new ResultWrapper(rs);
- return rs;
- }
-
- if (!executeWithFlags(p_sql, 0))
- throw new PSQLException(GT.tr("No results were returned by the query."), PSQLState.NO_DATA);
-
- if (result.getNext() != null)
- throw new PSQLException(GT.tr("Multiple ResultSets were returned by the query."),
- PSQLState.TOO_MANY_RESULTS);
-
- return (ResultSet)result.getResultSet();
- }
-
- /*
- * A Prepared SQL query is executed and its ResultSet is returned
- *
- * @return a ResultSet that contains the data produced by the
- * * query - never null
- * @exception SQLException if a database access error occurs
- */
- public java.sql.ResultSet executeQuery() throws SQLException
- {
- if (!executeWithFlags(0))
- throw new PSQLException(GT.tr("No results were returned by the query."), PSQLState.NO_DATA);
-
- if (result.getNext() != null)
- throw new PSQLException(GT.tr("Multiple ResultSets were returned by the query."), PSQLState.TOO_MANY_RESULTS);
-
- return (ResultSet) result.getResultSet();
- }
-
- /*
- * Execute a SQL INSERT, UPDATE or DELETE statement. In addition
- * SQL statements that return nothing such as SQL DDL statements
- * can be executed
- *
- * @param sql a SQL statement
- * @return either a row count, or 0 for SQL commands
- * @exception SQLException if a database access error occurs
- */
- public int executeUpdate(String p_sql) throws SQLException
- {
- if (preparedQuery != null)
- throw new PSQLException(GT.tr("Can''t use query methods that take a query string on a PreparedStatement."),
- PSQLState.WRONG_OBJECT_TYPE);
- if( isFunction )
- {
- executeWithFlags(p_sql, 0);
- return 0;
- }
-
- executeWithFlags(p_sql, QueryExecutor.QUERY_NO_RESULTS);
-
- ResultWrapper iter = result;
- while (iter != null) {
- if (iter.getResultSet() != null) {
- throw new PSQLException(GT.tr("A result was returned when none was expected."),
- PSQLState.TOO_MANY_RESULTS);
-
- }
- iter = iter.getNext();
- }
-
- return getUpdateCount();
- }
-
- /*
- * Execute a SQL INSERT, UPDATE or DELETE statement. In addition,
- * SQL statements that return nothing such as SQL DDL statements can
- * be executed.
- *
- * @return either the row count for INSERT, UPDATE or DELETE; or
- * * 0 for SQL statements that return nothing.
- * @exception SQLException if a database access error occurs
- */
- public int executeUpdate() throws SQLException
- {
- if( isFunction )
- {
- executeWithFlags(0);
- return 0;
- }
-
- executeWithFlags(QueryExecutor.QUERY_NO_RESULTS);
-
- ResultWrapper iter = result;
- while (iter != null) {
- if (iter.getResultSet() != null) {
- throw new PSQLException(GT.tr("A result was returned when none was expected."),
- PSQLState.TOO_MANY_RESULTS);
-
- }
- iter = iter.getNext();
- }
-
- return getUpdateCount();
- }
-
- /*
- * Execute a SQL statement that may return multiple results. We
- * don't have to worry about this since we do not support multiple
- * ResultSets. You can use getResultSet or getUpdateCount to
- * retrieve the result.
- *
- * @param sql any SQL statement
- * @return true if the next result is a ResulSet, false if it is
- * an update count or there are no more results
- * @exception SQLException if a database access error occurs
- */
- public boolean execute(String p_sql) throws SQLException
- {
- if (preparedQuery != null)
- throw new PSQLException(GT.tr("Can''t use query methods that take a query string on a PreparedStatement."),
- PSQLState.WRONG_OBJECT_TYPE);
-
- return executeWithFlags(p_sql, 0);
- }
-
- public boolean executeWithFlags(String p_sql, int flags) throws SQLException
- {
- checkClosed();
- p_sql = replaceProcessing(p_sql);
- Query simpleQuery = connection.getQueryExecutor().createSimpleQuery(p_sql);
- execute(simpleQuery, null, QueryExecutor.QUERY_ONESHOT | flags);
- this.lastSimpleQuery = simpleQuery;
- return (result != null && result.getResultSet() != null);
- }
-
- public boolean execute() throws SQLException
- {
- return executeWithFlags(0);
- }
-
- public boolean executeWithFlags(int flags) throws SQLException
- {
- checkClosed();
-
- execute(preparedQuery, preparedParameters, flags);
-
- // If we are executing and there are out parameters
- // callable statement function set the return data
-
- if (isFunction && returnTypeSet )
- {
- if (result == null || result.getResultSet() == null)
- throw new PSQLException(GT.tr("A CallableStatement was executed with nothing returned."), PSQLState.NO_DATA);
-
- ResultSet rs = result.getResultSet();
- if (!rs.next())
- throw new PSQLException(GT.tr("A CallableStatement was executed with nothing returned."), PSQLState.NO_DATA);
-
- // figure out how many columns
- int cols = rs.getMetaData().getColumnCount();
-
- int outParameterCount = preparedParameters.getOutParameterCount() ;
-
- if ( cols != outParameterCount )
- throw new PSQLException(GT.tr("A CallableStatement was executed with an invalid number of parameters"),PSQLState.SYNTAX_ERROR);
-
- // reset last result fetched (for wasNull)
- lastIndex = 0;
-
- // allocate enough space for all possible parameters without regard to in/out
- callResult = new Object[preparedParameters.getParameterCount()+1];
-
- // move them into the result set
- for ( int i=0,j=0; i < cols; i++,j++)
- {
- // find the next out parameter, the assumption is that the functionReturnType
- // array will be initialized with 0 and only out parameters will have values
- // other than 0. 0 is the value for java.sql.Types.NULL, which should not
- // conflict
- while( j< functionReturnType.length && functionReturnType[j]==0) j++;
-
- callResult[j] = rs.getObject(i+1);
- int columnType = rs.getMetaData().getColumnType(i+1);
-
- if (columnType != functionReturnType[j])
- {
- // this is here for the sole purpose of passing the cts
- if ( columnType == Types.DOUBLE && functionReturnType[j] == Types.REAL )
- {
- // return it as a float
- if ( callResult[j] != null)
- callResult[j] = new Float(((Double)callResult[j]).floatValue());
- }
- else
- {
- throw new PSQLException (GT.tr("A CallableStatement function was executed and the out parameter {0} was of type {1} however type {2} was registered.",
- new Object[]{new Integer(i+1),
- "java.sql.Types=" + columnType, "java.sql.Types=" + functionReturnType[j] }),
- PSQLState.DATA_TYPE_MISMATCH);
- }
- }
-
- }
- rs.close();
- result = null;
- return false;
- }
-
- return (result != null && result.getResultSet() != null);
- }
-
- protected void closeForNextExecution() throws SQLException {
- // Every statement execution clears any previous warnings.
- clearWarnings();
-
- // Close any existing resultsets associated with this statement.
- while (firstUnclosedResult != null)
- {
- if (firstUnclosedResult.getResultSet() != null)
- firstUnclosedResult.getResultSet().close();
- firstUnclosedResult = firstUnclosedResult.getNext();
- }
- result = null;
-
- if (lastSimpleQuery != null) {
- lastSimpleQuery.close();
- lastSimpleQuery = null;
- }
-
- if (generatedKeys != null) {
- if (generatedKeys.getResultSet() != null) {
- generatedKeys.getResultSet().close();
- }
- generatedKeys = null;
- }
- }
-
- protected void execute(Query queryToExecute, ParameterList queryParameters, int flags) throws SQLException {
- closeForNextExecution();
-
- // Enable cursor-based resultset if possible.
- if (fetchSize > 0 && !wantsScrollableResultSet() && !connection.getAutoCommit() && !wantsHoldableResultSet())
- flags |= QueryExecutor.QUERY_FORWARD_CURSOR;
-
- if (wantsGeneratedKeysOnce || wantsGeneratedKeysAlways)
- {
- flags |= QueryExecutor.QUERY_BOTH_ROWS_AND_STATUS;
-
- // If the no results flag is set (from executeUpdate)
- // clear it so we get the generated keys results.
- //
- if ((flags & QueryExecutor.QUERY_NO_RESULTS) != 0)
- flags &= ~(QueryExecutor.QUERY_NO_RESULTS);
- }
-
- // Only use named statements after we hit the threshold
- if (preparedQuery != null)
- {
- ++m_useCount; // We used this statement once more.
- if (m_prepareThreshold == 0 || m_useCount < m_prepareThreshold)
- flags |= QueryExecutor.QUERY_ONESHOT;
- }
-
- if (connection.getAutoCommit())
- flags |= QueryExecutor.QUERY_SUPPRESS_BEGIN;
-
- // updateable result sets do not yet support binary updates
- if (concurrency != ResultSet.CONCUR_READ_ONLY)
- flags |= QueryExecutor.QUERY_NO_BINARY_TRANSFER;
-
- if (ForceBinaryTransfers) {
- int flags2 = flags | QueryExecutor.QUERY_DESCRIBE_ONLY;
- StatementResultHandler handler2 = new StatementResultHandler();
- connection.getQueryExecutor().execute(queryToExecute, queryParameters, handler2, 0, 0, flags2);
- ResultWrapper result2 = handler2.getResults();
- if (result2 != null) {
- result2.getResultSet().close();
- }
- }
-
- StatementResultHandler handler = new StatementResultHandler();
- result = null;
- try
- {
-
-
- connection.getQueryExecutor().execute(queryToExecute,
- queryParameters,
- handler,
- maxrows,
- fetchSize,
- flags);
- }
- finally
- {
- killTimer();
- }
- result = firstUnclosedResult = handler.getResults();
-
- if (wantsGeneratedKeysOnce || wantsGeneratedKeysAlways)
- {
- generatedKeys = result;
- result = result.getNext();
-
- if (wantsGeneratedKeysOnce)
- wantsGeneratedKeysOnce = false;
- }
-
- }
-
- /*
- * setCursorName defines the SQL cursor name that will be used by
- * subsequent execute methods. This name can then be used in SQL
- * positioned update/delete statements to identify the current row
- * in the ResultSet generated by this statement. If a database
- * doesn't support positioned update/delete, this method is a
- * no-op.
- *
- * <p><B>Note:</B> By definition, positioned update/delete execution
- * must be done by a different Statement than the one which
- * generated the ResultSet being used for positioning. Also, cursor
- * names must be unique within a Connection.
- *
- * @param name the new cursor name
- * @exception SQLException if a database access error occurs
- */
- public void setCursorName(String name) throws SQLException
- {
- checkClosed();
- // No-op.
- }
-
- protected boolean isClosed = false;
- private int lastIndex = 0;
- /*
- * getUpdateCount returns the current result as an update count,
- * if the result is a ResultSet or there are no more results, -1
- * is returned. It should only be called once per result.
- *
- * @return the current result as an update count.
- * @exception SQLException if a database access error occurs
- */
- public int getUpdateCount() throws SQLException
- {
- checkClosed();
- if (result == null || result.getResultSet() != null)
- return -1;
-
- return result.getUpdateCount();
- }
-
- /*
- * getMoreResults moves to a Statement's next result. If it returns
- * true, this result is a ResulSet.
- *
- * @return true if the next ResultSet is valid
- * @exception SQLException if a database access error occurs
- */
- public boolean getMoreResults() throws SQLException
- {
- if (result == null)
- return false;
-
- result = result.getNext();
-
- // Close preceding resultsets.
- while (firstUnclosedResult != result)
- {
- if (firstUnclosedResult.getResultSet() != null)
- firstUnclosedResult.getResultSet().close();
- firstUnclosedResult = firstUnclosedResult.getNext();
- }
-
- return (result != null && result.getResultSet() != null);
- }
-
- /*
- * The maxRows limit is set to limit the number of rows that
- * any ResultSet can contain. If the limit is exceeded, the
- * excess rows are silently dropped.
- *
- * @return the current maximum row limit; zero means unlimited
- * @exception SQLException if a database access error occurs
- */
- public int getMaxRows() throws SQLException
- {
- checkClosed();
- return maxrows;
- }
-
- /*
- * Set the maximum number of rows
- *
- * @param max the new max rows limit; zero means unlimited
- * @exception SQLException if a database access error occurs
- * @see getMaxRows
- */
- public void setMaxRows(int max) throws SQLException
- {
- checkClosed();
- if (max < 0)
- throw new PSQLException(GT.tr("Maximum number of rows must be a value grater than or equal to 0."),
- PSQLState.INVALID_PARAMETER_VALUE);
- maxrows = max;
- }
-
- /*
- * If escape scanning is on (the default), the driver will do escape
- * substitution before sending the SQL to the database.
- *
- * @param enable true to enable; false to disable
- * @exception SQLException if a database access error occurs
- */
- public void setEscapeProcessing(boolean enable) throws SQLException
- {
- checkClosed();
- replaceProcessingEnabled = enable;
- }
-
- /*
- * The queryTimeout limit is the number of seconds the driver
- * will wait for a Statement to execute. If the limit is
- * exceeded, a SQLException is thrown.
- *
- * @return the current query timeout limit in seconds; 0 = unlimited
- * @exception SQLException if a database access error occurs
- */
- public int getQueryTimeout() throws SQLException
- {
- checkClosed();
- return timeout;
- }
-
- /*
- * Sets the queryTimeout limit
- *
- * @param seconds - the new query timeout limit in seconds
- * @exception SQLException if a database access error occurs
- */
- public void setQueryTimeout(int seconds) throws SQLException
- {
- checkClosed();
-
- if (seconds < 0)
- throw new PSQLException(GT.tr("Query timeout must be a value greater than or equals to 0."),
- PSQLState.INVALID_PARAMETER_VALUE);
-
- if (seconds == 0) {
- killTimer();
- return;
- }
-
- cancelTimer = new TimerTask() {
- public void run()
- {
- try {
- AbstractJdbc2Statement.this.cancel();
- } catch (SQLException e) {
- }
- finally
- {
- killTimer();
- }
- }
- };
-
- Driver.addTimerTask( cancelTimer, seconds * 1000);
- timeout = seconds;
- }
-
- /**
- * This adds a warning to the warning chain. We track the
- * tail of the warning chain as well to avoid O(N) behavior
- * for adding a new warning to an existing chain. Some
- * server functions which RAISE NOTICE (or equivalent) produce
- * a ton of warnings.
- * @param warn warning to add
- */
- public void addWarning(SQLWarning warn)
- {
- if (warnings == null) {
- warnings = warn;
- lastWarning = warn;
- } else {
- lastWarning.setNextWarning(warn);
- lastWarning = warn;
- }
- }
-
- /*
- * The first warning reported by calls on this Statement is
- * returned. A Statement's execute methods clear its SQLWarning
- * chain. Subsequent Statement warnings will be chained to this
- * SQLWarning.
- *
- * <p>The Warning chain is automatically cleared each time a statement
- * is (re)executed.
- *
- * <p><B>Note:</B> If you are processing a ResultSet then any warnings
- * associated with ResultSet reads will be chained on the ResultSet
- * object.
- *
- * @return the first SQLWarning on null
- * @exception SQLException if a database access error occurs
- */
- public SQLWarning getWarnings() throws SQLException
- {
- checkClosed();
- return warnings;
- }
-
- /*
- * The maxFieldSize limit (in bytes) is the maximum amount of
- * data returned for any column value; it only applies to
- * BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR and LONGVARCHAR
- * columns. If the limit is exceeded, the excess data is silently
- * discarded.
- *
- * @return the current max column size limit; zero means unlimited
- * @exception SQLException if a database access error occurs
- */
- public int getMaxFieldSize() throws SQLException
- {
- return maxfieldSize;
- }
-
- /*
- * Sets the maxFieldSize
- *
- * @param max the new max column size limit; zero means unlimited
- * @exception SQLException if a database access error occurs
- */
- public void setMaxFieldSize(int max) throws SQLException
- {
- checkClosed();
- if (max < 0)
- throw new PSQLException(GT.tr("The maximum field size must be a value greater than or equal to 0."),
- PSQLState.INVALID_PARAMETER_VALUE);
- maxfieldSize = max;
- }
-
- /*
- * After this call, getWarnings returns null until a new warning
- * is reported for this Statement.
- *
- * @exception SQLException if a database access error occurs
- */
- public void clearWarnings() throws SQLException
- {
- warnings = null;
- lastWarning = null;
- }
-
- /*
- * getResultSet returns the current result as a ResultSet. It
- * should only be called once per result.
- *
- * @return the current result set; null if there are no more
- * @exception SQLException if a database access error occurs (why?)
- */
- public java.sql.ResultSet getResultSet() throws SQLException
- {
- checkClosed();
-
- if (result == null)
- return null;
-
- return (ResultSet) result.getResultSet();
- }
-
- /*
- * In many cases, it is desirable to immediately release a
- * Statement's database and JDBC resources instead of waiting
- * for this to happen when it is automatically closed. The
- * close method provides this immediate release.
- *
- * <p><B>Note:</B> A Statement is automatically closed when it is
- * garbage collected. When a Statement is closed, its current
- * ResultSet, if one exists, is also closed.
- *
- * @exception SQLException if a database access error occurs (why?)
- */
- public void close() throws SQLException
- {
- // closing an already closed Statement is a no-op.
- if (isClosed)
- return ;
-
- killTimer();
-
- closeForNextExecution();
-
- if (preparedQuery != null)
- preparedQuery.close();
-
- isClosed = true;
- }
-
- /**
- * This finalizer ensures that statements that have allocated server-side
- * resources free them when they become unreferenced.
- */
- protected void finalize() {
- try
- {
- close();
- }
- catch (SQLException e)
- {
- }
- }
-
- /*
- * Filter the SQL string of Java SQL Escape clauses.
- *
- * Currently implemented Escape clauses are those mentioned in 11.3
- * in the specification. Basically we look through the sql string for
- * {d xxx}, {t xxx}, {ts xxx}, {oj xxx} or {fn xxx} in non-string sql
- * code. When we find them, we just strip the escape part leaving only
- * the xxx part.
- * So, something like "select * from x where d={d '2001-10-09'}" would
- * return "select * from x where d= '2001-10-09'".
- */
- protected String replaceProcessing(String p_sql) throws SQLException
- {
- if (replaceProcessingEnabled)
- {
- // Since escape codes can only appear in SQL CODE, we keep track
- // of if we enter a string or not.
- int len = p_sql.length();
- StringBuffer newsql = new StringBuffer(len);
- int i=0;
- while (i<len){
- i=parseSql(p_sql,i,newsql,false,connection.getStandardConformingStrings());
- // We need to loop here in case we encounter invalid
- // SQL, consider: SELECT a FROM t WHERE (1 > 0)) ORDER BY a
- // We can't ending replacing after the extra closing paren
- // because that changes a syntax error to a valid query
- // that isn't what the user specified.
- if (i < len) {
- newsql.append(p_sql.charAt(i));
- i++;
- }
- }
- return newsql.toString();
- }
- else
- {
- return p_sql;
- }
- }
-
- /**
- * parse the given sql from index i, appending it to the gven buffer
- * until we hit an unmatched right parentheses or end of string. When
- * the stopOnComma flag is set we also stop processing when a comma is
- * found in sql text that isn't inside nested parenthesis.
- *
- * @param p_sql the original query text
- * @param i starting position for replacing
- * @param newsql where to write the replaced output
- * @param stopOnComma should we stop after hitting the first comma in sql text?
- * @param stdStrings whether standard_conforming_strings is on
- * @return the position we stopped processing at
- */
- protected static int parseSql(String p_sql,int i,StringBuffer newsql, boolean stopOnComma,
- boolean stdStrings)throws SQLException{
- short state = IN_SQLCODE;
- int len = p_sql.length();
- int nestedParenthesis=0;
- boolean endOfNested=false;
-
- // because of the ++i loop
- i--;
- while (!endOfNested && ++i < len)
- {
- char c = p_sql.charAt(i);
- switch (state)
- {
- case IN_SQLCODE:
- if (c == '\'') // start of a string?
- state = IN_STRING;
- else if (c == '"') // start of a identifer?
- state = IN_IDENTIFIER;
- else if (c=='(') { // begin nested sql
- nestedParenthesis++;
- } else if (c==')') { // end of nested sql
- nestedParenthesis--;
- if (nestedParenthesis<0){
- endOfNested=true;
- break;
- }
- } else if (stopOnComma && c==',' && nestedParenthesis==0) {
- endOfNested=true;
- break;
- } else if (c == '{') { // start of an escape code?
- if (i + 1 < len)
- {
- char next = p_sql.charAt(i + 1);
- char nextnext = (i + 2 < len) ? p_sql.charAt(i + 2) : '\0';
- if (next == 'd' || next == 'D')
- {
- state = ESC_TIMEDATE;
- i++;
- newsql.append("DATE ");
- break;
- }
- else if (next == 't' || next == 'T')
- {
- state = ESC_TIMEDATE;
- if (nextnext == 's' || nextnext == 'S'){
- // timestamp constant
- i+=2;
- newsql.append("TIMESTAMP ");
- }else{
- // time constant
- i++;
- newsql.append("TIME ");
- }
- break;
- }
- else if ( next == 'f' || next == 'F' )
- {
- state = ESC_FUNCTION;
- i += (nextnext == 'n' || nextnext == 'N') ? 2 : 1;
- break;
- }
- else if ( next == 'o' || next == 'O' )
- {
- state = ESC_OUTERJOIN;
- i += (nextnext == 'j' || nextnext == 'J') ? 2 : 1;
- break;
- }
- else if ( next == 'e' || next == 'E' )
- { // we assume that escape is the only escape sequence beginning with e
- state = ESC_ESCAPECHAR;
- break;
- }
- }
- }
- newsql.append(c);
- break;
-
- case IN_STRING:
- if (c == '\'') // end of string?
- state = IN_SQLCODE;
- else if (c == '\\' && !stdStrings) // a backslash?
- state = BACKSLASH;
-
- newsql.append(c);
- break;
-
- case IN_IDENTIFIER:
- if (c == '"') // end of identifier
- state = IN_SQLCODE;
- newsql.append(c);
- break;
-
- case BACKSLASH:
- state = IN_STRING;
-
- newsql.append(c);
- break;
-
- case ESC_FUNCTION:
- // extract function name
- String functionName;
- int posArgs = p_sql.indexOf('(',i);
- if (posArgs!=-1){
- functionName=p_sql.substring(i,posArgs).trim();
- // extract arguments
- i= posArgs+1;// we start the scan after the first (
- StringBuffer args=new StringBuffer();
- i = parseSql(p_sql,i,args,false,stdStrings);
- // translate the function and parse arguments
- newsql.append(escapeFunction(functionName,args.toString(),stdStrings));
- }
- // go to the end of the function copying anything found
- i++;
- while (i<len && p_sql.charAt(i)!='}')
- newsql.append(p_sql.charAt(i++));
- state = IN_SQLCODE; // end of escaped function (or query)
- break;
- case ESC_TIMEDATE:
- case ESC_OUTERJOIN:
- case ESC_ESCAPECHAR:
- if (c == '}')
- state = IN_SQLCODE; // end of escape code.
- else
- newsql.append(c);
- break;
- } // end switch
- }
- return i;
- }
-
- /**
- * generate sql for escaped functions
- * @param functionName the escaped function name
- * @param args the arguments for this functin
- * @param stdStrings whether standard_conforming_strings is on
- * @return the right postgreSql sql
- */
- protected static String escapeFunction(String functionName, String args, boolean stdStrings) throws SQLException{
- // parse function arguments
- int len = args.length();
- int i=0;
- ArrayList parsedArgs = new ArrayList();
- while (i<len){
- StringBuffer arg = new StringBuffer();
- int lastPos=i;
- i=parseSql(args,i,arg,true,stdStrings);
- if (lastPos!=i){
- parsedArgs.add(arg);
- }
- i++;
- }
- // we can now tranlate escape functions
- try{
- Method escapeMethod = EscapedFunctions.getFunction(functionName);
- return (String) escapeMethod.invoke(null,new Object[] {parsedArgs});
- }catch(InvocationTargetException e){
- if (e.getTargetException() instanceof SQLException)
- throw (SQLException) e.getTargetException();
- else
- throw new PSQLException(e.getTargetException().getMessage(),
- PSQLState.SYSTEM_ERROR);
- }catch (Exception e){
- // by default the function name is kept unchanged
- StringBuffer buf = new StringBuffer();
- buf.append(functionName).append('(');
- for (int iArg = 0;iArg<parsedArgs.size();iArg++){
- buf.append(parsedArgs.get(iArg));
- if (iArg!=(parsedArgs.size()-1))
- buf.append(',');
- }
- buf.append(')');
- return buf.toString();
- }
- }
-
- /*
- *
- * The following methods are postgres extensions and are defined
- * in the interface BaseStatement
- *
- */
-
- /*
- * Returns the Last inserted/updated oid. Deprecated in 7.2 because
- * range of OID values is greater than a java signed int.
- * @deprecated Replaced by getLastOID in 7.2
- */
- public int getInsertedOID() throws SQLException
- {
- checkClosed();
- if (result == null)
- return 0;
- return (int) result.getInsertOID();
- }
-
- /*
- * Returns the Last inserted/updated oid.
- * @return OID of last insert
- * @since 7.2
- */
- public long getLastOID() throws SQLException
- {
- checkClosed();
- if (result == null)
- return 0;
- return result.getInsertOID();
- }
-
- /*
- * Set a parameter to SQL NULL
- *
- * <p><B>Note:</B> You must specify the parameter's SQL type.
- *
- * @param parameterIndex the first parameter is 1, etc...
- * @param sqlType the SQL type code defined in java.sql.Types
- * @exception SQLException if a database access error occurs
- */
- public void setNull(int parameterIndex, int sqlType) throws SQLException
- {
- checkClosed();
-
- int oid;
- switch (sqlType)
- {
- case Types.INTEGER:
- oid = Oid.INT4;
- break;
- case Types.TINYINT:
- case Types.SMALLINT:
- oid = Oid.INT2;
- break;
- case Types.BIGINT:
- oid = Oid.INT8;
- break;
- case Types.REAL:
- oid = Oid.FLOAT4;
- break;
- case Types.DOUBLE:
- case Types.FLOAT:
- oid = Oid.FLOAT8;
- break;
- case Types.DECIMAL:
- case Types.NUMERIC:
- oid = Oid.NUMERIC;
- break;
- case Types.CHAR:
- oid = Oid.BPCHAR;
- break;
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- oid = Oid.VARCHAR;
- break;
- case Types.DATE:
- oid = Oid.DATE;
- break;
- case Types.TIME:
- case Types.TIMESTAMP:
- oid = Oid.UNSPECIFIED;
- break;
- case Types.BIT:
- oid = Oid.BOOL;
- break;
- case Types.BINARY:
- case Types.VARBINARY:
- case Types.LONGVARBINARY:
- if (connection.haveMinimumCompatibleVersion("7.2"))
- {
- oid = Oid.BYTEA;
- }
- else
- {
- oid = Oid.OID;
- }
- break;
- case Types.BLOB:
- case Types.CLOB:
- oid = Oid.OID;
- break;
- case Types.ARRAY:
- case Types.DISTINCT:
- case Types.STRUCT:
- case Types.NULL:
- case Types.OTHER:
- oid = Oid.UNSPECIFIED;
- break;
- default:
- // Bad Types value.
- throw new PSQLException(GT.tr("Unknown Types value."), PSQLState.INVALID_PARAMETER_TYPE);
- }
- if ( adjustIndex )
- parameterIndex--;
- preparedParameters.setNull( parameterIndex, oid);
- }
-
- /*
- * Set a parameter to a Java boolean value. The driver converts this
- * to a SQL BIT value when it sends it to the database.
- *
- * @param parameterIndex the first parameter is 1...
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- */
- public void setBoolean(int parameterIndex, boolean x) throws SQLException
- {
- checkClosed();
- bindString(parameterIndex, x ? "1" : "0", Oid.BOOL);
- }
-
- /*
- * Set a parameter to a Java byte value. The driver converts this to
- * a SQL TINYINT value when it sends it to the database.
- *
- * @param parameterIndex the first parameter is 1...
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- */
- public void setByte(int parameterIndex, byte x) throws SQLException
- {
- setShort(parameterIndex, x);
- }
-
- /*
- * Set a parameter to a Java short value. The driver converts this
- * to a SQL SMALLINT value when it sends it to the database.
- *
- * @param parameterIndex the first parameter is 1...
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- */
- public void setShort(int parameterIndex, short x) throws SQLException
- {
- checkClosed();
- if (connection.binaryTransferSend(Oid.INT2)) {
- byte[] val = new byte[2];
- ByteConverter.int2(val, 0, x);
- bindBytes(parameterIndex, val, Oid.INT2);
- return;
- }
- bindLiteral(parameterIndex, Integer.toString(x), Oid.INT2);
- }
-
- /*
- * Set a parameter to a Java int value. The driver converts this to
- * a SQL INTEGER value when it sends it to the database.
- *
- * @param parameterIndex the first parameter is 1...
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- */
- public void setInt(int parameterIndex, int x) throws SQLException
- {
- checkClosed();
- if (connection.binaryTransferSend(Oid.INT4)) {
- byte[] val = new byte[4];
- ByteConverter.int4(val, 0, x);
- bindBytes(parameterIndex, val, Oid.INT4);
- return;
- }
- bindLiteral(parameterIndex, Integer.toString(x), Oid.INT4);
- }
-
- /*
- * Set a parameter to a Java long value. The driver converts this to
- * a SQL BIGINT value when it sends it to the database.
- *
- * @param parameterIndex the first parameter is 1...
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- */
- public void setLong(int parameterIndex, long x) throws SQLException
- {
- checkClosed();
- if (connection.binaryTransferSend(Oid.INT8)) {
- byte[] val = new byte[8];
- ByteConverter.int8(val, 0, x);
- bindBytes(parameterIndex, val, Oid.INT8);
- return;
- }
- bindLiteral(parameterIndex, Long.toString(x), Oid.INT8);
- }
-
- /*
- * Set a parameter to a Java float value. The driver converts this
- * to a SQL FLOAT value when it sends it to the database.
- *
- * @param parameterIndex the first parameter is 1...
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- */
- public void setFloat(int parameterIndex, float x) throws SQLException
- {
- checkClosed();
- if (connection.binaryTransferSend(Oid.FLOAT4)) {
- byte[] val = new byte[4];
- ByteConverter.float4(val, 0, x);
- bindBytes(parameterIndex, val, Oid.FLOAT4);
- return;
- }
- bindLiteral(parameterIndex, Float.toString(x), Oid.FLOAT8);
- }
-
- /*
- * Set a parameter to a Java double value. The driver converts this
- * to a SQL DOUBLE value when it sends it to the database
- *
- * @param parameterIndex the first parameter is 1...
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- */
- public void setDouble(int parameterIndex, double x) throws SQLException
- {
- checkClosed();
- if (connection.binaryTransferSend(Oid.FLOAT8)) {
- byte[] val = new byte[8];
- ByteConverter.float8(val, 0, x);
- bindBytes(parameterIndex, val, Oid.FLOAT8);
- return;
- }
- bindLiteral(parameterIndex, Double.toString(x), Oid.FLOAT8);
- }
-
- /*
- * Set a parameter to a java.lang.BigDecimal value. The driver
- * converts this to a SQL NUMERIC value when it sends it to the
- * database.
- *
- * @param parameterIndex the first parameter is 1...
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- */
- public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException
- {
- checkClosed();
- if (x == null)
- setNull(parameterIndex, Types.DECIMAL);
- else
- bindLiteral(parameterIndex, x.toString(), Oid.NUMERIC);
- }
-
- /*
- * Set a parameter to a Java String value. The driver converts this
- * to a SQL VARCHAR or LONGVARCHAR value (depending on the arguments
- * size relative to the driver's limits on VARCHARs) when it sends it
- * to the database.
- *
- * @param parameterIndex the first parameter is 1...
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- */
- public void setString(int parameterIndex, String x) throws SQLException
- {
- checkClosed();
- setString(parameterIndex, x, (connection.getStringVarcharFlag() ? Oid.VARCHAR : Oid.UNSPECIFIED));
- }
-
- protected void setString(int parameterIndex, String x, int oid) throws SQLException
- {
- // if the passed string is null, then set this column to null
- checkClosed();
- if (x == null)
- {
- if ( adjustIndex )
- parameterIndex--;
- preparedParameters.setNull( parameterIndex, oid);
- }
- else
- bindString(parameterIndex, x, oid);
- }
-
- /*
- * Set a parameter to a Java array of bytes. The driver converts this
- * to a SQL VARBINARY or LONGVARBINARY (depending on the argument's
- * size relative to the driver's limits on VARBINARYs) when it sends
- * it to the database.
- *
- * <p>Implementation note:
- * <br>With org.postgresql, this creates a large object, and stores the
- * objects oid in this column.
- *
- * @param parameterIndex the first parameter is 1...
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- */
- public void setBytes(int parameterIndex, byte[] x) throws SQLException
- {
- checkClosed();
-
- if (null == x)
- {
- setNull(parameterIndex, Types.VARBINARY);
- return ;
- }
-
- if (connection.haveMinimumCompatibleVersion("7.2"))
- {
- //Version 7.2 supports the bytea datatype for byte arrays
- byte[] copy = new byte[x.length];
- System.arraycopy(x, 0, copy, 0, x.length);
- preparedParameters.setBytea( parameterIndex, copy, 0, x.length);
- }
- else
- {
- //Version 7.1 and earlier support done as LargeObjects
- LargeObjectManager lom = connection.getLargeObjectAPI();
- long oid = lom.createLO();
- LargeObject lob = lom.open(oid);
- lob.write(x);
- lob.close();
- setLong(parameterIndex, oid);
- }
- }
-
- /*
- * Set a parameter to a java.sql.Date value. The driver converts this
- * to a SQL DATE value when it sends it to the database.
- *
- * @param parameterIndex the first parameter is 1...
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- */
- public void setDate(int parameterIndex, java.sql.Date x) throws SQLException
- {
- setDate(parameterIndex, x, null);
- }
-
- /*
- * Set a parameter to a java.sql.Time value. The driver converts
- * this to a SQL TIME value when it sends it to the database.
- *
- * @param parameterIndex the first parameter is 1...));
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- */
- public void setTime(int parameterIndex, Time x) throws SQLException
- {
- setTime(parameterIndex, x, null);
- }
-
- /*
- * Set a parameter to a java.sql.Timestamp value. The driver converts
- * this to a SQL TIMESTAMP value when it sends it to the database.
- *
- * @param parameterIndex the first parameter is 1...
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- */
- public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException
- {
- setTimestamp(parameterIndex, x, null);
- }
-
- private void setCharacterStreamPost71(int parameterIndex, InputStream x, int length, String encoding) throws SQLException
- {
-
- if (x == null)
- {
- setNull(parameterIndex, Types.VARCHAR);
- return ;
- }
- if (length < 0)
- throw new PSQLException(GT.tr("Invalid stream length {0}.", new Integer(length)),
- PSQLState.INVALID_PARAMETER_VALUE);
-
-
- //Version 7.2 supports AsciiStream for all PG text types (char, varchar, text)
- //As the spec/javadoc for this method indicate this is to be used for
- //large String values (i.e. LONGVARCHAR) PG doesn't have a separate
- //long varchar datatype, but with toast all text datatypes are capable of
- //handling very large values. Thus the implementation ends up calling
- //setString() since there is no current way to stream the value to the server
- try
- {
- InputStreamReader l_inStream = new InputStreamReader(x, encoding);
- char[] l_chars = new char[length];
- int l_charsRead = 0;
- while (true)
- {
- int n = l_inStream.read(l_chars, l_charsRead, length - l_charsRead);
- if (n == -1)
- break;
-
- l_charsRead += n;
-
- if (l_charsRead == length)
- break;
- }
-
- setString(parameterIndex, new String(l_chars, 0, l_charsRead), Oid.VARCHAR);
- }
- catch (UnsupportedEncodingException l_uee)
- {
- throw new PSQLException(GT.tr("The JVM claims not to support the {0} encoding.", encoding), PSQLState.UNEXPECTED_ERROR, l_uee);
- }
- catch (IOException l_ioe)
- {
- throw new PSQLException(GT.tr("Provided InputStream failed."), PSQLState.UNEXPECTED_ERROR, l_ioe);
- }
- }
-
- /*
- * When a very large ASCII value is input to a LONGVARCHAR parameter,
- * it may be more practical to send it via a java.io.InputStream.
- * JDBC will read the data from the stream as needed, until it reaches
- * end-of-file. The JDBC driver will do any necessary conversion from
- * ASCII to the database char format.
- *
- * <P><B>Note:</B> This stream object can either be a standard Java
- * stream object or your own subclass that implements the standard
- * interface.
- *
- * @param parameterIndex the first parameter is 1...
- * @param x the parameter value
- * @param length the number of bytes in the stream
- * @exception SQLException if a database access error occurs
- */
- public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException
- {
- checkClosed();
- if (connection.haveMinimumCompatibleVersion("7.2"))
- {
- setCharacterStreamPost71(parameterIndex, x, length, "ASCII");
- }
- else
- {
- //Version 7.1 supported only LargeObjects by treating everything
- //as binary data
- setBinaryStream(parameterIndex, x, length);
- }
- }
-
- /*
- * When a very large Unicode value is input to a LONGVARCHAR parameter,
- * it may be more practical to send it via a java.io.InputStream.
- * JDBC will read the data from the stream as needed, until it reaches
- * end-of-file. The JDBC driver will do any necessary conversion from
- * UNICODE to the database char format.
- *
- * <P><B>Note:</B> This stream object can either be a standard Java
- * stream object or your own subclass that implements the standard
- * interface.
- *
- * @param parameterIndex the first parameter is 1...
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- */
- public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException
- {
- checkClosed();
- if (connection.haveMinimumCompatibleVersion("7.2"))
- {
- setCharacterStreamPost71(parameterIndex, x, length, "UTF-8");
- }
- else
- {
- //Version 7.1 supported only LargeObjects by treating everything
- //as binary data
- setBinaryStream(parameterIndex, x, length);
- }
- }
-
- /*
- * When a very large binary value is input to a LONGVARBINARY parameter,
- * it may be more practical to send it via a java.io.InputStream.
- * JDBC will read the data from the stream as needed, until it reaches
- * end-of-file.
- *
- * <P><B>Note:</B> This stream object can either be a standard Java
- * stream object or your own subclass that implements the standard
- * interface.
- *
- * @param parameterIndex the first parameter is 1...
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- */
- public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException
- {
- checkClosed();
-
- if (x == null)
- {
- setNull(parameterIndex, Types.VARBINARY);
- return ;
- }
-
- if (length < 0)
- throw new PSQLException(GT.tr("Invalid stream length {0}.", new Integer(length)),
- PSQLState.INVALID_PARAMETER_VALUE);
-
- if (connection.haveMinimumCompatibleVersion("7.2"))
- {
- //Version 7.2 supports BinaryStream for for the PG bytea type
- //As the spec/javadoc for this method indicate this is to be used for
- //large binary values (i.e. LONGVARBINARY) PG doesn't have a separate
- //long binary datatype, but with toast the bytea datatype is capable of
- //handling very large values.
-
- preparedParameters.setBytea(parameterIndex, x, length);
- }
- else
- {
- //Version 7.1 only supported streams for LargeObjects
- //but the jdbc spec indicates that streams should be
- //available for LONGVARBINARY instead
- LargeObjectManager lom = connection.getLargeObjectAPI();
- long oid = lom.createLO();
- LargeObject lob = lom.open(oid);
- OutputStream los = lob.getOutputStream();
- try
- {
- // could be buffered, but then the OutputStream returned by LargeObject
- // is buffered internally anyhow, so there would be no performance
- // boost gained, if anything it would be worse!
- int c = x.read();
- int p = 0;
- while (c > -1 && p < length)
- {
- los.write(c);
- c = x.read();
- p++;
- }
- los.close();
- }
- catch (IOException se)
- {
- throw new PSQLException(GT.tr("Provided InputStream failed."), PSQLState.UNEXPECTED_ERROR, se);
- }
- // lob is closed by the stream so don't call lob.close()
- setLong(parameterIndex, oid);
- }
- }
-
-
- /*
- * In general, parameter values remain in force for repeated used of a
- * Statement. Setting a parameter value automatically clears its
- * previous value. However, in coms cases, it is useful to immediately
- * release the resources used by the current parameter values; this
- * can be done by calling clearParameters
- *
- * @exception SQLException if a database access error occurs
- */
- public void clearParameters() throws SQLException
- {
- preparedParameters.clear();
- }
-
- private PGType createInternalType( Object x, int targetType ) throws PSQLException
- {
- if ( x instanceof Byte ) return PGByte.castToServerType((Byte)x, targetType );
- if ( x instanceof Short ) return PGShort.castToServerType((Short)x, targetType );
- if ( x instanceof Integer ) return PGInteger.castToServerType((Integer)x, targetType );
- if ( x instanceof Long ) return PGLong.castToServerType((Long)x, targetType );
- if ( x instanceof Double ) return PGDouble.castToServerType((Double)x, targetType );
- if ( x instanceof Float ) return PGFloat.castToServerType((Float)x, targetType );
- if ( x instanceof BigDecimal) return PGBigDecimal.castToServerType((BigDecimal)x, targetType );
- // since all of the above are instances of Number make sure this is after them
- if ( x instanceof Number ) return PGNumber.castToServerType((Number)x, targetType );
- if ( x instanceof Boolean) return PGBoolean.castToServerType((Boolean)x, targetType );
- return new PGUnknown(x);
-
- }
- // Helper method for setting parameters to PGobject subclasses.
- private void setPGobject(int parameterIndex, PGobject x) throws SQLException {
- String typename = x.getType();
- int oid = connection.getTypeInfo().getPGType(typename);
- if (oid == Oid.UNSPECIFIED)
- throw new PSQLException(GT.tr("Unknown type {0}.", typename), PSQLState.INVALID_PARAMETER_TYPE);
-
- if ((x instanceof PGBinaryObject) && connection.binaryTransferSend(oid)) {
- PGBinaryObject binObj = (PGBinaryObject) x;
- byte[] data = new byte[binObj.lengthInBytes()];
- binObj.toBytes(data, 0);
- bindBytes(parameterIndex, data, oid);
- } else {
- setString(parameterIndex, x.getValue(), oid);
- }
- }
-
- private void setMap(int parameterIndex, Map x) throws SQLException {
- int oid = connection.getTypeInfo().getPGType("hstore");
- if (oid == Oid.UNSPECIFIED)
- throw new PSQLException(GT.tr("No hstore extension installed."), PSQLState.INVALID_PARAMETER_TYPE);
- if (connection.binaryTransferSend(oid)) {
- byte[] data = HStoreConverter.toBytes(x, connection.getEncoding());
- bindBytes(parameterIndex, data, oid);
- } else {
- setString(parameterIndex, HStoreConverter.toString(x), oid);
- }
- }
-
- /*
- * Set the value of a parameter using an object; use the java.lang
- * equivalent objects for integral values.
- *
- * <P>The given Java object will be converted to the targetSqlType before
- * being sent to the database.
- *
- * <P>note that this method may be used to pass database-specific
- * abstract data types. This is done by using a Driver-specific
- * Java type and using a targetSqlType of java.sql.Types.OTHER
- *
- * @param parameterIndex the first parameter is 1...
- * @param x the object containing the input parameter value
- * @param targetSqlType The SQL type to be send to the database
- * @param scale For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC
- * * types this is the number of digits after the decimal. For
- * * all other types this value will be ignored.
- * @exception SQLException if a database access error occurs
- */
- public void setObject(int parameterIndex, Object in, int targetSqlType, int scale) throws SQLException
- {
- checkClosed();
-
- if (in == null)
- {
- setNull(parameterIndex, targetSqlType);
- return ;
- }
-
- Object pgType = createInternalType( in, targetSqlType );
- switch (targetSqlType)
- {
- case Types.INTEGER:
- bindLiteral(parameterIndex, pgType.toString(), Oid.INT4);
- break;
- case Types.TINYINT:
- case Types.SMALLINT:
- bindLiteral(parameterIndex, pgType.toString(), Oid.INT2);
- break;
- case Types.BIGINT:
- bindLiteral(parameterIndex, pgType.toString(), Oid.INT8);
- break;
- case Types.REAL:
- //TODO: is this really necessary ?
- //bindLiteral(parameterIndex, new Float(pgType.toString()).toString(), Oid.FLOAT4);
- bindLiteral(parameterIndex, pgType.toString(), Oid.FLOAT4);
- break;
- case Types.DOUBLE:
- case Types.FLOAT:
- bindLiteral(parameterIndex, pgType.toString(), Oid.FLOAT8);
- break;
- case Types.DECIMAL:
- case Types.NUMERIC:
- bindLiteral(parameterIndex, pgType.toString(), Oid.NUMERIC);
- break;
- case Types.CHAR:
- setString(parameterIndex, pgType.toString(), Oid.BPCHAR);
- break;
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- setString(parameterIndex, pgType.toString(), Oid.VARCHAR);
- break;
- case Types.DATE:
- if (in instanceof java.sql.Date)
- setDate(parameterIndex, (java.sql.Date)in);
- else
- {
- java.sql.Date tmpd;
- if (in instanceof java.util.Date) {
- tmpd = new java.sql.Date(((java.util.Date)in).getTime());
- } else {
- tmpd = connection.getTimestampUtils().toDate(null, in.toString());
- }
- setDate(parameterIndex, tmpd);
- }
- break;
- case Types.TIME:
- if (in instanceof java.sql.Time)
- setTime(parameterIndex, (java.sql.Time)in);
- else
- {
- java.sql.Time tmpt;
- if (in instanceof java.util.Date) {
- tmpt = new java.sql.Time(((java.util.Date)in).getTime());
- } else {
- tmpt = connection.getTimestampUtils().toTime(null, in.toString());
- }
- setTime(parameterIndex, tmpt);
- }
- break;
- case Types.TIMESTAMP:
- if (in instanceof java.sql.Timestamp)
- setTimestamp(parameterIndex , (java.sql.Timestamp)in);
- else
- {
- java.sql.Timestamp tmpts;
- if (in instanceof java.util.Date) {
- tmpts = new java.sql.Timestamp(((java.util.Date)in).getTime());
- } else {
- tmpts = connection.getTimestampUtils().toTimestamp(null, in.toString());
- }
- setTimestamp(parameterIndex, tmpts);
- }
- break;
- case Types.BIT:
- bindLiteral(parameterIndex, pgType.toString(), Oid.BOOL);
- break;
- case Types.BINARY:
- case Types.VARBINARY:
- case Types.LONGVARBINARY:
- setObject(parameterIndex, in);
- break;
- case Types.BLOB:
- if (in instanceof Blob)
- setBlob(parameterIndex, (Blob)in);
- else
- throw new PSQLException(GT.tr("Cannot cast an instance of {0} to type {1}", new Object[]{in.getClass().getName(),"Types.BLOB"}), PSQLState.INVALID_PARAMETER_TYPE);
- break;
- case Types.CLOB:
- if (in instanceof Clob)
- setClob(parameterIndex, (Clob)in);
- else
- throw new PSQLException(GT.tr("Cannot cast an instance of {0} to type {1}", new Object[]{in.getClass().getName(),"Types.CLOB"}), PSQLState.INVALID_PARAMETER_TYPE);
- break;
- case Types.ARRAY:
- if (in instanceof Array)
- setArray(parameterIndex, (Array)in);
- else
- throw new PSQLException(GT.tr("Cannot cast an instance of {0} to type {1}", new Object[]{in.getClass().getName(),"Types.ARRAY"}), PSQLState.INVALID_PARAMETER_TYPE);
- break;
- case Types.DISTINCT:
- bindString(parameterIndex, in.toString(), Oid.UNSPECIFIED);
- break;
- case Types.OTHER:
- if (in instanceof PGobject)
- setPGobject(parameterIndex, (PGobject)in);
- else
- bindString(parameterIndex, in.toString(), Oid.UNSPECIFIED);
- break;
- default:
- throw new PSQLException(GT.tr("Unsupported Types value: {0}", new Integer(targetSqlType)), PSQLState.INVALID_PARAMETER_TYPE);
- }
- }
-
- public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException
- {
- setObject(parameterIndex, x, targetSqlType, 0);
- }
-
- /*
- * This stores an Object into a parameter.
- */
- public void setObject(int parameterIndex, Object x) throws SQLException
- {
- checkClosed();
- if (x == null)
- setNull(parameterIndex, Types.OTHER);
- else if (x instanceof String)
- setString(parameterIndex, (String)x);
- else if (x instanceof BigDecimal)
- setBigDecimal(parameterIndex, (BigDecimal)x);
- else if (x instanceof Short)
- setShort(parameterIndex, ((Short)x).shortValue());
- else if (x instanceof Integer)
- setInt(parameterIndex, ((Integer)x).intValue());
- else if (x instanceof Long)
- setLong(parameterIndex, ((Long)x).longValue());
- else if (x instanceof Float)
- setFloat(parameterIndex, ((Float)x).floatValue());
- else if (x instanceof Double)
- setDouble(parameterIndex, ((Double)x).doubleValue());
- else if (x instanceof byte[])
- setBytes(parameterIndex, (byte[])x);
- else if (x instanceof java.sql.Date)
- setDate(parameterIndex, (java.sql.Date)x);
- else if (x instanceof Time)
- setTime(parameterIndex, (Time)x);
- else if (x instanceof Timestamp)
- setTimestamp(parameterIndex, (Timestamp)x);
- else if (x instanceof Boolean)
- setBoolean(parameterIndex, ((Boolean)x).booleanValue());
- else if (x instanceof Byte)
- setByte(parameterIndex, ((Byte)x).byteValue());
- else if (x instanceof Blob)
- setBlob(parameterIndex, (Blob)x);
- else if (x instanceof Clob)
- setClob(parameterIndex, (Clob)x);
- else if (x instanceof Array)
- setArray(parameterIndex, (Array)x);
- else if (x instanceof PGobject)
- setPGobject(parameterIndex, (PGobject)x);
- else if (x instanceof Character)
- setString(parameterIndex, ((Character)x).toString());
- else if (x instanceof Map)
- setMap(parameterIndex, (Map)x);
- else
- {
- // Can't infer a type.
- throw new PSQLException(GT.tr("Can''t infer the SQL type to use for an instance of {0}. Use setObject() with an explicit Types value to specify the type to use.", x.getClass().getName()), PSQLState.INVALID_PARAMETER_TYPE);
- }
- }
-
- /*
- * Before executing a stored procedure call you must explicitly
- * call registerOutParameter to register the java.sql.Type of each
- * out parameter.
- *
- * <p>Note: When reading the value of an out parameter, you must use
- * the getXXX method whose Java type XXX corresponds to the
- * parameter's registered SQL type.
- *
- * ONLY 1 RETURN PARAMETER if {?= call ..} syntax is used
- *
- * @param parameterIndex the first parameter is 1, the second is 2,...
- * @param sqlType SQL type code defined by java.sql.Types; for
- * parameters of type Numeric or Decimal use the version of
- * registerOutParameter that accepts a scale value
- * @exception SQLException if a database-access error occurs.
- */
- public void registerOutParameter(int parameterIndex, int sqlType, boolean setPreparedParameters) throws SQLException
- {
- checkClosed();
- switch( sqlType )
- {
- case Types.TINYINT:
- // we don't have a TINYINT type use SMALLINT
- sqlType = Types.SMALLINT;
- break;
- case Types.LONGVARCHAR:
- sqlType = Types.VARCHAR;
- break;
- case Types.DECIMAL:
- sqlType = Types.NUMERIC;
- break;
- case Types.FLOAT:
- // float is the same as double
- sqlType = Types.DOUBLE;
- break;
- case Types.VARBINARY:
- case Types.LONGVARBINARY:
- sqlType = Types.BINARY;
- break;
- default:
- break;
- }
- if (!isFunction)
- throw new PSQLException (GT.tr("This statement does not declare an OUT parameter. Use '{' ?= call ... '}' to declare one."), PSQLState.STATEMENT_NOT_ALLOWED_IN_FUNCTION_CALL);
- checkIndex(parameterIndex, false);
-
- if( setPreparedParameters )
- preparedParameters.registerOutParameter( parameterIndex, sqlType );
- // functionReturnType contains the user supplied value to check
- // testReturn contains a modified version to make it easier to
- // check the getXXX methods..
- functionReturnType[parameterIndex-1] = sqlType;
- testReturn[parameterIndex-1] = sqlType;
-
- if (functionReturnType[parameterIndex-1] == Types.CHAR ||
- functionReturnType[parameterIndex-1] == Types.LONGVARCHAR)
- testReturn[parameterIndex-1] = Types.VARCHAR;
- else if (functionReturnType[parameterIndex-1] == Types.FLOAT)
- testReturn[parameterIndex-1] = Types.REAL; // changes to streamline later error checking
- returnTypeSet = true;
- }
-
- /*
- * You must also specify the scale for numeric/decimal types:
- *
- * <p>Note: When reading the value of an out parameter, you must use
- * the getXXX method whose Java type XXX corresponds to the
- * parameter's registered SQL type.
- *
- * @param parameterIndex the first parameter is 1, the second is 2,...
- * @param sqlType use either java.sql.Type.NUMERIC or java.sql.Type.DECIMAL
- * @param scale a value greater than or equal to zero representing the
- * desired number of digits to the right of the decimal point
- * @exception SQLException if a database-access error occurs.
- */
- public void registerOutParameter(int parameterIndex, int sqlType,
- int scale, boolean setPreparedParameters) throws SQLException
- {
- registerOutParameter (parameterIndex, sqlType, setPreparedParameters); // ignore for now..
- }
-
- /*
- * An OUT parameter may have the value of SQL NULL; wasNull
- * reports whether the last value read has this special value.
- *
- * <p>Note: You must first call getXXX on a parameter to read its
- * value and then call wasNull() to see if the value was SQL NULL.
- * @return true if the last parameter read was SQL NULL
- * @exception SQLException if a database-access error occurs.
- */
- public boolean wasNull() throws SQLException
- {
- if (lastIndex == 0)
- throw new PSQLException(GT.tr("wasNull cannot be call before fetching a result."), PSQLState.OBJECT_NOT_IN_STATE);
-
- // check to see if the last access threw an exception
- return (callResult[lastIndex-1] == null);
- }
-
- /*
- * Get the value of a CHAR, VARCHAR, or LONGVARCHAR parameter as a
- * Java String.
- *
- * @param parameterIndex the first parameter is 1, the second is 2,...
- * @return the parameter value; if the value is SQL NULL, the result is null
- * @exception SQLException if a database-access error occurs.
- */
- public String getString(int parameterIndex) throws SQLException
- {
- checkClosed();
- checkIndex (parameterIndex, Types.VARCHAR, "String");
- return (String)callResult[parameterIndex-1];
- }
-
-
- /*
- * Get the value of a BIT parameter as a Java boolean.
- *
- * @param parameterIndex the first parameter is 1, the second is 2,...
- * @return the parameter value; if the value is SQL NULL, the result is false
- * @exception SQLException if a database-access error occurs.
- */
- public boolean getBoolean(int parameterIndex) throws SQLException
- {
- checkClosed();
- checkIndex (parameterIndex, Types.BIT, "Boolean");
- if (callResult[parameterIndex-1] == null)
- return false;
-
- return ((Boolean)callResult[parameterIndex-1]).booleanValue ();
- }
-
- /*
- * Get the value of a TINYINT parameter as a Java byte.
- *
- * @param parameterIndex the first parameter is 1, the second is 2,...
- * @return the parameter value; if the value is SQL NULL, the result is 0
- * @exception SQLException if a database-access error occurs.
- */
- public byte getByte(int parameterIndex) throws SQLException
- {
- checkClosed();
- // fake tiny int with smallint
- checkIndex (parameterIndex, Types.SMALLINT, "Byte");
-
- if (callResult[parameterIndex-1] == null)
- return 0;
-
- return ((Integer)callResult[parameterIndex-1]).byteValue();
-
- }
-
- /*
- * Get the value of a SMALLINT parameter as a Java short.
- *
- * @param parameterIndex the first parameter is 1, the second is 2,...
- * @return the parameter value; if the value is SQL NULL, the result is 0
- * @exception SQLException if a database-access error occurs.
- */
- public short getShort(int parameterIndex) throws SQLException
- {
- checkClosed();
- checkIndex (parameterIndex, Types.SMALLINT, "Short");
- if (callResult[parameterIndex-1] == null)
- return 0;
- return ((Integer)callResult[parameterIndex-1]).shortValue ();
- }
-
-
- /*
- * Get the value of an INTEGER parameter as a Java int.
- *
- * @param parameterIndex the first parameter is 1, the second is 2,...
- * @return the parameter value; if the value is SQL NULL, the result is 0
- * @exception SQLException if a database-access error occurs.
- */
- public int getInt(int parameterIndex) throws SQLException
- {
- checkClosed();
- checkIndex (parameterIndex, Types.INTEGER, "Int");
- if (callResult[parameterIndex-1] == null)
- return 0;
-
- return ((Integer)callResult[parameterIndex-1]).intValue ();
- }
-
- /*
- * Get the value of a BIGINT parameter as a Java long.
- *
- * @param parameterIndex the first parameter is 1, the second is 2,...
- * @return the parameter value; if the value is SQL NULL, the result is 0
- * @exception SQLException if a database-access error occurs.
- */
- public long getLong(int parameterIndex) throws SQLException
- {
- checkClosed();
- checkIndex (parameterIndex, Types.BIGINT, "Long");
- if (callResult[parameterIndex-1] == null)
- return 0;
-
- return ((Long)callResult[parameterIndex-1]).longValue ();
- }
-
- /*
- * Get the value of a FLOAT parameter as a Java float.
- *
- * @param parameterIndex the first parameter is 1, the second is 2,...
- * @return the parameter value; if the value is SQL NULL, the result is 0
- * @exception SQLException if a database-access error occurs.
- */
- public float getFloat(int parameterIndex) throws SQLException
- {
- checkClosed();
- checkIndex (parameterIndex, Types.REAL, "Float");
- if (callResult[parameterIndex-1] == null)
- return 0;
-
- return ((Float)callResult[parameterIndex-1]).floatValue ();
- }
-
- /*
- * Get the value of a DOUBLE parameter as a Java double.
- *
- * @param parameterIndex the first parameter is 1, the second is 2,...
- * @return the parameter value; if the value is SQL NULL, the result is 0
- * @exception SQLException if a database-access error occurs.
- */
- public double getDouble(int parameterIndex) throws SQLException
- {
- checkClosed();
- checkIndex (parameterIndex, Types.DOUBLE, "Double");
- if (callResult[parameterIndex-1] == null)
- return 0;
-
- return ((Double)callResult[parameterIndex-1]).doubleValue ();
- }
-
- /*
- * Get the value of a NUMERIC parameter as a java.math.BigDecimal
- * object.
- *
- * @param parameterIndex the first parameter is 1, the second is 2,...
- * @param scale a value greater than or equal to zero representing the
- * desired number of digits to the right of the decimal point
- * @return the parameter value; if the value is SQL NULL, the result is null
- * @exception SQLException if a database-access error occurs.
- * @deprecated in Java2.0
- */
- public BigDecimal getBigDecimal(int parameterIndex, int scale)
- throws SQLException
- {
- checkClosed();
- checkIndex (parameterIndex, Types.NUMERIC, "BigDecimal");
- return ((BigDecimal)callResult[parameterIndex-1]);
- }
-
- /*
- * Get the value of a SQL BINARY or VARBINARY parameter as a Java
- * byte[]
- *
- * @param parameterIndex the first parameter is 1, the second is 2,...
- * @return the parameter value; if the value is SQL NULL, the result is null
- * @exception SQLException if a database-access error occurs.
- */
- public byte[] getBytes(int parameterIndex) throws SQLException
- {
- checkClosed();
- checkIndex (parameterIndex, Types.VARBINARY, Types.BINARY, "Bytes");
- return ((byte [])callResult[parameterIndex-1]);
- }
-
-
- /*
- * Get the value of a SQL DATE parameter as a java.sql.Date object
- *
- * @param parameterIndex the first parameter is 1, the second is 2,...
- * @return the parameter value; if the value is SQL NULL, the result is null
- * @exception SQLException if a database-access error occurs.
- */
- public java.sql.Date getDate(int parameterIndex) throws SQLException
- {
- checkClosed();
- checkIndex (parameterIndex, Types.DATE, "Date");
- return (java.sql.Date)callResult[parameterIndex-1];
- }
-
- /*
- * Get the value of a SQL TIME parameter as a java.sql.Time object.
- *
- * @param parameterIndex the first parameter is 1, the second is 2,...
- * @return the parameter value; if the value is SQL NULL, the result is null
- * @exception SQLException if a database-access error occurs.
- */
- public java.sql.Time getTime(int parameterIndex) throws SQLException
- {
- checkClosed();
- checkIndex (parameterIndex, Types.TIME, "Time");
- return (java.sql.Time)callResult[parameterIndex-1];
- }
-
- /*
- * Get the value of a SQL TIMESTAMP parameter as a java.sql.Timestamp object.
- *
- * @param parameterIndex the first parameter is 1, the second is 2,...
- * @return the parameter value; if the value is SQL NULL, the result is null
- * @exception SQLException if a database-access error occurs.
- */
- public java.sql.Timestamp getTimestamp(int parameterIndex)
- throws SQLException
- {
- checkClosed();
- checkIndex (parameterIndex, Types.TIMESTAMP, "Timestamp");
- return (java.sql.Timestamp)callResult[parameterIndex-1];
- }
-
- // getObject returns a Java object for the parameter.
- // See the JDBC spec's "Dynamic Programming" chapter for details.
- /*
- * Get the value of a parameter as a Java object.
- *
- * <p>This method returns a Java object whose type coresponds to the
- * SQL type that was registered for this parameter using
- * registerOutParameter.
- *
- * <P>Note that this method may be used to read datatabase-specific,
- * abstract data types. This is done by specifying a targetSqlType
- * of java.sql.types.OTHER, which allows the driver to return a
- * database-specific Java type.
- *
- * <p>See the JDBC spec's "Dynamic Programming" chapter for details.
- *
- * @param parameterIndex the first parameter is 1, the second is 2,...
- * @return A java.lang.Object holding the OUT parameter value.
- * @exception SQLException if a database-access error occurs.
- */
- public Object getObject(int parameterIndex)
- throws SQLException
- {
- checkClosed();
- checkIndex (parameterIndex);
- return callResult[parameterIndex-1];
- }
-
- /*
- * Returns the SQL statement with the current template values
- * substituted.
- */
- public String toString()
- {
- if (preparedQuery == null)
- return super.toString();
-
- return preparedQuery.toString(preparedParameters);
- }
-
-
- /*
- * Note if s is a String it should be escaped by the caller to avoid SQL
- * injection attacks. It is not done here for efficency reasons as
- * most calls to this method do not require escaping as the source
- * of the string is known safe (i.e. Integer.toString())
- */
- protected void bindLiteral(int paramIndex, String s, int oid) throws SQLException
- {
- if(adjustIndex)
- paramIndex--;
- preparedParameters.setLiteralParameter(paramIndex, s, oid);
- }
-
- protected void bindBytes(int paramIndex, byte[] b, int oid) throws SQLException
- {
- if(adjustIndex)
- paramIndex--;
- preparedParameters.setBinaryParameter(paramIndex, b, oid);
- }
-
- /*
- * This version is for values that should turn into strings
- * e.g. setString directly calls bindString with no escaping;
- * the per-protocol ParameterList does escaping as needed.
- */
- private void bindString(int paramIndex, String s, int oid) throws SQLException
- {
- if (adjustIndex)
- paramIndex--;
- preparedParameters.setStringParameter( paramIndex, s, oid);
- }
-
- /**
- * this method will turn a string of the form
- * { [? =] call <some_function> [(?, [?,..])] }
- * into the PostgreSQL format which is
- * select <some_function> (?, [?, ...]) as result
- * or select * from <some_function> (?, [?, ...]) as result (7.3)
- */
- private String modifyJdbcCall(String p_sql) throws SQLException
- {
- checkClosed();
-
- // Mini-parser for JDBC function-call syntax (only)
- // TODO: Merge with escape processing (and parameter parsing?)
- // so we only parse each query once.
-
- isFunction = false;
-
- boolean stdStrings = connection.getStandardConformingStrings();
-
- int len = p_sql.length();
- int state = 1;
- boolean inQuotes = false, inEscape = false;
- outParmBeforeFunc = false;
- int startIndex = -1, endIndex = -1;
- boolean syntaxError = false;
- int i = 0;
-
- while (i < len && !syntaxError)
- {
- char ch = p_sql.charAt(i);
-
- switch (state)
- {
- case 1: // Looking for { at start of query
- if (ch == '{')
- {
- ++i;
- ++state;
- }
- else if (Character.isWhitespace(ch))
- {
- ++i;
- }
- else
- {
- // Not function-call syntax. Skip the rest of the string.
- i = len;
- }
- break;
-
- case 2: // After {, looking for ? or =, skipping whitespace
- if (ch == '?')
- {
- outParmBeforeFunc = isFunction = true; // { ? = call ... } -- function with one out parameter
- ++i;
- ++state;
- }
- else if (ch == 'c')
- { // { call ... } -- proc with no out parameters
- state += 3; // Don't increase 'i'
- }
- else if (Character.isWhitespace(ch))
- {
- ++i;
- }
- else
- {
- // "{ foo ...", doesn't make sense, complain.
- syntaxError = true;
- }
- break;
-
- case 3: // Looking for = after ?, skipping whitespace
- if (ch == '=')
- {
- ++i;
- ++state;
- }
- else if (Character.isWhitespace(ch))
- {
- ++i;
- }
- else
- {
- syntaxError = true;
- }
- break;
-
- case 4: // Looking for 'call' after '? =' skipping whitespace
- if (ch == 'c' || ch == 'C')
- {
- ++state; // Don't increase 'i'.
- }
- else if (Character.isWhitespace(ch))
- {
- ++i;
- }
- else
- {
- syntaxError = true;
- }
- break;
-
- case 5: // Should be at 'call ' either at start of string or after ?=
- if ((ch == 'c' || ch == 'C') && i + 4 <= len && p_sql.substring(i, i + 4).equalsIgnoreCase("call"))
- {
- isFunction=true;
- i += 4;
- ++state;
- }
- else if (Character.isWhitespace(ch))
- {
- ++i;
- }
- else
- {
- syntaxError = true;
- }
- break;
-
- case 6: // Looking for whitespace char after 'call'
- if (Character.isWhitespace(ch))
- {
- // Ok, we found the start of the real call.
- ++i;
- ++state;
- startIndex = i;
- }
- else
- {
- syntaxError = true;
- }
- break;
-
- case 7: // In "body" of the query (after "{ [? =] call ")
- if (ch == '\'')
- {
- inQuotes = !inQuotes;
- ++i;
- }
- else if (inQuotes && ch == '\\' && !stdStrings)
- {
- // Backslash in string constant, skip next character.
- i += 2;
- }
- else if (!inQuotes && ch == '{')
- {
- inEscape = !inEscape;
- ++i;
- }
- else if (!inQuotes && ch == '}')
- {
- if (!inEscape)
- {
- // Should be end of string.
- endIndex = i;
- ++i;
- ++state;
- }
- else
- {
- inEscape = false;
- }
- }
- else if (!inQuotes && ch == ';')
- {
- syntaxError = true;
- }
- else
- {
- // Everything else is ok.
- ++i;
- }
- break;
-
- case 8: // At trailing end of query, eating whitespace
- if (Character.isWhitespace(ch))
- {
- ++i;
- }
- else
- {
- syntaxError = true;
- }
- break;
-
- default:
- throw new IllegalStateException("somehow got into bad state " + state);
- }
- }
-
- // We can only legally end in a couple of states here.
- if (i == len && !syntaxError)
- {
- if (state == 1)
- return p_sql; // Not an escaped syntax.
- if (state != 8)
- syntaxError = true; // Ran out of query while still parsing
- }
-
- if (syntaxError)
- throw new PSQLException (GT.tr("Malformed function or procedure escape syntax at offset {0}.", new Integer(i)),
- PSQLState.STATEMENT_NOT_ALLOWED_IN_FUNCTION_CALL);
-
- if (connection.haveMinimumServerVersion("8.1") && ((AbstractJdbc2Connection)connection).getProtocolVersion() == 3)
- {
- String s = p_sql.substring(startIndex, endIndex );
- StringBuffer sb = new StringBuffer(s);
- if ( outParmBeforeFunc )
- {
- // move the single out parameter into the function call
- // so that it can be treated like all other parameters
- boolean needComma=false;
-
- // have to use String.indexOf for java 2
- int opening = s.indexOf('(')+1;
- int closing = s.indexOf(')');
- for ( int j=opening; j< closing;j++ )
- {
- if ( !Character.isWhitespace(sb.charAt(j)) )
- {
- needComma = true;
- break;
- }
- }
- if ( needComma )
- {
- sb.insert(opening, "?,");
- }
- else
- {
- sb.insert(opening, "?");
- }
-
- }
- return "select * from " + sb.toString() + " as result";
- }
- else
- {
- return "select " + p_sql.substring(startIndex, endIndex) + " as result";
- }
- }
-
- /** helperfunction for the getXXX calls to check isFunction and index == 1
- * Compare BOTH type fields against the return type.
- */
- protected void checkIndex (int parameterIndex, int type1, int type2, String getName)
- throws SQLException
- {
- checkIndex (parameterIndex);
- if (type1 != this.testReturn[parameterIndex-1] && type2 != this.testReturn[parameterIndex-1])
- throw new PSQLException(GT.tr("Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was made.",
- new Object[]{"java.sql.Types=" + testReturn[parameterIndex-1],
- getName,
- "java.sql.Types=" + type1}),
- PSQLState.MOST_SPECIFIC_TYPE_DOES_NOT_MATCH);
- }
-
- /** helperfunction for the getXXX calls to check isFunction and index == 1
- */
- protected void checkIndex (int parameterIndex, int type, String getName)
- throws SQLException
- {
- checkIndex (parameterIndex);
- if (type != this.testReturn[parameterIndex-1])
- throw new PSQLException(GT.tr("Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was made.",
- new Object[]{"java.sql.Types=" + testReturn[parameterIndex-1],
- getName,
- "java.sql.Types=" + type}),
- PSQLState.MOST_SPECIFIC_TYPE_DOES_NOT_MATCH);
- }
-
- private void checkIndex (int parameterIndex) throws SQLException
- {
- checkIndex(parameterIndex, true);
- }
-
- /** helperfunction for the getXXX calls to check isFunction and index == 1
- * @param parameterIndex index of getXXX (index)
- * check to make sure is a function and index == 1
- */
- private void checkIndex (int parameterIndex, boolean fetchingData) throws SQLException
- {
- if (!isFunction)
- throw new PSQLException(GT.tr("A CallableStatement was declared, but no call to registerOutParameter(1, <some type>) was made."), PSQLState.STATEMENT_NOT_ALLOWED_IN_FUNCTION_CALL);
-
- if (fetchingData) {
- if (!returnTypeSet)
- throw new PSQLException(GT.tr("No function outputs were registered."), PSQLState.OBJECT_NOT_IN_STATE);
-
- if (callResult == null)
- throw new PSQLException(GT.tr("Results cannot be retrieved from a CallableStatement before it is executed."), PSQLState.NO_DATA);
-
- lastIndex = parameterIndex;
- }
- }
-
- public void setPrepareThreshold(int newThreshold) throws SQLException {
- checkClosed();
-
- if (ForceBinaryTransfers)
- newThreshold = 1;
-
- if (newThreshold < 0)
- newThreshold = 0;
-
- this.m_prepareThreshold = newThreshold;
- }
-
- public int getPrepareThreshold() {
- return m_prepareThreshold;
- }
-
- public void setUseServerPrepare(boolean flag) throws SQLException {
- setPrepareThreshold(flag ? 1 : 0);
- }
-
- public boolean isUseServerPrepare() {
- return (preparedQuery != null && m_prepareThreshold != 0 && m_useCount + 1 >= m_prepareThreshold);
- }
-
- protected void checkClosed() throws SQLException
- {
- if (isClosed)
- throw new PSQLException(GT.tr("This statement has been closed."),
- PSQLState.OBJECT_NOT_IN_STATE);
- }
-
- // ** JDBC 2 Extensions **
-
- public void addBatch(String p_sql) throws SQLException
- {
- checkClosed();
-
- if (preparedQuery != null)
- throw new PSQLException(GT.tr("Can''t use query methods that take a query string on a PreparedStatement."),
- PSQLState.WRONG_OBJECT_TYPE);
-
- if (batchStatements == null)
- {
- batchStatements = new ArrayList();
- batchParameters = new ArrayList();
- }
-
- p_sql = replaceProcessing(p_sql);
-
- batchStatements.add(connection.getQueryExecutor().createSimpleQuery(p_sql));
- batchParameters.add(null);
- }
-
- public void clearBatch() throws SQLException
- {
- if (batchStatements != null)
- {
- batchStatements.clear();
- batchParameters.clear();
- }
- }
-
- //
- // ResultHandler for batch queries.
- //
-
- private class BatchResultHandler implements ResultHandler {
- private BatchUpdateException batchException = null;
- private int resultIndex = 0;
-
- private final Query[] queries;
- private final ParameterList[] parameterLists;
- private final int[] updateCounts;
- private final boolean expectGeneratedKeys;
- private ResultSet generatedKeys;
-
- BatchResultHandler(Query[] queries, ParameterList[] parameterLists, int[] updateCounts, boolean expectGeneratedKeys) {
- this.queries = queries;
- this.parameterLists = parameterLists;
- this.updateCounts = updateCounts;
- this.expectGeneratedKeys = expectGeneratedKeys;
- }
-
- public void handleResultRows(Query fromQuery, Field[] fields, List tuples, ResultCursor cursor) {
- if (!expectGeneratedKeys) {
- handleError(new PSQLException(GT.tr("A result was returned when none was expected."),
- PSQLState.TOO_MANY_RESULTS));
- } else {
- if (generatedKeys == null) {
- try
- {
- generatedKeys = AbstractJdbc2Statement.this.createResultSet(fromQuery, fields, tuples, cursor);
- }
- catch (SQLException e)
- {
- handleError(e);
-
- }
- } else {
- ((AbstractJdbc2ResultSet)generatedKeys).addRows(tuples);
- }
- }
- }
-
- public void handleCommandStatus(String status, int updateCount, long insertOID) {
- if (resultIndex >= updateCounts.length)
- {
- handleError(new PSQLException(GT.tr("Too many update results were returned."),
- PSQLState.TOO_MANY_RESULTS));
- return ;
- }
-
- updateCounts[resultIndex++] = updateCount;
- }
-
- public void handleWarning(SQLWarning warning) {
- AbstractJdbc2Statement.this.addWarning(warning);
- }
-
- public void handleError(SQLException newError) {
- if (batchException == null)
- {
- int[] successCounts;
-
- if (resultIndex >= updateCounts.length)
- successCounts = updateCounts;
- else
- {
- successCounts = new int[resultIndex];
- System.arraycopy(updateCounts, 0, successCounts, 0, resultIndex);
- }
-
- String queryString = "<unknown>";
- if (resultIndex < queries.length)
- queryString = queries[resultIndex].toString(parameterLists[resultIndex]);
-
- batchException = new BatchUpdateException(GT.tr("Batch entry {0} {1} was aborted. Call getNextException to see the cause.",
- new Object[]{ new Integer(resultIndex),
- queryString}),
- newError.getSQLState(),
- successCounts);
- }
-
- batchException.setNextException(newError);
- }
-
- public void handleCompletion() throws SQLException {
- if (batchException != null)
- throw batchException;
- }
-
- public ResultSet getGeneratedKeys() {
- return generatedKeys;
- }
- }
- private class CallableBatchResultHandler implements ResultHandler {
- private BatchUpdateException batchException = null;
- private int resultIndex = 0;
-
- private final Query[] queries;
- private final ParameterList[] parameterLists;
- private final int[] updateCounts;
-
- CallableBatchResultHandler(Query[] queries, ParameterList[] parameterLists, int[] updateCounts) {
- this.queries = queries;
- this.parameterLists = parameterLists;
- this.updateCounts = updateCounts;
- }
-
- public void handleResultRows(Query fromQuery, Field[] fields, List tuples, ResultCursor cursor)
- {
-
- }
-
- public void handleCommandStatus(String status, int updateCount, long insertOID) {
- if (resultIndex >= updateCounts.length)
- {
- handleError(new PSQLException(GT.tr("Too many update results were returned."),
- PSQLState.TOO_MANY_RESULTS));
- return ;
- }
-
- updateCounts[resultIndex++] = updateCount;
- }
-
- public void handleWarning(SQLWarning warning) {
- AbstractJdbc2Statement.this.addWarning(warning);
- }
-
- public void handleError(SQLException newError) {
- if (batchException == null)
- {
- int[] successCounts;
-
- if (resultIndex >= updateCounts.length)
- successCounts = updateCounts;
- else
- {
- successCounts = new int[resultIndex];
- System.arraycopy(updateCounts, 0, successCounts, 0, resultIndex);
- }
-
- String queryString = "<unknown>";
- if (resultIndex < queries.length)
- queryString = queries[resultIndex].toString(parameterLists[resultIndex]);
-
- batchException = new BatchUpdateException(GT.tr("Batch entry {0} {1} was aborted. Call getNextException to see the cause.",
- new Object[]{ new Integer(resultIndex),
- queryString}),
- newError.getSQLState(),
- successCounts);
- }
-
- batchException.setNextException(newError);
- }
-
- public void handleCompletion() throws SQLException {
- if (batchException != null)
- throw batchException;
- }
- }
-
-
- public int[] executeBatch() throws SQLException
- {
- checkClosed();
-
- closeForNextExecution();
-
- if (batchStatements == null || batchStatements.isEmpty())
- return new int[0];
-
- int size = batchStatements.size();
- int[] updateCounts = new int[size];
-
- // Construct query/parameter arrays.
- Query[] queries = (Query[])batchStatements.toArray(new Query[batchStatements.size()]);
- ParameterList[] parameterLists = (ParameterList[])batchParameters.toArray(new ParameterList[batchParameters.size()]);
- batchStatements.clear();
- batchParameters.clear();
-
- int flags;
- boolean preDescribe = false;
-
- if (wantsGeneratedKeysAlways) {
- flags = QueryExecutor.QUERY_BOTH_ROWS_AND_STATUS | QueryExecutor.QUERY_DISALLOW_BATCHING;
- } else {
- flags = QueryExecutor.QUERY_NO_RESULTS;
- }
-
- // Only use named statements after we hit the threshold
- if (preparedQuery != null)
- {
- m_useCount += queries.length;
- }
- if (m_prepareThreshold == 0 || m_useCount < m_prepareThreshold) {
- flags |= QueryExecutor.QUERY_ONESHOT;
- } else {
- preDescribe = wantsGeneratedKeysAlways && !queries[0].isStatementDescribed();
- }
-
- if (connection.getAutoCommit())
- flags |= QueryExecutor.QUERY_SUPPRESS_BEGIN;
-
- if (preDescribe || ForceBinaryTransfers) {
- int flags2 = flags | QueryExecutor.QUERY_DESCRIBE_ONLY;
- StatementResultHandler handler2 = new StatementResultHandler();
- connection.getQueryExecutor().execute(queries[0], parameterLists[0], handler2, 0, 0, flags2);
- ResultWrapper result2 = handler2.getResults();
- if (result2 != null) {
- result2.getResultSet().close();
- }
- }
-
- result = null;
-
- ResultHandler handler;
- if (isFunction) {
- handler = new CallableBatchResultHandler(queries, parameterLists, updateCounts );
- } else {
- handler = new BatchResultHandler(queries, parameterLists, updateCounts, wantsGeneratedKeysAlways);
- }
-
- connection.getQueryExecutor().execute(queries,
- parameterLists,
- handler,
- maxrows,
- fetchSize,
- flags);
-
- if (wantsGeneratedKeysAlways) {
- generatedKeys = new ResultWrapper(((BatchResultHandler)handler).getGeneratedKeys());
- }
-
- return updateCounts;
- }
-
- /*
- * Cancel can be used by one thread to cancel a statement that
- * is being executed by another thread.
- * <p>
- *
- * @exception SQLException only because thats the spec.
- */
- public void cancel() throws SQLException
- {
- connection.cancelQuery();
- }
-
- public Connection getConnection() throws SQLException
- {
- return (Connection) connection;
- }
-
- public int getFetchDirection()
- {
- return fetchdirection;
- }
-
- public int getResultSetConcurrency()
- {
- return concurrency;
- }
-
- public int getResultSetType()
- {
- return resultsettype;
- }
-
- public void setFetchDirection(int direction) throws SQLException
- {
- switch (direction)
- {
- case ResultSet.FETCH_FORWARD:
- case ResultSet.FETCH_REVERSE:
- case ResultSet.FETCH_UNKNOWN:
- fetchdirection = direction;
- break;
- default:
- throw new PSQLException(GT.tr("Invalid fetch direction constant: {0}.", new Integer(direction)),
- PSQLState.INVALID_PARAMETER_VALUE);
- }
- }
-
- public void setFetchSize(int rows) throws SQLException
- {
- checkClosed();
- if (rows < 0)
- throw new PSQLException(GT.tr("Fetch size must be a value greater to or equal to 0."),
- PSQLState.INVALID_PARAMETER_VALUE);
- fetchSize = rows;
- }
-
- public void addBatch() throws SQLException
- {
- checkClosed();
-
- if (batchStatements == null)
- {
- batchStatements = new ArrayList();
- batchParameters = new ArrayList();
- }
-
- // we need to create copies of our parameters, otherwise the values can be changed
- batchStatements.add(preparedQuery);
- batchParameters.add(preparedParameters.copy());
- }
-
- public ResultSetMetaData getMetaData() throws SQLException
- {
- checkClosed();
- ResultSet rs = getResultSet();
-
- if (rs == null) {
- // OK, we haven't executed it yet, we've got to go to the backend
- // for more info. We send the full query, but just don't
- // execute it.
-
- int flags = QueryExecutor.QUERY_ONESHOT | QueryExecutor.QUERY_DESCRIBE_ONLY | QueryExecutor.QUERY_SUPPRESS_BEGIN;
- StatementResultHandler handler = new StatementResultHandler();
- connection.getQueryExecutor().execute(preparedQuery, preparedParameters, handler, 0, 0, flags);
- ResultWrapper wrapper = handler.getResults();
- if (wrapper != null) {
- rs = wrapper.getResultSet();
- }
- }
-
- if (rs != null)
- return rs.getMetaData();
-
- return null;
- }
-
- public void setArray(int i, java.sql.Array x) throws SQLException
- {
- checkClosed();
-
- if (null == x)
- {
- setNull(i, Types.ARRAY);
- return;
- }
-
- // This only works for Array implementations that return a valid array
- // literal from Array.toString(), such as the implementation we return
- // from ResultSet.getArray(). Eventually we need a proper implementation
- // here that works for any Array implementation.
-
- // Use a typename that is "_" plus the base type; this matches how the
- // backend looks for array types.
- String typename = "_" + x.getBaseTypeName();
- int oid = connection.getTypeInfo().getPGType(typename);
- if (oid == Oid.UNSPECIFIED)
- throw new PSQLException(GT.tr("Unknown type {0}.", typename), PSQLState.INVALID_PARAMETER_TYPE);
-
- if (x instanceof AbstractJdbc2Array) {
- AbstractJdbc2Array arr = (AbstractJdbc2Array) x;
- if (arr.isBinary()) {
- bindBytes(i, arr.toBytes(), oid);
- return;
- }
- }
-
- setString(i, x.toString(), oid);
- }
-
- public void setBlob(int i, Blob x) throws SQLException
- {
- checkClosed();
-
- if (x == null)
- {
- setNull(i, Types.BLOB);
- return;
- }
-
- InputStream l_inStream = x.getBinaryStream();
- LargeObjectManager lom = connection.getLargeObjectAPI();
- long oid = lom.createLO();
- LargeObject lob = lom.open(oid);
- OutputStream los = lob.getOutputStream();
- byte[] buf = new byte[4096];
- try
- {
- // could be buffered, but then the OutputStream returned by LargeObject
- // is buffered internally anyhow, so there would be no performance
- // boost gained, if anything it would be worse!
- long bytesRemaining = x.length();
- int numRead = l_inStream.read(buf, 0, (int)Math.min((long)buf.length, bytesRemaining));
- while (numRead != -1 && bytesRemaining > 0)
- {
- bytesRemaining -= numRead;
- if ( numRead == buf.length )
- los.write(buf); // saves a buffer creation and copy in LargeObject since it's full
- else
- los.write(buf, 0, numRead);
- numRead = l_inStream.read(buf, 0, (int)Math.min((long)buf.length, bytesRemaining));
- }
- }
- catch (IOException se)
- {
- throw new PSQLException(GT.tr("Unexpected error writing large object to database."), PSQLState.UNEXPECTED_ERROR, se);
- }
- finally
- {
- try
- {
- los.close();
- l_inStream.close();
- }
- catch ( Exception e )
- {
- }
- }
- setLong(i, oid);
- }
-
- public void setCharacterStream(int i, java.io.Reader x, int length) throws SQLException
- {
- checkClosed();
-
- if (x == null) {
- if (connection.haveMinimumServerVersion("7.2")) {
- setNull(i, Types.VARCHAR);
- } else {
- setNull(i, Types.CLOB);
- }
- return;
- }
-
- if (length < 0)
- throw new PSQLException(GT.tr("Invalid stream length {0}.", new Integer(length)),
- PSQLState.INVALID_PARAMETER_VALUE);
-
- if (connection.haveMinimumCompatibleVersion("7.2"))
- {
- //Version 7.2 supports CharacterStream for for the PG text types
- //As the spec/javadoc for this method indicate this is to be used for
- //large text values (i.e. LONGVARCHAR) PG doesn't have a separate
- //long varchar datatype, but with toast all the text datatypes are capable of
- //handling very large values. Thus the implementation ends up calling
- //setString() since there is no current way to stream the value to the server
- char[] l_chars = new char[length];
- int l_charsRead = 0;
- try
- {
- while (true)
- {
- int n = x.read(l_chars, l_charsRead, length - l_charsRead);
- if (n == -1)
- break;
-
- l_charsRead += n;
-
- if (l_charsRead == length)
- break;
- }
- }
- catch (IOException l_ioe)
- {
- throw new PSQLException(GT.tr("Provided Reader failed."), PSQLState.UNEXPECTED_ERROR, l_ioe);
- }
- setString(i, new String(l_chars, 0, l_charsRead));
- }
- else
- {
- //Version 7.1 only supported streams for LargeObjects
- //but the jdbc spec indicates that streams should be
- //available for LONGVARCHAR instead
- LargeObjectManager lom = connection.getLargeObjectAPI();
- long oid = lom.createLO();
- LargeObject lob = lom.open(oid);
- OutputStream los = lob.getOutputStream();
- try
- {
- // could be buffered, but then the OutputStream returned by LargeObject
- // is buffered internally anyhow, so there would be no performance
- // boost gained, if anything it would be worse!
- int c = x.read();
- int p = 0;
- while (c > -1 && p < length)
- {
- los.write(c);
- c = x.read();
- p++;
- }
- los.close();
- }
- catch (IOException se)
- {
- throw new PSQLException(GT.tr("Unexpected error writing large object to database."), PSQLState.UNEXPECTED_ERROR, se);
- }
- // lob is closed by the stream so don't call lob.close()
- setLong(i, oid);
- }
- }
-
- public void setClob(int i, Clob x) throws SQLException
- {
- checkClosed();
-
- if (x == null)
- {
- setNull(i, Types.CLOB);
- return;
- }
-
- InputStream l_inStream = x.getAsciiStream();
- int l_length = (int) x.length();
- LargeObjectManager lom = connection.getLargeObjectAPI();
- long oid = lom.createLO();
- LargeObject lob = lom.open(oid);
- OutputStream los = lob.getOutputStream();
- try
- {
- // could be buffered, but then the OutputStream returned by LargeObject
- // is buffered internally anyhow, so there would be no performance
- // boost gained, if anything it would be worse!
- int c = l_inStream.read();
- int p = 0;
- while (c > -1 && p < l_length)
- {
- los.write(c);
- c = l_inStream.read();
- p++;
- }
- los.close();
- }
- catch (IOException se)
- {
- throw new PSQLException(GT.tr("Unexpected error writing large object to database."), PSQLState.UNEXPECTED_ERROR, se);
- }
- // lob is closed by the stream so don't call lob.close()
- setLong(i, oid);
- }
-
- public void setNull(int i, int t, String s) throws SQLException
- {
- checkClosed();
- setNull(i, t);
- }
-
- public void setRef(int i, Ref x) throws SQLException
- {
- throw Driver.notImplemented(this.getClass(), "setRef(int,Ref)");
- }
-
- public void setDate(int i, java.sql.Date d, java.util.Calendar cal) throws SQLException
- {
- checkClosed();
-
- if (d == null)
- {
- setNull(i, Types.DATE);
- return;
- }
-
- if (connection.binaryTransferSend(Oid.DATE)) {
- byte[] val = new byte[4];
- TimeZone tz = cal != null ? cal.getTimeZone() : null;
- connection.getTimestampUtils().toBinDate(tz, val, d);
- preparedParameters.setBinaryParameter(i, val, Oid.DATE);
- return;
- }
-
- if (cal != null)
- cal = (Calendar)cal.clone();
-
- // We must use UNSPECIFIED here, or inserting a Date-with-timezone into a
- // timestamptz field does an unexpected rotation by the server's TimeZone:
- //
- // We want to interpret 2005/01/01 with calendar +0100 as
- // "local midnight in +0100", but if we go via date it interprets it
- // as local midnight in the server's timezone:
-
- // template1=# select '2005-01-01+0100'::timestamptz;
- // timestamptz
- // ------------------------
- // 2005-01-01 02:00:00+03
- // (1 row)
-
- // template1=# select '2005-01-01+0100'::date::timestamptz;
- // timestamptz
- // ------------------------
- // 2005-01-01 00:00:00+03
- // (1 row)
-
- bindString(i, connection.getTimestampUtils().toString(cal, d), Oid.UNSPECIFIED);
- }
-
- public void setTime(int i, Time t, java.util.Calendar cal) throws SQLException
- {
- checkClosed();
-
- if (t == null)
- {
- setNull(i, Types.TIME);
- return;
- }
-
- if (cal != null)
- cal = (Calendar)cal.clone();
-
- bindString(i, connection.getTimestampUtils().toString(cal, t), Oid.UNSPECIFIED);
- }
-
- public void setTimestamp(int i, Timestamp t, java.util.Calendar cal) throws SQLException
- {
- checkClosed();
-
- if (t == null) {
- setNull(i, Types.TIMESTAMP);
- return;
- }
-
- if (cal != null)
- cal = (Calendar)cal.clone();
-
- // Use UNSPECIFIED as a compromise to get both TIMESTAMP and TIMESTAMPTZ working.
- // This is because you get this in a +1300 timezone:
- //
- // template1=# select '2005-01-01 15:00:00 +1000'::timestamptz;
- // timestamptz
- // ------------------------
- // 2005-01-01 18:00:00+13
- // (1 row)
-
- // template1=# select '2005-01-01 15:00:00 +1000'::timestamp;
- // timestamp
- // ---------------------
- // 2005-01-01 15:00:00
- // (1 row)
-
- // template1=# select '2005-01-01 15:00:00 +1000'::timestamptz::timestamp;
- // timestamp
- // ---------------------
- // 2005-01-01 18:00:00
- // (1 row)
-
- // So we want to avoid doing a timestamptz -> timestamp conversion, as that
- // will first convert the timestamptz to an equivalent time in the server's
- // timezone (+1300, above), then turn it into a timestamp with the "wrong"
- // time compared to the string we originally provided. But going straight
- // to timestamp is OK as the input parser for timestamp just throws away
- // the timezone part entirely. Since we don't know ahead of time what type
- // we're actually dealing with, UNSPECIFIED seems the lesser evil, even if it
- // does give more scope for type-mismatch errors being silently hidden.
-
- bindString(i, connection.getTimestampUtils().toString(cal, t), Oid.UNSPECIFIED); // Let the server infer the right type.
- }
-
- // ** JDBC 2 Extensions for CallableStatement**
-
- public java.sql.Array getArray(int i) throws SQLException
- {
- checkClosed();
- checkIndex(i, Types.ARRAY, "Array");
- return (Array)callResult[i-1];
- }
-
- public java.math.BigDecimal getBigDecimal(int parameterIndex) throws SQLException
- {
- checkClosed();
- checkIndex (parameterIndex, Types.NUMERIC, "BigDecimal");
- return ((BigDecimal)callResult[parameterIndex-1]);
- }
-
- public Blob getBlob(int i) throws SQLException
- {
- throw Driver.notImplemented(this.getClass(), "getBlob(int)");
- }
-
- public Clob getClob(int i) throws SQLException
- {
- throw Driver.notImplemented(this.getClass(), "getClob(int)");
- }
-
- public Object getObjectImpl(int i, java.util.Map map) throws SQLException
- {
- if (map == null || map.isEmpty()) {
- return getObject(i);
- }
- throw Driver.notImplemented(this.getClass(), "getObjectImpl(int,Map)");
- }
-
- public Ref getRef(int i) throws SQLException
- {
- throw Driver.notImplemented(this.getClass(), "getRef(int)");
- }
-
- public java.sql.Date getDate(int i, java.util.Calendar cal) throws SQLException
- {
- checkClosed();
- checkIndex(i, Types.DATE, "Date");
-
- if (callResult[i-1] == null)
- return null;
-
- if (cal != null)
- cal = (Calendar)cal.clone();
-
- String value = callResult[i-1].toString();
- return connection.getTimestampUtils().toDate(cal, value);
- }
-
- public Time getTime(int i, java.util.Calendar cal) throws SQLException
- {
- checkClosed();
- checkIndex(i, Types.TIME, "Time");
-
- if (callResult[i-1] == null)
- return null;
-
- if (cal != null)
- cal = (Calendar)cal.clone();
-
- String value = callResult[i-1].toString();
- return connection.getTimestampUtils().toTime(cal, value);
- }
-
- public Timestamp getTimestamp(int i, java.util.Calendar cal) throws SQLException
- {
- checkClosed();
- checkIndex(i, Types.TIMESTAMP, "Timestamp");
-
- if (callResult[i-1] == null)
- return null;
-
- if (cal != null)
- cal = (Calendar)cal.clone();
-
- String value = callResult[i-1].toString();
- return connection.getTimestampUtils().toTimestamp(cal, value);
- }
-
- // no custom types allowed yet..
- public void registerOutParameter(int parameterIndex, int sqlType, String typeName) throws SQLException
- {
- throw Driver.notImplemented(this.getClass(), "registerOutParameter(int,int,String)");
- }
-
- private synchronized void killTimer()
- {
- if ( cancelTimer != null )
- {
- cancelTimer.cancel();
- cancelTimer = null;
- }
-
- }
-}
diff --git a/org/postgresql/jdbc2/EscapedFunctions.java b/org/postgresql/jdbc2/EscapedFunctions.java
deleted file mode 100644
index 5c4e72e..0000000
--- a/org/postgresql/jdbc2/EscapedFunctions.java
+++ /dev/null
@@ -1,596 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc2;
-
-import java.lang.reflect.Method;
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.List;
-import java.util.Map;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * this class stores supported escaped function
- * @author Xavier Poinsard
- */
-public class EscapedFunctions {
- // numeric functions names
- public final static String ABS="abs";
- public final static String ACOS="acos";
- public final static String ASIN="asin";
- public final static String ATAN="atan";
- public final static String ATAN2="atan2";
- public final static String CEILING="ceiling";
- public final static String COS="cos";
- public final static String COT="cot";
- public final static String DEGREES="degrees";
- public final static String EXP="exp";
- public final static String FLOOR="floor";
- public final static String LOG="log";
- public final static String LOG10="log10";
- public final static String MOD="mod";
- public final static String PI="pi";
- public final static String POWER="power";
- public final static String RADIANS="radians";
- public final static String ROUND="round";
- public final static String SIGN="sign";
- public final static String SIN="sin";
- public final static String SQRT="sqrt";
- public final static String TAN="tan";
- public final static String TRUNCATE="truncate";
-
- // string function names
- public final static String ASCII="ascii";
- public final static String CHAR="char";
- public final static String CONCAT="concat";
- public final static String INSERT="insert"; // change arguments order
- public final static String LCASE="lcase";
- public final static String LEFT="left";
- public final static String LENGTH="length";
- public final static String LOCATE="locate"; // the 3 args version duplicate args
- public final static String LTRIM="ltrim";
- public final static String REPEAT="repeat";
- public final static String REPLACE="replace";
- public final static String RIGHT="right"; // duplicate args
- public final static String RTRIM="rtrim";
- public final static String SPACE="space";
- public final static String SUBSTRING="substring";
- public final static String UCASE="ucase";
- // soundex is implemented on the server side by
- // the contrib/fuzzystrmatch module. We provide a translation
- // for this in the driver, but since we don't want to bother with run
- // time detection of this module's installation we don't report this
- // method as supported in DatabaseMetaData.
- // difference is currently unsupported entirely.
-
- // date time function names
- public final static String CURDATE="curdate";
- public final static String CURTIME="curtime";
- public final static String DAYNAME="dayname";
- public final static String DAYOFMONTH="dayofmonth";
- public final static String DAYOFWEEK="dayofweek";
- public final static String DAYOFYEAR="dayofyear";
- public final static String HOUR="hour";
- public final static String MINUTE="minute";
- public final static String MONTH="month";
- public final static String MONTHNAME="monthname";
- public final static String NOW="now";
- public final static String QUARTER="quarter";
- public final static String SECOND="second";
- public final static String WEEK="week";
- public final static String YEAR="year";
- // for timestampadd and timestampdiff the fractional part of second is not supported
- // by the backend
- // timestampdiff is very partially supported
- public final static String TIMESTAMPADD="timestampadd";
- public final static String TIMESTAMPDIFF="timestampdiff";
-
- // constants for timestampadd and timestampdiff
- public final static String SQL_TSI_ROOT="SQL_TSI_";
- public final static String SQL_TSI_DAY="DAY";
- public final static String SQL_TSI_FRAC_SECOND="FRAC_SECOND";
- public final static String SQL_TSI_HOUR="HOUR";
- public final static String SQL_TSI_MINUTE="MINUTE";
- public final static String SQL_TSI_MONTH="MONTH";
- public final static String SQL_TSI_QUARTER="QUARTER";
- public final static String SQL_TSI_SECOND="SECOND";
- public final static String SQL_TSI_WEEK="WEEK";
- public final static String SQL_TSI_YEAR="YEAR";
-
-
- // system functions
- public final static String DATABASE="database";
- public final static String IFNULL="ifnull";
- public final static String USER="user";
-
-
- /** storage for functions implementations */
- private static Map functionMap = createFunctionMap();
-
- private static Map createFunctionMap() {
- Method[] arrayMeths = EscapedFunctions.class.getDeclaredMethods();
- Map functionMap = new HashMap(arrayMeths.length*2);
- for (int i=0;i<arrayMeths.length;i++){
- Method meth = arrayMeths[i];
- if (meth.getName().startsWith("sql"))
- functionMap.put(meth.getName().toLowerCase(Locale.US),meth);
- }
- return functionMap;
- }
-
- /**
- * get Method object implementing the given function
- * @param functionName name of the searched function
- * @return a Method object or null if not found
- */
- public static Method getFunction(String functionName){
- return (Method) functionMap.get("sql"+functionName.toLowerCase(Locale.US));
- }
-
- // ** numeric functions translations **
- /** ceiling to ceil translation */
- public static String sqlceiling(List parsedArgs) throws SQLException{
- StringBuffer buf = new StringBuffer();
- buf.append("ceil(");
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","ceiling"),
- PSQLState.SYNTAX_ERROR);
- }
- buf.append(parsedArgs.get(0));
- return buf.append(')').toString();
- }
-
- /** log to ln translation */
- public static String sqllog(List parsedArgs) throws SQLException{
- StringBuffer buf = new StringBuffer();
- buf.append("ln(");
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","log"),
- PSQLState.SYNTAX_ERROR);
- }
- buf.append(parsedArgs.get(0));
- return buf.append(')').toString();
- }
-
- /** log10 to log translation */
- public static String sqllog10(List parsedArgs) throws SQLException{
- StringBuffer buf = new StringBuffer();
- buf.append("log(");
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","log10"),
- PSQLState.SYNTAX_ERROR);
- }
- buf.append(parsedArgs.get(0));
- return buf.append(')').toString();
- }
-
- /** power to pow translation */
- public static String sqlpower(List parsedArgs) throws SQLException{
- StringBuffer buf = new StringBuffer();
- buf.append("pow(");
- if (parsedArgs.size()!=2){
- throw new PSQLException(GT.tr("{0} function takes two and only two arguments.","power"),
- PSQLState.SYNTAX_ERROR);
- }
- buf.append(parsedArgs.get(0)).append(',').append(parsedArgs.get(1));
- return buf.append(')').toString();
- }
-
- /** truncate to trunc translation */
- public static String sqltruncate(List parsedArgs) throws SQLException{
- StringBuffer buf = new StringBuffer();
- buf.append("trunc(");
- if (parsedArgs.size()!=2){
- throw new PSQLException(GT.tr("{0} function takes two and only two arguments.","truncate"),
- PSQLState.SYNTAX_ERROR);
- }
- buf.append(parsedArgs.get(0)).append(',').append(parsedArgs.get(1));
- return buf.append(')').toString();
- }
-
- // ** string functions translations **
- /** char to chr translation */
- public static String sqlchar(List parsedArgs) throws SQLException{
- StringBuffer buf = new StringBuffer();
- buf.append("chr(");
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","char"),
- PSQLState.SYNTAX_ERROR);
- }
- buf.append(parsedArgs.get(0));
- return buf.append(')').toString();
- }
-
- /** concat translation */
- public static String sqlconcat(List parsedArgs){
- StringBuffer buf = new StringBuffer();
- buf.append('(');
- for (int iArg = 0;iArg<parsedArgs.size();iArg++){
- buf.append(parsedArgs.get(iArg));
- if (iArg!=(parsedArgs.size()-1))
- buf.append(" || ");
- }
- return buf.append(')').toString();
- }
-
- /** insert to overlay translation */
- public static String sqlinsert(List parsedArgs) throws SQLException{
- StringBuffer buf = new StringBuffer();
- buf.append("overlay(");
- if (parsedArgs.size()!=4){
- throw new PSQLException(GT.tr("{0} function takes four and only four argument.","insert"),
- PSQLState.SYNTAX_ERROR);
- }
- buf.append(parsedArgs.get(0)).append(" placing ").append(parsedArgs.get(3));
- buf.append(" from ").append(parsedArgs.get(1)).append(" for ").append(parsedArgs.get(2));
- return buf.append(')').toString();
- }
-
- /** lcase to lower translation */
- public static String sqllcase(List parsedArgs) throws SQLException{
- StringBuffer buf = new StringBuffer();
- buf.append("lower(");
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","lcase"),
- PSQLState.SYNTAX_ERROR);
- }
- buf.append(parsedArgs.get(0));
- return buf.append(')').toString();
- }
-
- /** left to substring translation */
- public static String sqlleft(List parsedArgs) throws SQLException{
- StringBuffer buf = new StringBuffer();
- buf.append("substring(");
- if (parsedArgs.size()!=2){
- throw new PSQLException(GT.tr("{0} function takes two and only two arguments.","left"),
- PSQLState.SYNTAX_ERROR);
- }
- buf.append(parsedArgs.get(0)).append(" for ").append(parsedArgs.get(1));
- return buf.append(')').toString();
- }
-
- /** length translation */
- public static String sqllength(List parsedArgs) throws SQLException{
- StringBuffer buf = new StringBuffer();
- buf.append("length(trim(trailing from ");
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","length"),
- PSQLState.SYNTAX_ERROR);
- }
- buf.append(parsedArgs.get(0));
- return buf.append("))").toString();
- }
-
- /** locate translation */
- public static String sqllocate(List parsedArgs) throws SQLException{
- if (parsedArgs.size()==2){
- return "position("+parsedArgs.get(0)+" in "+parsedArgs.get(1)+")";
- }else if (parsedArgs.size()==3){
- String tmp = "position("+parsedArgs.get(0)+" in substring("+parsedArgs.get(1)+" from "+parsedArgs.get(2)+"))";
- return "("+parsedArgs.get(2)+"*sign("+tmp+")+"+tmp+")";
- }else{
- throw new PSQLException(GT.tr("{0} function takes two or three arguments.","locate"),
- PSQLState.SYNTAX_ERROR);
- }
- }
-
- /** ltrim translation */
- public static String sqlltrim(List parsedArgs) throws SQLException{
- StringBuffer buf = new StringBuffer();
- buf.append("trim(leading from ");
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","ltrim"),
- PSQLState.SYNTAX_ERROR);
- }
- buf.append(parsedArgs.get(0));
- return buf.append(')').toString();
- }
-
- /** right to substring translation */
- public static String sqlright(List parsedArgs) throws SQLException{
- StringBuffer buf = new StringBuffer();
- buf.append("substring(");
- if (parsedArgs.size()!=2){
- throw new PSQLException(GT.tr("{0} function takes two and only two arguments.","right"),
- PSQLState.SYNTAX_ERROR);
- }
- buf.append(parsedArgs.get(0)).append(" from (length(").append(parsedArgs.get(0)).append(")+1-").append(parsedArgs.get(1));
- return buf.append("))").toString();
- }
-
- /** rtrim translation */
- public static String sqlrtrim(List parsedArgs) throws SQLException{
- StringBuffer buf = new StringBuffer();
- buf.append("trim(trailing from ");
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","rtrim"),
- PSQLState.SYNTAX_ERROR);
- }
- buf.append(parsedArgs.get(0));
- return buf.append(')').toString();
- }
-
- /** space translation */
- public static String sqlspace(List parsedArgs) throws SQLException{
- StringBuffer buf = new StringBuffer();
- buf.append("repeat(' ',");
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","space"),
- PSQLState.SYNTAX_ERROR);
- }
- buf.append(parsedArgs.get(0));
- return buf.append(')').toString();
- }
-
- /** substring to substr translation */
- public static String sqlsubstring(List parsedArgs) throws SQLException{
- if (parsedArgs.size()==2){
- return "substr("+parsedArgs.get(0)+","+parsedArgs.get(1)+")";
- }else if (parsedArgs.size()==3){
- return "substr("+parsedArgs.get(0)+","+parsedArgs.get(1)+","+parsedArgs.get(2)+")";
- }else{
- throw new PSQLException(GT.tr("{0} function takes two or three arguments.","substring"),
- PSQLState.SYNTAX_ERROR);
- }
- }
-
- /** ucase to upper translation */
- public static String sqlucase(List parsedArgs) throws SQLException{
- StringBuffer buf = new StringBuffer();
- buf.append("upper(");
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","ucase"),
- PSQLState.SYNTAX_ERROR);
- }
- buf.append(parsedArgs.get(0));
- return buf.append(')').toString();
- }
-
- /** curdate to current_date translation */
- public static String sqlcurdate(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=0){
- throw new PSQLException(GT.tr("{0} function doesn''t take any argument.","curdate"),
- PSQLState.SYNTAX_ERROR);
- }
- return "current_date";
- }
-
- /** curtime to current_time translation */
- public static String sqlcurtime(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=0){
- throw new PSQLException(GT.tr("{0} function doesn''t take any argument.","curtime"),
- PSQLState.SYNTAX_ERROR);
- }
- return "current_time";
- }
-
- /** dayname translation */
- public static String sqldayname(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","dayname"),
- PSQLState.SYNTAX_ERROR);
- }
- return "to_char("+parsedArgs.get(0)+",'Day')";
- }
-
- /** dayofmonth translation */
- public static String sqldayofmonth(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","dayofmonth"),
- PSQLState.SYNTAX_ERROR);
- }
- return "extract(day from "+parsedArgs.get(0)+")";
- }
-
- /** dayofweek translation
- * adding 1 to postgresql function since we expect values from 1 to 7 */
- public static String sqldayofweek(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","dayofweek"),
- PSQLState.SYNTAX_ERROR);
- }
- return "extract(dow from "+parsedArgs.get(0)+")+1";
- }
-
- /** dayofyear translation */
- public static String sqldayofyear(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","dayofyear"),
- PSQLState.SYNTAX_ERROR);
- }
- return "extract(doy from "+parsedArgs.get(0)+")";
- }
-
- /** hour translation */
- public static String sqlhour(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","hour"),
- PSQLState.SYNTAX_ERROR);
- }
- return "extract(hour from "+parsedArgs.get(0)+")";
- }
-
- /** minute translation */
- public static String sqlminute(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","minute"),
- PSQLState.SYNTAX_ERROR);
- }
- return "extract(minute from "+parsedArgs.get(0)+")";
- }
-
- /** month translation */
- public static String sqlmonth(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","month"),
- PSQLState.SYNTAX_ERROR);
- }
- return "extract(month from "+parsedArgs.get(0)+")";
- }
-
- /** monthname translation */
- public static String sqlmonthname(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","monthname"),
- PSQLState.SYNTAX_ERROR);
- }
- return "to_char("+parsedArgs.get(0)+",'Month')";
- }
-
- /** quarter translation */
- public static String sqlquarter(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","quarter"),
- PSQLState.SYNTAX_ERROR);
- }
- return "extract(quarter from "+parsedArgs.get(0)+")";
- }
-
- /** second translation */
- public static String sqlsecond(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","second"),
- PSQLState.SYNTAX_ERROR);
- }
- return "extract(second from "+parsedArgs.get(0)+")";
- }
-
- /** week translation */
- public static String sqlweek(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","week"),
- PSQLState.SYNTAX_ERROR);
- }
- return "extract(week from "+parsedArgs.get(0)+")";
- }
-
- /** year translation */
- public static String sqlyear(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=1){
- throw new PSQLException(GT.tr("{0} function takes one and only one argument.","year"),
- PSQLState.SYNTAX_ERROR);
- }
- return "extract(year from "+parsedArgs.get(0)+")";
- }
-
- /** time stamp add */
- public static String sqltimestampadd(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=3){
- throw new PSQLException(GT.tr("{0} function takes three and only three arguments.","timestampadd"),
- PSQLState.SYNTAX_ERROR);
- }
- String interval = EscapedFunctions.constantToInterval(parsedArgs.get(0).toString(),parsedArgs.get(1).toString());
- StringBuffer buf = new StringBuffer();
- buf.append("(").append(interval).append("+");
- buf.append(parsedArgs.get(2)).append(")");
- return buf.toString();
- }
-
- private final static String constantToInterval(String type,String value)throws SQLException{
- if (!type.startsWith(SQL_TSI_ROOT))
- throw new PSQLException(GT.tr("Interval {0} not yet implemented",type),
- PSQLState.SYNTAX_ERROR);
- String shortType = type.substring(SQL_TSI_ROOT.length());
- if (SQL_TSI_DAY.equalsIgnoreCase(shortType))
- return "CAST(" + value + " || ' day' as interval)";
- else if (SQL_TSI_SECOND.equalsIgnoreCase(shortType))
- return "CAST(" + value + " || ' second' as interval)";
- else if (SQL_TSI_HOUR.equalsIgnoreCase(shortType))
- return "CAST(" + value + " || ' hour' as interval)";
- else if (SQL_TSI_MINUTE.equalsIgnoreCase(shortType))
- return "CAST(" + value + " || ' minute' as interval)";
- else if (SQL_TSI_MONTH.equalsIgnoreCase(shortType))
- return "CAST(" + value + " || ' month' as interval)";
- else if (SQL_TSI_QUARTER.equalsIgnoreCase(shortType))
- return "CAST((" + value + "::int * 3) || ' month' as interval)";
- else if (SQL_TSI_WEEK.equalsIgnoreCase(shortType))
- return "CAST(" + value + " || ' week' as interval)";
- else if (SQL_TSI_YEAR.equalsIgnoreCase(shortType))
- return "CAST(" + value + " || ' year' as interval)";
- else if (SQL_TSI_FRAC_SECOND.equalsIgnoreCase(shortType))
- throw new PSQLException(GT.tr("Interval {0} not yet implemented","SQL_TSI_FRAC_SECOND"),
- PSQLState.SYNTAX_ERROR);
- else throw new PSQLException(GT.tr("Interval {0} not yet implemented",type),
- PSQLState.SYNTAX_ERROR);
- }
-
-
- /** time stamp diff */
- public static String sqltimestampdiff(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=3){
- throw new PSQLException(GT.tr("{0} function takes three and only three arguments.","timestampdiff"),
- PSQLState.SYNTAX_ERROR);
- }
- String datePart = EscapedFunctions.constantToDatePart(parsedArgs.get(0).toString());
- StringBuffer buf = new StringBuffer();
- buf.append("extract( ").append(datePart)
- .append(" from (").append(parsedArgs.get(2)).append("-").append(parsedArgs.get(1)).append("))");
- return buf.toString();
- }
-
- private final static String constantToDatePart(String type)throws SQLException{
- if (!type.startsWith(SQL_TSI_ROOT))
- throw new PSQLException(GT.tr("Interval {0} not yet implemented",type),
- PSQLState.SYNTAX_ERROR);
- String shortType = type.substring(SQL_TSI_ROOT.length());
- if (SQL_TSI_DAY.equalsIgnoreCase(shortType))
- return "day";
- else if (SQL_TSI_SECOND.equalsIgnoreCase(shortType))
- return "second";
- else if (SQL_TSI_HOUR.equalsIgnoreCase(shortType))
- return "hour";
- else if (SQL_TSI_MINUTE.equalsIgnoreCase(shortType))
- return "minute";
- // See http://archives.postgresql.org/pgsql-jdbc/2006-03/msg00096.php
- /*else if (SQL_TSI_MONTH.equalsIgnoreCase(shortType))
- return "month";
- else if (SQL_TSI_QUARTER.equalsIgnoreCase(shortType))
- return "quarter";
- else if (SQL_TSI_WEEK.equalsIgnoreCase(shortType))
- return "week";
- else if (SQL_TSI_YEAR.equalsIgnoreCase(shortType))
- return "year";*/
- else if (SQL_TSI_FRAC_SECOND.equalsIgnoreCase(shortType))
- throw new PSQLException(GT.tr("Interval {0} not yet implemented","SQL_TSI_FRAC_SECOND"),
- PSQLState.SYNTAX_ERROR);
- else throw new PSQLException(GT.tr("Interval {0} not yet implemented",type),
- PSQLState.SYNTAX_ERROR);
- }
-
- /** database translation */
- public static String sqldatabase(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=0){
- throw new PSQLException(GT.tr("{0} function doesn''t take any argument.","database"),
- PSQLState.SYNTAX_ERROR);
- }
- return "current_database()";
- }
-
- /** ifnull translation */
- public static String sqlifnull(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=2){
- throw new PSQLException(GT.tr("{0} function takes two and only two arguments.","ifnull"),
- PSQLState.SYNTAX_ERROR);
- }
- return "coalesce("+parsedArgs.get(0)+","+parsedArgs.get(1)+")";
- }
-
- /** user translation */
- public static String sqluser(List parsedArgs) throws SQLException{
- if (parsedArgs.size()!=0){
- throw new PSQLException(GT.tr("{0} function doesn''t take any argument.","user"),
- PSQLState.SYNTAX_ERROR);
- }
- return "user";
- }
-}
diff --git a/org/postgresql/jdbc2/ResultWrapper.java b/org/postgresql/jdbc2/ResultWrapper.java
deleted file mode 100644
index 1f94e12..0000000
--- a/org/postgresql/jdbc2/ResultWrapper.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc2;
-
-import java.sql.*;
-
-/**
- * Helper class that storing result info. This handles both the
- * ResultSet and no-ResultSet result cases with a single interface for
- * inspecting and stepping through them.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-public class ResultWrapper {
- public ResultWrapper(ResultSet rs) {
- this.rs = rs;
- this.updateCount = -1;
- this.insertOID = -1;
- }
-
- public ResultWrapper(int updateCount, long insertOID) {
- this.rs = null;
- this.updateCount = updateCount;
- this.insertOID = insertOID;
- }
-
- public ResultSet getResultSet() {
- return rs;
- }
-
- public int getUpdateCount() {
- return updateCount;
- }
-
- public long getInsertOID() {
- return insertOID;
- }
-
- public ResultWrapper getNext() {
- return next;
- }
-
- public void append(ResultWrapper newResult) {
- ResultWrapper tail = this;
- while (tail.next != null)
- tail = tail.next;
-
- tail.next = newResult;
- }
-
- private final ResultSet rs;
- private final int updateCount;
- private final long insertOID;
- private ResultWrapper next;
-}
diff --git a/org/postgresql/jdbc2/TimestampUtils.java b/org/postgresql/jdbc2/TimestampUtils.java
deleted file mode 100644
index 80386c3..0000000
--- a/org/postgresql/jdbc2/TimestampUtils.java
+++ /dev/null
@@ -1,917 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc2;
-
-import java.sql.*;
-
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-import java.util.TimeZone;
-import java.util.SimpleTimeZone;
-
-import org.postgresql.PGStatement;
-import org.postgresql.core.Oid;
-import org.postgresql.util.ByteConverter;
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.PSQLException;
-
-
-/**
- * Misc utils for handling time and date values.
- */
-public class TimestampUtils {
- /**
- * Number of milliseconds in one day.
- */
- private static final int ONEDAY = 24 * 3600 * 1000;
-
- private StringBuffer sbuf = new StringBuffer();
-
- private Calendar defaultCal = new GregorianCalendar();
- private final TimeZone defaultTz = defaultCal.getTimeZone();
-
- private Calendar calCache;
- private int calCacheZone;
-
- private final boolean min74;
- private final boolean min82;
-
- /**
- * True if the backend uses doubles for time values. False if long is used.
- */
- private final boolean usesDouble;
-
- TimestampUtils(boolean min74, boolean min82, boolean usesDouble) {
- this.min74 = min74;
- this.min82 = min82;
- this.usesDouble = usesDouble;
- }
-
- private Calendar getCalendar(int sign, int hr, int min, int sec) {
- int rawOffset = sign * (((hr * 60 + min) * 60 + sec) * 1000);
- if (calCache != null && calCacheZone == rawOffset)
- return calCache;
-
- StringBuffer zoneID = new StringBuffer("GMT");
- zoneID.append(sign < 0 ? '-' : '+');
- if (hr < 10) zoneID.append('0');
- zoneID.append(hr);
- if (min < 10) zoneID.append('0');
- zoneID.append(min);
- if (sec < 10) zoneID.append('0');
- zoneID.append(sec);
-
- TimeZone syntheticTZ = new SimpleTimeZone(rawOffset, zoneID.toString());
- calCache = new GregorianCalendar(syntheticTZ);
- calCacheZone = rawOffset;
- return calCache;
- }
-
- private static class ParsedTimestamp {
- boolean hasDate = false;
- int era = GregorianCalendar.AD;
- int year = 1970;
- int month = 1;
-
- boolean hasTime = false;
- int day = 1;
- int hour = 0;
- int minute = 0;
- int second = 0;
- int nanos = 0;
-
- Calendar tz = null;
- }
-
- /**
- * Load date/time information into the provided calendar
- * returning the fractional seconds.
- */
- private ParsedTimestamp loadCalendar(Calendar defaultTz, String str, String type) throws SQLException {
- char []s = str.toCharArray();
- int slen = s.length;
-
- // This is pretty gross..
- ParsedTimestamp result = new ParsedTimestamp();
-
- // We try to parse these fields in order; all are optional
- // (but some combinations don't make sense, e.g. if you have
- // both date and time then they must be whitespace-separated).
- // At least one of date and time must be present.
-
- // leading whitespace
- // yyyy-mm-dd
- // whitespace
- // hh:mm:ss
- // whitespace
- // timezone in one of the formats: +hh, -hh, +hh:mm, -hh:mm
- // whitespace
- // if date is present, an era specifier: AD or BC
- // trailing whitespace
-
- try {
- int start = skipWhitespace(s, 0); // Skip leading whitespace
- int end = firstNonDigit(s, start);
- int num;
- char sep;
-
- // Possibly read date.
- if (charAt(s, end) == '-') {
- //
- // Date
- //
- result.hasDate = true;
-
- // year
- result.year = number(s, start, end);
- start = end + 1; // Skip '-'
-
- // month
- end = firstNonDigit(s, start);
- result.month = number(s, start, end);
-
- sep = charAt(s, end);
- if (sep != '-')
- throw new NumberFormatException("Expected date to be dash-separated, got '" + sep + "'");
-
- start = end + 1; // Skip '-'
-
- // day of month
- end = firstNonDigit(s, start);
- result.day = number(s, start, end);
-
- start = skipWhitespace(s, end); // Skip trailing whitespace
- }
-
- // Possibly read time.
- if (Character.isDigit(charAt(s, start))) {
- //
- // Time.
- //
-
- result.hasTime = true;
-
- // Hours
-
- end = firstNonDigit(s, start);
- result.hour = number(s, start, end);
-
- sep = charAt(s, end);
- if (sep != ':')
- throw new NumberFormatException("Expected time to be colon-separated, got '" + sep + "'");
-
- start = end + 1; // Skip ':'
-
- // minutes
-
- end = firstNonDigit(s, start);
- result.minute = number(s, start, end);
-
- sep = charAt(s, end);
- if (sep != ':')
- throw new NumberFormatException("Expected time to be colon-separated, got '" + sep + "'");
-
- start = end + 1; // Skip ':'
-
- // seconds
-
- end = firstNonDigit(s, start);
- result.second = number(s, start, end);
- start = end;
-
- // Fractional seconds.
- if (charAt(s, start) == '.') {
- end = firstNonDigit(s, start+1); // Skip '.'
- num = number(s, start+1, end);
-
- for (int numlength = (end - (start+1)); numlength < 9; ++numlength)
- num *= 10;
-
- result.nanos = num;
- start = end;
- }
-
- start = skipWhitespace(s, start); // Skip trailing whitespace
- }
-
- // Possibly read timezone.
- sep = charAt(s, start);
- if (sep == '-' || sep == '+') {
- int tzsign = (sep == '-') ? -1 : 1;
- int tzhr, tzmin, tzsec;
-
- end = firstNonDigit(s, start+1); // Skip +/-
- tzhr = number(s, start+1, end);
- start = end;
-
- sep = charAt(s, start);
- if (sep == ':') {
- end = firstNonDigit(s, start+1); // Skip ':'
- tzmin = number(s, start+1, end);
- start = end;
- } else {
- tzmin = 0;
- }
-
- tzsec = 0;
- if (min82) {
- sep = charAt(s, start);
- if (sep == ':') {
- end = firstNonDigit(s, start+1); // Skip ':'
- tzsec = number(s, start+1, end);
- start = end;
- }
- }
-
- // Setting offset does not seem to work correctly in all
- // cases.. So get a fresh calendar for a synthetic timezone
- // instead
- result.tz = getCalendar(tzsign, tzhr, tzmin, tzsec);
-
- start = skipWhitespace(s, start); // Skip trailing whitespace
- }
-
- if (result.hasDate && start < slen) {
- String eraString = new String(s, start, slen - start) ;
- if (eraString.startsWith("AD")) {
- result.era = GregorianCalendar.AD;
- start += 2;
- } else if (eraString.startsWith("BC")) {
- result.era = GregorianCalendar.BC;
- start += 2;
- }
- }
-
- if (start < slen)
- throw new NumberFormatException("Trailing junk on timestamp: '" + new String(s, start, slen - start) + "'");
-
- if (!result.hasTime && !result.hasDate)
- throw new NumberFormatException("Timestamp has neither date nor time");
-
- } catch (NumberFormatException nfe) {
- throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{type,str}), PSQLState.BAD_DATETIME_FORMAT, nfe);
- }
-
- return result;
- }
-
- //
- // Debugging hooks, not normally used unless developing -- uncomment the
- // bodies for stderr debug spam.
- //
-
- private static void showParse(String type, String what, Calendar cal, java.util.Date result, Calendar resultCal) {
-// java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd G HH:mm:ss Z");
-// sdf.setTimeZone(resultCal.getTimeZone());
-
-// StringBuffer sb = new StringBuffer("Parsed ");
-// sb.append(type);
-// sb.append(" '");
-// sb.append(what);
-// sb.append("' in zone ");
-// sb.append(cal.getTimeZone().getID());
-// sb.append(" as ");
-// sb.append(sdf.format(result));
-// sb.append(" (millis=");
-// sb.append(result.getTime());
-// sb.append(")");
-
-// System.err.println(sb.toString());
- }
-
- private static void showString(String type, Calendar cal, java.util.Date value, String result) {
-// java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd G HH:mm:ss Z");
-// sdf.setTimeZone(cal.getTimeZone());
-
-// StringBuffer sb = new StringBuffer("Stringized ");
-// sb.append(type);
-// sb.append(" ");
-// sb.append(sdf.format(value));
-// sb.append(" (millis=");
-// sb.append(value.getTime());
-// sb.append(") as '");
-// sb.append(result);
-// sb.append("'");
-
-// System.err.println(sb.toString());
- }
-
- /**
- * Parse a string and return a timestamp representing its value.
- *
- * @param s The ISO formated date string to parse.
- *
- * @return null if s is null or a timestamp of the parsed string s.
- *
- * @throws SQLException if there is a problem parsing s.
- **/
- public synchronized Timestamp toTimestamp(Calendar cal, String s) throws SQLException
- {
- if (s == null)
- return null;
-
- int slen = s.length();
-
- // convert postgres's infinity values to internal infinity magic value
- if (slen == 8 && s.equals("infinity")) {
- return new Timestamp(PGStatement.DATE_POSITIVE_INFINITY);
- }
-
- if (slen == 9 && s.equals("-infinity")) {
- return new Timestamp(PGStatement.DATE_NEGATIVE_INFINITY);
- }
-
- if (cal == null)
- cal = defaultCal;
-
- ParsedTimestamp ts = loadCalendar(cal, s, "timestamp");
- Calendar useCal = (ts.tz == null ? cal : ts.tz);
- useCal.set(Calendar.ERA, ts.era);
- useCal.set(Calendar.YEAR, ts.year);
- useCal.set(Calendar.MONTH, ts.month-1);
- useCal.set(Calendar.DAY_OF_MONTH, ts.day);
- useCal.set(Calendar.HOUR_OF_DAY, ts.hour);
- useCal.set(Calendar.MINUTE, ts.minute);
- useCal.set(Calendar.SECOND, ts.second);
- useCal.set(Calendar.MILLISECOND, 0);
-
- Timestamp result = new Timestamp(useCal.getTime().getTime());
- result.setNanos(ts.nanos);
- showParse("timestamp", s, cal, result, useCal);
- return result;
- }
-
- public synchronized Time toTime(Calendar cal, String s) throws SQLException
- {
- if (s == null)
- return null;
-
- int slen = s.length();
-
- // infinity cannot be represented as Time
- // so there's not much we can do here.
- if ((slen == 8 && s.equals("infinity")) || (slen == 9 && s.equals("-infinity"))) {
- throw new PSQLException(GT.tr("Infinite value found for timestamp/date. This cannot be represented as time."),
- PSQLState.DATETIME_OVERFLOW);
- }
-
- if (cal == null)
- cal = defaultCal;
-
- ParsedTimestamp ts = loadCalendar(cal, s, "time");
-
- Calendar useCal = (ts.tz == null ? cal : ts.tz);
- useCal.set(Calendar.HOUR_OF_DAY, ts.hour);
- useCal.set(Calendar.MINUTE, ts.minute);
- useCal.set(Calendar.SECOND, ts.second);
- useCal.set(Calendar.MILLISECOND, (ts.nanos + 500000) / 1000000);
-
- if (ts.hasDate) {
- // Rotate it into the requested timezone before we zero out the date
- useCal.set(Calendar.ERA, ts.era);
- useCal.set(Calendar.YEAR, ts.year);
- useCal.set(Calendar.MONTH, ts.month-1);
- useCal.set(Calendar.DAY_OF_MONTH, ts.day);
- cal.setTime(new Date(useCal.getTime().getTime()));
- useCal = cal;
- }
-
- useCal.set(Calendar.ERA, GregorianCalendar.AD);
- useCal.set(Calendar.YEAR, 1970);
- useCal.set(Calendar.MONTH, 0);
- useCal.set(Calendar.DAY_OF_MONTH, 1);
-
- Time result = new Time(useCal.getTime().getTime());
- showParse("time", s, cal, result, useCal);
- return result;
- }
-
- public synchronized Date toDate(Calendar cal, String s) throws SQLException
- {
- if (s == null)
- return null;
-
- int slen = s.length();
-
- // convert postgres's infinity values to internal infinity magic value
- if (slen == 8 && s.equals("infinity")) {
- return new Date(PGStatement.DATE_POSITIVE_INFINITY);
- }
-
- if (slen == 9 && s.equals("-infinity")) {
- return new Date(PGStatement.DATE_NEGATIVE_INFINITY);
- }
-
- if (cal == null)
- cal = defaultCal;
-
- ParsedTimestamp ts = loadCalendar(cal, s, "date");
- Calendar useCal = (ts.tz == null ? cal : ts.tz);
-
- useCal.set(Calendar.ERA, ts.era);
- useCal.set(Calendar.YEAR, ts.year);
- useCal.set(Calendar.MONTH, ts.month-1);
- useCal.set(Calendar.DAY_OF_MONTH, ts.day);
-
- if (ts.hasTime) {
- // Rotate it into the requested timezone before we zero out the time
- useCal.set(Calendar.HOUR_OF_DAY, ts.hour);
- useCal.set(Calendar.MINUTE, ts.minute);
- useCal.set(Calendar.SECOND, ts.second);
- useCal.set(Calendar.MILLISECOND, (ts.nanos + 500000) / 1000000);
- cal.setTime(new Date(useCal.getTime().getTime()));
- useCal = cal;
- }
-
- useCal.set(Calendar.HOUR_OF_DAY, 0);
- useCal.set(Calendar.MINUTE, 0);
- useCal.set(Calendar.SECOND, 0);
- useCal.set(Calendar.MILLISECOND, 0);
-
- Date result = new Date(useCal.getTime().getTime());
- showParse("date", s, cal, result, useCal);
- return result;
- }
-
- public synchronized String toString(Calendar cal, Timestamp x) {
- if (cal == null)
- cal = defaultCal;
-
- cal.setTime(x);
- sbuf.setLength(0);
-
- if (x.getTime() == PGStatement.DATE_POSITIVE_INFINITY) {
- sbuf.append("infinity");
- } else if (x.getTime() == PGStatement.DATE_NEGATIVE_INFINITY) {
- sbuf.append("-infinity");
- } else {
- appendDate(sbuf, cal);
- sbuf.append(' ');
- appendTime(sbuf, cal, x.getNanos());
- appendTimeZone(sbuf, cal);
- appendEra(sbuf, cal);
- }
-
- showString("timestamp", cal, x, sbuf.toString());
- return sbuf.toString();
- }
-
- public synchronized String toString(Calendar cal, Date x) {
- if (cal == null)
- cal = defaultCal;
-
- cal.setTime(x);
- sbuf.setLength(0);
-
- if (x.getTime() == PGStatement.DATE_POSITIVE_INFINITY) {
- sbuf.append("infinity");
- } else if (x.getTime() == PGStatement.DATE_NEGATIVE_INFINITY) {
- sbuf.append("-infinity");
- } else {
- appendDate(sbuf, cal);
- appendEra(sbuf, cal);
- appendTimeZone(sbuf, cal);
- }
-
- showString("date", cal, x, sbuf.toString());
-
- return sbuf.toString();
- }
-
- public synchronized String toString(Calendar cal, Time x) {
- if (cal == null)
- cal = defaultCal;
-
- cal.setTime(x);
- sbuf.setLength(0);
-
- appendTime(sbuf, cal, cal.get(Calendar.MILLISECOND) * 1000000);
-
- // The 'time' parser for <= 7.3 doesn't like timezones.
- if (min74)
- appendTimeZone(sbuf, cal);
-
- showString("time", cal, x, sbuf.toString());
-
- return sbuf.toString();
- }
-
- private static void appendDate(StringBuffer sb, Calendar cal)
- {
- int l_year = cal.get(Calendar.YEAR);
- // always use at least four digits for the year so very
- // early years, like 2, don't get misinterpreted
- //
- int l_yearlen = String.valueOf(l_year).length();
- for (int i = 4; i > l_yearlen; i--)
- {
- sb.append("0");
- }
-
- sb.append(l_year);
- sb.append('-');
- int l_month = cal.get(Calendar.MONTH) + 1;
- if (l_month < 10)
- sb.append('0');
- sb.append(l_month);
- sb.append('-');
- int l_day = cal.get(Calendar.DAY_OF_MONTH);
- if (l_day < 10)
- sb.append('0');
- sb.append(l_day);
- }
-
- private static void appendTime(StringBuffer sb, Calendar cal, int nanos)
- {
- int hours = cal.get(Calendar.HOUR_OF_DAY);
- if (hours < 10)
- sb.append('0');
- sb.append(hours);
-
- sb.append(':');
- int minutes = cal.get(Calendar.MINUTE);
- if (minutes < 10)
- sb.append('0');
- sb.append(minutes);
-
- sb.append(':');
- int seconds = cal.get(Calendar.SECOND);
- if (seconds < 10)
- sb.append('0');
- sb.append(seconds);
-
- // Add nanoseconds.
- // This won't work for server versions < 7.2 which only want
- // a two digit fractional second, but we don't need to support 7.1
- // anymore and getting the version number here is difficult.
- //
- char[] decimalStr = {'0', '0', '0', '0', '0', '0', '0', '0', '0'};
- char[] nanoStr = Integer.toString(nanos).toCharArray();
- System.arraycopy(nanoStr, 0, decimalStr, decimalStr.length - nanoStr.length, nanoStr.length);
- sb.append('.');
- sb.append(decimalStr, 0, 6);
- }
-
- private void appendTimeZone(StringBuffer sb, java.util.Calendar cal)
- {
- int offset = (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET)) / 1000;
-
- int absoff = Math.abs(offset);
- int hours = absoff / 60 / 60;
- int mins = (absoff - hours * 60 * 60) / 60;
- int secs = absoff - hours * 60 * 60 - mins * 60;
-
- sb.append((offset >= 0) ? " +" : " -");
-
- if (hours < 10)
- sb.append('0');
- sb.append(hours);
-
- sb.append(':');
-
- if (mins < 10)
- sb.append('0');
- sb.append(mins);
-
- if (min82) {
- sb.append(':');
- if (secs < 10)
- sb.append('0');
- sb.append(secs);
- }
- }
-
- private static void appendEra(StringBuffer sb, Calendar cal)
- {
- if (cal.get(Calendar.ERA) == GregorianCalendar.BC) {
- sb.append(" BC");
- }
- }
-
- private static int skipWhitespace(char []s, int start)
- {
- int slen = s.length;
- for (int i=start; i<slen; i++) {
- if (!Character.isSpace(s[i]))
- return i;
- }
- return slen;
- }
-
- private static int firstNonDigit(char []s, int start)
- {
- int slen = s.length;
- for (int i=start; i<slen; i++) {
- if (!Character.isDigit(s[i])) {
- return i;
- }
- }
- return slen;
- }
-
- private static int number(char []s, int start, int end) {
- if (start >= end) {
- throw new NumberFormatException();
- }
- int n=0;
- for ( int i=start; i < end; i++)
- {
- n = 10 * n + (s[i]-'0');
- }
- return n;
- }
-
- private static char charAt(char []s, int pos) {
- if (pos >= 0 && pos < s.length) {
- return s[pos];
- }
- return '\0';
- }
-
- /**
- * Returns the SQL Date object matching the given bytes with
- * {@link Oid#DATE}.
- *
- * @param tz The timezone used.
- * @param bytes The binary encoded date value.
- * @return The parsed date object.
- * @throws PSQLException If binary format could not be parsed.
- */
- public Date toDateBin(TimeZone tz, byte[] bytes) throws PSQLException {
- if (bytes.length != 4) {
- throw new PSQLException(GT.tr("Unsupported binary encoding of {0}.",
- "date"), PSQLState.BAD_DATETIME_FORMAT);
- }
- int days = ByteConverter.int4(bytes, 0);
- if (tz == null) {
- tz = defaultTz;
- }
- long secs = toJavaSecs(days * 86400L);
- long millis = secs * 1000L;
- int offset = tz.getOffset(millis);
- if (millis <= PGStatement.DATE_NEGATIVE_SMALLER_INFINITY) {
- millis = PGStatement.DATE_NEGATIVE_INFINITY;
- offset = 0;
- } else if (millis >= PGStatement.DATE_POSITIVE_SMALLER_INFINITY) {
- millis = PGStatement.DATE_POSITIVE_INFINITY;
- offset = 0;
- }
- return new Date(millis - offset);
- }
-
- /**
- * Returns the SQL Time object matching the given bytes with
- * {@link Oid#TIME} or {@link Oid#TIMETZ}.
- *
- * @param tz The timezone used when received data is {@link Oid#TIME},
- * ignored if data already contains {@link Oid#TIMETZ}.
- * @param bytes The binary encoded time value.
- * @return The parsed time object.
- * @throws PSQLException If binary format could not be parsed.
- */
- public Time toTimeBin(TimeZone tz, byte[] bytes) throws PSQLException {
- if ((bytes.length != 8 && bytes.length != 12)) {
- throw new PSQLException(GT.tr("Unsupported binary encoding of {0}.",
- "time"), PSQLState.BAD_DATETIME_FORMAT);
- }
-
- long millis;
- int timeOffset;
-
- if (usesDouble) {
- double time = ByteConverter.float8(bytes, 0);
-
- millis = (long) (time * 1000);
- } else {
- long time = ByteConverter.int8(bytes, 0);
-
- millis = time / 1000;
- }
-
- if (bytes.length == 12) {
- timeOffset = ByteConverter.int4(bytes, 8);
- timeOffset *= -1000;
- } else {
- if (tz == null) {
- tz = defaultTz;
- }
-
- timeOffset = tz.getOffset(millis);
- }
-
- millis -= timeOffset;
- return new Time(millis);
- }
-
- /**
- * Returns the SQL Timestamp object matching the given bytes with
- * {@link Oid#TIMESTAMP} or {@link Oid#TIMESTAMPTZ}.
- *
- * @param tz The timezone used when received data is {@link Oid#TIMESTAMP},
- * ignored if data already contains {@link Oid#TIMESTAMPTZ}.
- * @param bytes The binary encoded timestamp value.
- * @param timestamptz True if the binary is in GMT.
- * @return The parsed timestamp object.
- * @throws PSQLException If binary format could not be parsed.
- */
- public Timestamp toTimestampBin(TimeZone tz, byte[] bytes, boolean timestamptz)
- throws PSQLException {
-
- if (bytes.length != 8) {
- throw new PSQLException(GT.tr("Unsupported binary encoding of {0}.",
- "timestamp"), PSQLState.BAD_DATETIME_FORMAT);
- }
-
- long secs;
- int nanos;
-
- if (usesDouble) {
- double time = ByteConverter.float8(bytes, 0);
- if (time == Double.POSITIVE_INFINITY) {
- return new Timestamp(PGStatement.DATE_POSITIVE_INFINITY);
- } else if (time == Double.NEGATIVE_INFINITY) {
- return new Timestamp(PGStatement.DATE_NEGATIVE_INFINITY);
- }
-
- secs = (long) time;
- nanos = (int) ((time - secs) * 1000000);
- } else {
- long time = ByteConverter.int8(bytes, 0);
-
- // compatibility with text based receiving, not strictly necessary
- // and can actually be confusing because there are timestamps
- // that are larger than infinite
- if (time == Long.MAX_VALUE) {
- return new Timestamp(PGStatement.DATE_POSITIVE_INFINITY);
- } else if (time == Long.MIN_VALUE) {
- return new Timestamp(PGStatement.DATE_NEGATIVE_INFINITY);
- }
-
- secs = time / 1000000;
- nanos = (int) (time - secs * 1000000);
- }
- if (nanos < 0) {
- secs--;
- nanos += 1000000;
- }
- nanos *= 1000;
-
- secs = toJavaSecs(secs);
- long millis = secs * 1000L;
- if (!timestamptz) {
- if (tz == null) {
- tz = defaultTz;
- }
- millis -= tz.getOffset(millis);
- }
-
- Timestamp ts = new Timestamp(millis);
- ts.setNanos(nanos);
- return ts;
- }
-
- /**
- * Extracts the date part from a timestamp.
- *
- * @param timestamp The timestamp from which to extract the date.
- * @param tz The time zone of the date.
- * @return The extracted date.
- */
- public Date convertToDate(Timestamp timestamp, TimeZone tz) {
- long millis = timestamp.getTime();
- // no adjustments for the inifity hack values
- if (millis <= PGStatement.DATE_NEGATIVE_INFINITY ||
- millis >= PGStatement.DATE_POSITIVE_INFINITY) {
- return new Date(millis);
- }
- if (tz == null) {
- tz = defaultTz;
- }
- int offset = tz.getOffset(millis);
- long timePart = millis % ONEDAY;
- if (timePart + offset >= ONEDAY) {
- millis += ONEDAY;
- }
- millis -= timePart;
- millis -= offset;
-
- return new Date(millis);
- }
-
- /**
- * Extracts the time part from a timestamp.
- *
- * @param timestamp The timestamp from which to extract the time.
- * @param tz The time zone of the time.
- * @return The extracted time.
- */
- public Time convertToTime(Timestamp timestamp, TimeZone tz) {
- long millis = timestamp.getTime();
- if (tz == null) {
- tz = defaultTz;
- }
- int offset = tz.getOffset(millis);
- long low = - tz.getOffset(millis);
- long high = low + ONEDAY;
- if (millis < low) {
- do { millis += ONEDAY; } while (millis < low);
- } else if (millis >= high) {
- do { millis -= ONEDAY; } while (millis > high);
- }
-
- return new Time(millis);
- }
-
- /**
- * Returns the given time value as String matching what the
- * current postgresql server would send in text mode.
- */
- public String timeToString(java.util.Date time) {
- long millis = time.getTime();
- if (millis <= PGStatement.DATE_NEGATIVE_INFINITY) {
- return "-infinity";
- }
- if (millis >= PGStatement.DATE_POSITIVE_INFINITY) {
- return "infinity";
- }
- return time.toString();
- }
-
- /**
- * Converts the given postgresql seconds to java seconds.
- * Reverse engineered by inserting varying dates to postgresql
- * and tuning the formula until the java dates matched.
- * See {@link #toPgSecs} for the reverse operation.
- *
- * @param secs Postgresql seconds.
- * @return Java seconds.
- */
- private static long toJavaSecs(long secs) {
- // postgres epoc to java epoc
- secs += 946684800L;
-
- // Julian/Gregorian calendar cutoff point
- if (secs < -12219292800L) { // October 4, 1582 -> October 15, 1582
- secs += 86400 * 10;
- if (secs < -14825808000L) { // 1500-02-28 -> 1500-03-01
- int extraLeaps = (int) ((secs + 14825808000L) / 3155760000L);
- extraLeaps--;
- extraLeaps -= extraLeaps / 4;
- secs += extraLeaps * 86400L;
- }
- }
- return secs;
- }
-
- /**
- * Converts the given java seconds to postgresql seconds.
- * See {@link #toJavaSecs} for the reverse operation.
- * The conversion is valid for any year 100 BC onwards.
- *
- * @param secs Postgresql seconds.
- * @return Java seconds.
- */
- private static long toPgSecs(long secs) {
- // java epoc to postgres epoc
- secs -= 946684800L;
-
- // Julian/Greagorian calendar cutoff point
- if (secs < -13165977600L) { // October 15, 1582 -> October 4, 1582
- secs -= 86400 * 10;
- if (secs < -15773356800L) { // 1500-03-01 -> 1500-02-28
- int years = (int) ((secs + 15773356800L) / -3155823050L);
- years++;
- years -= years/4;
- secs += years * 86400;
- }
- }
-
- return secs;
- }
-
- /**
- * Converts the SQL Date to binary representation for {@link Oid#DATE}.
- *
- * @param tz The timezone used.
- * @param bytes The binary encoded date value.
- * @throws PSQLException If binary format could not be parsed.
- */
- public void toBinDate(TimeZone tz, byte[] bytes, Date value) throws PSQLException {
- long millis = value.getTime();
-
- if (tz == null) {
- tz = defaultTz;
- }
- millis += tz.getOffset(millis);
-
- long secs = toPgSecs(millis / 1000);
- ByteConverter.int4(bytes, 0, (int) (secs / 86400));
- }
-
-}
diff --git a/org/postgresql/jdbc2/TypeInfoCache.java b/org/postgresql/jdbc2/TypeInfoCache.java
deleted file mode 100644
index 2e79758..0000000
--- a/org/postgresql/jdbc2/TypeInfoCache.java
+++ /dev/null
@@ -1,690 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * Copyright (c) 2005-2011, PostgreSQL Global Development Group
- *
- *
- *-------------------------------------------------------------------------
- */
-
-package org.postgresql.jdbc2;
-
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Collections;
-import java.sql.Types;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.PreparedStatement;
-import org.postgresql.Driver;
-import org.postgresql.core.Oid;
-import org.postgresql.core.BaseStatement;
-import org.postgresql.core.BaseConnection;
-import org.postgresql.core.QueryExecutor;
-import org.postgresql.core.TypeInfo;
-import org.postgresql.util.GT;
-import org.postgresql.util.PGobject;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.PSQLException;
-
-public class TypeInfoCache implements TypeInfo {
-
- // pgname (String) -> java.sql.Types (Integer)
- private Map _pgNameToSQLType;
-
- // pgname (String) -> java class name (String)
- // ie "text" -> "java.lang.String"
- private Map _pgNameToJavaClass;
-
- // oid (Integer) -> pgname (String)
- private Map _oidToPgName;
- // pgname (String) -> oid (Integer)
- private Map _pgNameToOid;
-
- // pgname (String) -> extension pgobject (Class)
- private Map _pgNameToPgObject;
-
- // type array oid -> base type's oid
- private Map/*<Integer, Integer>*/ _pgArrayToPgType;
-
- // array type oid -> base type array element delimiter
- private Map/*<Integer, Character>*/ _arrayOidToDelimiter;
-
- private BaseConnection _conn;
- private final int _unknownLength;
- private PreparedStatement _getOidStatement;
- private PreparedStatement _getNameStatement;
- private PreparedStatement _getArrayElementOidStatement;
- private PreparedStatement _getArrayDelimiterStatement;
- private PreparedStatement _getTypeInfoStatement;
-
- // basic pg types info:
- // 0 - type name
- // 1 - type oid
- // 2 - sql type
- // 3 - java class
- // 4 - array type oid
- // 5 - conditional minimum server version
- // 6 - conditional minimum JDK build version
- private static final Object types[][] = {
- {"int2", new Integer(Oid.INT2), new Integer(Types.SMALLINT), "java.lang.Integer", new Integer(Oid.INT2_ARRAY)},
- {"int4", new Integer(Oid.INT4), new Integer(Types.INTEGER), "java.lang.Integer", new Integer(Oid.INT4_ARRAY)},
- {"oid", new Integer(Oid.OID), new Integer(Types.BIGINT), "java.lang.Long", new Integer(Oid.OID_ARRAY)},
- {"int8", new Integer(Oid.INT8), new Integer(Types.BIGINT), "java.lang.Long", new Integer(Oid.INT8_ARRAY)},
- {"money", new Integer(Oid.MONEY), new Integer(Types.DOUBLE), "java.lang.Double", new Integer(Oid.MONEY_ARRAY)},
- {"numeric", new Integer(Oid.NUMERIC), new Integer(Types.NUMERIC), "java.math.BigDecimal", new Integer(Oid.NUMERIC_ARRAY)},
- {"float4", new Integer(Oid.FLOAT4), new Integer(Types.REAL), "java.lang.Float", new Integer(Oid.FLOAT4_ARRAY)},
- {"float8", new Integer(Oid.FLOAT8), new Integer(Types.DOUBLE), "java.lang.Double", new Integer(Oid.FLOAT8_ARRAY)},
- {"char", new Integer(Oid.CHAR), new Integer(Types.CHAR), "java.lang.String", new Integer(Oid.CHAR_ARRAY)},
- {"bpchar", new Integer(Oid.BPCHAR), new Integer(Types.CHAR), "java.lang.String", new Integer(Oid.BPCHAR_ARRAY)},
- {"varchar", new Integer(Oid.VARCHAR), new Integer(Types.VARCHAR), "java.lang.String", new Integer(Oid.VARCHAR_ARRAY)},
- {"text", new Integer(Oid.TEXT), new Integer(Types.VARCHAR), "java.lang.String", new Integer(Oid.TEXT_ARRAY)},
- {"name", new Integer(Oid.NAME), new Integer(Types.VARCHAR), "java.lang.String", new Integer(Oid.NAME_ARRAY)},
- {"bytea", new Integer(Oid.BYTEA), new Integer(Types.BINARY), "[B", new Integer(Oid.BYTEA_ARRAY)},
- {"bool", new Integer(Oid.BOOL), new Integer(Types.BIT), "java.lang.Boolean", new Integer(Oid.BOOL_ARRAY)},
- {"bit", new Integer(Oid.BIT), new Integer(Types.BIT), "java.lang.Boolean", new Integer(Oid.BIT_ARRAY)},
- {"date", new Integer(Oid.DATE), new Integer(Types.DATE), "java.sql.Date", new Integer(Oid.DATE_ARRAY)},
- {"time", new Integer(Oid.TIME), new Integer(Types.TIME), "java.sql.Time", new Integer(Oid.TIME_ARRAY)},
- {"timetz", new Integer(Oid.TIMETZ), new Integer(Types.TIME), "java.sql.Time", new Integer(Oid.TIMETZ_ARRAY)},
- {"timestamp", new Integer(Oid.TIMESTAMP), new Integer(Types.TIMESTAMP), "java.sql.Timestamp", new Integer(Oid.TIMESTAMP_ARRAY)},
- {"timestamptz", new Integer(Oid.TIMESTAMPTZ), new Integer(Types.TIMESTAMP), "java.sql.Timestamp", new Integer(Oid.TIMESTAMPTZ_ARRAY)},
- };
-
- /**
- * PG maps several alias to real type names. When we do queries
- * against pg_catalog, we must use the real type, not an alias, so
- * use this mapping.
- */
- private final static HashMap typeAliases;
- static {
- typeAliases = new HashMap();
- typeAliases.put("smallint", "int2");
- typeAliases.put("integer", "int4");
- typeAliases.put("int", "int4");
- typeAliases.put("bigint", "int8");
- typeAliases.put("float", "float8");
- typeAliases.put("boolean", "bool");
- typeAliases.put("decimal", "numeric");
- }
-
- public TypeInfoCache(BaseConnection conn, int unknownLength)
- {
- _conn = conn;
- _unknownLength = unknownLength;
- _oidToPgName = new HashMap();
- _pgNameToOid = new HashMap();
- _pgNameToJavaClass = new HashMap();
- _pgNameToPgObject = new HashMap();
- _pgArrayToPgType = new HashMap();
- _arrayOidToDelimiter = new HashMap();
-
- // needs to be synchronized because the iterator is returned
- // from getPGTypeNamesWithSQLTypes()
- _pgNameToSQLType = Collections.synchronizedMap(new HashMap());
-
- for (int i=0; i<types.length; i++) {
- String pgTypeName = (String)types[i][0];
- Integer oid = (Integer)types[i][1];
- Integer sqlType = (Integer)types[i][2];
- String javaClass = (String)types[i][3];
- Integer arrayOid = (Integer)types[i][4];
-
- addCoreType(pgTypeName, oid, sqlType, javaClass, arrayOid);
- }
-
- }
-
- public synchronized void addCoreType(String pgTypeName, Integer oid, Integer sqlType, String javaClass, Integer arrayOid)
- {
- _pgNameToJavaClass.put(pgTypeName, javaClass);
- _pgNameToOid.put(pgTypeName, oid);
- _oidToPgName.put(oid, pgTypeName);
- _pgArrayToPgType.put(arrayOid, oid);
- _pgNameToSQLType.put(pgTypeName, sqlType);
-
- // Currently we hardcode all core types array delimiter
- // to a comma. In a stock install the only exception is
- // the box datatype and it's not a JDBC core type.
- //
- Character delim = new Character(',');
- _arrayOidToDelimiter.put(oid, delim);
-
- String pgArrayTypeName = "_" + pgTypeName;
- _pgNameToJavaClass.put(pgArrayTypeName, "java.sql.Array");
- _pgNameToSQLType.put(pgArrayTypeName, new Integer(Types.ARRAY));
- }
-
-
- public synchronized void addDataType(String type, Class klass) throws SQLException
- {
- if (!PGobject.class.isAssignableFrom(klass))
- throw new PSQLException(GT.tr("The class {0} does not implement org.postgresql.util.PGobject.", klass.toString()), PSQLState.INVALID_PARAMETER_TYPE);
-
- _pgNameToPgObject.put(type, klass);
- _pgNameToJavaClass.put(type, klass.getName());
- }
-
- public Iterator getPGTypeNamesWithSQLTypes()
- {
- return _pgNameToSQLType.keySet().iterator();
- }
-
- public int getSQLType(int oid) throws SQLException
- {
- return getSQLType(getPGType(oid));
- }
-
- public synchronized int getSQLType(String pgTypeName) throws SQLException
- {
- Integer i = (Integer)_pgNameToSQLType.get(pgTypeName);
- if (i != null)
- return i.intValue();
-
- if (_getTypeInfoStatement == null) {
- // There's no great way of telling what's an array type.
- // People can name their own types starting with _.
- // Other types use typelem that aren't actually arrays, like box.
- //
- String sql = "SELECT typinput='array_in'::regproc, typtype FROM ";
- if (_conn.haveMinimumServerVersion("7.3")) {
- sql += "pg_catalog.";
- }
- sql += "pg_type WHERE typname = ?";
-
- _getTypeInfoStatement = _conn.prepareStatement(sql);
- }
-
- _getTypeInfoStatement.setString(1, pgTypeName);
-
- // Go through BaseStatement to avoid transaction start.
- if (!((BaseStatement)_getTypeInfoStatement).executeWithFlags(QueryExecutor.QUERY_SUPPRESS_BEGIN))
- throw new PSQLException(GT.tr("No results were returned by the query."), PSQLState.NO_DATA);
-
- ResultSet rs = _getTypeInfoStatement.getResultSet();
-
- Integer type = null;
- if (rs.next()) {
- boolean isArray = rs.getBoolean(1);
- String typtype = rs.getString(2);
- if (isArray) {
- type = new Integer(Types.ARRAY);
- } else if ("c".equals(typtype)) {
- type = new Integer(Types.STRUCT);
- } else if ("d".equals(typtype)) {
- type = new Integer(Types.DISTINCT);
- }
- }
-
- if (type == null) {
- type = new Integer(Types.OTHER);
- }
- rs.close();
-
- _pgNameToSQLType.put(pgTypeName, type);
-
- return type.intValue();
- }
-
- public synchronized int getPGType(String pgTypeName) throws SQLException
- {
- Integer oid = (Integer)_pgNameToOid.get(pgTypeName);
- if (oid != null)
- return oid.intValue();
-
- if (_getOidStatement == null) {
- String sql;
- if (_conn.haveMinimumServerVersion("7.3")) {
- sql = "SELECT oid FROM pg_catalog.pg_type WHERE typname = ?";
- } else {
- sql = "SELECT oid FROM pg_type WHERE typname = ?";
- }
-
- _getOidStatement = _conn.prepareStatement(sql);
- }
-
- _getOidStatement.setString(1, pgTypeName);
-
- // Go through BaseStatement to avoid transaction start.
- if (!((BaseStatement)_getOidStatement).executeWithFlags(QueryExecutor.QUERY_SUPPRESS_BEGIN))
- throw new PSQLException(GT.tr("No results were returned by the query."), PSQLState.NO_DATA);
-
- oid = new Integer(Oid.UNSPECIFIED);
- ResultSet rs = _getOidStatement.getResultSet();
- if (rs.next()) {
- oid = new Integer((int)rs.getLong(1));
- _oidToPgName.put(oid, pgTypeName);
- }
- _pgNameToOid.put(pgTypeName, oid);
- rs.close();
-
- return oid.intValue();
- }
-
- public synchronized String getPGType(int oid) throws SQLException
- {
- if (oid == Oid.UNSPECIFIED)
- return null;
-
- String pgTypeName = (String)_oidToPgName.get(new Integer(oid));
- if (pgTypeName != null)
- return pgTypeName;
-
- if (_getNameStatement == null) {
- String sql;
- if (_conn.haveMinimumServerVersion("7.3")) {
- sql = "SELECT typname FROM pg_catalog.pg_type WHERE oid = ?";
- } else {
- sql = "SELECT typname FROM pg_type WHERE oid = ?";
- }
-
- _getNameStatement = _conn.prepareStatement(sql);
- }
-
- _getNameStatement.setInt(1, oid);
-
- // Go through BaseStatement to avoid transaction start.
- if (!((BaseStatement)_getNameStatement).executeWithFlags(QueryExecutor.QUERY_SUPPRESS_BEGIN))
- throw new PSQLException(GT.tr("No results were returned by the query."), PSQLState.NO_DATA);
-
- ResultSet rs = _getNameStatement.getResultSet();
- if (rs.next()) {
- pgTypeName = rs.getString(1);
- _pgNameToOid.put(pgTypeName, new Integer(oid));
- _oidToPgName.put(new Integer(oid), pgTypeName);
- }
- rs.close();
-
- return pgTypeName;
- }
-
- public int getPGArrayType(String elementTypeName) throws SQLException
- {
- elementTypeName = getTypeForAlias(elementTypeName);
- return getPGType("_" + elementTypeName);
- }
-
- /**
- * Return the oid of the array's base element if it's an array,
- * if not return the provided oid. This doesn't do any database
- * lookups, so it's only useful for the originally provided type
- * mappings. This is fine for it's intended uses where we only have
- * intimate knowledge of types that are already known to the driver.
- */
- protected synchronized int convertArrayToBaseOid(int oid)
- {
- Integer i = (Integer)_pgArrayToPgType.get(new Integer(oid));
- if (i == null)
- return oid;
- return i.intValue();
- }
-
- public synchronized char getArrayDelimiter(int oid) throws SQLException
- {
- if (oid == Oid.UNSPECIFIED)
- return ',';
-
- Character delim = (Character) _arrayOidToDelimiter.get(new Integer(oid));
- if (delim != null)
- return delim.charValue();
-
- if (_getArrayDelimiterStatement == null) {
- String sql;
- if (_conn.haveMinimumServerVersion("7.3")) {
- sql = "SELECT e.typdelim FROM pg_catalog.pg_type t, pg_catalog.pg_type e WHERE t.oid = ? and t.typelem = e.oid";
- } else {
- sql = "SELECT e.typdelim FROM pg_type t, pg_type e WHERE t.oid = ? and t.typelem = e.oid";
- }
- _getArrayDelimiterStatement = _conn.prepareStatement(sql);
- }
-
- _getArrayDelimiterStatement.setInt(1, oid);
-
- // Go through BaseStatement to avoid transaction start.
- if (!((BaseStatement) _getArrayDelimiterStatement).executeWithFlags(QueryExecutor.QUERY_SUPPRESS_BEGIN))
- throw new PSQLException(GT.tr("No results were returned by the query."), PSQLState.NO_DATA);
-
- ResultSet rs = _getArrayDelimiterStatement.getResultSet();
- if (!rs.next())
- throw new PSQLException(GT.tr("No results were returned by the query."), PSQLState.NO_DATA);
-
- String s = rs.getString(1);
- delim = new Character(s.charAt(0));
-
- _arrayOidToDelimiter.put(new Integer(oid), delim);
-
- rs.close();
-
- return delim.charValue();
- }
-
- public synchronized int getPGArrayElement (int oid) throws SQLException
- {
- if (oid == Oid.UNSPECIFIED)
- return Oid.UNSPECIFIED;
-
- Integer pgType = (Integer) _pgArrayToPgType.get(new Integer(oid));
-
- if (pgType != null)
- return pgType.intValue();
-
- if (_getArrayElementOidStatement == null) {
- String sql;
- if (_conn.haveMinimumServerVersion("7.3")) {
- sql = "SELECT e.oid, e.typname FROM pg_catalog.pg_type t, pg_catalog.pg_type e WHERE t.oid = ? and t.typelem = e.oid";
- } else {
- sql = "SELECT e.oid, e.typname FROM pg_type t, pg_type e WHERE t.oid = ? and t.typelem = e.oid";
- }
- _getArrayElementOidStatement = _conn.prepareStatement(sql);
- }
-
- _getArrayElementOidStatement.setInt(1, oid);
-
- // Go through BaseStatement to avoid transaction start.
- if (!((BaseStatement) _getArrayElementOidStatement).executeWithFlags(QueryExecutor.QUERY_SUPPRESS_BEGIN))
- throw new PSQLException(GT.tr("No results were returned by the query."), PSQLState.NO_DATA);
-
- ResultSet rs = _getArrayElementOidStatement.getResultSet();
- if (!rs.next())
- throw new PSQLException(GT.tr("No results were returned by the query."), PSQLState.NO_DATA);
-
- pgType = new Integer((int)rs.getLong(1));
- _pgArrayToPgType.put(new Integer(oid), pgType);
- _pgNameToOid.put(rs.getString(2), pgType);
- _oidToPgName.put(pgType, rs.getString(2));
-
- rs.close();
-
- return pgType.intValue();
- }
-
- public synchronized Class getPGobject(String type)
- {
- return (Class)_pgNameToPgObject.get(type);
- }
-
- public synchronized String getJavaClass(int oid) throws SQLException
- {
- String pgTypeName = getPGType(oid);
-
- String result = (String)_pgNameToJavaClass.get(pgTypeName);
- if (result != null) {
- return result;
- }
-
- if (getSQLType(pgTypeName) == Types.ARRAY) {
- result = "java.sql.Array";
- _pgNameToJavaClass.put(pgTypeName, result);
- }
-
- return result;
- }
-
- public String getTypeForAlias(String alias) {
- String type = (String) typeAliases.get(alias);
- if (type != null)
- return type;
- return alias;
- }
-
- public int getPrecision(int oid, int typmod) {
- oid = convertArrayToBaseOid(oid);
- switch (oid) {
- case Oid.INT2:
- return 5;
-
- case Oid.OID:
- case Oid.INT4:
- return 10;
-
- case Oid.INT8:
- return 19;
-
- case Oid.FLOAT4:
- // For float4 and float8, we can normally only get 6 and 15
- // significant digits out, but extra_float_digits may raise
- // that number by up to two digits.
- return 8;
-
- case Oid.FLOAT8:
- return 17;
-
- case Oid.NUMERIC:
- if (typmod == -1)
- return 0;
- return ((typmod-4) & 0xFFFF0000) >> 16;
-
- case Oid.CHAR:
- case Oid.BOOL:
- return 1;
-
- case Oid.BPCHAR:
- case Oid.VARCHAR:
- if (typmod == -1)
- return _unknownLength;
- return typmod - 4;
-
- // datetime types get the
- // "length in characters of the String representation"
- case Oid.DATE:
- case Oid.TIME:
- case Oid.TIMETZ:
- case Oid.INTERVAL:
- case Oid.TIMESTAMP:
- case Oid.TIMESTAMPTZ:
- return getDisplaySize(oid, typmod);
-
- case Oid.BIT:
- return typmod;
-
- case Oid.VARBIT:
- if (typmod == -1)
- return _unknownLength;
- return typmod;
-
- case Oid.TEXT:
- case Oid.BYTEA:
- default:
- return _unknownLength;
- }
- }
-
- public int getScale(int oid, int typmod) {
- oid = convertArrayToBaseOid(oid);
- switch(oid) {
- case Oid.FLOAT4:
- return 8;
- case Oid.FLOAT8:
- return 17;
- case Oid.NUMERIC:
- if (typmod == -1)
- return 0;
- return (typmod-4) & 0xFFFF;
- case Oid.TIME:
- case Oid.TIMETZ:
- case Oid.TIMESTAMP:
- case Oid.TIMESTAMPTZ:
- if (typmod == -1)
- return 6;
- return typmod;
- case Oid.INTERVAL:
- if (typmod == -1)
- return 6;
- return typmod & 0xFFFF;
- default:
- return 0;
- }
- }
-
- public boolean isCaseSensitive(int oid) {
- oid = convertArrayToBaseOid(oid);
- switch(oid) {
- case Oid.OID:
- case Oid.INT2:
- case Oid.INT4:
- case Oid.INT8:
- case Oid.FLOAT4:
- case Oid.FLOAT8:
- case Oid.NUMERIC:
- case Oid.BOOL:
- case Oid.BIT:
- case Oid.VARBIT:
- case Oid.DATE:
- case Oid.TIME:
- case Oid.TIMETZ:
- case Oid.TIMESTAMP:
- case Oid.TIMESTAMPTZ:
- case Oid.INTERVAL:
- return false;
- default:
- return true;
- }
- }
-
- public boolean isSigned(int oid) {
- oid = convertArrayToBaseOid(oid);
- switch(oid) {
- case Oid.INT2:
- case Oid.INT4:
- case Oid.INT8:
- case Oid.FLOAT4:
- case Oid.FLOAT8:
- case Oid.NUMERIC:
- return true;
- default:
- return false;
- }
- }
-
- public int getDisplaySize(int oid, int typmod) {
- oid = convertArrayToBaseOid(oid);
- switch(oid) {
- case Oid.INT2:
- return 6; // -32768 to +32767
- case Oid.INT4:
- return 11; // -2147483648 to +2147483647
- case Oid.OID:
- return 10; // 0 to 4294967295
- case Oid.INT8:
- return 20; // -9223372036854775808 to +9223372036854775807
- case Oid.FLOAT4:
- // varies based upon the extra_float_digits GUC.
- // These values are for the longest possible length.
- return 15; // sign + 9 digits + decimal point + e + sign + 2 digits
- case Oid.FLOAT8:
- return 25; // sign + 18 digits + decimal point + e + sign + 3 digits
- case Oid.CHAR:
- return 1;
- case Oid.BOOL:
- return 1;
- case Oid.DATE:
- return 13; // "4713-01-01 BC" to "01/01/4713 BC" - "31/12/32767"
- case Oid.TIME:
- case Oid.TIMETZ:
- case Oid.TIMESTAMP:
- case Oid.TIMESTAMPTZ:
- // Calculate the number of decimal digits + the decimal point.
- int secondSize;
- switch(typmod) {
- case -1:
- secondSize = 6 + 1;
- break;
- case 0:
- secondSize = 0;
- break;
- case 1:
- // Bizarrely SELECT '0:0:0.1'::time(1); returns 2 digits.
- secondSize = 2 + 1;
- break;
- default:
- secondSize = typmod + 1;
- break;
- }
-
- // We assume the worst case scenario for all of these.
- // time = '00:00:00' = 8
- // date = '5874897-12-31' = 13 (although at large values second precision is lost)
- // date = '294276-11-20' = 12 --enable-integer-datetimes
- // zone = '+11:30' = 6;
-
- switch(oid) {
- case Oid.TIME:
- return 8 + secondSize;
- case Oid.TIMETZ:
- return 8 + secondSize + 6;
- case Oid.TIMESTAMP:
- return 13 + 1 + 8 + secondSize;
- case Oid.TIMESTAMPTZ:
- return 13 + 1 + 8 + secondSize + 6;
- }
- case Oid.INTERVAL:
- return 49; // SELECT LENGTH('-123456789 years 11 months 33 days 23 hours 10.123456 seconds'::interval);
- case Oid.VARCHAR:
- case Oid.BPCHAR:
- if (typmod == -1)
- return _unknownLength;
- return typmod - 4;
- case Oid.NUMERIC:
- if (typmod == -1)
- return 131089; // SELECT LENGTH(pow(10::numeric,131071)); 131071 = 2^17-1
- int precision = (typmod-4 >> 16) & 0xffff;
- int scale = (typmod-4) & 0xffff;
- // sign + digits + decimal point (only if we have nonzero scale)
- return 1 + precision + (scale != 0 ? 1 : 0);
- case Oid.BIT:
- return typmod;
- case Oid.VARBIT:
- if (typmod == -1)
- return _unknownLength;
- return typmod;
- case Oid.TEXT:
- case Oid.BYTEA:
- return _unknownLength;
- default:
- return _unknownLength;
- }
- }
-
- public int getMaximumPrecision(int oid) {
- oid = convertArrayToBaseOid(oid);
- switch(oid) {
- case Oid.NUMERIC:
- return 1000;
- case Oid.TIME:
- case Oid.TIMETZ:
- // Technically this depends on the --enable-integer-datetimes
- // configure setting. It is 6 with integer and 10 with float.
- return 6;
- case Oid.TIMESTAMP:
- case Oid.TIMESTAMPTZ:
- case Oid.INTERVAL:
- return 6;
- case Oid.BPCHAR:
- case Oid.VARCHAR:
- return 10485760;
- case Oid.BIT:
- case Oid.VARBIT:
- return 83886080;
- default:
- return 0;
- }
- }
-
- public boolean requiresQuoting(int oid) throws SQLException
- {
- int sqlType = getSQLType(oid);
- switch(sqlType) {
- case Types.BIGINT:
- case Types.DOUBLE:
- case Types.FLOAT:
- case Types.INTEGER:
- case Types.REAL:
- case Types.SMALLINT:
- case Types.TINYINT:
- case Types.NUMERIC:
- case Types.DECIMAL:
- return false;
- }
- return true;
- }
-
-}
diff --git a/org/postgresql/jdbc2/optional/ConnectionPool.java b/org/postgresql/jdbc2/optional/ConnectionPool.java
deleted file mode 100644
index 3d22daf..0000000
--- a/org/postgresql/jdbc2/optional/ConnectionPool.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-
-package org.postgresql.jdbc2.optional;
-
-import org.postgresql.ds.PGConnectionPoolDataSource;
-
-public class ConnectionPool extends PGConnectionPoolDataSource
-{
-}
diff --git a/org/postgresql/jdbc2/optional/PoolingDataSource.java b/org/postgresql/jdbc2/optional/PoolingDataSource.java
deleted file mode 100644
index 35e8517..0000000
--- a/org/postgresql/jdbc2/optional/PoolingDataSource.java
+++ /dev/null
@@ -1,14 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc2.optional;
-
-import org.postgresql.ds.PGPoolingDataSource;
-
-public class PoolingDataSource extends PGPoolingDataSource
-{
-}
diff --git a/org/postgresql/jdbc2/optional/SimpleDataSource.java b/org/postgresql/jdbc2/optional/SimpleDataSource.java
deleted file mode 100644
index 1876463..0000000
--- a/org/postgresql/jdbc2/optional/SimpleDataSource.java
+++ /dev/null
@@ -1,14 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc2.optional;
-
-import org.postgresql.ds.PGSimpleDataSource;
-
-public class SimpleDataSource extends PGSimpleDataSource
-{
-}
diff --git a/org/postgresql/jdbc3/AbstractJdbc3Blob.java b/org/postgresql/jdbc3/AbstractJdbc3Blob.java
deleted file mode 100644
index 1a60954..0000000
--- a/org/postgresql/jdbc3/AbstractJdbc3Blob.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-import java.sql.SQLException;
-
-public abstract class AbstractJdbc3Blob extends org.postgresql.jdbc2.AbstractJdbc2Blob
-{
-
- public AbstractJdbc3Blob(org.postgresql.core.BaseConnection conn, long oid) throws SQLException
- {
- super(conn, oid);
- }
-
- /**
- * Writes the given array of bytes to the <code>BLOB</code> value that
- * this <code>Blob</code> object represents, starting at position
- * <code>pos</code>, and returns the number of bytes written.
- *
- * @param pos the position in the <code>BLOB</code> object at which
- * to start writing
- * @param bytes the array of bytes to be written to the <code>BLOB</code>
- * value that this <code>Blob</code> object represents
- * @return the number of bytes written
- * @exception SQLException if there is an error accessing the
- * <code>BLOB</code> value
- * @see #getBytes
- * @since 1.4
- */
- public synchronized int setBytes(long pos, byte[] bytes) throws SQLException
- {
- return setBytes(pos, bytes, 0, bytes.length);
- }
-
-
-
- /**
- * Writes all or part of the given <code>byte</code> array to the
- * <code>BLOB</code> value that this <code>Blob</code> object represents
- * and returns the number of bytes written.
- * Writing starts at position <code>pos</code> in the <code>BLOB</code>
- * value; <code>len</code> bytes from the given byte array are written.
- *
- * @param pos the position in the <code>BLOB</code> object at which
- * to start writing
- * @param bytes the array of bytes to be written to this <code>BLOB</code>
- * object
- * @param offset the offset into the array <code>bytes</code> at which
- * to start reading the bytes to be set
- * @param len the number of bytes to be written to the <code>BLOB</code>
- * value from the array of bytes <code>bytes</code>
- * @return the number of bytes written
- * @exception SQLException if there is an error accessing the
- * <code>BLOB</code> value
- * @see #getBytes
- * @since 1.4
- */
- public synchronized int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException
- {
- assertPosition(pos);
- lo.seek((int) (pos-1));
- lo.write(bytes, offset, len);
- return len;
- }
-
-}
diff --git a/org/postgresql/jdbc3/AbstractJdbc3Clob.java b/org/postgresql/jdbc3/AbstractJdbc3Clob.java
deleted file mode 100644
index 0227445..0000000
--- a/org/postgresql/jdbc3/AbstractJdbc3Clob.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-
-import java.sql.*;
-
-public abstract class AbstractJdbc3Clob extends org.postgresql.jdbc2.AbstractJdbc2Clob
-{
-
- public AbstractJdbc3Clob(org.postgresql.core.BaseConnection conn, long oid) throws SQLException
- {
- super(conn, oid);
- }
-
- /**
- * Writes the given Java <code>String</code> to the <code>CLOB</code>
- * value that this <code>Clob</code> object designates at the position
- * <code>pos</code>.
- *
- * @param pos the position at which to start writing to the <code>CLOB</code>
- * value that this <code>Clob</code> object represents
- * @param str the string to be written to the <code>CLOB</code>
- * value that this <code>Clob</code> designates
- * @return the number of characters written
- * @exception SQLException if there is an error accessing the
- * <code>CLOB</code> value
- *
- * @since 1.4
- */
- public synchronized int setString(long pos, String str) throws SQLException
- {
- checkFreed();
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setString(long,str)");
- }
-
- /**
- * Writes <code>len</code> characters of <code>str</code>, starting
- * at character <code>offset</code>, to the <code>CLOB</code> value
- * that this <code>Clob</code> represents.
- *
- * @param pos the position at which to start writing to this
- * <code>CLOB</code> object
- * @param str the string to be written to the <code>CLOB</code>
- * value that this <code>Clob</code> object represents
- * @param offset the offset into <code>str</code> to start reading
- * the characters to be written
- * @param len the number of characters to be written
- * @return the number of characters written
- * @exception SQLException if there is an error accessing the
- * <code>CLOB</code> value
- *
- * @since 1.4
- */
- public synchronized int setString(long pos, String str, int offset, int len) throws SQLException
- {
- checkFreed();
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setString(long,String,int,int)");
- }
-
- /**
- * Retrieves a stream to be used to write Ascii characters to the
- * <code>CLOB</code> value that this <code>Clob</code> object represents,
- * starting at position <code>pos</code>.
- *
- * @param pos the position at which to start writing to this
- * <code>CLOB</code> object
- * @return the stream to which ASCII encoded characters can be written
- * @exception SQLException if there is an error accessing the
- * <code>CLOB</code> value
- * @see #getAsciiStream
- *
- * @since 1.4
- */
- public synchronized java.io.OutputStream setAsciiStream(long pos) throws SQLException
- {
- checkFreed();
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setAsciiStream(long)");
- }
-
- /**
- * Retrieves a stream to be used to write a stream of Unicode characters
- * to the <code>CLOB</code> value that this <code>Clob</code> object
- * represents, at position <code>pos</code>.
- *
- * @param pos the position at which to start writing to the
- * <code>CLOB</code> value
- *
- * @return a stream to which Unicode encoded characters can be written
- * @exception SQLException if there is an error accessing the
- * <code>CLOB</code> value
- * @see #getCharacterStream
- *
- * @since 1.4
- */
- public synchronized java.io.Writer setCharacterStream(long pos) throws SQLException
- {
- checkFreed();
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setCharacteStream(long)");
- }
-
-}
diff --git a/org/postgresql/jdbc3/AbstractJdbc3Connection.java b/org/postgresql/jdbc3/AbstractJdbc3Connection.java
deleted file mode 100644
index c7738a0..0000000
--- a/org/postgresql/jdbc3/AbstractJdbc3Connection.java
+++ /dev/null
@@ -1,478 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-import java.util.Properties;
-import java.sql.*;
-
-import org.postgresql.util.HostSpec;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.GT;
-
-/**
- * This class defines methods of the jdbc3 specification. This class extends
- * org.postgresql.jdbc2.AbstractJdbc2Connection which provides the jdbc2
- * methods. The real Connection class (for jdbc3) is org.postgresql.jdbc3.Jdbc3Connection
- */
-public abstract class AbstractJdbc3Connection extends org.postgresql.jdbc2.AbstractJdbc2Connection
-{
- private int rsHoldability = ResultSet.CLOSE_CURSORS_AT_COMMIT;
- private int savepointId = 0;
-
- protected AbstractJdbc3Connection(HostSpec[] hostSpec, String user, String database, Properties info, String url) throws SQLException {
- super(hostSpec, user, database, info, url);
- }
-
- /**
- * Changes the holdability of <code>ResultSet</code> objects
- * created using this <code>Connection</code> object to the given
- * holdability.
- *
- * @param holdability a <code>ResultSet</code> holdability constant; one of
- * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
- * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
- * @throws SQLException if a database access occurs, the given parameter
- * is not a <code>ResultSet</code> constant indicating holdability,
- * or the given holdability is not supported
- * @see #getHoldability
- * @see ResultSet
- * @since 1.4
- */
- public void setHoldability(int holdability) throws SQLException
- {
- checkClosed();
-
- switch (holdability)
- {
- case ResultSet.CLOSE_CURSORS_AT_COMMIT:
- rsHoldability = holdability;
- break;
- case ResultSet.HOLD_CURSORS_OVER_COMMIT:
- rsHoldability = holdability;
- break;
- default:
- throw new PSQLException(GT.tr("Unknown ResultSet holdability setting: {0}.", new Integer(holdability)),
- PSQLState.INVALID_PARAMETER_VALUE);
- }
- }
-
- /**
- * Retrieves the current holdability of <code>ResultSet</code> objects
- * created using this <code>Connection</code> object.
- *
- * @return the holdability, one of
- * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
- * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
- * @throws SQLException if a database access occurs
- * @see #setHoldability
- * @see ResultSet
- * @since 1.4
- */
- public int getHoldability() throws SQLException
- {
- checkClosed();
- return rsHoldability;
- }
-
- /**
- * Creates an unnamed savepoint in the current transaction and
- * returns the new <code>Savepoint</code> object that represents it.
- *
- * @return the new <code>Savepoint</code> object
- * @exception SQLException if a database access error occurs
- * or this <code>Connection</code> object is currently in
- * auto-commit mode
- * @see Savepoint
- * @since 1.4
- */
- public Savepoint setSavepoint() throws SQLException
- {
- checkClosed();
- if (!haveMinimumServerVersion("8.0"))
- throw new PSQLException(GT.tr("Server versions prior to 8.0 do not support savepoints."), PSQLState.NOT_IMPLEMENTED);
- if (getAutoCommit())
- throw new PSQLException(GT.tr("Cannot establish a savepoint in auto-commit mode."),
- PSQLState.NO_ACTIVE_SQL_TRANSACTION);
-
- PSQLSavepoint savepoint = new PSQLSavepoint(savepointId++);
-
- // Note we can't use execSQLUpdate because we don't want
- // to suppress BEGIN.
- Statement stmt = createStatement();
- stmt.executeUpdate("SAVEPOINT " + savepoint.getPGName());
- stmt.close();
-
- return savepoint;
- }
-
- /**
- * Creates a savepoint with the given name in the current transaction
- * and returns the new <code>Savepoint</code> object that represents it.
- *
- * @param name a <code>String</code> containing the name of the savepoint
- * @return the new <code>Savepoint</code> object
- * @exception SQLException if a database access error occurs
- * or this <code>Connection</code> object is currently in
- * auto-commit mode
- * @see Savepoint
- * @since 1.4
- */
- public Savepoint setSavepoint(String name) throws SQLException
- {
- checkClosed();
- if (!haveMinimumServerVersion("8.0"))
- throw new PSQLException(GT.tr("Server versions prior to 8.0 do not support savepoints."), PSQLState.NOT_IMPLEMENTED);
- if (getAutoCommit())
- throw new PSQLException(GT.tr("Cannot establish a savepoint in auto-commit mode."),
- PSQLState.NO_ACTIVE_SQL_TRANSACTION);
-
- PSQLSavepoint savepoint = new PSQLSavepoint(name);
-
- // Note we can't use execSQLUpdate because we don't want
- // to suppress BEGIN.
- Statement stmt = createStatement();
- stmt.executeUpdate("SAVEPOINT " + savepoint.getPGName());
- stmt.close();
-
- return savepoint;
- }
-
- /**
- * Undoes all changes made after the given <code>Savepoint</code> object
- * was set.
- * <P>
- * This method should be used only when auto-commit has been disabled.
- *
- * @param savepoint the <code>Savepoint</code> object to roll back to
- * @exception SQLException if a database access error occurs,
- * the <code>Savepoint</code> object is no longer valid,
- * or this <code>Connection</code> object is currently in
- * auto-commit mode
- * @see Savepoint
- * @see #rollback
- * @since 1.4
- */
- public void rollback(Savepoint savepoint) throws SQLException
- {
- checkClosed();
- if (!haveMinimumServerVersion("8.0"))
- throw new PSQLException(GT.tr("Server versions prior to 8.0 do not support savepoints."), PSQLState.NOT_IMPLEMENTED);
-
- PSQLSavepoint pgSavepoint = (PSQLSavepoint)savepoint;
- execSQLUpdate("ROLLBACK TO SAVEPOINT " + pgSavepoint.getPGName());
- }
-
-
- /**
- * Removes the given <code>Savepoint</code> object from the current
- * transaction. Any reference to the savepoint after it have been removed
- * will cause an <code>SQLException</code> to be thrown.
- *
- * @param savepoint the <code>Savepoint</code> object to be removed
- * @exception SQLException if a database access error occurs or
- * the given <code>Savepoint</code> object is not a valid
- * savepoint in the current transaction
- * @since 1.4
- */
- public void releaseSavepoint(Savepoint savepoint) throws SQLException
- {
- checkClosed();
- if (!haveMinimumServerVersion("8.0"))
- throw new PSQLException(GT.tr("Server versions prior to 8.0 do not support savepoints."), PSQLState.NOT_IMPLEMENTED);
-
- PSQLSavepoint pgSavepoint = (PSQLSavepoint)savepoint;
- execSQLUpdate("RELEASE SAVEPOINT " + pgSavepoint.getPGName());
- pgSavepoint.invalidate();
- }
-
-
- /**
- * Creates a <code>Statement</code> object that will generate
- * <code>ResultSet</code> objects with the given type, concurrency,
- * and holdability.
- * This method is the same as the <code>createStatement</code> method
- * above, but it allows the default result set
- * type, concurrency, and holdability to be overridden.
- *
- * @param resultSetType one of the following <code>ResultSet</code>
- * constants:
- * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
- * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
- * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
- * @param resultSetConcurrency one of the following <code>ResultSet</code>
- * constants:
- * <code>ResultSet.CONCUR_READ_ONLY</code> or
- * <code>ResultSet.CONCUR_UPDATABLE</code>
- * @param resultSetHoldability one of the following <code>ResultSet</code>
- * constants:
- * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
- * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
- * @return a new <code>Statement</code> object that will generate
- * <code>ResultSet</code> objects with the given type,
- * concurrency, and holdability
- * @exception SQLException if a database access error occurs
- * or the given parameters are not <code>ResultSet</code>
- * constants indicating type, concurrency, and holdability
- * @see ResultSet
- * @since 1.4
- */
- public abstract Statement createStatement(int resultSetType, int resultSetConcurrency,
- int resultSetHoldability) throws SQLException;
-
- public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
- checkClosed();
- return createStatement(resultSetType, resultSetConcurrency, getHoldability());
- }
-
- /**
- * Creates a <code>PreparedStatement</code> object that will generate
- * <code>ResultSet</code> objects with the given type, concurrency,
- * and holdability.
- * <P>
- * This method is the same as the <code>prepareStatement</code> method
- * above, but it allows the default result set
- * type, concurrency, and holdability to be overridden.
- *
- * @param sql a <code>String</code> object that is the SQL statement to
- * be sent to the database; may contain one or more ? IN
- * parameters
- * @param resultSetType one of the following <code>ResultSet</code>
- * constants:
- * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
- * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
- * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
- * @param resultSetConcurrency one of the following <code>ResultSet</code>
- * constants:
- * <code>ResultSet.CONCUR_READ_ONLY</code> or
- * <code>ResultSet.CONCUR_UPDATABLE</code>
- * @param resultSetHoldability one of the following <code>ResultSet</code>
- * constants:
- * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
- * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
- * @return a new <code>PreparedStatement</code> object, containing the
- * pre-compiled SQL statement, that will generate
- * <code>ResultSet</code> objects with the given type,
- * concurrency, and holdability
- * @exception SQLException if a database access error occurs
- * or the given parameters are not <code>ResultSet</code>
- * constants indicating type, concurrency, and holdability
- * @see ResultSet
- * @since 1.4
- */
- public abstract PreparedStatement prepareStatement(String sql, int resultSetType,
- int resultSetConcurrency, int resultSetHoldability)
- throws SQLException;
-
- public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
- checkClosed();
- return prepareStatement(sql, resultSetType, resultSetConcurrency, getHoldability());
- }
-
-
- /**
- * Creates a <code>CallableStatement</code> object that will generate
- * <code>ResultSet</code> objects with the given type and concurrency.
- * This method is the same as the <code>prepareCall</code> method
- * above, but it allows the default result set
- * type, result set concurrency type and holdability to be overridden.
- *
- * @param sql a <code>String</code> object that is the SQL statement to
- * be sent to the database; may contain on or more ? parameters
- * @param resultSetType one of the following <code>ResultSet</code>
- * constants:
- * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
- * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
- * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
- * @param resultSetConcurrency one of the following <code>ResultSet</code>
- * constants:
- * <code>ResultSet.CONCUR_READ_ONLY</code> or
- * <code>ResultSet.CONCUR_UPDATABLE</code>
- * @param resultSetHoldability one of the following <code>ResultSet</code>
- * constants:
- * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
- * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
- * @return a new <code>CallableStatement</code> object, containing the
- * pre-compiled SQL statement, that will generate
- * <code>ResultSet</code> objects with the given type,
- * concurrency, and holdability
- * @exception SQLException if a database access error occurs
- * or the given parameters are not <code>ResultSet</code>
- * constants indicating type, concurrency, and holdability
- * @see ResultSet
- * @since 1.4
- */
- public abstract CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldability) throws SQLException;
-
- public CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency) throws SQLException {
- checkClosed();
- return prepareCall(sql, resultSetType, resultSetConcurrency, getHoldability());
- }
-
- /**
- * Creates a default <code>PreparedStatement</code> object that has
- * the capability to retrieve auto-generated keys. The given constant
- * tells the driver whether it should make auto-generated keys
- * available for retrieval. This parameter is ignored if the SQL
- * statement is not an <code>INSERT</code> statement.
- * <P>
- * <B>Note:</B> This method is optimized for handling
- * parametric SQL statements that benefit from precompilation. If
- * the driver supports precompilation,
- * the method <code>prepareStatement</code> will send
- * the statement to the database for precompilation. Some drivers
- * may not support precompilation. In this case, the statement may
- * not be sent to the database until the <code>PreparedStatement</code>
- * object is executed. This has no direct effect on users; however, it does
- * affect which methods throw certain SQLExceptions.
- * <P>
- * Result sets created using the returned <code>PreparedStatement</code>
- * object will by default be type <code>TYPE_FORWARD_ONLY</code>
- * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
- *
- * @param sql an SQL statement that may contain one or more '?' IN
- * parameter placeholders
- * @param autoGeneratedKeys a flag indicating whether auto-generated keys
- * should be returned; one of the following <code>Statement</code>
- * constants:
- * <code>Statement.RETURN_GENERATED_KEYS</code> or
- * <code>Statement.NO_GENERATED_KEYS</code>.
- * @return a new <code>PreparedStatement</code> object, containing the
- * pre-compiled SQL statement, that will have the capability of
- * returning auto-generated keys
- * @exception SQLException if a database access error occurs
- * or the given parameter is not a <code>Statement</code>
- * constant indicating whether auto-generated keys should be
- * returned
- * @since 1.4
- */
- public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
- throws SQLException
- {
- checkClosed();
- if (autoGeneratedKeys != Statement.NO_GENERATED_KEYS)
- sql = AbstractJdbc3Statement.addReturning(this, sql, new String[]{"*"}, false);
-
- PreparedStatement ps = prepareStatement(sql);
-
- if (autoGeneratedKeys != Statement.NO_GENERATED_KEYS)
- ((AbstractJdbc3Statement)ps).wantsGeneratedKeysAlways = true;
-
- return ps;
- }
-
-
- /**
- * Creates a default <code>PreparedStatement</code> object capable
- * of returning the auto-generated keys designated by the given array.
- * This array contains the indexes of the columns in the target
- * table that contain the auto-generated keys that should be made
- * available. This array is ignored if the SQL
- * statement is not an <code>INSERT</code> statement.
- * <P>
- * An SQL statement with or without IN parameters can be
- * pre-compiled and stored in a <code>PreparedStatement</code> object. This
- * object can then be used to efficiently execute this statement
- * multiple times.
- * <P>
- * <B>Note:</B> This method is optimized for handling
- * parametric SQL statements that benefit from precompilation. If
- * the driver supports precompilation,
- * the method <code>prepareStatement</code> will send
- * the statement to the database for precompilation. Some drivers
- * may not support precompilation. In this case, the statement may
- * not be sent to the database until the <code>PreparedStatement</code>
- * object is executed. This has no direct effect on users; however, it does
- * affect which methods throw certain SQLExceptions.
- * <P>
- * Result sets created using the returned <code>PreparedStatement</code>
- * object will by default be type <code>TYPE_FORWARD_ONLY</code>
- * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
- *
- * @param sql an SQL statement that may contain one or more '?' IN
- * parameter placeholders
- * @param columnIndexes an array of column indexes indicating the columns
- * that should be returned from the inserted row or rows
- * @return a new <code>PreparedStatement</code> object, containing the
- * pre-compiled statement, that is capable of returning the
- * auto-generated keys designated by the given array of column
- * indexes
- * @exception SQLException if a database access error occurs
- *
- * @since 1.4
- */
- public PreparedStatement prepareStatement(String sql, int columnIndexes[])
- throws SQLException
- {
- if (columnIndexes == null || columnIndexes.length == 0)
- return prepareStatement(sql);
-
- checkClosed();
- throw new PSQLException(GT.tr("Returning autogenerated keys is not supported."), PSQLState.NOT_IMPLEMENTED);
- }
-
-
- /**
- * Creates a default <code>PreparedStatement</code> object capable
- * of returning the auto-generated keys designated by the given array.
- * This array contains the names of the columns in the target
- * table that contain the auto-generated keys that should be returned.
- * This array is ignored if the SQL
- * statement is not an <code>INSERT</code> statement.
- * <P>
- * An SQL statement with or without IN parameters can be
- * pre-compiled and stored in a <code>PreparedStatement</code> object. This
- * object can then be used to efficiently execute this statement
- * multiple times.
- * <P>
- * <B>Note:</B> This method is optimized for handling
- * parametric SQL statements that benefit from precompilation. If
- * the driver supports precompilation,
- * the method <code>prepareStatement</code> will send
- * the statement to the database for precompilation. Some drivers
- * may not support precompilation. In this case, the statement may
- * not be sent to the database until the <code>PreparedStatement</code>
- * object is executed. This has no direct effect on users; however, it does
- * affect which methods throw certain SQLExceptions.
- * <P>
- * Result sets created using the returned <code>PreparedStatement</code>
- * object will by default be type <code>TYPE_FORWARD_ONLY</code>
- * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
- *
- * @param sql an SQL statement that may contain one or more '?' IN
- * parameter placeholders
- * @param columnNames an array of column names indicating the columns
- * that should be returned from the inserted row or rows
- * @return a new <code>PreparedStatement</code> object, containing the
- * pre-compiled statement, that is capable of returning the
- * auto-generated keys designated by the given array of column
- * names
- * @exception SQLException if a database access error occurs
- *
- * @since 1.4
- */
- public PreparedStatement prepareStatement(String sql, String columnNames[])
- throws SQLException
- {
- if (columnNames != null && columnNames.length != 0)
- sql = AbstractJdbc3Statement.addReturning(this, sql, columnNames, true);
-
- PreparedStatement ps = prepareStatement(sql);
-
- if (columnNames != null && columnNames.length != 0)
- ((AbstractJdbc3Statement)ps).wantsGeneratedKeysAlways = true;
-
- return ps;
- }
-
-}
-
-
diff --git a/org/postgresql/jdbc3/AbstractJdbc3DatabaseMetaData.java b/org/postgresql/jdbc3/AbstractJdbc3DatabaseMetaData.java
deleted file mode 100644
index 950b626..0000000
--- a/org/postgresql/jdbc3/AbstractJdbc3DatabaseMetaData.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-
-import java.sql.*;
-
-public abstract class AbstractJdbc3DatabaseMetaData extends org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData
-{
-
- public AbstractJdbc3DatabaseMetaData(AbstractJdbc3Connection conn)
- {
- super(conn);
- }
-
-
- /**
- * Retrieves whether this database supports savepoints.
- *
- * @return <code>true</code> if savepoints are supported;
- * <code>false</code> otherwise
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public boolean supportsSavepoints() throws SQLException
- {
- return connection.haveMinimumServerVersion("8.0");
- }
-
- /**
- * Retrieves whether this database supports named parameters to callable
- * statements.
- *
- * @return <code>true</code> if named parameters are supported;
- * <code>false</code> otherwise
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public boolean supportsNamedParameters() throws SQLException
- {
- return false;
- }
-
- /**
- * Retrieves whether it is possible to have multiple <code>ResultSet</code> objects
- * returned from a <code>CallableStatement</code> object
- * simultaneously.
- *
- * @return <code>true</code> if a <code>CallableStatement</code> object
- * can return multiple <code>ResultSet</code> objects
- * simultaneously; <code>false</code> otherwise
- * @exception SQLException if a datanase access error occurs
- * @since 1.4
- */
- public boolean supportsMultipleOpenResults() throws SQLException
- {
- return false;
- }
-
- /**
- * Retrieves whether auto-generated keys can be retrieved after
- * a statement has been executed.
- *
- * @return <code>true</code> if auto-generated keys can be retrieved
- * after a statement has executed; <code>false</code> otherwise
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public boolean supportsGetGeneratedKeys() throws SQLException
- {
- // We don't support returning generated keys by column index,
- // but that should be a rarer case than the ones we do support.
- //
- return connection.haveMinimumServerVersion("8.2");
- }
-
- /**
- * Retrieves a description of the user-defined type (UDT) hierarchies defined in a
- * particular schema in this database. Only the immediate super type/
- * sub type relationship is modeled.
- * <P>
- * Only supertype information for UDTs matching the catalog,
- * schema, and type name is returned. The type name parameter
- * may be a fully-qualified name. When the UDT name supplied is a
- * fully-qualified name, the catalog and schemaPattern parameters are
- * ignored.
- * <P>
- * If a UDT does not have a direct super type, it is not listed here.
- * A row of the <code>ResultSet</code> object returned by this method
- * describes the designated UDT and a direct supertype. A row has the following
- * columns:
- * <OL>
- * <LI><B>TYPE_CAT</B> String => the UDT's catalog (may be <code>null</code>)
- * <LI><B>TYPE_SCHEM</B> String => UDT's schema (may be <code>null</code>)
- * <LI><B>TYPE_NAME</B> String => type name of the UDT
- * <LI><B>SUPERTYPE_CAT</B> String => the direct super type's catalog
- * (may be <code>null</code>)
- * <LI><B>SUPERTYPE_SCHEM</B> String => the direct super type's schema
- * (may be <code>null</code>)
- * <LI><B>SUPERTYPE_NAME</B> String => the direct super type's name
- * </OL>
- *
- * <P><B>Note:</B> If the driver does not support type hierarchies, an
- * empty result set is returned.
- *
- * @param catalog a catalog name; "" retrieves those without a catalog;
- * <code>null</code> means drop catalog name from the selection criteria
- * @param schemaPattern a schema name pattern; "" retrieves those
- * without a schema
- * @param typeNamePattern a UDT name pattern; may be a fully-qualified
- * name
- * @return a <code>ResultSet</code> object in which a row gives information
- * about the designated UDT
- * @throws SQLException if a database access error occurs
- * @since 1.4
- */
- public ResultSet getSuperTypes(String catalog, String schemaPattern,
- String typeNamePattern) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getSuperTypes(String,String,String)");
- }
-
- /**
- * Retrieves a description of the table hierarchies defined in a particular
- * schema in this database.
- *
- * <P>Only supertable information for tables matching the catalog, schema
- * and table name are returned. The table name parameter may be a fully-
- * qualified name, in which case, the catalog and schemaPattern parameters
- * are ignored. If a table does not have a super table, it is not listed here.
- * Supertables have to be defined in the same catalog and schema as the
- * sub tables. Therefore, the type description does not need to include
- * this information for the supertable.
- *
- * <P>Each type description has the following columns:
- * <OL>
- * <LI><B>TABLE_CAT</B> String => the type's catalog (may be <code>null</code>)
- * <LI><B>TABLE_SCHEM</B> String => type's schema (may be <code>null</code>)
- * <LI><B>TABLE_NAME</B> String => type name
- * <LI><B>SUPERTABLE_NAME</B> String => the direct super type's name
- * </OL>
- *
- * <P><B>Note:</B> If the driver does not support type hierarchies, an
- * empty result set is returned.
- *
- * @param catalog a catalog name; "" retrieves those without a catalog;
- * <code>null</code> means drop catalog name from the selection criteria
- * @param schemaPattern a schema name pattern; "" retrieves those
- * without a schema
- * @param tableNamePattern a table name pattern; may be a fully-qualified
- * name
- * @return a <code>ResultSet</code> object in which each row is a type description
- * @throws SQLException if a database access error occurs
- * @since 1.4
- */
- public ResultSet getSuperTables(String catalog, String schemaPattern,
- String tableNamePattern) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getSuperTables(String,String,String,String)");
- }
-
- /**
- * Retrieves a description of the given attribute of the given type
- * for a user-defined type (UDT) that is available in the given schema
- * and catalog.
- * <P>
- * Descriptions are returned only for attributes of UDTs matching the
- * catalog, schema, type, and attribute name criteria. They are ordered by
- * TYPE_SCHEM, TYPE_NAME and ORDINAL_POSITION. This description
- * does not contain inherited attributes.
- * <P>
- * The <code>ResultSet</code> object that is returned has the following
- * columns:
- * <OL>
- * <LI><B>TYPE_CAT</B> String => type catalog (may be <code>null</code>)
- * <LI><B>TYPE_SCHEM</B> String => type schema (may be <code>null</code>)
- * <LI><B>TYPE_NAME</B> String => type name
- * <LI><B>ATTR_NAME</B> String => attribute name
- * <LI><B>DATA_TYPE</B> short => attribute type SQL type from java.sql.Types
- * <LI><B>ATTR_TYPE_NAME</B> String => Data source dependent type name.
- * For a UDT, the type name is fully qualified. For a REF, the type name is
- * fully qualified and represents the target type of the reference type.
- * <LI><B>ATTR_SIZE</B> int => column size. For char or date
- * types this is the maximum number of characters; for numeric or
- * decimal types this is precision.
- * <LI><B>DECIMAL_DIGITS</B> int => the number of fractional digits
- * <LI><B>NUM_PREC_RADIX</B> int => Radix (typically either 10 or 2)
- * <LI><B>NULLABLE</B> int => whether NULL is allowed
- * <UL>
- * <LI> attributeNoNulls - might not allow NULL values
- * <LI> attributeNullable - definitely allows NULL values
- * <LI> attributeNullableUnknown - nullability unknown
- * </UL>
- * <LI><B>REMARKS</B> String => comment describing column (may be <code>null</code>)
- * <LI><B>ATTR_DEF</B> String => default value (may be <code>null</code>)
- * <LI><B>SQL_DATA_TYPE</B> int => unused
- * <LI><B>SQL_DATETIME_SUB</B> int => unused
- * <LI><B>CHAR_OCTET_LENGTH</B> int => for char types the
- * maximum number of bytes in the column
- * <LI><B>ORDINAL_POSITION</B> int => index of column in table
- * (starting at 1)
- * <LI><B>IS_NULLABLE</B> String => "NO" means column definitely
- * does not allow NULL values; "YES" means the column might
- * allow NULL values. An empty string means unknown.
- * <LI><B>SCOPE_CATALOG</B> String => catalog of table that is the
- * scope of a reference attribute (<code>null</code> if DATA_TYPE isn't REF)
- * <LI><B>SCOPE_SCHEMA</B> String => schema of table that is the
- * scope of a reference attribute (<code>null</code> if DATA_TYPE isn't REF)
- * <LI><B>SCOPE_TABLE</B> String => table name that is the scope of a
- * reference attribute (<code>null</code> if the DATA_TYPE isn't REF)
- * <LI><B>SOURCE_DATA_TYPE</B> short => source type of a distinct type or user-generated
- * Ref type,SQL type from java.sql.Types (<code>null</code> if DATA_TYPE
- * isn't DISTINCT or user-generated REF)
- * </OL>
- * @param catalog a catalog name; must match the catalog name as it
- * is stored in the database; "" retrieves those without a catalog;
- * <code>null</code> means that the catalog name should not be used to narrow
- * the search
- * @param schemaPattern a schema name pattern; must match the schema name
- * as it is stored in the database; "" retrieves those without a schema;
- * <code>null</code> means that the schema name should not be used to narrow
- * the search
- * @param typeNamePattern a type name pattern; must match the
- * type name as it is stored in the database
- * @param attributeNamePattern an attribute name pattern; must match the attribute
- * name as it is declared in the database
- * @return a <code>ResultSet</code> object in which each row is an
- * attribute description
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public ResultSet getAttributes(String catalog, String schemaPattern,
- String typeNamePattern, String attributeNamePattern)
- throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getAttributes(String,String,String,String)");
- }
-
- /**
- * Retrieves whether this database supports the given result set holdability.
- *
- * @param holdability one of the following constants:
- * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
- * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT<code>
- * @return <code>true</code> if so; <code>false</code> otherwise
- * @exception SQLException if a database access error occurs
- * @see Connection
- * @since 1.4
- */
- public boolean supportsResultSetHoldability(int holdability) throws SQLException
- {
- return true;
- }
-
- /**
- * Retrieves the default holdability of this <code>ResultSet</code>
- * object.
- *
- * @return the default holdability; either
- * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
- * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public int getResultSetHoldability() throws SQLException
- {
- return ResultSet.HOLD_CURSORS_OVER_COMMIT;
- }
-
- /**
- * Retrieves the major version number of the underlying database.
- *
- * @return the underlying database's major version
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public int getDatabaseMajorVersion() throws SQLException
- {
- return connection.getServerMajorVersion();
- }
-
- /**
- * Retrieves the minor version number of the underlying database.
- *
- * @return underlying database's minor version
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public int getDatabaseMinorVersion() throws SQLException
- {
- return connection.getServerMinorVersion();
- }
-
- /**
- * Retrieves the major JDBC version number for this
- * driver.
- *
- * @return JDBC version major number
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public int getJDBCMajorVersion() throws SQLException
- {
- return 3; // This class implements JDBC 3.0
- }
-
- /**
- * Retrieves the minor JDBC version number for this
- * driver.
- *
- * @return JDBC version minor number
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public int getJDBCMinorVersion() throws SQLException
- {
- return 0; // This class implements JDBC 3.0
- }
-
- /**
- * Indicates whether the SQLSTATEs returned by <code>SQLException.getSQLState</code>
- * is X/Open (now known as Open Group) SQL CLI or SQL99.
- * @return the type of SQLSTATEs, one of:
- * sqlStateXOpen or
- * sqlStateSQL99
- * @throws SQLException if a database access error occurs
- * @since 1.4
- */
- public int getSQLStateType() throws SQLException
- {
- return DatabaseMetaData.sqlStateSQL99;
- }
-
- /**
- * Indicates whether updates made to a LOB are made on a copy or directly
- * to the LOB.
- * @return <code>true</code> if updates are made to a copy of the LOB;
- * <code>false</code> if updates are made directly to the LOB
- * @throws SQLException if a database access error occurs
- * @since 1.4
- */
- public boolean locatorsUpdateCopy() throws SQLException
- {
- /*
- * Currently LOB's aren't updateable at all, so it doesn't
- * matter what we return. We don't throw the notImplemented
- * Exception because the 1.5 JDK's CachedRowSet calls this
- * method regardless of wether large objects are used.
- */
- return true;
- }
-
- /**
- * Retrieves weather this database supports statement pooling.
- *
- * @return <code>true</code> is so;
- <code>false</code> otherwise
- * @throws SQLExcpetion if a database access error occurs
- * @since 1.4
- */
- public boolean supportsStatementPooling() throws SQLException
- {
- return false;
- }
-
- public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException
- {
- return getColumns(3, catalog, schemaPattern, tableNamePattern, columnNamePattern);
- }
-
- public ResultSet getSchemas() throws SQLException
- {
- return getSchemas(3, null, null);
- }
-
-}
diff --git a/org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java b/org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java
deleted file mode 100644
index 8c41c43..0000000
--- a/org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2005-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-import java.sql.SQLException;
-import java.sql.ParameterMetaData;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.PSQLException;
-import org.postgresql.core.BaseConnection;
-import org.postgresql.jdbc2.TypeInfoCache;
-
-public abstract class AbstractJdbc3ParameterMetaData {
-
- private final BaseConnection _connection;
- private final int _oids[];
-
- public AbstractJdbc3ParameterMetaData(BaseConnection connection, int oids[]) {
- _connection = connection;
- _oids = oids;
- }
-
- public String getParameterClassName(int param) throws SQLException {
- checkParamIndex(param);
- return _connection.getTypeInfo().getJavaClass(_oids[param-1]);
- }
-
- public int getParameterCount() {
- return _oids.length;
- }
-
- // For now report all parameters as inputs. CallableStatements may
- // have one output, but ignore that for now.
- public int getParameterMode(int param) throws SQLException {
- checkParamIndex(param);
- return ParameterMetaData.parameterModeIn;
- }
-
- public int getParameterType(int param) throws SQLException {
- checkParamIndex(param);
- return _connection.getTypeInfo().getSQLType(_oids[param-1]);
- }
-
- public String getParameterTypeName(int param) throws SQLException {
- checkParamIndex(param);
- return _connection.getTypeInfo().getPGType(_oids[param-1]);
- }
-
- // we don't know this
- public int getPrecision(int param) throws SQLException {
- checkParamIndex(param);
- return 0;
- }
-
- // we don't know this
- public int getScale(int param) throws SQLException {
- checkParamIndex(param);
- return 0;
- }
-
- // we can't tell anything about nullability
- public int isNullable(int param) throws SQLException {
- checkParamIndex(param);
- return ParameterMetaData.parameterNullableUnknown;
- }
-
- // pg doesn't have unsigned numbers
- public boolean isSigned(int param) throws SQLException {
- checkParamIndex(param);
- return _connection.getTypeInfo().isSigned(_oids[param-1]);
- }
-
- private void checkParamIndex(int param) throws PSQLException {
- if (param < 1 || param > _oids.length)
- throw new PSQLException(GT.tr("The parameter index is out of range: {0}, number of parameters: {1}.", new Object[]{new Integer(param), new Integer(_oids.length)}), PSQLState.INVALID_PARAMETER_VALUE);
- }
-
-}
diff --git a/org/postgresql/jdbc3/AbstractJdbc3ResultSet.java b/org/postgresql/jdbc3/AbstractJdbc3ResultSet.java
deleted file mode 100644
index 3b63f8f..0000000
--- a/org/postgresql/jdbc3/AbstractJdbc3ResultSet.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-
-import java.sql.*;
-import java.util.List;
-import org.postgresql.core.*;
-
-
-/**
- * This class defines methods of the jdbc3 specification. This class extends
- * org.postgresql.jdbc2.AbstractJdbc2ResultSet which provides the jdbc2
- * methods. The real Statement class (for jdbc3) is org.postgresql.jdbc3.Jdbc3ResultSet
- */
-public abstract class AbstractJdbc3ResultSet extends org.postgresql.jdbc2.AbstractJdbc2ResultSet
-{
- public AbstractJdbc3ResultSet(Query originalQuery, BaseStatement statement, Field[] fields, List tuples,
- ResultCursor cursor, int maxRows, int maxFieldSize, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super (originalQuery, statement, fields, tuples, cursor, maxRows, maxFieldSize, rsType, rsConcurrency);
- }
-
- // Overrides JDBC2 version to support Types.BOOLEAN.
- protected Object internalGetObject(int columnIndex, Field field) throws SQLException
- {
- switch (getSQLType(columnIndex)) {
- case Types.BOOLEAN:
- return new Boolean(getBoolean(columnIndex));
- default:
- return super.internalGetObject(columnIndex, field);
- }
- }
-
- /**
- * Retrieves the value of the designated column in the current row
- * of this <code>ResultSet</code> object as a <code>java.net.URL</code>
- * object in the Java programming language.
- *
- * @param columnIndex the index of the column 1 is the first, 2 is the second,...
- * @return the column value as a <code>java.net.URL</code> object;
- * if the value is SQL <code>NULL</code>,
- * the value returned is <code>null</code> in the Java programming language
- * @exception SQLException if a database access error occurs,
- * or if a URL is malformed
- * @since 1.4
- */
- public java.net.URL getURL(int columnIndex) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getURL(int)");
- }
-
- /**
- * Retrieves the value of the designated column in the current row
- * of this <code>ResultSet</code> object as a <code>java.net.URL</code>
- * object in the Java programming language.
- *
- * @param columnName the SQL name of the column
- * @return the column value as a <code>java.net.URL</code> object;
- * if the value is SQL <code>NULL</code>,
- * the value returned is <code>null</code> in the Java programming language
- * @exception SQLException if a database access error occurs
- * or if a URL is malformed
- * @since 1.4
- */
- public java.net.URL getURL(String columnName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getURL(String)");
- }
-
- /**
- * Updates the designated column with a <code>java.sql.Ref</code> value.
- * The updater methods are used to update column values in the
- * current row or the insert row. The updater methods do not
- * update the underlying database; instead the <code>updateRow</code> or
- * <code>insertRow</code> methods are called to update the database.
- *
- * @param columnIndex the first column is 1, the second is 2, ...
- * @param x the new column value
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public void updateRef(int columnIndex, java.sql.Ref x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateRef(int,Ref)");
- }
-
- /**
- * Updates the designated column with a <code>java.sql.Ref</code> value.
- * The updater methods are used to update column values in the
- * current row or the insert row. The updater methods do not
- * update the underlying database; instead the <code>updateRow</code> or
- * <code>insertRow</code> methods are called to update the database.
- *
- * @param columnName the name of the column
- * @param x the new column value
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public void updateRef(String columnName, java.sql.Ref x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateRef(String,Ref)");
- }
-
- /**
- * Updates the designated column with a <code>java.sql.Blob</code> value.
- * The updater methods are used to update column values in the
- * current row or the insert row. The updater methods do not
- * update the underlying database; instead the <code>updateRow</code> or
- * <code>insertRow</code> methods are called to update the database.
- *
- * @param columnIndex the first column is 1, the second is 2, ...
- * @param x the new column value
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public void updateBlob(int columnIndex, java.sql.Blob x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateBlob(int,Blob)");
- }
-
- /**
- * Updates the designated column with a <code>java.sql.Blob</code> value.
- * The updater methods are used to update column values in the
- * current row or the insert row. The updater methods do not
- * update the underlying database; instead the <code>updateRow</code> or
- * <code>insertRow</code> methods are called to update the database.
- *
- * @param columnName the name of the column
- * @param x the new column value
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public void updateBlob(String columnName, java.sql.Blob x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateBlob(String,Blob)");
- }
-
- /**
- * Updates the designated column with a <code>java.sql.Clob</code> value.
- * The updater methods are used to update column values in the
- * current row or the insert row. The updater methods do not
- * update the underlying database; instead the <code>updateRow</code> or
- * <code>insertRow</code> methods are called to update the database.
- *
- * @param columnIndex the first column is 1, the second is 2, ...
- * @param x the new column value
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public void updateClob(int columnIndex, java.sql.Clob x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateClob(int,Clob)");
- }
-
- /**
- * Updates the designated column with a <code>java.sql.Clob</code> value.
- * The updater methods are used to update column values in the
- * current row or the insert row. The updater methods do not
- * update the underlying database; instead the <code>updateRow</code> or
- * <code>insertRow</code> methods are called to update the database.
- *
- * @param columnName the name of the column
- * @param x the new column value
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public void updateClob(String columnName, java.sql.Clob x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateClob(String,Clob)");
- }
-
- /**
- * Updates the designated column with a <code>java.sql.Array</code> value.
- * The updater methods are used to update column values in the
- * current row or the insert row. The updater methods do not
- * update the underlying database; instead the <code>updateRow</code> or
- * <code>insertRow</code> methods are called to update the database.
- *
- * @param columnIndex the first column is 1, the second is 2, ...
- * @param x the new column value
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public void updateArray(int columnIndex, java.sql.Array x) throws SQLException
- {
- updateObject(columnIndex, x);
- }
-
- /**
- * Updates the designated column with a <code>java.sql.Array</code> value.
- * The updater methods are used to update column values in the
- * current row or the insert row. The updater methods do not
- * update the underlying database; instead the <code>updateRow</code> or
- * <code>insertRow</code> methods are called to update the database.
- *
- * @param columnName the name of the column
- * @param x the new column value
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public void updateArray(String columnName, java.sql.Array x) throws SQLException
- {
- updateArray(findColumn(columnName), x);
- }
-
-}
-
diff --git a/org/postgresql/jdbc3/AbstractJdbc3Statement.java b/org/postgresql/jdbc3/AbstractJdbc3Statement.java
deleted file mode 100644
index a12e895..0000000
--- a/org/postgresql/jdbc3/AbstractJdbc3Statement.java
+++ /dev/null
@@ -1,1519 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-import java.math.BigDecimal;
-import java.sql.*;
-import java.util.ArrayList;
-import java.util.Calendar;
-
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-import org.postgresql.core.Utils;
-import org.postgresql.core.QueryExecutor;
-import org.postgresql.core.Field;
-import org.postgresql.core.BaseConnection;
-import org.postgresql.util.GT;
-
-/**
- * This class defines methods of the jdbc3 specification. This class extends
- * org.postgresql.jdbc2.AbstractJdbc2Statement which provides the jdbc2
- * methods. The real Statement class (for jdbc2) is org.postgresql.jdbc3.Jdbc3Statement
- */
-public abstract class AbstractJdbc3Statement extends org.postgresql.jdbc2.AbstractJdbc2Statement
-{
- private final int rsHoldability;
-
- public AbstractJdbc3Statement (AbstractJdbc3Connection c, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(c, rsType, rsConcurrency);
- this.rsHoldability = rsHoldability;
- }
-
- public AbstractJdbc3Statement(AbstractJdbc3Connection connection, String sql, boolean isCallable, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(connection, sql, isCallable, rsType, rsConcurrency);
- this.rsHoldability = rsHoldability;
- }
-
- /**
- * Moves to this <code>Statement</code> object's next result, deals with
- * any current <code>ResultSet</code> object(s) according to the instructions
- * specified by the given flag, and returns
- * <code>true</code> if the next result is a <code>ResultSet</code> object.
- *
- * <P>There are no more results when the following is true:
- * <PRE>
- * <code>(!getMoreResults() && (getUpdateCount() == -1)</code>
- * </PRE>
- *
- * @param current one of the following <code>Statement</code>
- * constants indicating what should happen to current
- * <code>ResultSet</code> objects obtained using the method
- * <code>getResultSet</code:
- * <code>CLOSE_CURRENT_RESULT</code>,
- * <code>KEEP_CURRENT_RESULT</code>, or
- * <code>CLOSE_ALL_RESULTS</code>
- * @return <code>true</code> if the next result is a <code>ResultSet</code>
- * object; <code>false</code> if it is an update count or there are no
- * more results
- * @exception SQLException if a database access error occurs
- * @since 1.4
- * @see #execute
- */
- public boolean getMoreResults(int current) throws SQLException
- {
- // CLOSE_CURRENT_RESULT
- if (current == Statement.CLOSE_CURRENT_RESULT && result != null && result.getResultSet() != null)
- result.getResultSet().close();
-
- // Advance resultset.
- if (result != null)
- result = result.getNext();
-
- // CLOSE_ALL_RESULTS
- if (current == Statement.CLOSE_ALL_RESULTS)
- {
- // Close preceding resultsets.
- while (firstUnclosedResult != result)
- {
- if (firstUnclosedResult.getResultSet() != null)
- firstUnclosedResult.getResultSet().close();
- firstUnclosedResult = firstUnclosedResult.getNext();
- }
- }
-
- // Done.
- return (result != null && result.getResultSet() != null);
- }
-
- /**
- * Retrieves any auto-generated keys created as a result of executing this
- * <code>Statement</code> object. If this <code>Statement</code> object did
- * not generate any keys, an empty <code>ResultSet</code>
- * object is returned.
- *
- * @return a <code>ResultSet</code> object containing the auto-generated key(s)
- * generated by the execution of this <code>Statement</code> object
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public ResultSet getGeneratedKeys() throws SQLException
- {
- checkClosed();
- if (generatedKeys == null || generatedKeys.getResultSet() == null)
- return createDriverResultSet(new Field[0], new ArrayList());
-
- return generatedKeys.getResultSet();
- }
-
- /**
- * Executes the given SQL statement and signals the driver with the
- * given flag about whether the
- * auto-generated keys produced by this <code>Statement</code> object
- * should be made available for retrieval.
- *
- * @param sql must be an SQL <code>INSERT</code>, <code>UPDATE</code> or
- * <code>DELETE</code> statement or an SQL statement that
- * returns nothing
- * @param autoGeneratedKeys a flag indicating whether auto-generated keys
- * should be made available for retrieval;
- * one of the following constants:
- * <code>Statement.RETURN_GENERATED_KEYS</code>
- * <code>Statement.NO_GENERATED_KEYS</code>
- * @return either the row count for <code>INSERT</code>, <code>UPDATE</code>
- * or <code>DELETE</code> statements, or <code>0</code> for SQL
- * statements that return nothing
- * @exception SQLException if a database access error occurs, the given
- * SQL statement returns a <code>ResultSet</code> object, or
- * the given constant is not one of those allowed
- * @since 1.4
- */
- public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
- {
- if (autoGeneratedKeys == Statement.NO_GENERATED_KEYS)
- return executeUpdate(sql);
-
- sql = addReturning(connection, sql, new String[]{"*"}, false);
- wantsGeneratedKeysOnce = true;
-
- return executeUpdate(sql);
- }
-
- static String addReturning(BaseConnection connection, String sql, String columns[], boolean escape) throws SQLException
- {
- if (!connection.haveMinimumServerVersion("8.2"))
- throw new PSQLException(GT.tr("Returning autogenerated keys is only supported for 8.2 and later servers."), PSQLState.NOT_IMPLEMENTED);
-
- sql = sql.trim();
- if (sql.endsWith(";"))
- sql = sql.substring(0, sql.length()-1);
-
- StringBuffer sb = new StringBuffer(sql);
- sb.append(" RETURNING ");
- for (int i=0; i<columns.length; i++) {
- if (i != 0)
- sb.append(", ");
- // If given user provided column names, quote and escape them.
- // This isn't likely to be popular as it enforces case sensitivity,
- // but it does match up with our handling of things like
- // DatabaseMetaData.getColumns and is necessary for the same
- // reasons.
- if (escape)
- Utils.appendEscapedIdentifier(sb, columns[i]);
- else
- sb.append(columns[i]);
- }
-
- return sb.toString();
- }
-
- /**
- * Executes the given SQL statement and signals the driver that the
- * auto-generated keys indicated in the given array should be made available
- * for retrieval. The driver will ignore the array if the SQL statement
- * is not an <code>INSERT</code> statement.
- *
- * @param sql an SQL <code>INSERT</code>, <code>UPDATE</code> or
- * <code>DELETE</code> statement or an SQL statement that returns nothing,
- * such as an SQL DDL statement
- * @param columnIndexes an array of column indexes indicating the columns
- * that should be returned from the inserted row
- * @return either the row count for <code>INSERT</code>, <code>UPDATE</code>,
- * or <code>DELETE</code> statements, or 0 for SQL statements
- * that return nothing
- * @exception SQLException if a database access error occurs or the SQL
- * statement returns a <code>ResultSet</code> object
- * @since 1.4
- */
- public int executeUpdate(String sql, int columnIndexes[]) throws SQLException
- {
- if (columnIndexes == null || columnIndexes.length == 0)
- return executeUpdate(sql);
-
- throw new PSQLException(GT.tr("Returning autogenerated keys by column index is not supported."), PSQLState.NOT_IMPLEMENTED);
- }
-
- /**
- * Executes the given SQL statement and signals the driver that the
- * auto-generated keys indicated in the given array should be made available
- * for retrieval. The driver will ignore the array if the SQL statement
- * is not an <code>INSERT</code> statement.
- *
- * @param sql an SQL <code>INSERT</code>, <code>UPDATE</code> or
- * <code>DELETE</code> statement or an SQL statement that returns nothing
- * @param columnNames an array of the names of the columns that should be
- * returned from the inserted row
- * @return either the row count for <code>INSERT</code>, <code>UPDATE</code>,
- * or <code>DELETE</code> statements, or 0 for SQL statements
- * that return nothing
- * @exception SQLException if a database access error occurs
- *
- * @since 1.4
- */
- public int executeUpdate(String sql, String columnNames[]) throws SQLException
- {
- if (columnNames == null || columnNames.length == 0)
- return executeUpdate(sql);
-
- sql = addReturning(connection, sql, columnNames, true);
- wantsGeneratedKeysOnce = true;
-
- return executeUpdate(sql);
- }
-
- /**
- * Executes the given SQL statement, which may return multiple results,
- * and signals the driver that any
- * auto-generated keys should be made available
- * for retrieval. The driver will ignore this signal if the SQL statement
- * is not an <code>INSERT</code> statement.
- * <P>
- * In some (uncommon) situations, a single SQL statement may return
- * multiple result sets and/or update counts. Normally you can ignore
- * this unless you are (1) executing a stored procedure that you know may
- * return multiple results or (2) you are dynamically executing an
- * unknown SQL string.
- * <P>
- * The <code>execute</code> method executes an SQL statement and indicates the
- * form of the first result. You must then use the methods
- * <code>getResultSet</code> or <code>getUpdateCount</code>
- * to retrieve the result, and <code>getMoreResults</code> to
- * move to any subsequent result(s).
- *
- * @param sql any SQL statement
- * @param autoGeneratedKeys a constant indicating whether auto-generated
- * keys should be made available for retrieval using the method
- * <code>getGeneratedKeys</code>; one of the following constants:
- * <code>Statement.RETURN_GENERATED_KEYS</code> or
- * <code>Statement.NO_GENERATED_KEYS</code>
- * @return <code>true</code> if the first result is a <code>ResultSet</code>
- * object; <code>false</code> if it is an update count or there are
- * no results
- * @exception SQLException if a database access error occurs
- * @see #getResultSet
- * @see #getUpdateCount
- * @see #getMoreResults
- * @see #getGeneratedKeys
- *
- * @since 1.4
- */
- public boolean execute(String sql, int autoGeneratedKeys) throws SQLException
- {
- if (autoGeneratedKeys == Statement.NO_GENERATED_KEYS)
- return execute(sql);
-
- sql = addReturning(connection, sql, new String[]{"*"}, false);
- wantsGeneratedKeysOnce = true;
-
- return execute(sql);
- }
-
- /**
- * Executes the given SQL statement, which may return multiple results,
- * and signals the driver that the
- * auto-generated keys indicated in the given array should be made available
- * for retrieval. This array contains the indexes of the columns in the
- * target table that contain the auto-generated keys that should be made
- * available. The driver will ignore the array if the given SQL statement
- * is not an <code>INSERT</code> statement.
- * <P>
- * Under some (uncommon) situations, a single SQL statement may return
- * multiple result sets and/or update counts. Normally you can ignore
- * this unless you are (1) executing a stored procedure that you know may
- * return multiple results or (2) you are dynamically executing an
- * unknown SQL string.
- * <P>
- * The <code>execute</code> method executes an SQL statement and indicates the
- * form of the first result. You must then use the methods
- * <code>getResultSet</code> or <code>getUpdateCount</code>
- * to retrieve the result, and <code>getMoreResults</code> to
- * move to any subsequent result(s).
- *
- * @param sql any SQL statement
- * @param columnIndexes an array of the indexes of the columns in the
- * inserted row that should be made available for retrieval by a
- * call to the method <code>getGeneratedKeys</code>
- * @return <code>true</code> if the first result is a <code>ResultSet</code>
- * object; <code>false</code> if it is an update count or there
- * are no results
- * @exception SQLException if a database access error occurs
- * @see #getResultSet
- * @see #getUpdateCount
- * @see #getMoreResults
- *
- * @since 1.4
- */
- public boolean execute(String sql, int columnIndexes[]) throws SQLException
- {
- if (columnIndexes == null || columnIndexes.length == 0)
- return execute(sql);
-
- throw new PSQLException(GT.tr("Returning autogenerated keys by column index is not supported."), PSQLState.NOT_IMPLEMENTED);
- }
-
- /**
- * Executes the given SQL statement, which may return multiple results,
- * and signals the driver that the
- * auto-generated keys indicated in the given array should be made available
- * for retrieval. This array contains the names of the columns in the
- * target table that contain the auto-generated keys that should be made
- * available. The driver will ignore the array if the given SQL statement
- * is not an <code>INSERT</code> statement.
- * <P>
- * In some (uncommon) situations, a single SQL statement may return
- * multiple result sets and/or update counts. Normally you can ignore
- * this unless you are (1) executing a stored procedure that you know may
- * return multiple results or (2) you are dynamically executing an
- * unknown SQL string.
- * <P>
- * The <code>execute</code> method executes an SQL statement and indicates the
- * form of the first result. You must then use the methods
- * <code>getResultSet</code> or <code>getUpdateCount</code>
- * to retrieve the result, and <code>getMoreResults</code> to
- * move to any subsequent result(s).
- *
- * @param sql any SQL statement
- * @param columnNames an array of the names of the columns in the inserted
- * row that should be made available for retrieval by a call to the
- * method <code>getGeneratedKeys</code>
- * @return <code>true</code> if the next result is a <code>ResultSet</code>
- * object; <code>false</code> if it is an update count or there
- * are no more results
- * @exception SQLException if a database access error occurs
- * @see #getResultSet
- * @see #getUpdateCount
- * @see #getMoreResults
- * @see #getGeneratedKeys
- *
- * @since 1.4
- */
- public boolean execute(String sql, String columnNames[]) throws SQLException
- {
- if (columnNames == null || columnNames.length == 0)
- return execute(sql);
-
- sql = addReturning(connection, sql, columnNames, true);
- wantsGeneratedKeysOnce = true;
-
- return execute(sql);
- }
-
- /**
- * Retrieves the result set holdability for <code>ResultSet</code> objects
- * generated by this <code>Statement</code> object.
- *
- * @return either <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
- * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
- * @exception SQLException if a database access error occurs
- *
- * @since 1.4
- */
- public int getResultSetHoldability() throws SQLException
- {
- return rsHoldability;
- }
-
- /**
- * Sets the designated parameter to the given <code>java.net.URL</code> value.
- * The driver converts this to an SQL <code>DATALINK</code> value
- * when it sends it to the database.
- *
- * @param parameterIndex the first parameter is 1, the second is 2, ...
- * @param x the <code>java.net.URL</code> object to be set
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public void setURL(int parameterIndex, java.net.URL x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setURL(int,URL)");
- }
-
- /**
- * Retrieves the number, types and properties of this
- * <code>PreparedStatement</code> object's parameters.
- *
- * @return a <code>ParameterMetaData</code> object that contains information
- * about the number, types and properties of this
- * <code>PreparedStatement</code> object's parameters
- * @exception SQLException if a database access error occurs
- * @see ParameterMetaData
- * @since 1.4
- */
- public ParameterMetaData getParameterMetaData() throws SQLException
- {
- int flags = QueryExecutor.QUERY_ONESHOT | QueryExecutor.QUERY_DESCRIBE_ONLY | QueryExecutor.QUERY_SUPPRESS_BEGIN;
- StatementResultHandler handler = new StatementResultHandler();
- connection.getQueryExecutor().execute(preparedQuery, preparedParameters, handler, 0, 0, flags);
-
- int oids[] = preparedParameters.getTypeOIDs();
- if (oids != null)
- return createParameterMetaData(connection, oids);
-
- return null;
-
- }
-
- public abstract ParameterMetaData createParameterMetaData(BaseConnection conn, int oids[]) throws SQLException;
-
- /**
- * Registers the OUT parameter named
- * <code>parameterName</code> to the JDBC type
- * <code>sqlType</code>. All OUT parameters must be registered
- * before a stored procedure is executed.
- * <p>
- * The JDBC type specified by <code>sqlType</code> for an OUT
- * parameter determines the Java type that must be used
- * in the <code>get</code> method to read the value of that parameter.
- * <p>
- * If the JDBC type expected to be returned to this output parameter
- * is specific to this particular database, <code>sqlType</code>
- * should be <code>java.sql.Types.OTHER</code>. The method
- * {@link #getObject} retrieves the value.
- * @param parameterName the name of the parameter
- * @param sqlType the JDBC type code defined by <code>java.sql.Types</code>.
- * If the parameter is of JDBC type <code>NUMERIC</code>
- * or <code>DECIMAL</code>, the version of
- * <code>registerOutParameter</code> that accepts a scale value
- * should be used.
- * @exception SQLException if a database access error occurs
- * @since 1.4
- * @see Types
- */
- public void registerOutParameter(String parameterName, int sqlType)
- throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "registerOutParameter(String,int)");
- }
-
- /**
- * Registers the parameter named
- * <code>parameterName</code> to be of JDBC type
- * <code>sqlType</code>. This method must be called
- * before a stored procedure is executed.
- * <p>
- * The JDBC type specified by <code>sqlType</code> for an OUT
- * parameter determines the Java type that must be used
- * in the <code>get</code> method to read the value of that parameter.
- * <p>
- * This version of <code>registerOutParameter</code> should be
- * used when the parameter is of JDBC type <code>NUMERIC</code>
- * or <code>DECIMAL</code>.
- * @param parameterName the name of the parameter
- * @param sqlType SQL type code defined by <code>java.sql.Types</code>.
- * @param scale the desired number of digits to the right of the
- * decimal point. It must be greater than or equal to zero.
- * @exception SQLException if a database access error occurs
- * @since 1.4
- * @see Types
- */
- public void registerOutParameter(String parameterName, int sqlType, int scale)
- throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "registerOutParameter(String,int,int)");
- }
-
- /**
- * Registers the designated output parameter. This version of
- * the method <code>registerOutParameter</code>
- * should be used for a user-named or REF output parameter. Examples
- * of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and
- * named array types.
- *
- * Before executing a stored procedure call, you must explicitly
- * call <code>registerOutParameter</code> to register the type from
- * <code>java.sql.Types</code> for each
- * OUT parameter. For a user-named parameter the fully-qualified SQL
- * type name of the parameter should also be given, while a REF
- * parameter requires that the fully-qualified type name of the
- * referenced type be given. A JDBC driver that does not need the
- * type code and type name information may ignore it. To be portable,
- * however, applications should always provide these values for
- * user-named and REF parameters.
- *
- * Although it is intended for user-named and REF parameters,
- * this method may be used to register a parameter of any JDBC type.
- * If the parameter does not have a user-named or REF type, the
- * typeName parameter is ignored.
- *
- * <P><B>Note:</B> When reading the value of an out parameter, you
- * must use the <code>getXXX</code> method whose Java type XXX corresponds to the
- * parameter's registered SQL type.
- *
- * @param parameterName the name of the parameter
- * @param sqlType a value from {@link java.sql.Types}
- * @param typeName the fully-qualified name of an SQL structured type
- * @exception SQLException if a database access error occurs
- * @see Types
- * @since 1.4
- */
- public void registerOutParameter (String parameterName, int sqlType, String typeName)
- throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "registerOutParameter(String,int,String)");
- }
-
- /**
- * Retrieves the value of the designated JDBC <code>DATALINK</code> parameter as a
- * <code>java.net.URL</code> object.
- *
- * @param parameterIndex the first parameter is 1, the second is 2,...
- * @return a <code>java.net.URL</code> object that represents the
- * JDBC <code>DATALINK</code> value used as the designated
- * parameter
- * @exception SQLException if a database access error occurs,
- * or if the URL being returned is
- * not a valid URL on the Java platform
- * @see #setURL
- * @since 1.4
- */
- public java.net.URL getURL(int parameterIndex) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getURL(String)");
- }
-
- /**
- * Sets the designated parameter to the given <code>java.net.URL</code> object.
- * The driver converts this to an SQL <code>DATALINK</code> value when
- * it sends it to the database.
- *
- * @param parameterName the name of the parameter
- * @param val the parameter value
- * @exception SQLException if a database access error occurs,
- * or if a URL is malformed
- * @see #getURL
- * @since 1.4
- */
- public void setURL(String parameterName, java.net.URL val) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setURL(String,URL)");
- }
-
- /**
- * Sets the designated parameter to SQL <code>NULL</code>.
- *
- * <P><B>Note:</B> You must specify the parameter's SQL type.
- *
- * @param parameterName the name of the parameter
- * @param sqlType the SQL type code defined in <code>java.sql.Types</code>
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public void setNull(String parameterName, int sqlType) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setNull(String,int)");
- }
-
- /**
- * Sets the designated parameter to the given Java <code>boolean</code> value.
- * The driver converts this
- * to an SQL <code>BIT</code> value when it sends it to the database.
- *
- * @param parameterName the name of the parameter
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- * @see #getBoolean
- * @since 1.4
- */
- public void setBoolean(String parameterName, boolean x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setBoolean(String,boolean)");
- }
-
- /**
- * Sets the designated parameter to the given Java <code>byte</code> value.
- * The driver converts this
- * to an SQL <code>TINYINT</code> value when it sends it to the database.
- *
- * @param parameterName the name of the parameter
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- * @see #getByte
- * @since 1.4
- */
- public void setByte(String parameterName, byte x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setByte(String,byte)");
- }
-
- /**
- * Sets the designated parameter to the given Java <code>short</code> value.
- * The driver converts this
- * to an SQL <code>SMALLINT</code> value when it sends it to the database.
- *
- * @param parameterName the name of the parameter
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- * @see #getShort
- * @since 1.4
- */
- public void setShort(String parameterName, short x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setShort(String,short)");
- }
-
- /**
- * Sets the designated parameter to the given Java <code>int</code> value.
- * The driver converts this
- * to an SQL <code>INTEGER</code> value when it sends it to the database.
- *
- * @param parameterName the name of the parameter
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- * @see #getInt
- * @since 1.4
- */
- public void setInt(String parameterName, int x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setInt(String,int)");
- }
-
- /**
- * Sets the designated parameter to the given Java <code>long</code> value.
- * The driver converts this
- * to an SQL <code>BIGINT</code> value when it sends it to the database.
- *
- * @param parameterName the name of the parameter
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- * @see #getLong
- * @since 1.4
- */
- public void setLong(String parameterName, long x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setLong(String,long)");
- }
-
- /**
- * Sets the designated parameter to the given Java <code>float</code> value.
- * The driver converts this
- * to an SQL <code>FLOAT</code> value when it sends it to the database.
- *
- * @param parameterName the name of the parameter
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- * @see #getFloat
- * @since 1.4
- */
- public void setFloat(String parameterName, float x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setFloat(String,float)");
- }
-
- /**
- * Sets the designated parameter to the given Java <code>double</code> value.
- * The driver converts this
- * to an SQL <code>DOUBLE</code> value when it sends it to the database.
- *
- * @param parameterName the name of the parameter
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- * @see #getDouble
- * @since 1.4
- */
- public void setDouble(String parameterName, double x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setDouble(String,double)");
- }
-
- /**
- * Sets the designated parameter to the given
- * <code>java.math.BigDecimal</code> value.
- * The driver converts this to an SQL <code>NUMERIC</code> value when
- * it sends it to the database.
- *
- * @param parameterName the name of the parameter
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- * @see #getBigDecimal
- * @since 1.4
- */
- public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setBigDecimal(String,BigDecimal)");
- }
-
- /**
- * Sets the designated parameter to the given Java <code>String</code> value.
- * The driver converts this
- * to an SQL <code>VARCHAR</code> or <code>LONGVARCHAR</code> value
- * (depending on the argument's
- * size relative to the driver's limits on <code>VARCHAR</code> values)
- * when it sends it to the database.
- *
- * @param parameterName the name of the parameter
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- * @see #getString
- * @since 1.4
- */
- public void setString(String parameterName, String x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setString(String,String)");
- }
-
- /**
- * Sets the designated parameter to the given Java array of bytes.
- * The driver converts this to an SQL <code>VARBINARY</code> or
- * <code>LONGVARBINARY</code> (depending on the argument's size relative
- * to the driver's limits on <code>VARBINARY</code> values) when it sends
- * it to the database.
- *
- * @param parameterName the name of the parameter
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- * @see #getBytes
- * @since 1.4
- */
- public void setBytes(String parameterName, byte x[]) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setBytes(String,byte)");
- }
-
- /**
- * Sets the designated parameter to the given <code>java.sql.Date</code> value.
- * The driver converts this
- * to an SQL <code>DATE</code> value when it sends it to the database.
- *
- * @param parameterName the name of the parameter
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- * @see #getDate
- * @since 1.4
- */
- public void setDate(String parameterName, java.sql.Date x)
- throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setDate(String,Date)");
- }
-
- /**
- * Sets the designated parameter to the given <code>java.sql.Time</code> value.
- * The driver converts this
- * to an SQL <code>TIME</code> value when it sends it to the database.
- *
- * @param parameterName the name of the parameter
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- * @see #getTime
- * @since 1.4
- */
- public void setTime(String parameterName, java.sql.Time x)
- throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setTime(String,Time)");
- }
-
- /**
- * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value.
- * The driver
- * converts this to an SQL <code>TIMESTAMP</code> value when it sends it to the
- * database.
- *
- * @param parameterName the name of the parameter
- * @param x the parameter value
- * @exception SQLException if a database access error occurs
- * @see #getTimestamp
- * @since 1.4
- */
- public void setTimestamp(String parameterName, java.sql.Timestamp x)
- throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setTimestamp(String,Timestamp)");
- }
-
- /**
- * Sets the designated parameter to the given input stream, which will have
- * the specified number of bytes.
- * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
- * parameter, it may be more practical to send it via a
- * <code>java.io.InputStream</code>. Data will be read from the stream
- * as needed until end-of-file is reached. The JDBC driver will
- * do any necessary conversion from ASCII to the database char format.
- *
- * <P><B>Note:</B> This stream object can either be a standard
- * Java stream object or your own subclass that implements the
- * standard interface.
- *
- * @param parameterName the name of the parameter
- * @param x the Java input stream that contains the ASCII parameter value
- * @param length the number of bytes in the stream
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public void setAsciiStream(String parameterName, java.io.InputStream x, int length)
- throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setAsciiStream(String,InputStream,int)");
- }
-
- /**
- * Sets the designated parameter to the given input stream, which will have
- * the specified number of bytes.
- * When a very large binary value is input to a <code>LONGVARBINARY</code>
- * parameter, it may be more practical to send it via a
- * <code>java.io.InputStream</code> object. The data will be read from the stream
- * as needed until end-of-file is reached.
- *
- * <P><B>Note:</B> This stream object can either be a standard
- * Java stream object or your own subclass that implements the
- * standard interface.
- *
- * @param parameterName the name of the parameter
- * @param x the java input stream which contains the binary parameter value
- * @param length the number of bytes in the stream
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public void setBinaryStream(String parameterName, java.io.InputStream x,
- int length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setBinaryStream(String,InputStream,int)");
- }
-
- /**
- * Sets the value of the designated parameter with the given object. The second
- * argument must be an object type; for integral values, the
- * <code>java.lang</code> equivalent objects should be used.
- *
- * <p>The given Java object will be converted to the given targetSqlType
- * before being sent to the database.
- *
- * If the object has a custom mapping (is of a class implementing the
- * interface <code>SQLData</code>),
- * the JDBC driver should call the method <code>SQLData.writeSQL</code> to write it
- * to the SQL data stream.
- * If, on the other hand, the object is of a class implementing
- * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>Struct</code>,
- * or <code>Array</code>, the driver should pass it to the database as a
- * value of the corresponding SQL type.
- * <P>
- * Note that this method may be used to pass datatabase-
- * specific abstract data types.
- *
- * @param parameterName the name of the parameter
- * @param x the object containing the input parameter value
- * @param targetSqlType the SQL type (as defined in java.sql.Types) to be
- * sent to the database. The scale argument may further qualify this type.
- * @param scale for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types,
- * this is the number of digits after the decimal point. For all other
- * types, this value will be ignored.
- * @exception SQLException if a database access error occurs
- * @see Types
- * @see #getObject
- * @since 1.4
- */
- public void setObject(String parameterName, Object x, int targetSqlType, int scale)
- throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setObject(String,Object,int,int)");
- }
-
- /**
- * Sets the value of the designated parameter with the given object.
- * This method is like the method <code>setObject</code>
- * above, except that it assumes a scale of zero.
- *
- * @param parameterName the name of the parameter
- * @param x the object containing the input parameter value
- * @param targetSqlType the SQL type (as defined in java.sql.Types) to be
- * sent to the database
- * @exception SQLException if a database access error occurs
- * @see #getObject
- * @since 1.4
- */
- public void setObject(String parameterName, Object x, int targetSqlType)
- throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setObject(String,Object,int)");
- }
-
- /**
- * Sets the value of the designated parameter with the given object.
- * The second parameter must be of type <code>Object</code>; therefore, the
- * <code>java.lang</code> equivalent objects should be used for built-in types.
- *
- * <p>The JDBC specification specifies a standard mapping from
- * Java <code>Object</code> types to SQL types. The given argument
- * will be converted to the corresponding SQL type before being
- * sent to the database.
- *
- * <p>Note that this method may be used to pass datatabase-
- * specific abstract data types, by using a driver-specific Java
- * type.
- *
- * If the object is of a class implementing the interface <code>SQLData</code>,
- * the JDBC driver should call the method <code>SQLData.writeSQL</code>
- * to write it to the SQL data stream.
- * If, on the other hand, the object is of a class implementing
- * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>Struct</code>,
- * or <code>Array</code>, the driver should pass it to the database as a
- * value of the corresponding SQL type.
- * <P>
- * This method throws an exception if there is an ambiguity, for example, if the
- * object is of a class implementing more than one of the interfaces named above.
- *
- * @param parameterName the name of the parameter
- * @param x the object containing the input parameter value
- * @exception SQLException if a database access error occurs or if the given
- * <code>Object</code> parameter is ambiguous
- * @see #getObject
- * @since 1.4
- */
- public void setObject(String parameterName, Object x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setObject(String,Object)");
- }
-
-
- /**
- * Sets the designated parameter to the given <code>Reader</code>
- * object, which is the given number of characters long.
- * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
- * parameter, it may be more practical to send it via a
- * <code>java.io.Reader</code> object. The data will be read from the stream
- * as needed until end-of-file is reached. The JDBC driver will
- * do any necessary conversion from UNICODE to the database char format.
- *
- * <P><B>Note:</B> This stream object can either be a standard
- * Java stream object or your own subclass that implements the
- * standard interface.
- *
- * @param parameterName the name of the parameter
- * @param reader the <code>java.io.Reader</code> object that
- * contains the UNICODE data used as the designated parameter
- * @param length the number of characters in the stream
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public void setCharacterStream(String parameterName,
- java.io.Reader reader,
- int length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setCharacterStream(String,Reader,int)");
- }
-
- /**
- * Sets the designated parameter to the given <code>java.sql.Date</code> value,
- * using the given <code>Calendar</code> object. The driver uses
- * the <code>Calendar</code> object to construct an SQL <code>DATE</code> value,
- * which the driver then sends to the database. With a
- * a <code>Calendar</code> object, the driver can calculate the date
- * taking into account a custom timezone. If no
- * <code>Calendar</code> object is specified, the driver uses the default
- * timezone, which is that of the virtual machine running the application.
- *
- * @param parameterName the name of the parameter
- * @param x the parameter value
- * @param cal the <code>Calendar</code> object the driver will use
- * to construct the date
- * @exception SQLException if a database access error occurs
- * @see #getDate
- * @since 1.4
- */
- public void setDate(String parameterName, java.sql.Date x, Calendar cal)
- throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setDate(String,Date,Calendar)");
- }
-
- /**
- * Sets the designated parameter to the given <code>java.sql.Time</code> value,
- * using the given <code>Calendar</code> object. The driver uses
- * the <code>Calendar</code> object to construct an SQL <code>TIME</code> value,
- * which the driver then sends to the database. With a
- * a <code>Calendar</code> object, the driver can calculate the time
- * taking into account a custom timezone. If no
- * <code>Calendar</code> object is specified, the driver uses the default
- * timezone, which is that of the virtual machine running the application.
- *
- * @param parameterName the name of the parameter
- * @param x the parameter value
- * @param cal the <code>Calendar</code> object the driver will use
- * to construct the time
- * @exception SQLException if a database access error occurs
- * @see #getTime
- * @since 1.4
- */
- public void setTime(String parameterName, java.sql.Time x, Calendar cal)
- throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setTime(String,Time,Calendar)");
- }
-
- /**
- * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value,
- * using the given <code>Calendar</code> object. The driver uses
- * the <code>Calendar</code> object to construct an SQL <code>TIMESTAMP</code> value,
- * which the driver then sends to the database. With a
- * a <code>Calendar</code> object, the driver can calculate the timestamp
- * taking into account a custom timezone. If no
- * <code>Calendar</code> object is specified, the driver uses the default
- * timezone, which is that of the virtual machine running the application.
- *
- * @param parameterName the name of the parameter
- * @param x the parameter value
- * @param cal the <code>Calendar</code> object the driver will use
- * to construct the timestamp
- * @exception SQLException if a database access error occurs
- * @see #getTimestamp
- * @since 1.4
- */
- public void setTimestamp(String parameterName, java.sql.Timestamp x, Calendar cal)
- throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setTimestamp(String,Timestamp,Calendar)");
- }
-
- /**
- * Sets the designated parameter to SQL <code>NULL</code>.
- * This version of the method <code>setNull</code> should
- * be used for user-defined types and REF type parameters. Examples
- * of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and
- * named array types.
- *
- * <P><B>Note:</B> To be portable, applications must give the
- * SQL type code and the fully-qualified SQL type name when specifying
- * a NULL user-defined or REF parameter. In the case of a user-defined type
- * the name is the type name of the parameter itself. For a REF
- * parameter, the name is the type name of the referenced type. If
- * a JDBC driver does not need the type code or type name information,
- * it may ignore it.
- *
- * Although it is intended for user-defined and Ref parameters,
- * this method may be used to set a null parameter of any JDBC type.
- * If the parameter does not have a user-defined or REF type, the given
- * typeName is ignored.
- *
- *
- * @param parameterName the name of the parameter
- * @param sqlType a value from <code>java.sql.Types</code>
- * @param typeName the fully-qualified name of an SQL user-defined type;
- * ignored if the parameter is not a user-defined type or
- * SQL <code>REF</code> value
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public void setNull (String parameterName, int sqlType, String typeName)
- throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setNull(String,int,String)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>CHAR</code>, <code>VARCHAR</code>,
- * or <code>LONGVARCHAR</code> parameter as a <code>String</code> in
- * the Java programming language.
- * <p>
- * For the fixed-length type JDBC <code>CHAR</code>,
- * the <code>String</code> object
- * returned has exactly the same value the JDBC
- * <code>CHAR</code> value had in the
- * database, including any padding added by the database.
- * @param parameterName the name of the parameter
- * @return the parameter value. If the value is SQL <code>NULL</code>, the result
- * is <code>null</code>.
- * @exception SQLException if a database access error occurs
- * @see #setString
- * @since 1.4
- */
- public String getString(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getString(String)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>BIT</code> parameter as a
- * <code>boolean</code> in the Java programming language.
- * @param parameterName the name of the parameter
- * @return the parameter value. If the value is SQL <code>NULL</code>, the result
- * is <code>false</code>.
- * @exception SQLException if a database access error occurs
- * @see #setBoolean
- * @since 1.4
- */
- public boolean getBoolean(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getBoolean(String)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>TINYINT</code> parameter as a <code>byte</code>
- * in the Java programming language.
- * @param parameterName the name of the parameter
- * @return the parameter value. If the value is SQL <code>NULL</code>, the result
- * is <code>0</code>.
- * @exception SQLException if a database access error occurs
- * @see #setByte
- * @since 1.4
- */
- public byte getByte(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getByte(String)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>SMALLINT</code> parameter as a <code>short</code>
- * in the Java programming language.
- * @param parameterName the name of the parameter
- * @return the parameter value. If the value is SQL <code>NULL</code>, the result
- * is <code>0</code>.
- * @exception SQLException if a database access error occurs
- * @see #setShort
- * @since 1.4
- */
- public short getShort(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getShort(String)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>INTEGER</code> parameter as an <code>int</code>
- * in the Java programming language.
- *
- * @param parameterName the name of the parameter
- * @return the parameter value. If the value is SQL <code>NULL</code>,
- * the result is <code>0</code>.
- * @exception SQLException if a database access error occurs
- * @see #setInt
- * @since 1.4
- */
- public int getInt(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getInt(String)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>BIGINT</code> parameter as a <code>long</code>
- * in the Java programming language.
- *
- * @param parameterName the name of the parameter
- * @return the parameter value. If the value is SQL <code>NULL</code>,
- * the result is <code>0</code>.
- * @exception SQLException if a database access error occurs
- * @see #setLong
- * @since 1.4
- */
- public long getLong(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getLong(String)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>FLOAT</code> parameter as a <code>float</code>
- * in the Java programming language.
- * @param parameterName the name of the parameter
- * @return the parameter value. If the value is SQL <code>NULL</code>,
- * the result is <code>0</code>.
- * @exception SQLException if a database access error occurs
- * @see #setFloat
- * @since 1.4
- */
- public float getFloat(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getFloat(String)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>DOUBLE</code> parameter as a <code>double</code>
- * in the Java programming language.
- * @param parameterName the name of the parameter
- * @return the parameter value. If the value is SQL <code>NULL</code>,
- * the result is <code>0</code>.
- * @exception SQLException if a database access error occurs
- * @see #setDouble
- * @since 1.4
- */
- public double getDouble(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getDouble(String)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>BINARY</code> or <code>VARBINARY</code>
- * parameter as an array of <code>byte</code> values in the Java
- * programming language.
- * @param parameterName the name of the parameter
- * @return the parameter value. If the value is SQL <code>NULL</code>, the result is
- * <code>null</code>.
- * @exception SQLException if a database access error occurs
- * @see #setBytes
- * @since 1.4
- */
- public byte[] getBytes(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getBytes(String)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>DATE</code> parameter as a
- * <code>java.sql.Date</code> object.
- * @param parameterName the name of the parameter
- * @return the parameter value. If the value is SQL <code>NULL</code>, the result
- * is <code>null</code>.
- * @exception SQLException if a database access error occurs
- * @see #setDate
- * @since 1.4
- */
- public java.sql.Date getDate(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getDate(String)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>TIME</code> parameter as a
- * <code>java.sql.Time</code> object.
- * @param parameterName the name of the parameter
- * @return the parameter value. If the value is SQL <code>NULL</code>, the result
- * is <code>null</code>.
- * @exception SQLException if a database access error occurs
- * @see #setTime
- * @since 1.4
- */
- public java.sql.Time getTime(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getTime(String)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>TIMESTAMP</code> parameter as a
- * <code>java.sql.Timestamp</code> object.
- * @param parameterName the name of the parameter
- * @return the parameter value. If the value is SQL <code>NULL</code>, the result
- * is <code>null</code>.
- * @exception SQLException if a database access error occurs
- * @see #setTimestamp
- * @since 1.4
- */
- public java.sql.Timestamp getTimestamp(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getTimestamp(String)");
- }
-
- /**
- * Retrieves the value of a parameter as an <code>Object</code> in the Java
- * programming language. If the value is an SQL <code>NULL</code>, the
- * driver returns a Java <code>null</code>.
- * <p>
- * This method returns a Java object whose type corresponds to the JDBC
- * type that was registered for this parameter using the method
- * <code>registerOutParameter</code>. By registering the target JDBC
- * type as <code>java.sql.Types.OTHER</code>, this method can be used
- * to read database-specific abstract data types.
- * @param parameterName the name of the parameter
- * @return A <code>java.lang.Object</code> holding the OUT parameter value.
- * @exception SQLException if a database access error occurs
- * @see Types
- * @see #setObject
- * @since 1.4
- */
- public Object getObject(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getObject(String)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>NUMERIC</code> parameter as a
- * <code>java.math.BigDecimal</code> object with as many digits to the
- * right of the decimal point as the value contains.
- * @param parameterName the name of the parameter
- * @return the parameter value in full precision. If the value is
- * SQL <code>NULL</code>, the result is <code>null</code>.
- * @exception SQLException if a database access error occurs
- * @see #setBigDecimal
- * @since 1.4
- */
- public BigDecimal getBigDecimal(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getBigDecimal(String)");
- }
-
- /**
- * Returns an object representing the value of OUT parameter
- * <code>i</code> and uses <code>map</code> for the custom
- * mapping of the parameter value.
- * <p>
- * This method returns a Java object whose type corresponds to the
- * JDBC type that was registered for this parameter using the method
- * <code>registerOutParameter</code>. By registering the target
- * JDBC type as <code>java.sql.Types.OTHER</code>, this method can
- * be used to read database-specific abstract data types.
- * @param parameterName the name of the parameter
- * @param map the mapping from SQL type names to Java classes
- * @return a <code>java.lang.Object</code> holding the OUT parameter value
- * @exception SQLException if a database access error occurs
- * @see #setObject
- * @since 1.4
- */
- public Object getObjectImpl (String parameterName, java.util.Map map) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getObject(String,Map)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>REF(<structured-type>)</code>
- * parameter as a {@link Ref} object in the Java programming language.
- *
- * @param parameterName the name of the parameter
- * @return the parameter value as a <code>Ref</code> object in the
- * Java programming language. If the value was SQL <code>NULL</code>,
- * the value <code>null</code> is returned.
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public Ref getRef (String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getRef(String)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>BLOB</code> parameter as a
- * {@link Blob} object in the Java programming language.
- *
- * @param parameterName the name of the parameter
- * @return the parameter value as a <code>Blob</code> object in the
- * Java programming language. If the value was SQL <code>NULL</code>,
- * the value <code>null</code> is returned.
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public Blob getBlob (String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getBlob(String)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>CLOB</code> parameter as a
- * <code>Clob</code> object in the Java programming language.
- * @param parameterName the name of the parameter
- * @return the parameter value as a <code>Clob</code> object in the
- * Java programming language. If the value was SQL <code>NULL</code>,
- * the value <code>null</code> is returned.
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public Clob getClob (String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getClob(String)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>ARRAY</code> parameter as an
- * {@link Array} object in the Java programming language.
- *
- * @param parameterName the name of the parameter
- * @return the parameter value as an <code>Array</code> object in
- * Java programming language. If the value was SQL <code>NULL</code>,
- * the value <code>null</code> is returned.
- * @exception SQLException if a database access error occurs
- * @since 1.4
- */
- public Array getArray (String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getArray(String)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>DATE</code> parameter as a
- * <code>java.sql.Date</code> object, using
- * the given <code>Calendar</code> object
- * to construct the date.
- * With a <code>Calendar</code> object, the driver
- * can calculate the date taking into account a custom timezone and locale.
- * If no <code>Calendar</code> object is specified, the driver uses the
- * default timezone and locale.
- *
- * @param parameterName the name of the parameter
- * @param cal the <code>Calendar</code> object the driver will use
- * to construct the date
- * @return the parameter value. If the value is SQL <code>NULL</code>,
- * the result is <code>null</code>.
- * @exception SQLException if a database access error occurs
- * @see #setDate
- * @since 1.4
- */
- public java.sql.Date getDate(String parameterName, Calendar cal)
- throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getDate(String,Calendar)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>TIME</code> parameter as a
- * <code>java.sql.Time</code> object, using
- * the given <code>Calendar</code> object
- * to construct the time.
- * With a <code>Calendar</code> object, the driver
- * can calculate the time taking into account a custom timezone and locale.
- * If no <code>Calendar</code> object is specified, the driver uses the
- * default timezone and locale.
- *
- * @param parameterName the name of the parameter
- * @param cal the <code>Calendar</code> object the driver will use
- * to construct the time
- * @return the parameter value; if the value is SQL <code>NULL</code>, the result is
- * <code>null</code>.
- * @exception SQLException if a database access error occurs
- * @see #setTime
- * @since 1.4
- */
- public java.sql.Time getTime(String parameterName, Calendar cal)
- throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getTime(String,Calendar)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>TIMESTAMP</code> parameter as a
- * <code>java.sql.Timestamp</code> object, using
- * the given <code>Calendar</code> object to construct
- * the <code>Timestamp</code> object.
- * With a <code>Calendar</code> object, the driver
- * can calculate the timestamp taking into account a custom timezone and locale.
- * If no <code>Calendar</code> object is specified, the driver uses the
- * default timezone and locale.
- *
- *
- * @param parameterName the name of the parameter
- * @param cal the <code>Calendar</code> object the driver will use
- * to construct the timestamp
- * @return the parameter value. If the value is SQL <code>NULL</code>, the result is
- * <code>null</code>.
- * @exception SQLException if a database access error occurs
- * @see #setTimestamp
- * @since 1.4
- */
- public java.sql.Timestamp getTimestamp(String parameterName, Calendar cal)
- throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getTimestamp(String,Calendar)");
- }
-
- /**
- * Retrieves the value of a JDBC <code>DATALINK</code> parameter as a
- * <code>java.net.URL</code> object.
- *
- * @param parameterName the name of the parameter
- * @return the parameter value as a <code>java.net.URL</code> object in the
- * Java programming language. If the value was SQL <code>NULL</code>, the
- * value <code>null</code> is returned.
- * @exception SQLException if a database access error occurs,
- * or if there is a problem with the URL
- * @see #setURL
- * @since 1.4
- */
- public java.net.URL getURL(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getURL(String)");
- }
-
- public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException
- {
- if (targetSqlType == Types.BOOLEAN)
- {
- targetSqlType = Types.BIT;
- }
- super.setObject(parameterIndex, x, targetSqlType, scale);
- }
-
- public void setNull(int parameterIndex, int sqlType) throws SQLException
- {
- if (sqlType == Types.BOOLEAN)
- {
- sqlType = Types.BIT;
- }
- super.setNull(parameterIndex, sqlType);
- }
-
-
-
- protected boolean wantsHoldableResultSet() {
- return rsHoldability == ResultSet.HOLD_CURSORS_OVER_COMMIT;
- }
-
- public void registerOutParameter( int parameterIndex, int sqlType ) throws SQLException
- {
- // if this isn't 8.1 or we are using protocol version 2 then we don't
- // register the parameter
- switch( sqlType )
- {
- case Types.BOOLEAN:
- sqlType = Types.BIT;
- break;
- default:
-
- }
- super.registerOutParameter(parameterIndex, sqlType, !adjustIndex );
- }
- public void registerOutParameter(int parameterIndex, int sqlType,
- int scale) throws SQLException
- {
- // ignore scale for now
- registerOutParameter(parameterIndex, sqlType );
- }
-}
diff --git a/org/postgresql/jdbc3/Jdbc3Array.java b/org/postgresql/jdbc3/Jdbc3Array.java
deleted file mode 100644
index b246a5f..0000000
--- a/org/postgresql/jdbc3/Jdbc3Array.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-import java.util.Map;
-import org.postgresql.core.*;
-import java.sql.SQLException;
-import java.sql.ResultSet;
-
-public class Jdbc3Array extends org.postgresql.jdbc2.AbstractJdbc2Array implements java.sql.Array
-{
- public Jdbc3Array(BaseConnection conn, int oid, String fieldString) throws SQLException
- {
- super(conn, oid, fieldString);
- }
-
- public Jdbc3Array(BaseConnection conn, int oid, byte[] fieldBytes) throws SQLException
- {
- super(conn, oid, fieldBytes);
- }
-
- public Object getArray(Map map) throws SQLException
- {
- return getArrayImpl(map);
- }
-
- public Object getArray(long index, int count, Map map) throws SQLException
- {
- return getArrayImpl(index, count, map);
- }
-
- public ResultSet getResultSet(Map map) throws SQLException
- {
- return getResultSetImpl(map);
- }
-
- public ResultSet getResultSet(long index, int count, Map map) throws SQLException
- {
- return getResultSetImpl(index, count, map);
- }
-
-}
diff --git a/org/postgresql/jdbc3/Jdbc3Blob.java b/org/postgresql/jdbc3/Jdbc3Blob.java
deleted file mode 100644
index e6ee1bc..0000000
--- a/org/postgresql/jdbc3/Jdbc3Blob.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-
-import java.sql.*;
-
-public class Jdbc3Blob extends org.postgresql.jdbc3.AbstractJdbc3Blob implements java.sql.Blob
-{
-
- public Jdbc3Blob(org.postgresql.core.BaseConnection conn, long oid) throws SQLException
- {
- super(conn, oid);
- }
-
-}
diff --git a/org/postgresql/jdbc3/Jdbc3CallableStatement.java b/org/postgresql/jdbc3/Jdbc3CallableStatement.java
deleted file mode 100644
index 8bf9f29..0000000
--- a/org/postgresql/jdbc3/Jdbc3CallableStatement.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-import java.sql.*;
-import java.util.Map;
-
-class Jdbc3CallableStatement extends Jdbc3PreparedStatement implements CallableStatement
-{
-
- Jdbc3CallableStatement(Jdbc3Connection connection, String sql, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(connection, sql, true, rsType, rsConcurrency, rsHoldability);
- if ( !connection.haveMinimumServerVersion("8.1") || connection.getProtocolVersion() == 2)
- {
- // if there is no out parameter before the function determined by modifyJdbcCall then do not
- // set adjustIndex to true
- adjustIndex = outParmBeforeFunc;
- }
- }
-
- public Object getObject(int i, Map map) throws SQLException
- {
- return getObjectImpl(i, map);
- }
-
- public Object getObject(String s, Map map) throws SQLException
- {
- return getObjectImpl(s, map);
- }
-
-}
diff --git a/org/postgresql/jdbc3/Jdbc3Clob.java b/org/postgresql/jdbc3/Jdbc3Clob.java
deleted file mode 100644
index e1bf5d2..0000000
--- a/org/postgresql/jdbc3/Jdbc3Clob.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-
-public class Jdbc3Clob extends org.postgresql.jdbc3.AbstractJdbc3Clob implements java.sql.Clob
-{
-
- public Jdbc3Clob(org.postgresql.core.BaseConnection conn, long oid) throws java.sql.SQLException
- {
- super(conn, oid);
- }
-
-}
diff --git a/org/postgresql/jdbc3/Jdbc3Connection.java b/org/postgresql/jdbc3/Jdbc3Connection.java
deleted file mode 100644
index 00a7f04..0000000
--- a/org/postgresql/jdbc3/Jdbc3Connection.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-import java.util.Map;
-import java.util.Properties;
-import java.sql.SQLException;
-
-import org.postgresql.util.HostSpec;
-
-/**
- * This class implements the java.sql.Connection interface for JDBC3.
- * However most of the implementation is really done in
- * org.postgresql.jdbc3.AbstractJdbc3Connection or one of it's parents
- */
-public class Jdbc3Connection extends org.postgresql.jdbc3.AbstractJdbc3Connection implements java.sql.Connection
-{
- public Jdbc3Connection(HostSpec[] hostSpecs, String user, String database, Properties info, String url) throws SQLException {
- super(hostSpecs, user, database, info, url);
- }
-
- public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- {
- checkClosed();
- Jdbc3Statement s = new Jdbc3Statement(this, resultSetType, resultSetConcurrency, resultSetHoldability);
- s.setPrepareThreshold(getPrepareThreshold());
- return s;
- }
-
-
- public java.sql.PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- {
- checkClosed();
- Jdbc3PreparedStatement s = new Jdbc3PreparedStatement(this, sql, resultSetType, resultSetConcurrency, resultSetHoldability);
- s.setPrepareThreshold(getPrepareThreshold());
- return s;
- }
-
- public java.sql.CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- {
- checkClosed();
- Jdbc3CallableStatement s = new Jdbc3CallableStatement(this, sql, resultSetType, resultSetConcurrency, resultSetHoldability);
- s.setPrepareThreshold(getPrepareThreshold());
- return s;
- }
-
- public java.sql.DatabaseMetaData getMetaData() throws SQLException
- {
- checkClosed();
- if (metadata == null)
- metadata = new Jdbc3DatabaseMetaData(this);
- return metadata;
- }
-
- public void setTypeMap(Map map) throws SQLException
- {
- setTypeMapImpl(map);
- }
-
-}
diff --git a/org/postgresql/jdbc3/Jdbc3ConnectionPool.java b/org/postgresql/jdbc3/Jdbc3ConnectionPool.java
deleted file mode 100644
index 6aad7e1..0000000
--- a/org/postgresql/jdbc3/Jdbc3ConnectionPool.java
+++ /dev/null
@@ -1,14 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-import org.postgresql.ds.PGConnectionPoolDataSource;
-
-public class Jdbc3ConnectionPool extends PGConnectionPoolDataSource
-{
-}
diff --git a/org/postgresql/jdbc3/Jdbc3DatabaseMetaData.java b/org/postgresql/jdbc3/Jdbc3DatabaseMetaData.java
deleted file mode 100644
index c711bc3..0000000
--- a/org/postgresql/jdbc3/Jdbc3DatabaseMetaData.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-
-public class Jdbc3DatabaseMetaData extends org.postgresql.jdbc3.AbstractJdbc3DatabaseMetaData implements java.sql.DatabaseMetaData
-{
-
- public Jdbc3DatabaseMetaData(Jdbc3Connection conn)
- {
- super(conn);
- }
-
-}
diff --git a/org/postgresql/jdbc3/Jdbc3ParameterMetaData.java b/org/postgresql/jdbc3/Jdbc3ParameterMetaData.java
deleted file mode 100644
index 9c53f5d..0000000
--- a/org/postgresql/jdbc3/Jdbc3ParameterMetaData.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2005-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-import java.sql.ParameterMetaData;
-import org.postgresql.core.BaseConnection;
-
-public class Jdbc3ParameterMetaData extends AbstractJdbc3ParameterMetaData implements ParameterMetaData {
-
- public Jdbc3ParameterMetaData(BaseConnection connection, int oids[])
- {
- super(connection, oids);
- }
-
-}
-
diff --git a/org/postgresql/jdbc3/Jdbc3PoolingDataSource.java b/org/postgresql/jdbc3/Jdbc3PoolingDataSource.java
deleted file mode 100644
index 3898833..0000000
--- a/org/postgresql/jdbc3/Jdbc3PoolingDataSource.java
+++ /dev/null
@@ -1,14 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-import org.postgresql.ds.PGPoolingDataSource;
-
-public class Jdbc3PoolingDataSource extends PGPoolingDataSource
-{
-}
diff --git a/org/postgresql/jdbc3/Jdbc3PreparedStatement.java b/org/postgresql/jdbc3/Jdbc3PreparedStatement.java
deleted file mode 100644
index 49dd02a..0000000
--- a/org/postgresql/jdbc3/Jdbc3PreparedStatement.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-import java.sql.*;
-
-class Jdbc3PreparedStatement extends Jdbc3Statement implements PreparedStatement
-{
- Jdbc3PreparedStatement(Jdbc3Connection connection, String sql, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- this(connection, sql, false, rsType, rsConcurrency, rsHoldability);
- }
-
- protected Jdbc3PreparedStatement(Jdbc3Connection connection, String sql, boolean isCallable, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(connection, sql, isCallable, rsType, rsConcurrency, rsHoldability);
- }
-}
diff --git a/org/postgresql/jdbc3/Jdbc3ResultSet.java b/org/postgresql/jdbc3/Jdbc3ResultSet.java
deleted file mode 100644
index 0e4c595..0000000
--- a/org/postgresql/jdbc3/Jdbc3ResultSet.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2008, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-
-import java.sql.*;
-import java.util.List;
-import java.util.Map;
-import org.postgresql.core.*;
-
-/**
- * This class implements the java.sql.ResultSet interface for JDBC3.
- * However most of the implementation is really done in
- * org.postgresql.jdbc3.AbstractJdbc3ResultSet or one of it's parents
- */
-public class Jdbc3ResultSet extends org.postgresql.jdbc3.AbstractJdbc3ResultSet implements java.sql.ResultSet
-{
- Jdbc3ResultSet(Query originalQuery, BaseStatement statement, Field[] fields, List tuples, ResultCursor cursor,
- int maxRows, int maxFieldSize, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(originalQuery, statement, fields, tuples, cursor, maxRows, maxFieldSize, rsType, rsConcurrency, rsHoldability);
- }
-
- protected java.sql.ResultSetMetaData createMetaData() throws SQLException
- {
- return new Jdbc3ResultSetMetaData(connection, fields);
- }
-
- protected java.sql.Clob makeClob(long oid) throws SQLException
- {
- return new Jdbc3Clob(connection, oid);
- }
-
- protected java.sql.Blob makeBlob(long oid) throws SQLException
- {
- return new Jdbc3Blob(connection, oid);
- }
-
- protected Array makeArray(int oid, byte[] value) throws SQLException
- {
- return new Jdbc3Array(connection, oid, value);
- }
-
- protected Array makeArray(int oid, String value) throws SQLException
- {
- return new Jdbc3Array(connection, oid, value);
- }
-
- public Object getObject(String s, Map map) throws SQLException
- {
- return getObjectImpl(s, map);
- }
-
- public Object getObject(int i, Map map) throws SQLException
- {
- return getObjectImpl(i, map);
- }
-
-}
-
diff --git a/org/postgresql/jdbc3/Jdbc3ResultSetMetaData.java b/org/postgresql/jdbc3/Jdbc3ResultSetMetaData.java
deleted file mode 100644
index 4f37b5f..0000000
--- a/org/postgresql/jdbc3/Jdbc3ResultSetMetaData.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-import org.postgresql.core.*;
-
-public class Jdbc3ResultSetMetaData extends org.postgresql.jdbc2.AbstractJdbc2ResultSetMetaData implements java.sql.ResultSetMetaData
-{
-
- public Jdbc3ResultSetMetaData(BaseConnection connection, Field[] fields)
- {
- super(connection, fields);
- }
-
-}
-
diff --git a/org/postgresql/jdbc3/Jdbc3SimpleDataSource.java b/org/postgresql/jdbc3/Jdbc3SimpleDataSource.java
deleted file mode 100644
index 2c9d867..0000000
--- a/org/postgresql/jdbc3/Jdbc3SimpleDataSource.java
+++ /dev/null
@@ -1,14 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-import org.postgresql.ds.PGSimpleDataSource;
-
-public class Jdbc3SimpleDataSource extends PGSimpleDataSource
-{
-}
diff --git a/org/postgresql/jdbc3/Jdbc3Statement.java b/org/postgresql/jdbc3/Jdbc3Statement.java
deleted file mode 100644
index d6b0781..0000000
--- a/org/postgresql/jdbc3/Jdbc3Statement.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-import java.sql.*;
-import java.util.List;
-import org.postgresql.core.*;
-
-/**
- * This class implements the java.sql.Statement interface for JDBC3.
- * However most of the implementation is really done in
- * org.postgresql.jdbc3.AbstractJdbc3Statement or one of it's parents
- */
-class Jdbc3Statement extends AbstractJdbc3Statement implements Statement
-{
- Jdbc3Statement (Jdbc3Connection c, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(c, rsType, rsConcurrency, rsHoldability);
- }
-
- protected Jdbc3Statement(Jdbc3Connection connection, String sql, boolean isCallable, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(connection, sql, isCallable, rsType, rsConcurrency, rsHoldability);
- }
-
- public ResultSet createResultSet (Query originalQuery, Field[] fields, List tuples, ResultCursor cursor)
- throws SQLException
- {
- Jdbc3ResultSet newResult = new Jdbc3ResultSet(originalQuery, this, fields, tuples, cursor,
- getMaxRows(), getMaxFieldSize(),
- getResultSetType(), getResultSetConcurrency(), getResultSetHoldability());
- newResult.setFetchSize(getFetchSize());
- newResult.setFetchDirection(getFetchDirection());
- return newResult;
- }
-
- public ParameterMetaData createParameterMetaData(BaseConnection conn, int oids[]) throws SQLException
- {
- return new Jdbc3ParameterMetaData(conn, oids);
- }
-
-}
diff --git a/org/postgresql/jdbc3/PSQLSavepoint.java b/org/postgresql/jdbc3/PSQLSavepoint.java
deleted file mode 100644
index 044b3c0..0000000
--- a/org/postgresql/jdbc3/PSQLSavepoint.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3;
-
-import java.sql.SQLException;
-import java.sql.Savepoint;
-import org.postgresql.core.Utils;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLState;
-
-public class PSQLSavepoint implements Savepoint {
-
- private boolean _isValid;
- private boolean _isNamed;
- private int _id;
- private String _name;
-
- public PSQLSavepoint(int id) {
- _isValid = true;
- _isNamed = false;
- _id = id;
- }
-
- public PSQLSavepoint(String name) {
- _isValid = true;
- _isNamed = true;
- _name = name;
- }
-
- public int getSavepointId() throws SQLException {
- if (!_isValid)
- throw new PSQLException(GT.tr("Cannot reference a savepoint after it has been released."),
- PSQLState.INVALID_SAVEPOINT_SPECIFICATION);
-
- if (_isNamed)
- throw new PSQLException(GT.tr("Cannot retrieve the id of a named savepoint."),
- PSQLState.WRONG_OBJECT_TYPE);
-
- return _id;
- }
-
- public String getSavepointName() throws SQLException {
- if (!_isValid)
- throw new PSQLException(GT.tr("Cannot reference a savepoint after it has been released."),
- PSQLState.INVALID_SAVEPOINT_SPECIFICATION);
-
- if (!_isNamed)
- throw new PSQLException(GT.tr("Cannot retrieve the name of an unnamed savepoint."),
- PSQLState.WRONG_OBJECT_TYPE);
-
- return _name;
- }
-
- public void invalidate() {
- _isValid = false;
- }
-
- public String getPGName() throws SQLException {
- if (!_isValid)
- throw new PSQLException(GT.tr("Cannot reference a savepoint after it has been released."),
- PSQLState.INVALID_SAVEPOINT_SPECIFICATION);
-
- if (_isNamed)
- {
- // We need to quote and escape the name in case it
- // contains spaces/quotes/etc.
- //
- return Utils.appendEscapedIdentifier(null, _name).toString();
- }
-
- return "JDBC_SAVEPOINT_" + _id;
- }
-
-}
diff --git a/org/postgresql/jdbc3g/AbstractJdbc3gConnection.java b/org/postgresql/jdbc3g/AbstractJdbc3gConnection.java
deleted file mode 100644
index 1b42c33..0000000
--- a/org/postgresql/jdbc3g/AbstractJdbc3gConnection.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2008-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3g;
-
-import java.sql.SQLException;
-import java.util.Properties;
-
-import org.postgresql.core.Oid;
-import org.postgresql.core.TypeInfo;
-import org.postgresql.util.HostSpec;
-
-public abstract class AbstractJdbc3gConnection extends org.postgresql.jdbc3.AbstractJdbc3Connection
-{
-
- public AbstractJdbc3gConnection(HostSpec[] hostSpecs, String user, String database, Properties info, String url) throws SQLException {
- super(hostSpecs, user, database, info, url);
-
- TypeInfo types = getTypeInfo();
- if (haveMinimumServerVersion("8.3")) {
- types.addCoreType("uuid", Oid.UUID, java.sql.Types.OTHER, "java.util.UUID", Oid.UUID_ARRAY);
- }
- }
-
-}
-
diff --git a/org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java b/org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java
deleted file mode 100644
index 278c0f4..0000000
--- a/org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2008-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-
-package org.postgresql.jdbc3g;
-
-import java.sql.*;
-import java.util.List;
-import java.util.UUID;
-
-import org.postgresql.core.*;
-import org.postgresql.util.ByteConverter;
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.PSQLException;
-
-public abstract class AbstractJdbc3gResultSet extends org.postgresql.jdbc3.AbstractJdbc3ResultSet
-{
-
- public AbstractJdbc3gResultSet(Query originalQuery, BaseStatement statement, Field[] fields, List tuples,
- ResultCursor cursor, int maxRows, int maxFieldSize, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super (originalQuery, statement, fields, tuples, cursor, maxRows, maxFieldSize, rsType, rsConcurrency, rsHoldability);
- }
-
-
- protected Object getUUID(String data) throws SQLException
- {
- UUID uuid;
- try {
- uuid = UUID.fromString(data);
- } catch (java.lang.IllegalArgumentException iae) {
- throw new PSQLException(GT.tr("Invalid UUID data."), PSQLState.INVALID_PARAMETER_VALUE, iae);
- }
-
- return uuid;
- }
-
- protected Object getUUID(byte[] data) throws SQLException
- {
- return new UUID(ByteConverter.int8(data, 0), ByteConverter.int8(data, 8));
- }
-}
-
diff --git a/org/postgresql/jdbc3g/AbstractJdbc3gStatement.java b/org/postgresql/jdbc3g/AbstractJdbc3gStatement.java
deleted file mode 100644
index 6013522..0000000
--- a/org/postgresql/jdbc3g/AbstractJdbc3gStatement.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2008-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-
-package org.postgresql.jdbc3g;
-
-import java.sql.*;
-import java.util.UUID;
-
-import org.postgresql.core.Oid;
-import org.postgresql.jdbc3.AbstractJdbc3Connection;
-import org.postgresql.util.ByteConverter;
-
-public abstract class AbstractJdbc3gStatement extends org.postgresql.jdbc3.AbstractJdbc3Statement
-{
- public AbstractJdbc3gStatement (AbstractJdbc3Connection c, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(c, rsType, rsConcurrency, rsHoldability);
- }
-
- public AbstractJdbc3gStatement(AbstractJdbc3Connection connection, String sql, boolean isCallable, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(connection, sql, isCallable, rsType, rsConcurrency, rsHoldability);
- }
-
- public void setObject(int parameterIndex, Object x) throws SQLException
- {
- if (x instanceof UUID && connection.haveMinimumServerVersion("8.3"))
- {
- setUuid(parameterIndex, (UUID)x);
- } else {
- super.setObject(parameterIndex, x);
- }
- }
-
- public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException
- {
- if (targetSqlType == Types.OTHER && x instanceof UUID && connection.haveMinimumServerVersion("8.3"))
- {
- setUuid(parameterIndex, (UUID) x);
- } else {
- super.setObject(parameterIndex, x, targetSqlType, scale);
- }
- }
-
- private void setUuid(int parameterIndex, UUID uuid) throws SQLException {
- if (connection.binaryTransferSend(Oid.UUID)) {
- byte[] val = new byte[16];
- ByteConverter.int8(val, 0, uuid.getMostSignificantBits());
- ByteConverter.int8(val, 8, uuid.getLeastSignificantBits());
- bindBytes(parameterIndex, val, Oid.UUID);
- } else {
- bindLiteral(parameterIndex, uuid.toString(), Oid.UUID);
- }
- }
-}
\ No newline at end of file
diff --git a/org/postgresql/jdbc3g/Jdbc3gArray.java b/org/postgresql/jdbc3g/Jdbc3gArray.java
deleted file mode 100644
index e37ad6f..0000000
--- a/org/postgresql/jdbc3g/Jdbc3gArray.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3g;
-
-import java.util.Map;
-import org.postgresql.core.*;
-import java.sql.SQLException;
-import java.sql.ResultSet;
-
-public class Jdbc3gArray extends org.postgresql.jdbc2.AbstractJdbc2Array implements java.sql.Array
-{
- public Jdbc3gArray(BaseConnection conn, int oid, String fieldString) throws SQLException
- {
- super(conn, oid, fieldString);
- }
-
- public Jdbc3gArray(BaseConnection conn, int oid, byte[] fieldBytes) throws SQLException
- {
- super(conn, oid, fieldBytes);
- }
-
- public Object getArray(Map < String, Class < ? >> map) throws SQLException
- {
- return getArrayImpl(map);
- }
-
- public Object getArray(long index, int count, Map < String, Class < ? >> map) throws SQLException
- {
- return getArrayImpl(index, count, map);
- }
-
- public ResultSet getResultSet(Map < String, Class < ? >> map) throws SQLException
- {
- return getResultSetImpl(map);
- }
-
- public ResultSet getResultSet(long index, int count, Map < String, Class < ? >> map) throws SQLException
- {
- return getResultSetImpl(index, count, map);
- }
-
-}
diff --git a/org/postgresql/jdbc3g/Jdbc3gBlob.java b/org/postgresql/jdbc3g/Jdbc3gBlob.java
deleted file mode 100644
index 9bf9ac5..0000000
--- a/org/postgresql/jdbc3g/Jdbc3gBlob.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3g;
-
-
-import java.sql.*;
-
-public class Jdbc3gBlob extends org.postgresql.jdbc3.AbstractJdbc3Blob implements java.sql.Blob
-{
-
- public Jdbc3gBlob(org.postgresql.core.BaseConnection conn, long oid) throws SQLException
- {
- super(conn, oid);
- }
-
-}
diff --git a/org/postgresql/jdbc3g/Jdbc3gCallableStatement.java b/org/postgresql/jdbc3g/Jdbc3gCallableStatement.java
deleted file mode 100644
index dfe46c4..0000000
--- a/org/postgresql/jdbc3g/Jdbc3gCallableStatement.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3g;
-
-import java.sql.*;
-import java.util.Map;
-
-class Jdbc3gCallableStatement extends Jdbc3gPreparedStatement implements CallableStatement
-{
- Jdbc3gCallableStatement(Jdbc3gConnection connection, String sql, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(connection, sql, true, rsType, rsConcurrency, rsHoldability);
- if ( !connection.haveMinimumServerVersion("8.1") || connection.getProtocolVersion() == 2)
- {
- // if there is no out parameter before the function determined by modifyJdbcCall then do not
- // set adjustIndex to true
- adjustIndex = outParmBeforeFunc;
- }
- }
-
- public Object getObject(int i, Map < String, Class < ? >> map) throws SQLException
- {
- return getObjectImpl(i, map);
- }
-
- public Object getObject(String s, Map < String, Class < ? >> map) throws SQLException
- {
- return getObjectImpl(s, map);
- }
-
-}
diff --git a/org/postgresql/jdbc3g/Jdbc3gClob.java b/org/postgresql/jdbc3g/Jdbc3gClob.java
deleted file mode 100644
index 1179d27..0000000
--- a/org/postgresql/jdbc3g/Jdbc3gClob.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3g;
-
-
-public class Jdbc3gClob extends org.postgresql.jdbc3.AbstractJdbc3Clob implements java.sql.Clob
-{
-
- public Jdbc3gClob(org.postgresql.core.BaseConnection conn, long oid) throws java.sql.SQLException
- {
- super(conn, oid);
- }
-
-}
diff --git a/org/postgresql/jdbc3g/Jdbc3gConnection.java b/org/postgresql/jdbc3g/Jdbc3gConnection.java
deleted file mode 100644
index b8dfe00..0000000
--- a/org/postgresql/jdbc3g/Jdbc3gConnection.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3g;
-
-import java.util.Map;
-import java.util.Properties;
-import java.sql.SQLException;
-
-import org.postgresql.util.HostSpec;
-
-/**
- * This class implements the java.sql.Connection interface for JDBC3.
- * However most of the implementation is really done in
- * org.postgresql.jdbc3.AbstractJdbc3Connection or one of it's parents
- */
-public class Jdbc3gConnection extends org.postgresql.jdbc3g.AbstractJdbc3gConnection implements java.sql.Connection
-{
- public Jdbc3gConnection(HostSpec[] hostSpecs, String user, String database, Properties info, String url) throws SQLException {
- super(hostSpecs, user, database, info, url);
- }
-
- public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- {
- checkClosed();
- Jdbc3gStatement s = new Jdbc3gStatement(this, resultSetType, resultSetConcurrency, resultSetHoldability);
- s.setPrepareThreshold(getPrepareThreshold());
- return s;
- }
-
-
- public java.sql.PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- {
- checkClosed();
- Jdbc3gPreparedStatement s = new Jdbc3gPreparedStatement(this, sql, resultSetType, resultSetConcurrency, resultSetHoldability);
- s.setPrepareThreshold(getPrepareThreshold());
- return s;
- }
-
- public java.sql.CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- {
- checkClosed();
- Jdbc3gCallableStatement s = new Jdbc3gCallableStatement(this, sql, resultSetType, resultSetConcurrency, resultSetHoldability);
- s.setPrepareThreshold(getPrepareThreshold());
- return s;
- }
-
- public java.sql.DatabaseMetaData getMetaData() throws SQLException
- {
- checkClosed();
- if (metadata == null)
- metadata = new Jdbc3gDatabaseMetaData(this);
- return metadata;
- }
-
- public void setTypeMap(Map < String, Class < ? >> map) throws SQLException
- {
- setTypeMapImpl(map);
- }
-
-}
diff --git a/org/postgresql/jdbc3g/Jdbc3gDatabaseMetaData.java b/org/postgresql/jdbc3g/Jdbc3gDatabaseMetaData.java
deleted file mode 100644
index 65a84fc..0000000
--- a/org/postgresql/jdbc3g/Jdbc3gDatabaseMetaData.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3g;
-
-
-public class Jdbc3gDatabaseMetaData extends org.postgresql.jdbc3.AbstractJdbc3DatabaseMetaData implements java.sql.DatabaseMetaData
-{
-
- public Jdbc3gDatabaseMetaData(Jdbc3gConnection conn)
- {
- super(conn);
- }
-
-}
diff --git a/org/postgresql/jdbc3g/Jdbc3gParameterMetaData.java b/org/postgresql/jdbc3g/Jdbc3gParameterMetaData.java
deleted file mode 100644
index d3224dc..0000000
--- a/org/postgresql/jdbc3g/Jdbc3gParameterMetaData.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2005-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3g;
-
-import java.sql.ParameterMetaData;
-import org.postgresql.core.BaseConnection;
-
-public class Jdbc3gParameterMetaData extends org.postgresql.jdbc3.AbstractJdbc3ParameterMetaData implements ParameterMetaData {
-
- public Jdbc3gParameterMetaData(BaseConnection connection, int oids[])
- {
- super(connection, oids);
- }
-
-}
-
diff --git a/org/postgresql/jdbc3g/Jdbc3gPreparedStatement.java b/org/postgresql/jdbc3g/Jdbc3gPreparedStatement.java
deleted file mode 100644
index 960b4d1..0000000
--- a/org/postgresql/jdbc3g/Jdbc3gPreparedStatement.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3g;
-
-import java.sql.*;
-
-class Jdbc3gPreparedStatement extends Jdbc3gStatement implements PreparedStatement
-{
- Jdbc3gPreparedStatement(Jdbc3gConnection connection, String sql, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- this(connection, sql, false, rsType, rsConcurrency, rsHoldability);
- }
-
- protected Jdbc3gPreparedStatement(Jdbc3gConnection connection, String sql, boolean isCallable, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(connection, sql, isCallable, rsType, rsConcurrency, rsHoldability);
- }
-}
diff --git a/org/postgresql/jdbc3g/Jdbc3gResultSet.java b/org/postgresql/jdbc3g/Jdbc3gResultSet.java
deleted file mode 100644
index 6994525..0000000
--- a/org/postgresql/jdbc3g/Jdbc3gResultSet.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2008, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3g;
-
-
-import java.sql.*;
-import java.util.List;
-import java.util.Map;
-import org.postgresql.core.*;
-
-/**
- * This class implements the java.sql.ResultSet interface for JDBC3.
- * However most of the implementation is really done in
- * org.postgresql.jdbc3.AbstractJdbc3ResultSet or one of it's parents
- */
-public class Jdbc3gResultSet extends org.postgresql.jdbc3g.AbstractJdbc3gResultSet implements java.sql.ResultSet
-{
- Jdbc3gResultSet(Query originalQuery, BaseStatement statement, Field[] fields, List tuples, ResultCursor cursor,
- int maxRows, int maxFieldSize, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(originalQuery, statement, fields, tuples, cursor, maxRows, maxFieldSize, rsType, rsConcurrency, rsHoldability);
- }
-
- protected java.sql.ResultSetMetaData createMetaData() throws SQLException
- {
- return new Jdbc3gResultSetMetaData(connection, fields);
- }
-
- protected java.sql.Clob makeClob(long oid) throws SQLException
- {
- return new Jdbc3gClob(connection, oid);
- }
-
- protected java.sql.Blob makeBlob(long oid) throws SQLException
- {
- return new Jdbc3gBlob(connection, oid);
- }
-
- public Array makeArray(int oid, byte[] value) throws SQLException
- {
- return new Jdbc3gArray(connection, oid, value);
- }
-
- public Array makeArray(int oid, String value) throws SQLException
- {
- return new Jdbc3gArray(connection, oid, value);
- }
-
- public Object getObject(String s, Map < String, Class < ? >> map) throws SQLException
- {
- return getObjectImpl(s, map);
- }
-
- public Object getObject(int i, Map < String, Class < ? >> map) throws SQLException
- {
- return getObjectImpl(i, map);
- }
-
-}
-
diff --git a/org/postgresql/jdbc3g/Jdbc3gResultSetMetaData.java b/org/postgresql/jdbc3g/Jdbc3gResultSetMetaData.java
deleted file mode 100644
index b7a4ea3..0000000
--- a/org/postgresql/jdbc3g/Jdbc3gResultSetMetaData.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3g;
-
-import org.postgresql.core.*;
-
-public class Jdbc3gResultSetMetaData extends org.postgresql.jdbc2.AbstractJdbc2ResultSetMetaData implements java.sql.ResultSetMetaData
-{
-
- public Jdbc3gResultSetMetaData(BaseConnection connection, Field[] fields)
- {
- super(connection, fields);
- }
-
-}
-
diff --git a/org/postgresql/jdbc3g/Jdbc3gStatement.java b/org/postgresql/jdbc3g/Jdbc3gStatement.java
deleted file mode 100644
index 74b87fd..0000000
--- a/org/postgresql/jdbc3g/Jdbc3gStatement.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc3g;
-
-import java.sql.*;
-import java.util.List;
-import org.postgresql.core.*;
-
-/**
- * This class implements the java.sql.Statement interface for JDBC3.
- * However most of the implementation is really done in
- * org.postgresql.jdbc3.AbstractJdbc3Statement or one of it's parents
- */
-class Jdbc3gStatement extends org.postgresql.jdbc3g.AbstractJdbc3gStatement implements Statement
-{
- Jdbc3gStatement (Jdbc3gConnection c, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(c, rsType, rsConcurrency, rsHoldability);
- }
-
- protected Jdbc3gStatement(Jdbc3gConnection connection, String sql, boolean isCallable, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(connection, sql, isCallable, rsType, rsConcurrency, rsHoldability);
- }
-
- public ResultSet createResultSet (Query originalQuery, Field[] fields, List tuples, ResultCursor cursor)
- throws SQLException
- {
- Jdbc3gResultSet newResult = new Jdbc3gResultSet(originalQuery, this, fields, tuples, cursor,
- getMaxRows(), getMaxFieldSize(),
- getResultSetType(), getResultSetConcurrency(), getResultSetHoldability());
- newResult.setFetchSize(getFetchSize());
- newResult.setFetchDirection(getFetchDirection());
- return newResult;
- }
-
- public ParameterMetaData createParameterMetaData(BaseConnection conn, int oids[]) throws SQLException
- {
- return new Jdbc3gParameterMetaData(conn, oids);
- }
-
-}
diff --git a/org/postgresql/jdbc4/AbstractJdbc4Blob.java b/org/postgresql/jdbc4/AbstractJdbc4Blob.java
deleted file mode 100644
index 5adc09a..0000000
--- a/org/postgresql/jdbc4/AbstractJdbc4Blob.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-
-import java.sql.*;
-
-public abstract class AbstractJdbc4Blob extends org.postgresql.jdbc3.AbstractJdbc3Blob
-{
-
- public AbstractJdbc4Blob(org.postgresql.core.BaseConnection conn, long oid) throws SQLException
- {
- super(conn, oid);
- }
-
- public synchronized java.io.InputStream getBinaryStream(long pos, long length) throws SQLException
- {
- checkFreed();
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getBinaryStream(long, long)");
- }
-
-}
-
diff --git a/org/postgresql/jdbc4/AbstractJdbc4Clob.java b/org/postgresql/jdbc4/AbstractJdbc4Clob.java
deleted file mode 100644
index 725e548..0000000
--- a/org/postgresql/jdbc4/AbstractJdbc4Clob.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-import java.io.Reader;
-import java.sql.SQLException;
-
-public abstract class AbstractJdbc4Clob extends org.postgresql.jdbc3.AbstractJdbc3Clob
-{
-
- public AbstractJdbc4Clob(org.postgresql.core.BaseConnection conn, long oid) throws SQLException
- {
- super(conn, oid);
- }
-
- public synchronized Reader getCharacterStream(long pos, long length) throws SQLException
- {
- checkFreed();
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getCharacterStream(long, long)");
- }
-
-}
diff --git a/org/postgresql/jdbc4/AbstractJdbc4Connection.java b/org/postgresql/jdbc4/AbstractJdbc4Connection.java
deleted file mode 100644
index 7870deb..0000000
--- a/org/postgresql/jdbc4/AbstractJdbc4Connection.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-import java.sql.*;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.concurrent.Executor;
-
-import org.postgresql.core.Oid;
-import org.postgresql.core.Utils;
-import org.postgresql.core.TypeInfo;
-import org.postgresql.util.GT;
-import org.postgresql.util.HostSpec;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.PSQLException;
-import org.postgresql.jdbc2.AbstractJdbc2Array;
-
-abstract class AbstractJdbc4Connection extends org.postgresql.jdbc3g.AbstractJdbc3gConnection
-{
- private final Properties _clientInfo;
-
- public AbstractJdbc4Connection(HostSpec[] hostSpecs, String user, String database, Properties info, String url) throws SQLException {
- super(hostSpecs, user, database, info, url);
-
- TypeInfo types = getTypeInfo();
- if (haveMinimumServerVersion("8.3")) {
- types.addCoreType("xml", Oid.XML, java.sql.Types.SQLXML, "java.sql.SQLXML", Oid.XML_ARRAY);
- }
-
- _clientInfo = new Properties();
- if (haveMinimumServerVersion("9.0")) {
- String appName = info.getProperty("ApplicationName");
- if (appName == null) {
- appName = "";
- }
- _clientInfo.put("ApplicationName", appName);
- }
- }
-
- public Clob createClob() throws SQLException
- {
- checkClosed();
- throw org.postgresql.Driver.notImplemented(this.getClass(), "createClob()");
- }
-
- public Blob createBlob() throws SQLException
- {
- checkClosed();
- throw org.postgresql.Driver.notImplemented(this.getClass(), "createBlob()");
- }
-
- public NClob createNClob() throws SQLException
- {
- checkClosed();
- throw org.postgresql.Driver.notImplemented(this.getClass(), "createNClob()");
- }
-
- public SQLXML createSQLXML() throws SQLException
- {
- checkClosed();
- return new Jdbc4SQLXML(this);
- }
-
- public Struct createStruct(String typeName, Object[] attributes) throws SQLException
- {
- checkClosed();
- throw org.postgresql.Driver.notImplemented(this.getClass(), "createStruct(String, Object[])");
- }
-
- public Array createArrayOf(String typeName, Object[] elements) throws SQLException
- {
- checkClosed();
- int oid = getTypeInfo().getPGArrayType(typeName);
- if (oid == Oid.UNSPECIFIED)
- throw new PSQLException(GT.tr("Unable to find server array type for provided name {0}.", typeName), PSQLState.INVALID_NAME);
-
- char delim = getTypeInfo().getArrayDelimiter(oid);
- StringBuffer sb = new StringBuffer();
- appendArray(sb, elements, delim);
-
- // This will not work once we have a JDBC 5,
- // but it'll do for now.
- return new Jdbc4Array(this, oid, sb.toString());
- }
-
- private static void appendArray(StringBuffer sb, Object elements, char delim)
- {
- sb.append('{');
-
- int nElements = java.lang.reflect.Array.getLength(elements);
- for (int i=0; i<nElements; i++) {
- if (i > 0) {
- sb.append(delim);
- }
-
- Object o = java.lang.reflect.Array.get(elements, i);
- if (o == null) {
- sb.append("NULL");
- } else if (o.getClass().isArray()) {
- appendArray(sb, o, delim);
- } else {
- String s = o.toString();
- AbstractJdbc2Array.escapeArrayElement(sb, s);
- }
- }
- sb.append('}');
- }
-
- public boolean isValid(int timeout) throws SQLException
- {
- checkClosed();
- if (timeout < 0) {
- throw new PSQLException(GT.tr("Invalid timeout ({0}<0).", timeout), PSQLState.INVALID_PARAMETER_VALUE);
- }
- boolean valid = false;
- Statement stmt = null;
- try {
- if (!isClosed()) {
- stmt = createStatement();
- stmt.setQueryTimeout( timeout );
- stmt.executeQuery( "SELECT 1" );
- valid = true;
- }
- }
- catch ( SQLException e) {
- getLogger().log(GT.tr("Validating connection."),e);
- }
- finally
- {
- if(stmt!=null) try {stmt.close();}catch(Exception ex){}
- }
- return valid;
-}
-
- public void setClientInfo(String name, String value) throws SQLClientInfoException
- {
- if (haveMinimumServerVersion("9.0") && "ApplicationName".equals(name)) {
- if (value == null)
- value = "";
-
- try {
- StringBuffer sql = new StringBuffer("SET application_name = '");
- Utils.appendEscapedLiteral(sql, value, getStandardConformingStrings());
- sql.append("'");
- execSQLUpdate(sql.toString());
- } catch (SQLException sqle) {
- Map<String, ClientInfoStatus> failures = new HashMap<String, ClientInfoStatus>();
- failures.put(name, ClientInfoStatus.REASON_UNKNOWN);
- throw new SQLClientInfoException(GT.tr("Failed to set ClientInfo property: {0}", "ApplicationName"), sqle.getSQLState(), failures, sqle);
- }
-
- _clientInfo.put(name, value);
- return;
- }
-
- Map<String, ClientInfoStatus> failures = new HashMap<String, ClientInfoStatus>();
- failures.put(name, ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
- throw new SQLClientInfoException(GT.tr("ClientInfo property not supported."), PSQLState.NOT_IMPLEMENTED.getState(), failures);
- }
-
- public void setClientInfo(Properties properties) throws SQLClientInfoException
- {
- if (properties == null || properties.size() == 0)
- return;
-
- Map<String, ClientInfoStatus> failures = new HashMap<String, ClientInfoStatus>();
-
- Iterator<String> i = properties.stringPropertyNames().iterator();
- while (i.hasNext()) {
- String name = i.next();
- if (haveMinimumServerVersion("9.0") && "ApplicationName".equals(name)) {
- String value = properties.getProperty(name);
- setClientInfo(name, value);
- } else {
- failures.put(i.next(), ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
- }
- }
-
- if (!failures.isEmpty())
- throw new SQLClientInfoException(GT.tr("ClientInfo property not supported."), PSQLState.NOT_IMPLEMENTED.getState(), failures);
- }
-
- public String getClientInfo(String name) throws SQLException
- {
- checkClosed();
- return _clientInfo.getProperty(name);
- }
-
- public Properties getClientInfo() throws SQLException
- {
- checkClosed();
- return _clientInfo;
- }
-
- public <T> T createQueryObject(Class<T> ifc) throws SQLException
- {
- checkClosed();
- throw org.postgresql.Driver.notImplemented(this.getClass(), "createQueryObject(Class<T>)");
- }
-
- public boolean isWrapperFor(Class<?> iface) throws SQLException
- {
- checkClosed();
- throw org.postgresql.Driver.notImplemented(this.getClass(), "isWrapperFor(Class<?>)");
- }
-
- public <T> T unwrap(Class<T> iface) throws SQLException
- {
- checkClosed();
- throw org.postgresql.Driver.notImplemented(this.getClass(), "unwrap(Class<T>)");
- }
-
- public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getParentLogger()");
- }
-
- public void setSchema(String schema) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setSchema(String)");
- }
-
- public String getSchema() throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getSchema()");
- }
-
- public void abort(Executor executor) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "abort(Executor)");
- }
-
- public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setNetworkTimeout(Executor, int)");
- }
-
- public int getNetworkTimeout() throws SQLException {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getNetworkTimeout()");
- }
-
-}
diff --git a/org/postgresql/jdbc4/AbstractJdbc4DatabaseMetaData.java b/org/postgresql/jdbc4/AbstractJdbc4DatabaseMetaData.java
deleted file mode 100644
index b88bba4..0000000
--- a/org/postgresql/jdbc4/AbstractJdbc4DatabaseMetaData.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-import java.sql.*;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.postgresql.core.*;
-
-public abstract class AbstractJdbc4DatabaseMetaData extends org.postgresql.jdbc3.AbstractJdbc3DatabaseMetaData
-{
-
- public AbstractJdbc4DatabaseMetaData(AbstractJdbc4Connection conn)
- {
- super(conn);
- }
-
- public RowIdLifetime getRowIdLifetime() throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getRowIdLifetime()");
- }
-
- public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException
- {
- return getSchemas(4, catalog, schemaPattern);
- }
-
- public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException
- {
- return true;
- }
-
- public boolean autoCommitFailureClosesAllResultSets() throws SQLException
- {
- return false;
- }
-
- public ResultSet getClientInfoProperties() throws SQLException
- {
- Field f[] = new Field[4];
- f[0] = new Field("NAME", Oid.VARCHAR);
- f[1] = new Field("MAX_LEN", Oid.INT4);
- f[2] = new Field("DEFAULT_VALUE", Oid.VARCHAR);
- f[3] = new Field("DESCRIPTION", Oid.VARCHAR);
-
- List v = new ArrayList();
-
- if (connection.haveMinimumServerVersion("9.0")) {
- byte[][] tuple = new byte[4][];
- tuple[0] = connection.encodeString("ApplicationName");
- tuple[1] = connection.encodeString(Integer.toString(getMaxNameLength()));
- tuple[2] = connection.encodeString("");
- tuple[3] = connection.encodeString("The name of the application currently utilizing the connection.");
- v.add(tuple);
- }
-
- return (ResultSet) ((BaseStatement)createMetaDataStatement()).createDriverResultSet(f, v);
- }
-
- public boolean providesQueryObjectGenerator() throws SQLException
- {
- return false;
- }
-
- public boolean isWrapperFor(Class<?> iface) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "isWrapperFor(Class<?>)");
- }
-
- public <T> T unwrap(Class<T> iface) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "unwrap(Class<T>)");
- }
-
- public ResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getFunction(String, String, String)");
- }
-
- public ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getFunctionColumns(String, String, String, String)");
- }
-
- public int getJDBCMajorVersion() throws SQLException
- {
- return 4;
- }
-
- public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException
- {
- return getColumns(4, catalog, schemaPattern, tableNamePattern, columnNamePattern);
- }
-
- public ResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern) throws SQLException
- {
- return getProcedures(4, catalog, schemaPattern, procedureNamePattern);
- }
-
- public ResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) throws SQLException
- {
- return getProcedureColumns(4, catalog, schemaPattern, procedureNamePattern, columnNamePattern);
- }
-
- public ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getPseudoColumns(String, String, String, String)");
- }
-
- public boolean generatedKeyAlwaysReturned() throws SQLException {
- return true;
- }
-
-}
diff --git a/org/postgresql/jdbc4/AbstractJdbc4ParameterMetaData.java b/org/postgresql/jdbc4/AbstractJdbc4ParameterMetaData.java
deleted file mode 100644
index b3895b5..0000000
--- a/org/postgresql/jdbc4/AbstractJdbc4ParameterMetaData.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2005-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-import java.sql.SQLException;
-import org.postgresql.core.BaseConnection;
-
-public abstract class AbstractJdbc4ParameterMetaData extends org.postgresql.jdbc3.AbstractJdbc3ParameterMetaData
-{
-
- public AbstractJdbc4ParameterMetaData(BaseConnection connection, int oids[])
- {
- super(connection, oids);
- }
-
- public boolean isWrapperFor(Class<?> iface) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "isWrapperFor(Class<?>)");
- }
-
- public <T> T unwrap(Class<T> iface) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "unwrap(Class<T>)");
- }
-
-}
-
diff --git a/org/postgresql/jdbc4/AbstractJdbc4ResultSet.java b/org/postgresql/jdbc4/AbstractJdbc4ResultSet.java
deleted file mode 100644
index 665c0ae..0000000
--- a/org/postgresql/jdbc4/AbstractJdbc4ResultSet.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-
-import java.sql.*;
-import java.io.Reader;
-import java.io.InputStream;
-import java.util.List;
-import org.postgresql.core.*;
-
-abstract class AbstractJdbc4ResultSet extends org.postgresql.jdbc3g.AbstractJdbc3gResultSet
-{
- AbstractJdbc4ResultSet(Query originalQuery, BaseStatement statement, Field[] fields, List tuples, ResultCursor cursor,
- int maxRows, int maxFieldSize, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(originalQuery, statement, fields, tuples, cursor, maxRows, maxFieldSize, rsType, rsConcurrency, rsHoldability);
- }
-
- public RowId getRowId(int columnIndex) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getRowId(int)");
- }
-
- public RowId getRowId(String columnName) throws SQLException
- {
- return getRowId(findColumn(columnName));
- }
-
- public void updateRowId(int columnIndex, RowId x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateRowId(int, RowId)");
- }
-
- public void updateRowId(String columnName, RowId x) throws SQLException
- {
- updateRowId(findColumn(columnName), x);
- }
-
- public int getHoldability() throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getHoldability()");
- }
-
- public boolean isClosed() throws SQLException
- {
- return (rows == null);
- }
-
- public void updateNString(int columnIndex, String nString) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateNString(int, String)");
- }
-
- public void updateNString(String columnName, String nString) throws SQLException
- {
- updateNString(findColumn(columnName), nString);
- }
-
- public void updateNClob(int columnIndex, NClob nClob) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateNClob(int, NClob)");
- }
-
- public void updateNClob(String columnName, NClob nClob) throws SQLException
- {
- updateNClob(findColumn(columnName), nClob);
- }
-
- public void updateNClob(int columnIndex, Reader reader) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateNClob(int, Reader)");
- }
-
- public void updateNClob(String columnName, Reader reader) throws SQLException
- {
- updateNClob(findColumn(columnName), reader);
- }
-
- public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateNClob(int, Reader, long)");
- }
-
- public void updateNClob(String columnName, Reader reader, long length) throws SQLException
- {
- updateNClob(findColumn(columnName), reader, length);
- }
-
- public NClob getNClob(int columnIndex) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getNClob(int)");
- }
-
- public NClob getNClob(String columnName) throws SQLException
- {
- return getNClob(findColumn(columnName));
- }
-
- public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateBlob(int, InputStream, long)");
- }
-
- public void updateBlob(String columnName, InputStream inputStream, long length) throws SQLException
- {
- updateBlob(findColumn(columnName), inputStream, length);
- }
-
- public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateBlob(int, InputStream)");
- }
-
- public void updateBlob(String columnName, InputStream inputStream) throws SQLException
- {
- updateBlob(findColumn(columnName), inputStream);
- }
-
- public void updateClob(int columnIndex, Reader reader, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateClob(int, Reader, long)");
- }
-
- public void updateClob(String columnName, Reader reader, long length) throws SQLException
- {
- updateClob(findColumn(columnName), reader, length);
- }
-
- public void updateClob(int columnIndex, Reader reader) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateClob(int, Reader)");
- }
-
- public void updateClob(String columnName, Reader reader) throws SQLException
- {
- updateClob(findColumn(columnName), reader);
- }
-
- public SQLXML getSQLXML(int columnIndex) throws SQLException
- {
- String data = getString(columnIndex);
- if (data == null)
- return null;
-
- return new Jdbc4SQLXML(connection, data);
- }
-
- public SQLXML getSQLXML(String columnName) throws SQLException
- {
- return getSQLXML(findColumn(columnName));
- }
-
- public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException
- {
- updateValue(columnIndex, xmlObject);
- }
-
- public void updateSQLXML(String columnName, SQLXML xmlObject) throws SQLException
- {
- updateSQLXML(findColumn(columnName), xmlObject);
- }
-
- public String getNString(int columnIndex) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getNString(int)");
- }
-
- public String getNString(String columnName) throws SQLException
- {
- return getNString(findColumn(columnName));
- }
-
- public Reader getNCharacterStream(int columnIndex) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getNCharacterStream(int)");
- }
-
- public Reader getNCharacterStream(String columnName) throws SQLException
- {
- return getNCharacterStream(findColumn(columnName));
- }
-
- public void updateNCharacterStream(int columnIndex, Reader x, int length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateNCharacterStream(int, Reader, int)");
- }
-
- public void updateNCharacterStream(String columnName, Reader x, int length) throws SQLException
- {
- updateNCharacterStream(findColumn(columnName), x, length);
- }
-
- public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateNCharacterStream(int, Reader)");
- }
-
- public void updateNCharacterStream(String columnName, Reader x) throws SQLException
- {
- updateNCharacterStream(findColumn(columnName), x);
- }
-
- public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateNCharacterStream(int, Reader, long)");
- }
-
- public void updateNCharacterStream(String columnName, Reader x, long length) throws SQLException
- {
- updateNCharacterStream(findColumn(columnName), x, length);
- }
-
- public void updateCharacterStream(int columnIndex, Reader reader, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateCharaceterStream(int, Reader, long)");
- }
-
- public void updateCharacterStream(String columnName, Reader reader, long length) throws SQLException
- {
- updateCharacterStream(findColumn(columnName), reader, length);
- }
-
- public void updateCharacterStream(int columnIndex, Reader reader) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateCharaceterStream(int, Reader)");
- }
-
- public void updateCharacterStream(String columnName, Reader reader) throws SQLException
- {
- updateCharacterStream(findColumn(columnName), reader);
- }
-
- public void updateBinaryStream(int columnIndex, InputStream inputStream, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateBinaryStream(int, InputStream, long)");
- }
-
- public void updateBinaryStream(String columnName, InputStream inputStream, long length) throws SQLException
- {
- updateBinaryStream(findColumn(columnName), inputStream, length);
- }
-
- public void updateBinaryStream(int columnIndex, InputStream inputStream) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateBinaryStream(int, InputStream)");
- }
-
- public void updateBinaryStream(String columnName, InputStream inputStream) throws SQLException
- {
- updateBinaryStream(findColumn(columnName), inputStream);
- }
-
- public void updateAsciiStream(int columnIndex, InputStream inputStream, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateAsciiStream(int, InputStream, long)");
- }
-
- public void updateAsciiStream(String columnName, InputStream inputStream, long length) throws SQLException
- {
- updateAsciiStream(findColumn(columnName), inputStream, length);
- }
-
- public void updateAsciiStream(int columnIndex, InputStream inputStream) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "updateAsciiStream(int, InputStream)");
- }
-
- public void updateAsciiStream(String columnName, InputStream inputStream) throws SQLException
- {
- updateAsciiStream(findColumn(columnName), inputStream);
- }
-
- public boolean isWrapperFor(Class<?> iface) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "isWrapperFor(Class<?>)");
- }
-
- public <T> T unwrap(Class<T> iface) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "unwrap(Class<T>)");
- }
-
- protected Object internalGetObject(int columnIndex, Field field) throws SQLException
- {
- switch(getSQLType(columnIndex))
- {
- case Types.SQLXML:
- return getSQLXML(columnIndex);
- }
- return super.internalGetObject(columnIndex, field);
- }
-
- public <T> T getObject(int columnIndex, Class<T> type) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getObject(int, Class<T>)");
- }
-
- public <T> T getObject(String columnLabel, Class<T> type) throws SQLException
- {
- return getObject(findColumn(columnLabel), type);
- }
-
-}
-
diff --git a/org/postgresql/jdbc4/AbstractJdbc4ResultSetMetaData.java b/org/postgresql/jdbc4/AbstractJdbc4ResultSetMetaData.java
deleted file mode 100644
index d83c9d9..0000000
--- a/org/postgresql/jdbc4/AbstractJdbc4ResultSetMetaData.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-import org.postgresql.core.*;
-
-import java.sql.SQLException;
-
-abstract class AbstractJdbc4ResultSetMetaData extends org.postgresql.jdbc2.AbstractJdbc2ResultSetMetaData
-{
-
- public AbstractJdbc4ResultSetMetaData(BaseConnection connection, Field[] fields)
- {
- super(connection, fields);
- }
-
- public boolean isWrapperFor(Class<?> iface) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "isWrapperFor(Class<?>)");
- }
-
- public <T> T unwrap(Class<T> iface) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "unwrap(Class<T>)");
- }
-
-}
-
-
diff --git a/org/postgresql/jdbc4/AbstractJdbc4Statement.java b/org/postgresql/jdbc4/AbstractJdbc4Statement.java
deleted file mode 100644
index ad89a84..0000000
--- a/org/postgresql/jdbc4/AbstractJdbc4Statement.java
+++ /dev/null
@@ -1,400 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-import java.sql.*;
-
-import java.io.Reader;
-import java.io.InputStream;
-
-import org.postgresql.core.Oid;
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.PSQLException;
-
-abstract class AbstractJdbc4Statement extends org.postgresql.jdbc3g.AbstractJdbc3gStatement
-{
-
- private boolean poolable;
-
- AbstractJdbc4Statement (Jdbc4Connection c, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(c, rsType, rsConcurrency, rsHoldability);
- poolable = true;
- }
-
- public AbstractJdbc4Statement(Jdbc4Connection connection, String sql, boolean isCallable, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(connection, sql, isCallable, rsType, rsConcurrency, rsHoldability);
- }
-
- public boolean isClosed() throws SQLException
- {
- return isClosed;
- }
-
- public void setObject(int parameterIndex, Object x) throws SQLException
- {
- if (x instanceof SQLXML)
- {
- setSQLXML(parameterIndex, (SQLXML)x);
- } else {
- super.setObject(parameterIndex, x);
- }
- }
-
- public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException
- {
- checkClosed();
-
- if (x == null)
- {
- setNull(parameterIndex, targetSqlType);
- return;
- }
-
- switch (targetSqlType) {
- case Types.SQLXML:
- if (x instanceof SQLXML) {
- setSQLXML(parameterIndex, (SQLXML)x);
- } else {
- setSQLXML(parameterIndex, new Jdbc4SQLXML(connection, x.toString()));
- }
- break;
- default:
- super.setObject(parameterIndex, x, targetSqlType, scale);
- }
- }
-
- public void setNull(int parameterIndex, int targetSqlType) throws SQLException
- {
- checkClosed();
- int oid;
- switch (targetSqlType)
- {
- case Types.SQLXML:
- oid = Oid.XML;
- break;
- default:
- super.setNull(parameterIndex, targetSqlType);
- return;
- }
-
- if (adjustIndex)
- parameterIndex--;
- preparedParameters.setNull(parameterIndex, oid);
- }
-
- public void setRowId(int parameterIndex, RowId x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setRowId(int, RowId)");
- }
-
- public void setNString(int parameterIndex, String value) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setNString(int, String)");
- }
-
- public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setNCharacterStream(int, Reader, long)");
- }
-
- public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setNCharacterStream(int, Reader)");
- }
-
- public void setCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setCharacterStream(int, Reader, long)");
- }
-
- public void setCharacterStream(int parameterIndex, Reader value) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setCharacterStream(int, Reader)");
- }
-
- public void setBinaryStream(int parameterIndex, InputStream value, long length) throws SQLException
- {
- if (length > Integer.MAX_VALUE)
- {
- throw new PSQLException(GT.tr("Object is too large to send over the protocol."), PSQLState.NUMERIC_CONSTANT_OUT_OF_RANGE);
- }
- preparedParameters.setBytea(parameterIndex, value, (int)length);
- }
-
- public void setBinaryStream(int parameterIndex, InputStream value) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setBinaryStream(int, InputStream)");
- }
-
- public void setAsciiStream(int parameterIndex, InputStream value, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setAsciiStream(int, InputStream, long)");
- }
-
- public void setAsciiStream(int parameterIndex, InputStream value) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setAsciiStream(int, InputStream)");
- }
-
- public void setNClob(int parameterIndex, NClob value) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setNClob(int, NClob)");
- }
-
- public void setClob(int parameterIndex, Reader reader, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setClob(int, Reader, long)");
- }
-
- public void setClob(int parameterIndex, Reader reader) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setClob(int, Reader)");
- }
-
- public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setBlob(int, InputStream, long)");
- }
-
- public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setBlob(int, InputStream)");
- }
-
- public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setNClob(int, Reader, long)");
- }
-
- public void setNClob(int parameterIndex, Reader reader) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setNClob(int, Reader)");
- }
-
- public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
- {
- checkClosed();
- if (xmlObject == null || xmlObject.getString() == null)
- setNull(parameterIndex, Types.SQLXML);
- else
- setString(parameterIndex, xmlObject.getString(), Oid.XML);
- }
-
- public void setPoolable(boolean poolable) throws SQLException
- {
- checkClosed();
- this.poolable = poolable;
- }
-
- public boolean isPoolable() throws SQLException
- {
- checkClosed();
- return poolable;
- }
-
- public RowId getRowId(int parameterIndex) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getRowId(int)");
- }
-
- public RowId getRowId(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getRowId(String)");
- }
-
- public void setRowId(String parameterName, RowId x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setRowId(String, RowId)");
- }
-
- public void setNString(String parameterName, String value) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setNString(String, String)");
- }
-
- public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setNCharacterStream(String, Reader, long)");
- }
-
- public void setNCharacterStream(String parameterName, Reader value) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setNCharacterStream(String, Reader)");
- }
-
- public void setCharacterStream(String parameterName, Reader value, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setCharacterStream(String, Reader, long)");
- }
-
- public void setCharacterStream(String parameterName, Reader value) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setCharacterStream(String, Reader)");
- }
-
- public void setBinaryStream(String parameterName, InputStream value, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setBinaryStream(String, InputStream, long)");
- }
-
- public void setBinaryStream(String parameterName, InputStream value) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setBinaryStream(String, InputStream)");
- }
-
- public void setAsciiStream(String parameterName, InputStream value, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setAsciiStream(String, InputStream, long)");
- }
-
- public void setAsciiStream(String parameterName, InputStream value) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setAsciiStream(String, InputStream)");
- }
-
- public void setNClob(String parameterName, NClob value) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setNClob(String, NClob)");
- }
-
- public void setClob(String parameterName, Reader reader, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setClob(String, Reader, long)");
- }
-
- public void setClob(String parameterName, Reader reader) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setClob(String, Reader)");
- }
-
- public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setBlob(String, InputStream, long)");
- }
-
- public void setBlob(String parameterName, InputStream inputStream) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setBlob(String, InputStream)");
- }
-
- public void setNClob(String parameterName, Reader reader, long length) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setNClob(String, Reader, long)");
- }
-
- public void setNClob(String parameterName, Reader reader) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setNClob(String, Reader)");
- }
-
- public NClob getNClob(int parameterIndex) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getNClob(int)");
- }
-
- public NClob getNClob(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getNClob(String)");
- }
-
- public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setSQLXML(String, SQLXML)");
- }
-
- public SQLXML getSQLXML(int parameterIndex) throws SQLException
- {
- checkClosed();
- checkIndex(parameterIndex, Types.SQLXML, "SQLXML");
- return (SQLXML)callResult[parameterIndex - 1];
- }
-
- public SQLXML getSQLXML(String parameterIndex) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getSQLXML(String)");
- }
-
- public String getNString(int parameterIndex) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getNString(int)");
- }
-
- public String getNString(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getNString(String)");
- }
-
- public Reader getNCharacterStream(int parameterIndex) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getNCharacterStream(int)");
- }
-
- public Reader getNCharacterStream(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getNCharacterStream(String)");
- }
-
- public Reader getCharacterStream(int parameterIndex) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getCharacterStream(int)");
- }
-
- public Reader getCharacterStream(String parameterName) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getCharacterStream(String)");
- }
-
- public void setBlob(String parameterName, Blob x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setBlob(String, Blob)");
- }
-
- public void setClob(String parameterName, Clob x) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "setClob(String, Clob)");
- }
-
- public boolean isWrapperFor(Class<?> iface) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "isWrapperFor(Class<?>)");
- }
-
- public <T> T unwrap(Class<T> iface) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "unwrap(Class<T>)");
- }
-
- public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getParentLogger()");
- }
-
- public void closeOnCompletion() throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "closeOnCompletion()");
- }
-
- public boolean isCloseOnCompletion() throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "isCloseOnCompletion()");
- }
-
- public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getObject(int, Class<T>)");
- }
-
- public <T> T getObject(String parameterName, Class<T> type) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getObject(String, Class<T>)");
- }
-
-}
diff --git a/org/postgresql/jdbc4/Jdbc4Array.java b/org/postgresql/jdbc4/Jdbc4Array.java
deleted file mode 100644
index 130b663..0000000
--- a/org/postgresql/jdbc4/Jdbc4Array.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-import java.util.Map;
-import org.postgresql.core.*;
-import java.sql.SQLException;
-import java.sql.ResultSet;
-
-public class Jdbc4Array extends org.postgresql.jdbc2.AbstractJdbc2Array implements java.sql.Array
-{
- public Jdbc4Array(BaseConnection conn, int oid, String fieldString) throws SQLException
- {
- super(conn, oid, fieldString);
- }
-
- public Jdbc4Array(BaseConnection conn, int oid, byte[] fieldBytes) throws SQLException
- {
- super(conn, oid, fieldBytes);
- }
-
- public Object getArray(Map < String, Class < ? >> map) throws SQLException
- {
- return getArrayImpl(map);
- }
-
- public Object getArray(long index, int count, Map < String, Class < ? >> map) throws SQLException
- {
- return getArrayImpl(index, count, map);
- }
-
- public ResultSet getResultSet(Map < String, Class < ? >> map) throws SQLException
- {
- return getResultSetImpl(map);
- }
-
- public ResultSet getResultSet(long index, int count, Map < String, Class < ? >> map) throws SQLException
- {
- return getResultSetImpl(index, count, map);
- }
-
- public void free() throws SQLException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "free()");
- }
-
-}
diff --git a/org/postgresql/jdbc4/Jdbc4Blob.java b/org/postgresql/jdbc4/Jdbc4Blob.java
deleted file mode 100644
index 5e99415..0000000
--- a/org/postgresql/jdbc4/Jdbc4Blob.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-
-import java.sql.*;
-
-public class Jdbc4Blob extends AbstractJdbc4Blob implements java.sql.Blob
-{
-
- public Jdbc4Blob(org.postgresql.core.BaseConnection conn, long oid) throws SQLException
- {
- super(conn, oid);
- }
-
-}
diff --git a/org/postgresql/jdbc4/Jdbc4CallableStatement.java b/org/postgresql/jdbc4/Jdbc4CallableStatement.java
deleted file mode 100644
index 6926d9c..0000000
--- a/org/postgresql/jdbc4/Jdbc4CallableStatement.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-import java.sql.*;
-import java.util.Map;
-
-class Jdbc4CallableStatement extends Jdbc4PreparedStatement implements CallableStatement
-{
- Jdbc4CallableStatement(Jdbc4Connection connection, String sql, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(connection, sql, true, rsType, rsConcurrency, rsHoldability);
- if ( !connection.haveMinimumServerVersion("8.1") || connection.getProtocolVersion() == 2)
- {
- // if there is no out parameter before the function determined by modifyJdbcCall then do not
- // set adjustIndex to true
- adjustIndex = outParmBeforeFunc;
- }
- }
-
- public Object getObject(int i, Map < String, Class < ? >> map) throws SQLException
- {
- return getObjectImpl(i, map);
- }
-
- public Object getObject(String s, Map < String, Class < ? >> map) throws SQLException
- {
- return getObjectImpl(s, map);
- }
-
-}
diff --git a/org/postgresql/jdbc4/Jdbc4Clob.java b/org/postgresql/jdbc4/Jdbc4Clob.java
deleted file mode 100644
index b4fa61a..0000000
--- a/org/postgresql/jdbc4/Jdbc4Clob.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-
-public class Jdbc4Clob extends AbstractJdbc4Clob implements java.sql.Clob
-{
-
- public Jdbc4Clob(org.postgresql.core.BaseConnection conn, long oid) throws java.sql.SQLException
- {
- super(conn, oid);
- }
-
-}
diff --git a/org/postgresql/jdbc4/Jdbc4Connection.java b/org/postgresql/jdbc4/Jdbc4Connection.java
deleted file mode 100644
index 209b970..0000000
--- a/org/postgresql/jdbc4/Jdbc4Connection.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-import java.util.Map;
-import java.util.Properties;
-import java.sql.SQLException;
-
-import org.postgresql.util.HostSpec;
-
-/**
- * This class implements the java.sql.Connection interface for JDBC4.
- * However most of the implementation is really done in
- * org.postgresql.jdbc4.AbstractJdbc4Connection or one of it's parents
- */
-public class Jdbc4Connection extends AbstractJdbc4Connection implements java.sql.Connection
-{
- public Jdbc4Connection(HostSpec[] hostSpecs, String user, String database, Properties info, String url) throws SQLException {
- super(hostSpecs, user, database, info, url);
- }
-
- public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- {
- checkClosed();
- Jdbc4Statement s = new Jdbc4Statement(this, resultSetType, resultSetConcurrency, resultSetHoldability);
- s.setPrepareThreshold(getPrepareThreshold());
- return s;
- }
-
-
- public java.sql.PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- {
- checkClosed();
- Jdbc4PreparedStatement s = new Jdbc4PreparedStatement(this, sql, resultSetType, resultSetConcurrency, resultSetHoldability);
- s.setPrepareThreshold(getPrepareThreshold());
- return s;
- }
-
- public java.sql.CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- {
- checkClosed();
- Jdbc4CallableStatement s = new Jdbc4CallableStatement(this, sql, resultSetType, resultSetConcurrency, resultSetHoldability);
- s.setPrepareThreshold(getPrepareThreshold());
- return s;
- }
-
- public java.sql.DatabaseMetaData getMetaData() throws SQLException
- {
- checkClosed();
- if (metadata == null)
- metadata = new Jdbc4DatabaseMetaData(this);
- return metadata;
- }
-
- public void setTypeMap(Map < String, Class < ? >> map) throws SQLException
- {
- setTypeMapImpl(map);
- }
-
-}
diff --git a/org/postgresql/jdbc4/Jdbc4DatabaseMetaData.java b/org/postgresql/jdbc4/Jdbc4DatabaseMetaData.java
deleted file mode 100644
index 282df99..0000000
--- a/org/postgresql/jdbc4/Jdbc4DatabaseMetaData.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-
-public class Jdbc4DatabaseMetaData extends AbstractJdbc4DatabaseMetaData implements java.sql.DatabaseMetaData
-{
-
- public Jdbc4DatabaseMetaData(Jdbc4Connection conn)
- {
- super(conn);
- }
-
-}
diff --git a/org/postgresql/jdbc4/Jdbc4ParameterMetaData.java b/org/postgresql/jdbc4/Jdbc4ParameterMetaData.java
deleted file mode 100644
index 85ce86d..0000000
--- a/org/postgresql/jdbc4/Jdbc4ParameterMetaData.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2005-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-import java.sql.ParameterMetaData;
-import org.postgresql.core.BaseConnection;
-
-public class Jdbc4ParameterMetaData extends AbstractJdbc4ParameterMetaData implements ParameterMetaData {
-
- public Jdbc4ParameterMetaData(BaseConnection connection, int oids[])
- {
- super(connection, oids);
- }
-
-}
-
diff --git a/org/postgresql/jdbc4/Jdbc4PreparedStatement.java b/org/postgresql/jdbc4/Jdbc4PreparedStatement.java
deleted file mode 100644
index 50ba279..0000000
--- a/org/postgresql/jdbc4/Jdbc4PreparedStatement.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-import java.sql.*;
-
-class Jdbc4PreparedStatement extends Jdbc4Statement implements PreparedStatement
-{
- Jdbc4PreparedStatement(Jdbc4Connection connection, String sql, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- this(connection, sql, false, rsType, rsConcurrency, rsHoldability);
- }
-
- protected Jdbc4PreparedStatement(Jdbc4Connection connection, String sql, boolean isCallable, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(connection, sql, isCallable, rsType, rsConcurrency, rsHoldability);
- }
-}
diff --git a/org/postgresql/jdbc4/Jdbc4ResultSet.java b/org/postgresql/jdbc4/Jdbc4ResultSet.java
deleted file mode 100644
index 7280b39..0000000
--- a/org/postgresql/jdbc4/Jdbc4ResultSet.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-
-import java.sql.*;
-import java.util.List;
-import java.util.Map;
-import org.postgresql.core.*;
-
-/**
- * This class implements the java.sql.ResultSet interface for JDBC4.
- * However most of the implementation is really done in
- * org.postgresql.jdbc4.AbstractJdbc4ResultSet or one of it's parents
- */
-public class Jdbc4ResultSet extends AbstractJdbc4ResultSet implements java.sql.ResultSet
-{
- Jdbc4ResultSet(Query originalQuery, BaseStatement statement, Field[] fields, List tuples, ResultCursor cursor,
- int maxRows, int maxFieldSize, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(originalQuery, statement, fields, tuples, cursor, maxRows, maxFieldSize, rsType, rsConcurrency, rsHoldability);
- }
-
- protected java.sql.ResultSetMetaData createMetaData() throws SQLException
- {
- return new Jdbc4ResultSetMetaData(connection, fields);
- }
-
- protected java.sql.Clob makeClob(long oid) throws SQLException
- {
- return new Jdbc4Clob(connection, oid);
- }
-
- protected java.sql.Blob makeBlob(long oid) throws SQLException
- {
- return new Jdbc4Blob(connection, oid);
- }
-
- protected Array makeArray(int oid, byte[] value) throws SQLException
- {
- return new Jdbc4Array(connection, oid, value);
- }
-
- protected Array makeArray(int oid, String value) throws SQLException
- {
- return new Jdbc4Array(connection, oid, value);
- }
-
- public Object getObject(String s, Map < String, Class < ? >> map) throws SQLException
- {
- return getObjectImpl(s, map);
- }
-
- public Object getObject(int i, Map < String, Class < ? >> map) throws SQLException
- {
- return getObjectImpl(i, map);
- }
-
-}
-
diff --git a/org/postgresql/jdbc4/Jdbc4ResultSetMetaData.java b/org/postgresql/jdbc4/Jdbc4ResultSetMetaData.java
deleted file mode 100644
index 1d5d8e1..0000000
--- a/org/postgresql/jdbc4/Jdbc4ResultSetMetaData.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-import org.postgresql.core.*;
-
-public class Jdbc4ResultSetMetaData extends AbstractJdbc4ResultSetMetaData implements java.sql.ResultSetMetaData
-{
-
- public Jdbc4ResultSetMetaData(BaseConnection connection, Field[] fields)
- {
- super(connection, fields);
- }
-
-}
-
diff --git a/org/postgresql/jdbc4/Jdbc4SQLXML.java b/org/postgresql/jdbc4/Jdbc4SQLXML.java
deleted file mode 100644
index 2302185..0000000
--- a/org/postgresql/jdbc4/Jdbc4SQLXML.java
+++ /dev/null
@@ -1,297 +0,0 @@
-package org.postgresql.jdbc4;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.PSQLException;
-import org.postgresql.core.BaseConnection;
-
-import java.io.*;
-import java.sql.SQLXML;
-import java.sql.SQLException;
-import javax.xml.transform.Source;
-import javax.xml.transform.Result;
-
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerException;
-
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.sax.SAXResult;
-import org.xml.sax.InputSource;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXParseException;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.sax.TransformerHandler;
-
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-
-import javax.xml.transform.stax.StAXSource;
-import javax.xml.transform.stax.StAXResult;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.stream.XMLStreamException;
-
-public class Jdbc4SQLXML implements SQLXML {
-
- private final BaseConnection _conn;
- private String _data; // The actual data contained.
- private boolean _initialized; // Has someone assigned the data for this object?
- private boolean _active; // Is anyone in the process of loading data into us?
- private boolean _freed;
-
- private ByteArrayOutputStream _byteArrayOutputStream;
- private StringWriter _stringWriter;
- private DOMResult _domResult;
-
- public Jdbc4SQLXML(BaseConnection conn)
- {
- this(conn, null, false);
- }
-
- public Jdbc4SQLXML(BaseConnection conn, String data)
- {
- this(conn, data, true);
- }
-
- private Jdbc4SQLXML(BaseConnection conn, String data, boolean initialized)
- {
- _conn = conn;
- _data = data;
- _initialized = initialized;
- _active = false;
- _freed = false;
- }
-
- public synchronized void free()
- {
- _freed = true;
- _data = null;
- }
-
- public synchronized InputStream getBinaryStream() throws SQLException
- {
- checkFreed();
- ensureInitialized();
-
- if (_data == null)
- return null;
-
- try {
- return new ByteArrayInputStream(_conn.getEncoding().encode(_data));
- } catch (IOException ioe) {
- // This should be a can't happen exception. We just
- // decoded this data, so it would be surprising that
- // we couldn't encode it.
- // For this reason don't make it translatable.
- throw new PSQLException("Failed to re-encode xml data.", PSQLState.DATA_ERROR, ioe);
- }
- }
-
- public synchronized Reader getCharacterStream() throws SQLException
- {
- checkFreed();
- ensureInitialized();
-
- if (_data == null)
- return null;
-
- return new StringReader(_data);
- }
-
- // We must implement this unsafely because that's what the
- // interface requires. Because it says we're returning T
- // which is unknown, none of the return values can satisfy it
- // as Java isn't going to understand the if statements that
- // ensure they are the same.
- //
- public synchronized Source getSource(Class sourceClass) throws SQLException
- {
- checkFreed();
- ensureInitialized();
-
- if (_data == null)
- return null;
-
- try {
- if (sourceClass == null || DOMSource.class.equals(sourceClass))
- {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder builder = factory.newDocumentBuilder();
- builder.setErrorHandler(new NonPrintingErrorHandler());
- InputSource input = new InputSource(new StringReader(_data));
- return new DOMSource(builder.parse(input));
- }
- else if (SAXSource.class.equals(sourceClass))
- {
- InputSource is = new InputSource(new StringReader(_data));
- return new SAXSource(is);
- }
- else if (StreamSource.class.equals(sourceClass))
- {
- return new StreamSource(new StringReader(_data));
- }
- else if (StAXSource.class.equals(sourceClass))
- {
- XMLInputFactory xif = XMLInputFactory.newInstance();
- XMLStreamReader xsr = xif.createXMLStreamReader(new StringReader(_data));
- return new StAXSource(xsr);
- }
- } catch (Exception e) {
- throw new PSQLException(GT.tr("Unable to decode xml data."), PSQLState.DATA_ERROR, e);
- }
-
- throw new PSQLException(GT.tr("Unknown XML Source class: {0}", sourceClass), PSQLState.INVALID_PARAMETER_TYPE);
- }
-
- public synchronized String getString() throws SQLException
- {
- checkFreed();
- ensureInitialized();
- return _data;
- }
-
- public synchronized OutputStream setBinaryStream() throws SQLException
- {
- checkFreed();
- initialize();
- _active = true;
- _byteArrayOutputStream = new ByteArrayOutputStream();
- return _byteArrayOutputStream;
- }
-
- public synchronized Writer setCharacterStream() throws SQLException
- {
- checkFreed();
- initialize();
- _stringWriter = new StringWriter();
- return _stringWriter;
- }
-
- public synchronized Result setResult(Class resultClass) throws SQLException
- {
- checkFreed();
- initialize();
-
- if (resultClass == null || DOMResult.class.equals(resultClass)) {
- _domResult = new DOMResult();
- _active = true;
- return _domResult;
- } else if (SAXResult.class.equals(resultClass)) {
- try {
- SAXTransformerFactory transformerFactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance();
- TransformerHandler transformerHandler = transformerFactory.newTransformerHandler();
- _stringWriter = new StringWriter();
- transformerHandler.setResult(new StreamResult(_stringWriter));
- _active = true;
- return new SAXResult(transformerHandler);
- } catch (TransformerException te) {
- throw new PSQLException(GT.tr("Unable to create SAXResult for SQLXML."), PSQLState.UNEXPECTED_ERROR, te);
- }
- } else if (StreamResult.class.equals(resultClass)) {
- _stringWriter = new StringWriter();
- _active = true;
- return new StreamResult(_stringWriter);
- } else if (StAXResult.class.equals(resultClass)) {
- _stringWriter = new StringWriter();
- try {
- XMLOutputFactory xof = XMLOutputFactory.newInstance();
- XMLStreamWriter xsw = xof.createXMLStreamWriter(_stringWriter);
- _active = true;
- return new StAXResult(xsw);
- } catch (XMLStreamException xse) {
- throw new PSQLException(GT.tr("Unable to create StAXResult for SQLXML"), PSQLState.UNEXPECTED_ERROR, xse);
- }
- }
-
- throw new PSQLException(GT.tr("Unknown XML Result class: {0}", resultClass), PSQLState.INVALID_PARAMETER_TYPE);
- }
-
- public synchronized void setString(String value) throws SQLException
- {
- checkFreed();
- initialize();
- _data = value;
- }
-
- private void checkFreed() throws SQLException
- {
- if (_freed) {
- throw new PSQLException(GT.tr("This SQLXML object has already been freed."), PSQLState.OBJECT_NOT_IN_STATE);
- }
- }
-
- private void ensureInitialized() throws SQLException
- {
- if (!_initialized) {
- throw new PSQLException(GT.tr("This SQLXML object has not been initialized, so you cannot retrieve data from it."), PSQLState.OBJECT_NOT_IN_STATE);
- }
-
- // Is anyone loading data into us at the moment?
- if (!_active)
- return;
-
- if (_byteArrayOutputStream != null) {
- try {
- _data = _conn.getEncoding().decode(_byteArrayOutputStream.toByteArray());
- } catch (IOException ioe) {
- throw new PSQLException(GT.tr("Failed to convert binary xml data to encoding: {0}.", _conn.getEncoding().name()), PSQLState.DATA_ERROR, ioe);
- } finally {
- _byteArrayOutputStream = null;
- _active = false;
- }
- } else if (_stringWriter != null) {
- // This is also handling the work for Stream, SAX, and StAX Results
- // as they will use the same underlying stringwriter variable.
- //
- _data = _stringWriter.toString();
- _stringWriter = null;
- _active = false;
- } else if (_domResult != null) {
- // Copy the content from the result to a source
- // and use the identify transform to get it into a
- // friendlier result format.
- try {
- TransformerFactory factory = TransformerFactory.newInstance();
- Transformer transformer = factory.newTransformer();
- DOMSource domSource = new DOMSource(_domResult.getNode());
- StringWriter stringWriter = new StringWriter();
- StreamResult streamResult = new StreamResult(stringWriter);
- transformer.transform(domSource, streamResult);
- _data = stringWriter.toString();
- } catch (TransformerException te) {
- throw new PSQLException(GT.tr("Unable to convert DOMResult SQLXML data to a string."), PSQLState.DATA_ERROR, te);
- }
- finally {
- _domResult = null;
- _active = false;
- }
- }
- }
-
-
- private void initialize() throws SQLException
- {
- if (_initialized) {
- throw new PSQLException(GT.tr("This SQLXML object has already been initialized, so you cannot manipulate it further."), PSQLState.OBJECT_NOT_IN_STATE);
- }
- _initialized = true;
- }
-
- // Don't clutter System.err with errors the user can't silence.
- // If something bad really happens an exception will be thrown.
- static class NonPrintingErrorHandler implements ErrorHandler
- {
- public void error(SAXParseException e) { }
- public void fatalError(SAXParseException e) { }
- public void warning(SAXParseException e) { }
- }
-
-}
-
diff --git a/org/postgresql/jdbc4/Jdbc4Statement.java b/org/postgresql/jdbc4/Jdbc4Statement.java
deleted file mode 100644
index fff945f..0000000
--- a/org/postgresql/jdbc4/Jdbc4Statement.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.jdbc4;
-
-import java.sql.*;
-import java.util.List;
-import org.postgresql.core.*;
-
-/**
- * This class implements the java.sql.Statement interface for JDBC4.
- * However most of the implementation is really done in
- * org.postgresql.jdbc4.AbstractJdbc4Statement or one of it's parents
- */
-class Jdbc4Statement extends AbstractJdbc4Statement implements Statement
-{
- Jdbc4Statement (Jdbc4Connection c, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(c, rsType, rsConcurrency, rsHoldability);
- }
-
- protected Jdbc4Statement(Jdbc4Connection connection, String sql, boolean isCallable, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
- {
- super(connection, sql, isCallable, rsType, rsConcurrency, rsHoldability);
- }
-
- public ResultSet createResultSet (Query originalQuery, Field[] fields, List tuples, ResultCursor cursor)
- throws SQLException
- {
- Jdbc4ResultSet newResult = new Jdbc4ResultSet(originalQuery, this, fields, tuples, cursor,
- getMaxRows(), getMaxFieldSize(),
- getResultSetType(), getResultSetConcurrency(), getResultSetHoldability());
- newResult.setFetchSize(getFetchSize());
- newResult.setFetchDirection(getFetchDirection());
- return newResult;
- }
-
- public ParameterMetaData createParameterMetaData(BaseConnection conn, int oids[]) throws SQLException
- {
- return new Jdbc4ParameterMetaData(conn, oids);
- }
-
-}
diff --git a/org/postgresql/largeobject/BlobInputStream.java b/org/postgresql/largeobject/BlobInputStream.java
deleted file mode 100644
index f525484..0000000
--- a/org/postgresql/largeobject/BlobInputStream.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.largeobject;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.sql.SQLException;
-
-/**
- * This is an implementation of an InputStream from a large object.
- */
-public class BlobInputStream extends InputStream
-{
- /**
- * The parent LargeObject
- */
- private LargeObject lo;
-
- /**
- * Buffer used to improve performance
- */
- private byte[] buffer;
-
- /**
- * Position within buffer
- */
- private int bpos;
-
- /**
- * The buffer size
- */
- private int bsize;
-
- /**
- * The mark position
- */
- private int mpos = 0;
-
- /**
- * @param lo LargeObject to read from
- */
- public BlobInputStream(LargeObject lo)
- {
- this(lo, 1024);
- }
-
- /**
- * @param lo LargeObject to read from
- * @param bsize buffer size
- */
- public BlobInputStream(LargeObject lo, int bsize)
- {
- this.lo = lo;
- buffer = null;
- bpos = 0;
- this.bsize = bsize;
- }
-
- /**
- * The minimum required to implement input stream
- */
- public int read() throws java.io.IOException
- {
- checkClosed();
- try
- {
- if (buffer == null || bpos >= buffer.length)
- {
- buffer = lo.read(bsize);
- bpos = 0;
- }
-
- // Handle EOF
- if (bpos >= buffer.length)
- {
- return -1;
- }
-
- int ret = (buffer[bpos] & 0x7F);
- if ((buffer[bpos] &0x80) == 0x80)
- {
- ret |= 0x80;
- }
-
- bpos++;
-
- return ret;
- }
- catch (SQLException se)
- {
- throw new IOException(se.toString());
- }
- }
-
-
- /**
- * Closes this input stream and releases any system resources associated
- * with the stream.
- *
- * <p> The <code>close</code> method of <code>InputStream</code> does
- * nothing.
- *
- * @exception IOException if an I/O error occurs.
- */
- public void close() throws IOException
- {
- if (lo != null) {
- try
- {
- lo.close();
- lo = null;
- }
- catch (SQLException se)
- {
- throw new IOException(se.toString());
- }
- }
- }
-
- /**
- * Marks the current position in this input stream. A subsequent call to
- * the <code>reset</code> method repositions this stream at the last marked
- * position so that subsequent reads re-read the same bytes.
- *
- * <p> The <code>readlimit</code> arguments tells this input stream to
- * allow that many bytes to be read before the mark position gets
- * invalidated.
- *
- * <p> The general contract of <code>mark</code> is that, if the method
- * <code>markSupported</code> returns <code>true</code>, the stream somehow
- * remembers all the bytes read after the call to <code>mark</code> and
- * stands ready to supply those same bytes again if and whenever the method
- * <code>reset</code> is called. However, the stream is not required to
- * remember any data at all if more than <code>readlimit</code> bytes are
- * read from the stream before <code>reset</code> is called.
- *
- * <p> Marking a closed stream should not have any effect on the stream.
- *
- * @param readlimit the maximum limit of bytes that can be read before
- * the mark position becomes invalid.
- * @see java.io.InputStream#reset()
- */
- public synchronized void mark(int readlimit)
- {
- try
- {
- mpos = lo.tell();
- }
- catch (SQLException se)
- {
- // Can't throw this because mark API doesn't allow it.
- // throw new IOException(se.toString());
- }
- }
-
- /**
- * Repositions this stream to the position at the time the
- * <code>mark</code> method was last called on this input stream.
- * NB: If mark is not called we move to the begining.
- * @see java.io.InputStream#mark(int)
- * @see java.io.IOException
- */
- public synchronized void reset()
- throws IOException
- {
- checkClosed();
- try
- {
- lo.seek(mpos);
- }
- catch (SQLException se)
- {
- throw new IOException(se.toString());
- }
- }
-
- /**
- * Tests if this input stream supports the <code>mark</code> and
- * <code>reset</code> methods. The <code>markSupported</code> method of
- * <code>InputStream</code> returns <code>false</code>.
- *
- * @return <code>true</code> if this true type supports the mark and reset
- * method; <code>false</code> otherwise.
- * @see java.io.InputStream#mark(int)
- * @see java.io.InputStream#reset()
- */
- public boolean markSupported()
- {
- return true;
- }
-
- private void checkClosed() throws IOException
- {
- if (lo == null)
- throw new IOException("BlobOutputStream is closed");
- }
-
-}
diff --git a/org/postgresql/largeobject/BlobOutputStream.java b/org/postgresql/largeobject/BlobOutputStream.java
deleted file mode 100644
index b174533..0000000
--- a/org/postgresql/largeobject/BlobOutputStream.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.largeobject;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.sql.SQLException;
-
-/**
- * This implements a basic output stream that writes to a LargeObject
- */
-public class BlobOutputStream extends OutputStream
-{
- /**
- * The parent LargeObject
- */
- private LargeObject lo;
-
- /**
- * Buffer
- */
- private byte buf[];
-
- /**
- * Size of the buffer (default 1K)
- */
- private int bsize;
-
- /**
- * Position within the buffer
- */
- private int bpos;
-
- /**
- * Create an OutputStream to a large object
- * @param lo LargeObject
- */
- public BlobOutputStream(LargeObject lo)
- {
- this(lo, 1024);
- }
-
- /**
- * Create an OutputStream to a large object
- * @param lo LargeObject
- * @param bsize The size of the buffer used to improve performance
- */
- public BlobOutputStream(LargeObject lo, int bsize)
- {
- this.lo = lo;
- this.bsize = bsize;
- buf = new byte[bsize];
- bpos = 0;
- }
-
- public void write(int b) throws java.io.IOException
- {
- checkClosed();
- try
- {
- if (bpos >= bsize)
- {
- lo.write(buf);
- bpos = 0;
- }
- buf[bpos++] = (byte)b;
- }
- catch (SQLException se)
- {
- throw new IOException(se.toString());
- }
- }
-
- public void write(byte[] buf, int off, int len) throws java.io.IOException
- {
- checkClosed();
- try
- {
- // If we have any internally buffered data, send it first
- if ( bpos > 0 )
- flush();
-
- if ( off == 0 && len == buf.length )
- lo.write(buf); // save a buffer creation and copy since full buffer written
- else
- lo.write(buf, off, len);
- }
- catch (SQLException se)
- {
- throw new IOException(se.toString());
- }
- }
-
-
- /**
- * Flushes this output stream and forces any buffered output bytes
- * to be written out. The general contract of <code>flush</code> is
- * that calling it is an indication that, if any bytes previously
- * written have been buffered by the implementation of the output
- * stream, such bytes should immediately be written to their
- * intended destination.
- *
- * @exception IOException if an I/O error occurs.
- */
- public void flush() throws IOException
- {
- checkClosed();
- try
- {
- if (bpos > 0)
- lo.write(buf, 0, bpos);
- bpos = 0;
- }
- catch (SQLException se)
- {
- throw new IOException(se.toString());
- }
- }
-
- /**
- * Closes this output stream and releases any system resources
- * associated with this stream. The general contract of <code>close</code>
- * is that it closes the output stream. A closed stream cannot perform
- * output operations and cannot be reopened.
- * <p>
- * The <code>close</code> method of <code>OutputStream</code> does nothing.
- *
- * @exception IOException if an I/O error occurs.
- */
- public void close() throws IOException
- {
- if (lo != null) {
- try
- {
- flush();
- lo.close();
- lo = null;
- }
- catch (SQLException se)
- {
- throw new IOException(se.toString());
- }
- }
- }
-
- private void checkClosed() throws IOException
- {
- if (lo == null)
- throw new IOException("BlobOutputStream is closed");
- }
-
-}
diff --git a/org/postgresql/largeobject/LargeObject.java b/org/postgresql/largeobject/LargeObject.java
deleted file mode 100644
index c1ac30d..0000000
--- a/org/postgresql/largeobject/LargeObject.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.largeobject;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.sql.SQLException;
-import org.postgresql.core.BaseConnection;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-import org.postgresql.fastpath.Fastpath;
-import org.postgresql.fastpath.FastpathArg;
-
-/**
- * This class provides the basic methods required to run the interface, plus
- * a pair of methods that provide InputStream and OutputStream classes
- * for this object.
- *
- * <p>Normally, client code would use the getAsciiStream, getBinaryStream,
- * or getUnicodeStream methods in ResultSet, or setAsciiStream,
- * setBinaryStream, or setUnicodeStream methods in PreparedStatement to
- * access Large Objects.
- *
- * <p>However, sometimes lower level access to Large Objects are required,
- * that are not supported by the JDBC specification.
- *
- * <p>Refer to org.postgresql.largeobject.LargeObjectManager on how to gain access
- * to a Large Object, or how to create one.
- *
- * @see org.postgresql.largeobject.LargeObjectManager
- * @see java.sql.ResultSet#getAsciiStream
- * @see java.sql.ResultSet#getBinaryStream
- * @see java.sql.ResultSet#getUnicodeStream
- * @see java.sql.PreparedStatement#setAsciiStream
- * @see java.sql.PreparedStatement#setBinaryStream
- * @see java.sql.PreparedStatement#setUnicodeStream
- *
- */
-public class LargeObject
-{
- /**
- * Indicates a seek from the begining of a file
- */
- public static final int SEEK_SET = 0;
-
- /**
- * Indicates a seek from the current position
- */
- public static final int SEEK_CUR = 1;
-
- /**
- * Indicates a seek from the end of a file
- */
- public static final int SEEK_END = 2;
-
- private final Fastpath fp; // Fastpath API to use
- private final long oid; // OID of this object
- private final int mode; // read/write mode of this object
- private final int fd; // the descriptor of the open large object
-
- private BlobOutputStream os; // The current output stream
-
- private boolean closed = false; // true when we are closed
-
- private BaseConnection conn; // Only initialized when open a LOB with CommitOnClose
- private boolean commitOnClose; // Only initialized when open a LOB with CommitOnClose
-
- /**
- * This opens a large object.
- *
- * <p>If the object does not exist, then an SQLException is thrown.
- *
- * @param fp FastPath API for the connection to use
- * @param oid of the Large Object to open
- * @param mode Mode of opening the large object
- * @param conn the connection to the database used to access this LOB
- * @param commitOnClose commit the transaction when this LOB will be closed
- * (defined in LargeObjectManager)
- * @exception SQLException if a database-access error occurs.
- * @see org.postgresql.largeobject.LargeObjectManager
- */
- protected LargeObject(Fastpath fp, long oid, int mode, BaseConnection conn, boolean commitOnClose) throws SQLException
- {
- this.fp = fp;
- this.oid = oid;
- this.mode = mode;
- if (commitOnClose == true)
- {
- this.commitOnClose = true;
- this.conn = conn;
- }
- else
- {
- this.commitOnClose = false;
- }
-
- FastpathArg args[] = new FastpathArg[2];
- args[0] = Fastpath.createOIDArg(oid);
- args[1] = new FastpathArg(mode);
- this.fd = fp.getInteger("lo_open", args);
- }
-
- /**
- * This opens a large object.
- *
- * <p>If the object does not exist, then an SQLException is thrown.
- *
- * @param fp FastPath API for the connection to use
- * @param oid of the Large Object to open
- * @param mode Mode of opening the large object
- * (defined in LargeObjectManager)
- * @exception SQLException if a database-access error occurs.
- * @see org.postgresql.largeobject.LargeObjectManager
- */
- protected LargeObject(Fastpath fp, long oid, int mode) throws SQLException
- {
- this(fp,oid,mode,null,false);
- }
-
- public LargeObject copy() throws SQLException
- {
- return new LargeObject(fp, oid, mode);
- }
-
- /* Release large object resources during garbage cleanup.
- *
- * This code used to call close() however that was problematic
- * because the scope of the fd is a transaction, thus if commit
- * or rollback was called before garbage collection ran then
- * the call to close would error out with an invalid large object
- * handle. So this method now does nothing and lets the server
- * handle cleanup when it ends the transaction.
- *
- * protected void finalize() throws SQLException
- * {
- * }
- */
-
- /**
- * @return the OID of this LargeObject
- * @deprecated As of 8.3, replaced by {@link #getLongOID()}
- */
- public int getOID()
- {
- return (int)oid;
- }
-
- /**
- * @return the OID of this LargeObject
- */
- public long getLongOID()
- {
- return oid;
- }
-
- /**
- * This method closes the object. You must not call methods in this
- * object after this is called.
- * @exception SQLException if a database-access error occurs.
- */
- public void close() throws SQLException
- {
- if (!closed)
- {
- // flush any open output streams
- if (os != null)
- {
- try
- {
- // we can't call os.close() otherwise we go into an infinite loop!
- os.flush();
- }
- catch (IOException ioe)
- {
- throw new PSQLException("Exception flushing output stream",
- PSQLState.DATA_ERROR, ioe);
- }
- finally
- {
- os = null;
- }
- }
-
- // finally close
- FastpathArg args[] = new FastpathArg[1];
- args[0] = new FastpathArg(fd);
- fp.fastpath("lo_close", false, args); // true here as we dont care!!
- closed = true;
- if (this.commitOnClose == true)
- {
- this.conn.commit();
- }
- }
- }
-
- /**
- * Reads some data from the object, and return as a byte[] array
- *
- * @param len number of bytes to read
- * @return byte[] array containing data read
- * @exception SQLException if a database-access error occurs.
- */
- public byte[] read(int len) throws SQLException
- {
- // This is the original method, where the entire block (len bytes)
- // is retrieved in one go.
- FastpathArg args[] = new FastpathArg[2];
- args[0] = new FastpathArg(fd);
- args[1] = new FastpathArg(len);
- return fp.getData("loread", args);
- }
-
- /**
- * Reads some data from the object into an existing array
- *
- * @param buf destination array
- * @param off offset within array
- * @param len number of bytes to read
- * @return the number of bytes actually read
- * @exception SQLException if a database-access error occurs.
- */
- public int read(byte buf[], int off, int len) throws SQLException
- {
- byte b[] = read(len);
- if (b.length < len)
- len = b.length;
- System.arraycopy(b, 0, buf, off, len);
- return len;
- }
-
- /**
- * Writes an array to the object
- *
- * @param buf array to write
- * @exception SQLException if a database-access error occurs.
- */
- public void write(byte buf[]) throws SQLException
- {
- FastpathArg args[] = new FastpathArg[2];
- args[0] = new FastpathArg(fd);
- args[1] = new FastpathArg(buf);
- fp.fastpath("lowrite", false, args);
- }
-
- /**
- * Writes some data from an array to the object
- *
- * @param buf destination array
- * @param off offset within array
- * @param len number of bytes to write
- * @exception SQLException if a database-access error occurs.
- */
- public void write(byte buf[], int off, int len) throws SQLException
- {
- FastpathArg args[] = new FastpathArg[2];
- args[0] = new FastpathArg(fd);
- args[1] = new FastpathArg(buf, off, len);
- fp.fastpath("lowrite", false, args);
- }
-
- /**
- * Sets the current position within the object.
- *
- * <p>This is similar to the fseek() call in the standard C library. It
- * allows you to have random access to the large object.
- *
- * @param pos position within object
- * @param ref Either SEEK_SET, SEEK_CUR or SEEK_END
- * @exception SQLException if a database-access error occurs.
- */
- public void seek(int pos, int ref) throws SQLException
- {
- FastpathArg args[] = new FastpathArg[3];
- args[0] = new FastpathArg(fd);
- args[1] = new FastpathArg(pos);
- args[2] = new FastpathArg(ref);
- fp.fastpath("lo_lseek", false, args);
- }
-
- /**
- * Sets the current position within the object.
- *
- * <p>This is similar to the fseek() call in the standard C library. It
- * allows you to have random access to the large object.
- *
- * @param pos position within object from begining
- * @exception SQLException if a database-access error occurs.
- */
- public void seek(int pos) throws SQLException
- {
- seek(pos, SEEK_SET);
- }
-
- /**
- * @return the current position within the object
- * @exception SQLException if a database-access error occurs.
- */
- public int tell() throws SQLException
- {
- FastpathArg args[] = new FastpathArg[1];
- args[0] = new FastpathArg(fd);
- return fp.getInteger("lo_tell", args);
- }
-
- /**
- * This method is inefficient, as the only way to find out the size of
- * the object is to seek to the end, record the current position, then
- * return to the original position.
- *
- * <p>A better method will be found in the future.
- *
- * @return the size of the large object
- * @exception SQLException if a database-access error occurs.
- */
- public int size() throws SQLException
- {
- int cp = tell();
- seek(0, SEEK_END);
- int sz = tell();
- seek(cp, SEEK_SET);
- return sz;
- }
-
- /**
- * Truncates the large object to the given length in bytes.
- * If the number of bytes is larger than the current large
- * object length, the large object will be filled with zero
- * bytes. This method does not modify the current file offset.
- */
- public void truncate(int len) throws SQLException
- {
- FastpathArg args[] = new FastpathArg[2];
- args[0] = new FastpathArg(fd);
- args[1] = new FastpathArg(len);
- fp.getInteger("lo_truncate", args);
- }
-
- /**
- * Returns an InputStream from this object.
- *
- * <p>This InputStream can then be used in any method that requires an
- * InputStream.
- *
- * @exception SQLException if a database-access error occurs.
- */
- public InputStream getInputStream() throws SQLException
- {
- return new BlobInputStream(this, 4096);
- }
-
- /**
- * Returns an OutputStream to this object.
- *
- * <p>This OutputStream can then be used in any method that requires an
- * OutputStream.
- *
- * @exception SQLException if a database-access error occurs.
- */
- public OutputStream getOutputStream() throws SQLException
- {
- if (os == null)
- os = new BlobOutputStream(this, 4096);
- return os;
- }
-
-}
diff --git a/org/postgresql/largeobject/LargeObjectManager.java b/org/postgresql/largeobject/LargeObjectManager.java
deleted file mode 100644
index e07cc14..0000000
--- a/org/postgresql/largeobject/LargeObjectManager.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.largeobject;
-
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import org.postgresql.core.BaseConnection;
-import org.postgresql.fastpath.Fastpath;
-import org.postgresql.fastpath.FastpathArg;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLState;
-
-/**
- * This class implements the large object interface to org.postgresql.
- *
- * <p>It provides methods that allow client code to create, open and delete
- * large objects from the database. When opening an object, an instance of
- * org.postgresql.largeobject.LargeObject is returned, and its methods then allow
- * access to the object.
- *
- * <p>This class can only be created by org.postgresql.Connection
- *
- * <p>To get access to this class, use the following segment of code:
- * <br><pre>
- * import org.postgresql.largeobject.*;
- *
- * Connection conn;
- * LargeObjectManager lobj;
- *
- * ... code that opens a connection ...
- *
- * lobj = ((org.postgresql.PGConnection)myconn).getLargeObjectAPI();
- * </pre>
- *
- * <p>Normally, client code would use the getAsciiStream, getBinaryStream,
- * or getUnicodeStream methods in ResultSet, or setAsciiStream,
- * setBinaryStream, or setUnicodeStream methods in PreparedStatement to
- * access Large Objects.
- *
- * <p>However, sometimes lower level access to Large Objects are required,
- * that are not supported by the JDBC specification.
- *
- * <p>Refer to org.postgresql.largeobject.LargeObject on how to manipulate the
- * contents of a Large Object.
- *
- * @see java.sql.ResultSet#getAsciiStream
- * @see java.sql.ResultSet#getBinaryStream
- * @see java.sql.ResultSet#getUnicodeStream
- * @see java.sql.PreparedStatement#setAsciiStream
- * @see java.sql.PreparedStatement#setBinaryStream
- * @see java.sql.PreparedStatement#setUnicodeStream
- */
-public class LargeObjectManager
-{
- // the fastpath api for this connection
- private Fastpath fp;
- private BaseConnection conn;
-
- /**
- * This mode indicates we want to write to an object
- */
- public static final int WRITE = 0x00020000;
-
- /**
- * This mode indicates we want to read an object
- */
- public static final int READ = 0x00040000;
-
- /**
- * This mode is the default. It indicates we want read and write access to
- * a large object
- */
- public static final int READWRITE = READ | WRITE;
-
- /**
- * This prevents us being created by mere mortals
- */
- private LargeObjectManager()
- {
- }
-
- /**
- * Constructs the LargeObject API.
- *
- * <p><b>Important Notice</b>
- * <br>This method should only be called by org.postgresql.Connection
- *
- * <p>There should only be one LargeObjectManager per Connection. The
- * org.postgresql.Connection class keeps track of the various extension API's
- * and it's advised you use those to gain access, and not going direct.
- */
- public LargeObjectManager(BaseConnection conn) throws SQLException
- {
- this.conn = conn;
- // We need Fastpath to do anything
- this.fp = conn.getFastpathAPI();
-
- // Now get the function oid's for the api
- //
- // This is an example of Fastpath.addFunctions();
- //
- String sql;
- if (conn.getMetaData().supportsSchemasInTableDefinitions())
- {
- sql = "SELECT p.proname,p.oid " +
- " FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n " +
- " WHERE p.pronamespace=n.oid AND n.nspname='pg_catalog' AND (";
- }
- else
- {
- sql = "SELECT proname,oid FROM pg_proc WHERE ";
- }
- sql += " proname = 'lo_open'" +
- " or proname = 'lo_close'" +
- " or proname = 'lo_creat'" +
- " or proname = 'lo_unlink'" +
- " or proname = 'lo_lseek'" +
- " or proname = 'lo_tell'" +
- " or proname = 'loread'" +
- " or proname = 'lowrite'" +
- " or proname = 'lo_truncate'";
-
- if (conn.getMetaData().supportsSchemasInTableDefinitions())
- {
- sql += ")";
- }
-
- ResultSet res = conn.createStatement().executeQuery(sql);
-
- if (res == null)
- throw new PSQLException(GT.tr("Failed to initialize LargeObject API"), PSQLState.SYSTEM_ERROR);
-
- fp.addFunctions(res);
- res.close();
-
- conn.getLogger().debug("Large Object initialised");
- }
-
- /**
- * This opens an existing large object, based on its OID. This method
- * assumes that READ and WRITE access is required (the default).
- *
- * @param oid of large object
- * @return LargeObject instance providing access to the object
- * @exception SQLException on error
- * @deprecated As of 8.3, replaced by {@link #open(long)}
- */
- public LargeObject open(int oid) throws SQLException
- {
- return open((long)oid,false);
- }
-
- /**
- * This opens an existing large object, same as previous method,
- * but commits the transaction on close if asked. This is useful when
- * the LOB is returned to a caller which won't take care of transactions by
- * itself.
- * @param oid of large object
- * @param commitOnClose commit the transaction when this LOB will be closed
- * @return LargeObject instance providing access to the object
- * @exception SQLException on error
- */
-
- public LargeObject open(int oid, boolean commitOnClose) throws SQLException
- {
- return open((long)oid,commitOnClose);
- }
-
- /**
- * This opens an existing large object, based on its OID. This method
- * assumes that READ and WRITE access is required (the default).
- *
- * @param oid of large object
- * @return LargeObject instance providing access to the object
- * @exception SQLException on error
- */
- public LargeObject open(long oid) throws SQLException
- {
- return open(oid, READWRITE, false);
- }
-
- /**
- * This opens an existing large object, same as previous method,
- * but commits the transaction on close if asked
- * @param oid of large object
- * @param commitOnClose commit the transaction when this LOB will be closed
- * @return LargeObject instance providing access to the object
- * @exception SQLException on error
- */
-
- public LargeObject open(long oid, boolean commitOnClose) throws SQLException
- {
- return open((long)oid,READWRITE,commitOnClose);
- }
-
- /**
- * This opens an existing large object, based on its OID
- *
- * @param oid of large object
- * @param mode mode of open
- * @return LargeObject instance providing access to the object
- * @exception SQLException on error
- * @deprecated As of 8.3, replaced by {@link #open(long, int)}
- */
- public LargeObject open(int oid, int mode) throws SQLException
- {
- return open((long)oid,mode,false);
- }
-
- /**
- * This opens an existing large object, same as previous method,
- * but commits the transaction on close if asked
- * @param oid of large object
- * @param mode mode of open
- * @param commitOnClose commit the transaction when this LOB will be closed
- * @return LargeObject instance providing access to the object
- * @exception SQLException on error
- */
-
- public LargeObject open(int oid, int mode, boolean commitOnClose) throws SQLException
- {
- return open((long)oid,mode,commitOnClose);
- }
-
- /**
- * This opens an existing large object, based on its OID
- *
- * @param oid of large object
- * @param mode mode of open
- * @return LargeObject instance providing access to the object
- * @exception SQLException on error
- */
- public LargeObject open(long oid, int mode) throws SQLException
- {
- return open((long)oid,mode,false);
- }
-
- /**
- * This opens an existing large object, based on its OID
- *
- * @param oid of large object
- * @param mode mode of open
- * @param commitOnClose commit the transaction when this LOB will be closed
- * @return LargeObject instance providing access to the object
- * @exception SQLException on error
- */
- public LargeObject open(long oid, int mode, boolean commitOnClose) throws SQLException
- {
- if (conn.getAutoCommit())
- throw new PSQLException(GT.tr("Large Objects may not be used in auto-commit mode."),
- PSQLState.NO_ACTIVE_SQL_TRANSACTION);
- return new LargeObject(fp, oid, mode, conn, commitOnClose);
- }
-
- /**
- * This creates a large object, returning its OID.
- *
- * <p>It defaults to READWRITE for the new object's attributes.
- *
- * @return oid of new object
- * @exception SQLException on error
- * @deprecated As of 8.3, replaced by {@link #createLO()}
- */
- public int create() throws SQLException
- {
- return create(READWRITE);
- }
-
- /**
- * This creates a large object, returning its OID.
- *
- * <p>It defaults to READWRITE for the new object's attributes.
- *
- * @return oid of new object
- */
- public long createLO() throws SQLException
- {
- return createLO(READWRITE);
- }
-
- /**
- * This creates a large object, returning its OID
- *
- * @param mode a bitmask describing different attributes of the new object
- * @return oid of new object
- * @exception SQLException on error
- */
- public long createLO(int mode) throws SQLException
- {
- if (conn.getAutoCommit())
- throw new PSQLException(GT.tr("Large Objects may not be used in auto-commit mode."),
- PSQLState.NO_ACTIVE_SQL_TRANSACTION);
- FastpathArg args[] = new FastpathArg[1];
- args[0] = new FastpathArg(mode);
- return fp.getOID("lo_creat", args);
- }
-
- /**
- * This creates a large object, returning its OID
- *
- * @param mode a bitmask describing different attributes of the new object
- * @return oid of new object
- * @exception SQLException on error
- * @deprecated As of 8.3, replaced by {@link #createLO(int)}
- */
- public int create(int mode) throws SQLException
- {
- long oid = createLO(mode);
- return (int)oid;
- }
-
- /**
- * This deletes a large object.
- *
- * @param oid describing object to delete
- * @exception SQLException on error
- */
- public void delete(long oid) throws SQLException
- {
- FastpathArg args[] = new FastpathArg[1];
- args[0] = Fastpath.createOIDArg(oid);
- fp.fastpath("lo_unlink", false, args);
- }
-
- /**
- * This deletes a large object.
- *
- * <p>It is identical to the delete method, and is supplied as the C API uses
- * unlink.
- *
- * @param oid describing object to delete
- * @exception SQLException on error
- * @deprecated As of 8.3, replaced by {@link #unlink(long)}
- */
- public void unlink(int oid) throws SQLException
- {
- delete((long)oid);
- }
-
- /**
- * This deletes a large object.
- *
- * <p>It is identical to the delete method, and is supplied as the C API uses
- * unlink.
- *
- * @param oid describing object to delete
- * @exception SQLException on error
- */
- public void unlink(long oid) throws SQLException
- {
- delete(oid);
- }
-
- /**
- * This deletes a large object.
- *
- * @param oid describing object to delete
- * @exception SQLException on error
- * @deprecated As of 8.3, replaced by {@link #delete(long)}
- */
- public void delete(int oid) throws SQLException
- {
- delete((long)oid);
- }
-
-}
diff --git a/org/postgresql/ssl/.gitignore b/org/postgresql/ssl/.gitignore
deleted file mode 100644
index 1c58860..0000000
--- a/org/postgresql/ssl/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-MakeSSL.java
diff --git a/org/postgresql/ssl/MakeSSL.java.in b/org/postgresql/ssl/MakeSSL.java.in
deleted file mode 100644
index 8aaea8c..0000000
--- a/org/postgresql/ssl/MakeSSL.java.in
+++ /dev/null
@@ -1,18 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ssl;
-
-
-
-public class MakeSSL extends @MAKE_SSL_CLASS@
-{
-
-}
-
-
-
diff --git a/org/postgresql/ssl/NonValidatingFactory.java b/org/postgresql/ssl/NonValidatingFactory.java
deleted file mode 100644
index e6fb242..0000000
--- a/org/postgresql/ssl/NonValidatingFactory.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ssl;
-
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-import java.security.cert.X509Certificate;
-import java.security.GeneralSecurityException;
-
-/**
- * Provide a SSLSocketFactory that allows SSL connections to be
- * made without validating the server's certificate. This is more
- * convenient for some applications, but is less secure as it allows
- * "man in the middle" attacks.
- */
-public class NonValidatingFactory extends WrappedFactory {
-
- /**
- * We provide a constructor that takes an unused argument solely
- * because the ssl calling code will look for this constructor
- * first and then fall back to the no argument constructor, so
- * we avoid an exception and additional reflection lookups.
- */
- public NonValidatingFactory(String arg) throws GeneralSecurityException {
- SSLContext ctx = SSLContext.getInstance("TLS"); // or "SSL" ?
-
- ctx.init(null,
- new TrustManager[] { new NonValidatingTM() },
- null);
-
- _factory = ctx.getSocketFactory();
- }
-
- public static class NonValidatingTM implements X509TrustManager {
-
- public X509Certificate[] getAcceptedIssuers() {
- return new X509Certificate[0];
- }
-
- public void checkClientTrusted(X509Certificate[] certs, String authType) {
- }
-
- public void checkServerTrusted(X509Certificate[] certs, String authType) {
- }
- }
-
-}
-
diff --git a/org/postgresql/ssl/WrappedFactory.java b/org/postgresql/ssl/WrappedFactory.java
deleted file mode 100644
index 453596b..0000000
--- a/org/postgresql/ssl/WrappedFactory.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ssl;
-
-import java.io.IOException;
-import java.net.Socket;
-import java.net.InetAddress;
-
-import javax.net.ssl.SSLSocketFactory;
-
-/**
- * Provide a wrapper to a real SSLSocketFactory delegating all calls
- * to the contained instance. A subclass needs only provide a
- * constructor for the wrapped SSLSocketFactory.
- */
-public abstract class WrappedFactory extends SSLSocketFactory {
-
- protected SSLSocketFactory _factory;
-
- public Socket createSocket(InetAddress host, int port) throws IOException {
- return _factory.createSocket(host, port);
- }
-
- public Socket createSocket(String host, int port) throws IOException {
- return _factory.createSocket(host, port);
- }
-
- public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException {
- return _factory.createSocket(host, port, localHost, localPort);
- }
-
- public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException {
- return _factory.createSocket(address, port, localAddress, localPort);
- }
-
- public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException {
- return _factory.createSocket(socket, host, port, autoClose);
- }
-
- public String[] getDefaultCipherSuites() {
- return _factory.getDefaultCipherSuites();
- }
-
- public String[] getSupportedCipherSuites() {
- return _factory.getSupportedCipherSuites();
- }
-
-}
diff --git a/org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java b/org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java
deleted file mode 100644
index a5ae634..0000000
--- a/org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ssl.jdbc3;
-
-import java.util.Properties;
-import java.io.IOException;
-import java.net.Socket;
-import java.lang.reflect.Constructor;
-
-import javax.net.ssl.SSLSocketFactory;
-
-import org.postgresql.core.PGStream;
-import org.postgresql.core.Logger;
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLState;
-import org.postgresql.util.PSQLException;
-
-public class AbstractJdbc3MakeSSL {
- public static void convert(PGStream stream, Properties info, Logger logger) throws IOException, PSQLException {
- logger.debug("converting regular socket connection to ssl");
-
- SSLSocketFactory factory;
-
- // Use the default factory if no specific factory is requested
- //
- String classname = info.getProperty("sslfactory");
- if (classname == null)
- {
- factory = (SSLSocketFactory)SSLSocketFactory.getDefault();
- }
- else
- {
- Object[] args = {info.getProperty("sslfactoryarg")};
- Constructor ctor;
- Class factoryClass;
-
- try
- {
- factoryClass = Class.forName(classname);
- try
- {
- ctor = factoryClass.getConstructor(new Class[]{String.class});
- }
- catch (NoSuchMethodException nsme)
- {
- ctor = factoryClass.getConstructor((Class[])null);
- args = null;
- }
- factory = (SSLSocketFactory)ctor.newInstance(args);
- }
- catch (Exception e)
- {
- throw new PSQLException(GT.tr("The SSLSocketFactory class provided {0} could not be instantiated.", classname), PSQLState.CONNECTION_FAILURE, e);
- }
- }
-
- Socket newConnection = factory.createSocket(stream.getSocket(), stream.getHostSpec().getHost(), stream.getHostSpec().getPort(), true);
- stream.changeSocket(newConnection);
- }
-
-}
-
-
diff --git a/org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java b/org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java
deleted file mode 100644
index b4ebd89..0000000
--- a/org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.ssl.jdbc4;
-
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Properties;
-
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.SSLSocket;
-import javax.net.ssl.SSLSocketFactory;
-
-import org.postgresql.core.Logger;
-import org.postgresql.core.PGStream;
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-public class AbstractJdbc4MakeSSL {
-
- /**
- * Instantiates a class using the appropriate constructor.
- * If a constructor with a single Propertiesparameter exists, it is
- * used. Otherwise, if tryString is true a constructor with
- * a single String argument is searched if it fails, or tryString is true
- * a no argument constructor is tried.
- * @param classname Nam of the class to instantiate
- * @param info parameter to pass as Properties
- * @param tryString weather to look for a single String argument constructor
- * @param stringarg parameter to pass as String
- * @return the instantiated class
- * @throws ClassNotFoundException
- * @throws SecurityException
- * @throws NoSuchMethodException
- * @throws IllegalArgumentException
- * @throws InstantiationException
- * @throws IllegalAccessException
- * @throws InvocationTargetException
- */
- public static Object instantiate(String classname, Properties info, boolean tryString, String stringarg)
- throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException,
- InstantiationException, IllegalAccessException, InvocationTargetException
- {
- Object[] args = {info};
- Constructor ctor = null;
- Class cls;
- cls = Class.forName(classname);
- try
- {
- ctor = cls.getConstructor(new Class[]{Properties.class});
- }
- catch (NoSuchMethodException nsme)
- {
- if (tryString)
- {
- try
- {
- ctor = cls.getConstructor(new Class[]{String.class});
- args = new String[]{stringarg};
- }
- catch (NoSuchMethodException nsme2)
- {
- tryString = false;
- }
- }
- if (!tryString)
- {
- ctor = cls.getConstructor((Class[])null);
- args = null;
- }
- }
- return ctor.newInstance(args);
- }
-
- public static void convert(PGStream stream, Properties info, Logger logger) throws PSQLException, IOException {
- logger.debug("converting regular socket connection to ssl");
-
- SSLSocketFactory factory;
-
- String sslmode = info.getProperty("sslmode");
- // Use the default factory if no specific factory is requested
- // unless sslmode is set
- String classname = info.getProperty("sslfactory");
- if (classname == null)
- {
- //If sslmode is set, use the libp compatible factory
- if (sslmode!=null)
- {
- factory = new LibPQFactory(info);
- }
- else
- {
- factory = (SSLSocketFactory)SSLSocketFactory.getDefault();
- }
- }
- else
- {
- try
- {
- factory = (SSLSocketFactory)instantiate(classname, info, true, info.getProperty("sslfactoryarg"));
- }
- catch (Exception e)
- {
- throw new PSQLException(GT.tr("The SSLSocketFactory class provided {0} could not be instantiated.", classname), PSQLState.CONNECTION_FAILURE, e);
- }
- }
-
- SSLSocket newConnection;
- try
- {
- newConnection = (SSLSocket)factory.createSocket(stream.getSocket(), stream.getHostSpec().getHost(), stream.getHostSpec().getPort(), true);
- newConnection.startHandshake(); //We must invoke manually, otherwise the exceptions are hidden
- }
- catch (IOException ex) {
- if (factory instanceof LibPQFactory)
- { //throw any KeyManager exception
- ((LibPQFactory)factory).throwKeyManagerException();
- }
- throw new PSQLException(GT.tr("SSL error: {0}", ex.getMessage()), PSQLState.CONNECTION_FAILURE, ex);
- }
-
- String sslhostnameverifier = info.getProperty("sslhostnameverifier");
- if (sslhostnameverifier!=null)
- {
- HostnameVerifier hvn;
- try
- {
- hvn = (HostnameVerifier)instantiate(sslhostnameverifier, info, false, null);
- }
- catch (Exception e)
- {
- throw new PSQLException(GT.tr("The HostnameVerifier class provided {0} could not be instantiated.", sslhostnameverifier), PSQLState.CONNECTION_FAILURE, e);
- }
- if (!hvn.verify(stream.getHostSpec().getHost(), newConnection.getSession()))
- {
- throw new PSQLException(GT.tr("The hostname {0} could not be verified by hostnameverifier {1}.", new Object[]{stream.getHostSpec().getHost(), sslhostnameverifier}), PSQLState.CONNECTION_FAILURE);
- }
- } else {
- if ("verify-full".equals(sslmode) && factory instanceof LibPQFactory)
- {
- if (!(((LibPQFactory)factory).verify(stream.getHostSpec().getHost(), newConnection.getSession())))
- {
- throw new PSQLException(GT.tr("The hostname {0} could not be verified.", stream.getHostSpec().getHost()), PSQLState.CONNECTION_FAILURE);
- }
- }
-
- }
- stream.changeSocket(newConnection);
- }
-
-}
-
-
diff --git a/org/postgresql/ssl/jdbc4/LazyKeyManager.java b/org/postgresql/ssl/jdbc4/LazyKeyManager.java
deleted file mode 100644
index 8da2d72..0000000
--- a/org/postgresql/ssl/jdbc4/LazyKeyManager.java
+++ /dev/null
@@ -1,247 +0,0 @@
-package org.postgresql.ssl.jdbc4;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.Socket;
-import java.security.AlgorithmParameters;
-import java.security.GeneralSecurityException;
-import java.security.Key;
-import java.security.KeyFactory;
-import java.security.NoSuchAlgorithmException;
-import java.security.Principal;
-import java.security.PrivateKey;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.KeySpec;
-import java.security.spec.PKCS8EncodedKeySpec;
-import java.util.Collection;
-
-import javax.crypto.Cipher;
-import javax.crypto.EncryptedPrivateKeyInfo;
-import javax.crypto.NoSuchPaddingException;
-import javax.crypto.SecretKeyFactory;
-import javax.crypto.spec.PBEKeySpec;
-import javax.net.ssl.X509KeyManager;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import javax.security.auth.x500.X500Principal;
-
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * A Key manager that only loads the keys, if necessary.
- *
- */
-public class LazyKeyManager implements X509KeyManager {
- private X509Certificate[] cert = null;
- private PrivateKey key = null;
- private String certfile;
- private String keyfile;
- private CallbackHandler cbh;
- private boolean defaultfile;
- private PSQLException error = null;
-
- /**
- * Constructor. certfile and keyfile can be null, in that case no
- * certificate is presented to the server.
- * @param certfile
- * @param keyfile
- * @param cbh
- * @param defaultfile
- */
- public LazyKeyManager(String certfile, String keyfile, CallbackHandler cbh, boolean defaultfile) {
- this.certfile = certfile;
- this.keyfile = keyfile;
- this.cbh = cbh;
- this.defaultfile = defaultfile;
- }
-
- /**
- * getCertificateChain and getPrivateKey cannot throw exeptions,
- * therefore any exception is stored in this.error and can be raised
- * by this method
- * @throws PSQLException
- */
- public void throwKeyManagerException() throws PSQLException
- {
- if (error!=null) throw error;
- }
-
- public String chooseClientAlias(String[] keyType, Principal[] issuers,
- Socket socket) {
- if (certfile==null)
- {
- return null;
- } else {
- if (issuers==null || issuers.length==0)
- { //Postgres 8.4 and earlier do not send the list of accepted certificate authorities
- //to the client. See BUG #5468. We only hope, that our certificate will be accepted.
- return "user";
- } else { //Sending a wrong certificate makes the connection rejected, even, if clientcert=0 in pg_hba.conf.
- //therefore we only send our certificate, if the issuer is listed in issuers
- X509Certificate[] certchain = getCertificateChain("user");
- if (certchain==null)
- {
- return null;
- } else {
- X500Principal ourissuer = certchain[certchain.length-1].getIssuerX500Principal();
- boolean found = false;
- for (int i=0; i<issuers.length; i++)
- {
- if (ourissuer.equals(issuers[i])) { found = true;}
- }
- return (found ? "user" : null);
- }
- }
- }
- }
-
- public String chooseServerAlias(String keyType, Principal[] issuers,
- Socket socket) {
- return null; //We are not a server
- }
-
- public X509Certificate[] getCertificateChain(String alias) {
- if (cert==null && certfile!=null) //If certfile is null, we do not load the certificate
- { //The certificate must be loaded
- CertificateFactory cf;
- try
- {
- cf = CertificateFactory.getInstance("X.509");
- } catch (CertificateException ex)
- { //For some strange reason it throws CertificateException instead of NoSuchAlgorithmException...
- error = new PSQLException(GT.tr("Could not find a java cryptographic algorithm: X.509 CertificateFactory not available.", null), PSQLState.CONNECTION_FAILURE, ex);
- return null;
- }
- Collection certs;
- try
- {
- certs = cf.generateCertificates(new FileInputStream(certfile));
- } catch (FileNotFoundException ioex)
- {
- if (!defaultfile)
- { //It is not an error if there is no file at the default location
- error = new PSQLException(GT.tr("Could not open SSL certificate file {0}.", new Object[]{certfile}), PSQLState.CONNECTION_FAILURE, ioex);
- }
- return null;
- }catch (CertificateException gsex)
- {
- error = new PSQLException(GT.tr("Loading the SSL certificate {0} into a KeyManager failed.", new Object[]{certfile}), PSQLState.CONNECTION_FAILURE, gsex);
- return null;
- }
- cert = (X509Certificate[]) certs.toArray(new X509Certificate[certs.size()]);
- }
- return cert;
- }
-
- public String[] getClientAliases(String keyType, Principal[] issuers) {
- String alias = chooseClientAlias(new String[]{keyType}, issuers, (Socket)null);
- return (alias==null ? new String[]{} : new String[]{alias});
- }
-
- public PrivateKey getPrivateKey(String alias) {
- try
- {
- if (key==null && keyfile!=null) //If keyfile is null, we do not load the key
- { //The private key must be loaded
- if (cert==null)
- { //We need the certificate for the algorithm
- if(getCertificateChain("user")==null)
- return null; //getCertificateChain failed...
- }
- File keyf = new File(keyfile);
- FileInputStream fl;
- try
- {
- fl = new FileInputStream(keyfile);
- }
- catch (FileNotFoundException ex)
- {
- if (!defaultfile)
- { //It is not an error if there is no file at the default location
- throw ex;
- }
- return null;
- }
- byte[] keydata = new byte[(int)keyf.length()];
- fl.read ( keydata, 0, (int)keyf.length() );
- fl.close();
- KeyFactory kf = KeyFactory.getInstance(cert[0].getPublicKey().getAlgorithm());
- try {
- KeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec (keydata);
- key = kf.generatePrivate (pkcs8KeySpec);
- }
- catch (InvalidKeySpecException ex) //The key might be password protected
- {
- EncryptedPrivateKeyInfo ePKInfo = new EncryptedPrivateKeyInfo(keydata);
- Cipher cipher;
- try
- {
- cipher = Cipher.getInstance(ePKInfo.getAlgName());
- } catch (NoSuchPaddingException npex)
- { //Why is it not a subclass of NoSuchAlgorithmException?
- throw new NoSuchAlgorithmException(npex.getMessage(),npex);
- }
- //We call back for the password
- PasswordCallback pwdcb = new PasswordCallback(GT.tr("Enter SSL password: "), false);
- try
- {
- cbh.handle(new Callback[]{pwdcb});
- } catch (UnsupportedCallbackException ucex)
- {
- if ((cbh instanceof LibPQFactory.ConsoleCallbackHandler) && ("Console is not available".equals(ucex.getMessage())))
- {
- error = new PSQLException(GT.tr("Could not read password for SSL key file, console is not available.", null), PSQLState.CONNECTION_FAILURE, ucex);
- } else {
- error = new PSQLException(GT.tr("Could not read password for SSL key file by callbackhandler {0}.", new Object[]{cbh.getClass().getName()}), PSQLState.CONNECTION_FAILURE, ucex);
- }
- return null;
- }
- try
- {
- PBEKeySpec pbeKeySpec = new PBEKeySpec(pwdcb.getPassword());
- // Now create the Key from the PBEKeySpec
- SecretKeyFactory skFac = SecretKeyFactory.getInstance(ePKInfo.getAlgName());
- Key pbeKey = skFac.generateSecret(pbeKeySpec);
- // Extract the iteration count and the salt
- AlgorithmParameters algParams = ePKInfo.getAlgParameters();
- cipher.init(Cipher.DECRYPT_MODE, pbeKey, algParams);
- // Decrypt the encryped private key into a PKCS8EncodedKeySpec
- KeySpec pkcs8KeySpec = ePKInfo.getKeySpec(cipher);
- key = kf.generatePrivate (pkcs8KeySpec);
- }
- catch (GeneralSecurityException ikex)
- {
- error = new PSQLException(GT.tr("Could not decrypt SSL key file {0}.", new Object[]{keyfile}), PSQLState.CONNECTION_FAILURE, ikex);
- return null;
- }
- }
- }
- }
- catch (IOException ioex)
- {
- error = new PSQLException(GT.tr("Could not read SSL key file {0}.", new Object[]{keyfile}), PSQLState.CONNECTION_FAILURE, ioex);
- }
- catch(NoSuchAlgorithmException ex)
- {
- error = new PSQLException(GT.tr("Could not find a java cryptographic algorithm: {0}.", new Object[]{ex.getMessage()}), PSQLState.CONNECTION_FAILURE, ex);
- return null;
- }
-
- return key;
- }
-
- public String[] getServerAliases(String keyType, Principal[] issuers) {
- return new String[]{};
- }
-
-
-}
diff --git a/org/postgresql/ssl/jdbc4/LibPQFactory.java b/org/postgresql/ssl/jdbc4/LibPQFactory.java
deleted file mode 100644
index be474be..0000000
--- a/org/postgresql/ssl/jdbc4/LibPQFactory.java
+++ /dev/null
@@ -1,291 +0,0 @@
-package org.postgresql.ssl.jdbc4;
-
-import java.io.Console;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.security.GeneralSecurityException;
-import java.security.KeyManagementException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
-import java.util.Iterator;
-import java.util.Properties;
-
-import javax.naming.InvalidNameException;
-import javax.naming.ldap.LdapName;
-import javax.naming.ldap.Rdn;
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.KeyManager;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLPeerUnverifiedException;
-import javax.net.ssl.SSLSession;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.TrustManagerFactory;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import javax.security.auth.x500.X500Principal;
-
-import org.postgresql.ssl.NonValidatingFactory.NonValidatingTM;
-import org.postgresql.ssl.WrappedFactory;
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-/**
- * Provide an SSLSocketFactory that is compatible with the libpq
- * behaviour.
- */
-public class LibPQFactory extends WrappedFactory implements HostnameVerifier {
-
- LazyKeyManager km = null;
- String sslmode;
- /**
- *
- * @param info the connection parameters
- * The following parameters are used:
- * sslmode,sslcert,sslkey,sslrootcert,sslhostnameverifier,sslpasswordcallback,sslpassword
- * @throws GeneralSecurityException
- * @throws IOException
- * @throws UnsupportedCallbackException
- */
- public LibPQFactory(Properties info) throws PSQLException {
- try
- {
- sslmode = info.getProperty("sslmode");
- SSLContext ctx = SSLContext.getInstance("TLS"); // or "SSL" ?
-
- //Determinig the default file location
- String pathsep = System.getProperty("path.separator");
- String defaultdir;
- boolean defaultfile = false;
- if (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1)
- { //It is Windows
- defaultdir = System.getenv("APPDATA")+pathsep+"postgresql"+pathsep;
- } else {
- defaultdir = System.getProperty("user.home")+pathsep+".postgresql"+pathsep;
- }
-
- //Load the client's certificate and key
- String sslcertfile = info.getProperty("sslcert");
- if (sslcertfile == null)
- { //Fall back to default
- defaultfile = true;
- sslcertfile = defaultdir + "postgresql.crt";
- }
- String sslkeyfile = info.getProperty("sslkey");
- if (sslkeyfile == null)
- { //Fall back to default
- defaultfile = true;
- sslkeyfile = defaultdir + "postgresql.pk8";
- }
-
- //Determine the callback handler
- CallbackHandler cbh;
- String sslpasswordcallback = info.getProperty("sslpasswordcallback");
- if (sslpasswordcallback != null)
- {
- try
- {
- cbh = (CallbackHandler)AbstractJdbc4MakeSSL.instantiate(sslpasswordcallback, info, false, null);
- }
- catch (Exception e)
- {
- throw new PSQLException(GT.tr("The password callback class provided {0} could not be instantiated.", sslpasswordcallback), PSQLState.CONNECTION_FAILURE, e);
- }
- } else {
- cbh = new ConsoleCallbackHandler(info.getProperty("sslpassword"));
- }
-
- //If the properies are empty, give null to prevent client key selection
- km = new LazyKeyManager(("".equals(sslcertfile) ? null : sslcertfile), ("".equals(sslkeyfile) ? null : sslkeyfile), cbh, defaultfile);
-
- TrustManager[] tm;
- if("verify-ca".equals(sslmode) || "verify-full".equals(sslmode))
- {
- //Load the server certificate
-
- TrustManagerFactory tmf = TrustManagerFactory.getInstance("PKIX");
- KeyStore ks;
- try
- {
- ks = KeyStore.getInstance("jks");
- } catch (KeyStoreException e)
- {
- throw new NoSuchAlgorithmException("jks KeyStore not available"); //this should never happen
- }
- String sslrootcertfile = info.getProperty("sslrootcert");
- if (sslrootcertfile == null)
- { //Fall back to default
- sslrootcertfile = defaultdir + "root.crt";
- }
- FileInputStream fis;
- try
- {
- fis = new FileInputStream(sslrootcertfile);
- } catch (FileNotFoundException ex)
- {
- throw new PSQLException(GT.tr("Could not open SSL root certificate file {0}.", new Object[]{sslrootcertfile}), PSQLState.CONNECTION_FAILURE, ex);
- }
- try
- {
- CertificateFactory cf = CertificateFactory.getInstance("X.509");
- //Certificate[] certs = cf.generateCertificates(fis).toArray(new Certificate[]{}); //Does not work in java 1.4
- Object[] certs = cf.generateCertificates(fis).toArray(new Certificate[]{});
- fis.close();
- ks.load(null, null);
- for(int i=0; i<certs.length; i++)
- {
- ks.setCertificateEntry("cert"+i, (Certificate)certs[i]);
- }
- tmf.init(ks);
- }
- catch (IOException ioex)
- {
- throw new PSQLException(GT.tr("Could not read SSL root certificate file {0}.", new Object[]{sslrootcertfile}), PSQLState.CONNECTION_FAILURE, ioex);
- } catch (GeneralSecurityException gsex)
- {
- throw new PSQLException(GT.tr("Loading the SSL root certificate {0} into a TrustManager failed.", new Object[]{sslrootcertfile}), PSQLState.CONNECTION_FAILURE, gsex);
- }
- tm = tmf.getTrustManagers();
- } else { //server validation is not required
- tm = new TrustManager[] { new NonValidatingTM() };
- }
-
- //finally we can initialize the context
- try
- {
- ctx.init(new KeyManager[]{km}, tm, null);
- } catch (KeyManagementException ex)
- {
- throw new PSQLException(GT.tr("Could not initialize SSL context.", null), PSQLState.CONNECTION_FAILURE, ex);
- }
-
- _factory = ctx.getSocketFactory();
- }
- catch(NoSuchAlgorithmException ex)
- {
- throw new PSQLException(GT.tr("Could not find a java cryptographic algorithm: {0}.", new Object[]{ex.getMessage()}), PSQLState.CONNECTION_FAILURE, ex);
- }
- }
-
- /**
- * Propagates any exception from LazyKeyManager
- * @throws PSQLException
- */
- public void throwKeyManagerException() throws PSQLException
- {
- if (km!=null) km.throwKeyManagerException();
- }
-
- /**
- * A CallbackHandler that reads the password from the console
- * or returns the password given to it's constructor.
- *
- */
- class ConsoleCallbackHandler implements CallbackHandler {
-
- private char[] password = null;
-
- public ConsoleCallbackHandler(String password)
- {
- if (password != null) this.password = password.toCharArray();
- }
-
- /**
- * Handles the callbacks.
- * @param callbacks The callbacks to handle
- * @throws UnsupportedCallbackException If the console is not available
- * or other than PasswordCallback is supplied
- */
- public void handle(Callback[] callbacks) throws IOException,
- UnsupportedCallbackException {
- Console cons = System.console();
- if (cons==null && password==null) {throw new UnsupportedCallbackException(callbacks[0], "Console is not available");}
- for (int i=0; i<callbacks.length; i++)
- {
- if (callbacks[i] instanceof PasswordCallback)
- {
- if (password==null)
- {
- //It is used instead of cons.readPassword(prompt), because the prompt may contain '%' characters
- ((PasswordCallback)callbacks[i]).setPassword(cons.readPassword("%s", new Object[]{((PasswordCallback)callbacks[i]).getPrompt()}));
- } else {
- ((PasswordCallback)callbacks[i]).setPassword(password);
- }
- } else {
- throw new UnsupportedCallbackException(callbacks[i]);
- }
- }
-
- }
- }
-
- /**
- * Verifies the server certificate according to the libpq rules.
- * The cn attribute of the certificate is matched against the hostname.
- * If the cn attribute starts with an asterisk (*), it will be treated as a wildcard,
- * and will match all characters except a dot (.). This means the certificate
- * will not match subdomains. If the connection is made using an IP address instead of a
- * hostname, the IP address will be matched (without doing any DNS lookups).
- * @param hostname Hostname or IP address of the server.
- * @param session The SSL session.
- * @returns true if the certificate belongs to the server, false otherwise.
- */
- public boolean verify(String hostname, SSLSession session) {
- X509Certificate[] peerCerts;
- try
- {
- peerCerts = (X509Certificate[])session.getPeerCertificates();
- } catch (SSLPeerUnverifiedException e)
- {
- return false;
- }
- if (peerCerts == null || peerCerts.length == 0) {
- return false;
- }
- //Extract the common name
- X509Certificate serverCert = peerCerts[0];
- LdapName DN;
- try
- {
- DN = new LdapName(serverCert.getSubjectX500Principal().getName(X500Principal.RFC2253));
- } catch (InvalidNameException e)
- {
- return false;
- }
- String CN = null;
- Iterator it = DN.getRdns().iterator();
- //for(Rdn rdn : DN.getRdns())
- while(it.hasNext())
- {
- Rdn rdn = (Rdn)it.next();
- if ("CN".equals(rdn.getType())) //Multiple AVAs are not treated
- {
- CN = (String)rdn.getValue();
- break;
- }
- }
- if (CN == null)
- {
- return false;
- } else if (CN.startsWith("*"))
- { //We have a wildcard
- if (hostname.endsWith(CN.substring(1)))
- { //Avoid IndexOutOfBoundsException because hostname already ends with CN
- return !(hostname.substring(0, hostname.length()-CN.length()+1).contains("."));
- } else {
- return false;
- }
- } else {
- return CN.equals(hostname);
- }
- }
-
-}
-
diff --git a/org/postgresql/test/.gitignore b/org/postgresql/test/.gitignore
deleted file mode 100644
index 0a319f1..0000000
--- a/org/postgresql/test/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-VersionInfo.java
diff --git a/org/postgresql/test/README b/org/postgresql/test/README
deleted file mode 100644
index fb55ef6..0000000
--- a/org/postgresql/test/README
+++ /dev/null
@@ -1,310 +0,0 @@
-PostgreSQL/JDBC Test Suite Howto
-================================
-1 Introduction
-2 Installation
-3 Configuration
-4 Running the test suite
-5 Extending the test suite with new tests
-6 Guidelines for developing new tests
-7 Example
-8 Running the JDBC 2 test suite from Sun against PostgreSQL
-9 Credits, feedback
-
-
-1 Introduction
---------------
-The PostgreSQL source tree contains an automated test suite for
-the JDBC driver. This document explains how to install,
-configure and run this test suite. Furthermore, it offers
-guidelines and an example for developers to add new test cases.
-
-Sun provides two standard JDBC test suites that you may also
-find useful.
-http://java.sun.com/products/jdbc/download2.html (JDBC 1)
-http://java.sun.com/products/jdbc/jdbctestsuite-1_2_1.html (JDBC
-2, including J2EE requirements)
-The JDBC 2 test suite is covered in section 8 below. The JDBC 1
-test suite is not currently covered in this document.
-
-2 Installation
---------------
-Of course, you need to have a Java 2 JDK or JRE installed. The
-standard JDK from Sun is OK. You can download it from
-http://java.sun.com/.
-
-You need to install the Ant build utility. You can download it
-from http://jakarta.apache.org/ant/.
-
-You also need to install the JUnit testing framework. You can
-download it from http://www.junit.org/. Add junit.jar to your
-CLASSPATH before you perform the following steps. Ant will
-dynamically detect that JUnit is present and then build the JDBC
-test suite.
-
-You need to install and build the PostgreSQL JDBC driver source
-tree. You can download it from http://jdbc.postgresql.org/. See
-README in the top of the tree for more information.
-
-In this Howto we'll use $JDBC_SRC to refer to the top-level directory
-of the JDBC driver source tree. The test suite is located in the
-subdirectory $JDBC_SRC/org/postgresql/test.
-
-3 Configuration
----------------
-The test suite requires a PostgreSQL database to run the tests against
-and a user to login as. The tests will create and drop many objects in
-this database, so it should not contain production tables to avoid
-loss of data. We recommend you assign the following names:
-
- database: test
- username: test
- password: password
-
-These names correspond with the default names set for the test suite
-in $JDBC_SRC/build.xml. If you have chosen other names you need to
-create a file named $JDBC_SRC/build.local.properties and add your
-customized values of the properties "database", "username" and
-"password".
-
-4 Running the test suite
-------------------------
-%cd $JDBC_SRC
-%ant test
-
-This will run the command line version of JUnit. If you'd like
-to see an animated coloured progress bar as the tests are
-executed, you may want to use one of the GUI versions of the
-test runner. See the JUnit documentation for more information.
-
-If the test suite reports errors or failures that you cannot
-explain, please post the relevant parts of the output to the
-mailing list pgsql-jdbc at postgresql.org.
-
-5 Extending the test suite with new tests
------------------------------------------
-If you're not familiar with JUnit, we recommend that you
-first read the introductory article "JUnit Test Infected:
-Programmers Love Writing Tests" on
-http://junit.sourceforge.net/doc/testinfected/testing.htm.
-Before continuing, you should ensure you understand the
-following concepts: test suite, test case, test, fixture,
-assertion, failure.
-
-The test suite consists of test cases, which consist of tests.
-A test case is a collection of tests that test a particular
-feature. The test suite is a collection of test cases that
-together test the driver - and to an extent the PostgreSQL
-backend - as a whole.
-
-If you decide to add a test to an existing test case, all you
-need to do is add a method with a name that begins with "test"
-and which takes no arguments. JUnit will dynamically find this
-method using reflection and run it when it runs the test case.
-In your test method you can use the fixture that is setup for it
-by the test case.
-
-If you decide to add a new test case, you should do two things:
-1) Add a class that extends junit.framework.TestCase. It should
-contain setUp() and tearDown() methods that create and destroy
-the fixture respectively.
-2) Edit $JDBC_SRC/org/postgresql/test/jdbc2/Jdbc2TestSuite.java or
-$JDBC_SRC/org/postgresql/test/jdbc3/Jdbc3TestSuite.java and add a
-suite.addTestSuite() call for your class. This will make the test case
-part of the test suite.
-
-6 Guidelines for developing new tests
--------------------------------------
-Every test should create and drop its own tables. We suggest to
-consider database objects (e.g. tables) part of the fixture for
-the tests in the test case. The test should also succeed when a
-table by the same name already exists in the test database, e.g.
-by dropping the table before running the test (ignoring errors).
-The recommended pattern for creating and dropping tables can be
-found in the example in section 7 below.
-
-Please note that JUnit provides several convenience methods to
-check for conditions. See the TestCase class in the Javadoc
-documentation of JUnit, which is installed on your system. For
-example, you can compare two integers using
-TestCase.assertEquals(int expected, int actual). This method
-will print both values in case of a failure.
-
-To simply report a failure use TestCase.fail().
-
-The JUnit FAQ explains how to test for a thrown exception.
-
-Avoid the use of the deprecated TestCase.assert(), since it
-collides with the new assert keyword in the Java 2 platform
-version 1.4.
-
-As a rule, the test suite should succeed. Any errors or failures
-- which may be caused by bugs in the JDBC driver, the backend or
-the test suite - should be fixed ASAP. Don't let a test fail
-just to make it clear that something needs to be fixed somewhere.
-That's what the TODO lists are for.
-
-Add some comments to your tests to explain to others what it is
-you're testing. A long sequence of JDBC method calls and JUnit
-assertions can be hard to comprehend.
-
-For example, in the comments you can explain where a certain test
-condition originates from. Is it a JDBC requirement, PostgreSQL
-behaviour or the intended implementation of a feature?
-
-7 Example (incomplete)
-----------------------
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-import java.sql.*;
-
-/*
- * Test case for ...
- */
-public class FooTest extends TestCase {
-
- private Connection con;
- private Statement stmt;
-
- public FooTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- con = TestUtil.openDB();
- stmt = con.createStatement();
-
- // Drop the test table if it already exists for some
- // reason. It is not an error if it doesn't exist.
- try {
- stmt.executeUpdate("DROP TABLE testfoo");
- } catch (SQLException e) {
- // Intentionally ignore. We cannot distinguish
- // "table does not exist" from other errors, since
- // PostgreSQL doesn't support error codes yet.
- }
-
- stmt.executeUpdate(
- "CREATE TABLE testfoo(pk INTEGER, col1 INTEGER)");
- stmt.executeUpdate("INSERT INTO testfoo VALUES(1, 0)");
-
- // You may want to call con.setAutoCommit(false) at
- // this point, if most tests in this test case require
- // the use of transactions.
- }
-
- protected void tearDown() throws Exception {
- con.setAutoCommit(true);
- if (stmt != null) {
- stmt.executeUpdate("DROP TABLE testfoo");
- stmt.close();
- }
- if (con != null) {
- TestUtil.closeDB(con);
- }
- }
-
- public void testFoo() {
- // Use the assert methods in junit.framework.TestCase
- // for the actual tests
-
- // Just some silly examples
- assertNotNull(con);
- if (stmt == null) {
- fail("Where is my statement?");
- }
- }
-
- public void testBar() {
- // Another test.
- }
-}
-
-8. Running the JDBC 2 test suite from Sun against PostgreSQL
-------------------------------------------------------------
-Download the test suite from
-http://java.sun.com/products/jdbc/jdbctestsuite-1_2_1.html
-This is the JDBC 2 test suite that includes J2EE requirements.
-
-1. Configure PostgreSQL so that it accepts TCP/IP connections and
- start the server. Prepare PostgreSQL by creating two users (cts1
- and cts2) and two databases (DB1 and DB2) in the cluster that is
- going to be used for JDBC testing.
-
-2. Download the latest release versions of the J2EE, J2SE, and JDBC
- test suite from Sun's Java site (http://java.sun.com), and install
- according to Sun's documentation.
-
-3. The following environment variables should be set:
-
- CTS_HOME=<path where JDBC test suite installed (eg: /usr/local/jdbccts)>
- J2EE_HOME=<path where J2EE installed (eg: /usr/local/j2sdkee1.2.1)>
- JAVA_HOME=<path where J2SE installed (eg: /usr/local/jdk1.3.1)>
- NO_JAVATEST=Y
- LOCAL_CLASSES=<path to PostgreSQL JDBC driver jar>
-
-4. In $J2EE_HOME/config/default.properties:
-
- jdbc.drivers=org.postgresql.Driver
- jdbc.datasources=jdbc/DB1|jdbc:postgresql://localhost:5432/DB1|jdbc/DB2|jdbc:postgresq://localhost:5432/DB2
-
- Of course, if PostgreSQL is running on a computer different from
- the one running the application server, localhost should be changed
- to the proper host. Also, 5432 should be changed to whatever port
- PostgreSQL is listening on (5432 is the default).
-
- In $J2EE_HOME/bin/userconfig.sh:
-
- Add $CTS_HOME/lib/harness.jar, $CTS_HOME/lib/moo.jar,
- $CTS_HOME/lib/util.jar to J2EE_CLASSPATH. Also add the path to
- the PostgreSQL JDBC jar to J2EE_CLASSPATH. Set the JAVA_HOME
- variable to where you installed the J2SE. You should end up with
- something like this:
-
- CTS_HOME=/home/liams/linux/java/jdbccts
- J2EE_CLASSPATH=/home/liams/work/inst/postgresql-7.1.2/share/java/postgresql.jar:$CTS_HOME/lib/harness.jar:$CTS_HOME/lib/moo.jar:$CTS_HOME/lib/util.jar
- export J2EE_CLASSPATH
-
- JAVA_HOME=/home/liams/linux/java/jdk1.3.1
- export JAVA_HOME
-
- In $CTS_HOME/bin/cts.jte:
-
- webServerHost=localhost
- webServerPort=8000
- servletServerHost=localhost
- servletServerPort=8000
-
-5. Start the application server (j2ee):
-
- $ cd $J2EE_HOME
- $ bin/j2ee -verbose
-
- The server can be stopped after the tests have finished:
-
- $ cd $J2EE_HOME
- $ bin/j2ee -stop
-
-6. Run the JDBC tests:
-
- $ cd $CTS_HOME/tests/jdbc/ee
- $ make jdbc-tests
-
-At the time of writing of this document, a great number of tests
-in this test suite fail.
-
-9 Credits, feedback
--------------------
-The parts of this document describing the PostgreSQL test suite
-were originally written by Rene Pijlman. Liam Stewart contributed
-the section on the Sun JDBC 2 test suite.
-
-Please send your questions about the JDBC test suites or suggestions
-for improvement to the pgsql-jdbc at postgresql.org mailing list.
-
-The source of this document is maintained in
-org/postgresql/test/README in CVS. Patches for
-improvement can be send to the mailing list
-pgsql-jdbc at postgresql.org.
-
diff --git a/org/postgresql/test/TestUtil.java b/org/postgresql/test/TestUtil.java
deleted file mode 100644
index 7c6c612..0000000
--- a/org/postgresql/test/TestUtil.java
+++ /dev/null
@@ -1,440 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.sql.*;
-import java.util.Properties;
-
-import org.postgresql.jdbc2.AbstractJdbc2Connection;
-
-/**
- * Utility class for JDBC tests
- */
-public class TestUtil
-{
- /*
- * Returns the Test database JDBC URL
- */
- public static String getURL()
- {
- String protocolVersion = "";
- if (getProtocolVersion() != 0) {
- protocolVersion = "&protocolVersion=" + getProtocolVersion();
- }
-
- String binaryTransfer = "";
- if (getBinaryTransfer() != null && !getBinaryTransfer().equals("")) {
- binaryTransfer = "&binaryTransfer=" + getBinaryTransfer();
- }
-
- String receiveBufferSize = "";
- if (getReceiveBufferSize() != -1 ){
- receiveBufferSize = "&receiveBufferSize="+getReceiveBufferSize();
- }
-
- String sendBufferSize = "";
- if (getSendBufferSize() != -1 ){
- sendBufferSize = "&sendBufferSize="+getSendBufferSize();
- }
-
- return "jdbc:postgresql://"
- + getServer() + ":"
- + getPort() + "/"
- + getDatabase()
- + "?prepareThreshold=" + getPrepareThreshold()
- + "&loglevel=" + getLogLevel()
- + protocolVersion
- + binaryTransfer
- + receiveBufferSize
- + sendBufferSize;
- }
-
- /*
- * Returns the Test server
- */
- public static String getServer()
- {
- return System.getProperty("server", "localhost");
- }
-
- /*
- * Returns the Test port
- */
- public static int getPort()
- {
- return Integer.parseInt(System.getProperty("port", System.getProperty("def_pgport")));
- }
-
- /*
- * Returns the server side prepared statement threshold.
- */
- public static int getPrepareThreshold()
- {
- return Integer.parseInt(System.getProperty("preparethreshold", "5"));
- }
-
- public static int getProtocolVersion()
- {
- return Integer.parseInt(System.getProperty("protocolVersion", "0"));
- }
-
- /*
- * Returns the Test database
- */
- public static String getDatabase()
- {
- return System.getProperty("database");
- }
-
- /*
- * Returns the Postgresql username
- */
- public static String getUser()
- {
- return System.getProperty("username");
- }
-
- /*
- * Returns the user's password
- */
- public static String getPassword()
- {
- return System.getProperty("password");
- }
-
- /*
- * Returns the log level to use
- */
- public static int getLogLevel()
- {
- return Integer.parseInt(System.getProperty("loglevel", "0"));
- }
-
- /*
- * Returns the binary transfer mode to use
- */
- public static String getBinaryTransfer()
- {
- return System.getProperty("binaryTransfer");
- }
-
- public static int getSendBufferSize()
- {
- return Integer.parseInt(System.getProperty("sendBufferSize", "-1"));
- }
-
- public static int getReceiveBufferSize()
- {
- return Integer.parseInt(System.getProperty("receiveBufferSize","-1"));
- }
-
- private static boolean initialized = false;
- public static void initDriver() throws Exception
- {
- synchronized (TestUtil.class) {
- if (initialized)
- return;
-
- Properties p = new Properties();
- try {
- p.load(new FileInputStream("build.properties"));
- p.load(new FileInputStream("build.local.properties"));
- } catch (IOException ex) {
- // ignore
- }
- p.putAll(System.getProperties());
- System.getProperties().putAll(p);
-
- if (getLogLevel() > 0) {
- // Ant's junit task likes to buffer stdout/stderr and tends to run out of memory.
- // So we put debugging output to a file instead.
- java.io.Writer output = new java.io.FileWriter("postgresql-jdbc-tests.debug.txt", true);
- java.sql.DriverManager.setLogWriter(new java.io.PrintWriter(output,true));
- }
-
- org.postgresql.Driver.setLogLevel(getLogLevel()); // Also loads and registers driver.
- initialized = true;
- }
- }
-
- /*
- * Helper - opens a connection.
- */
- public static java.sql.Connection openDB() throws Exception
- {
- return openDB(new Properties());
- }
-
- /*
- * Helper - opens a connection with the allowance for passing
- * additional parameters, like "compatible".
- */
- public static java.sql.Connection openDB(Properties props) throws Exception
- {
- initDriver();
-
- props.setProperty("user", getUser());
- props.setProperty("password", getPassword());
-
- return DriverManager.getConnection(getURL(), props);
- }
-
- /*
- * Helper - closes an open connection.
- */
- public static void closeDB(Connection con) throws SQLException
- {
- if (con != null)
- con.close();
- }
-
- /*
- * Helper - creates a test table for use by a test
- */
- public static void createTable(Connection con,
- String table,
- String columns) throws SQLException
- {
- // by default we don't request oids.
- createTable(con,table,columns,false);
- }
-
- /*
- * Helper - creates a test table for use by a test
- */
- public static void createTable(Connection con,
- String table,
- String columns,
- boolean withOids) throws SQLException
- {
- Statement st = con.createStatement();
- try
- {
- // Drop the table
- dropTable(con, table);
-
- // Now create the table
- String sql = "CREATE TABLE " + table + " (" + columns + ") ";
-
- // Starting with 8.0 oids may be turned off by default.
- // Some tests need them, so they flag that here.
- if (withOids && haveMinimumServerVersion(con,"8.0")) {
- sql += " WITH OIDS";
- }
- st.executeUpdate(sql);
- }
- finally
- {
- st.close();
- }
- }
-
- /**
- * Helper creates a temporary table
- * @param con Connection
- * @param table String
- * @param columns String
- * @throws SQLException
- */
-
- public static void createTempTable( Connection con,
- String table,
- String columns) throws SQLException
- {
- Statement st = con.createStatement();
- try
- {
- // Drop the table
- dropTable(con, table);
-
- // Now create the table
- st.executeUpdate("create temp table " + table + " (" + columns + ")");
- }
- finally
- {
- st.close();
- }
- }
-
- /*
- * drop a sequence because older versions don't have dependency
- * information for serials
- */
- public static void dropSequence(Connection con, String sequence) throws SQLException
- {
- Statement stmt = con.createStatement();
- try
- {
- String sql = "DROP SEQUENCE " + sequence;
- stmt.executeUpdate(sql);
- }
- catch (SQLException sqle)
- {
- if (!con.getAutoCommit())
- throw sqle;
- }
- }
-
- /*
- * Helper - drops a table
- */
- public static void dropTable(Connection con, String table) throws SQLException
- {
- Statement stmt = con.createStatement();
- try
- {
- String sql = "DROP TABLE " + table;
- if (haveMinimumServerVersion(con, "7.3"))
- {
- sql += " CASCADE ";
- }
- stmt.executeUpdate(sql);
- }
- catch (SQLException ex)
- {
- // Since every create table issues a drop table
- // it's easy to get a table doesn't exist error.
- // we want to ignore these, but if we're in a
- // transaction then we've got trouble
- if (!con.getAutoCommit())
- throw ex;
- }
- }
-
- /*
- * Helper - generates INSERT SQL - very simple
- */
- public static String insertSQL(String table, String values)
- {
- return insertSQL(table, null, values);
- }
-
- public static String insertSQL(String table, String columns, String values)
- {
- String s = "INSERT INTO " + table;
-
- if (columns != null)
- s = s + " (" + columns + ")";
-
- return s + " VALUES (" + values + ")";
- }
-
- /*
- * Helper - generates SELECT SQL - very simple
- */
- public static String selectSQL(String table, String columns)
- {
- return selectSQL(table, columns, null, null);
- }
-
- public static String selectSQL(String table, String columns, String where)
- {
- return selectSQL(table, columns, where, null);
- }
-
- public static String selectSQL(String table, String columns, String where, String other)
- {
- String s = "SELECT " + columns + " FROM " + table;
-
- if (where != null)
- s = s + " WHERE " + where;
- if (other != null)
- s = s + " " + other;
-
- return s;
- }
-
- /*
- * Helper to prefix a number with leading zeros - ugly but it works...
- * @param v value to prefix
- * @param l number of digits (0-10)
- */
- public static String fix(int v, int l)
- {
- String s = "0000000000".substring(0, l) + Integer.toString(v);
- return s.substring(s.length() - l);
- }
-
- public static String escapeString(Connection con, String value) throws SQLException
- {
- if (con instanceof org.postgresql.jdbc2.AbstractJdbc2Connection)
- {
- return ((org.postgresql.jdbc2.AbstractJdbc2Connection)con).escapeString(value);
- }
- return value;
- }
-
- public static boolean getStandardConformingStrings(Connection con)
- {
- if (con instanceof org.postgresql.jdbc2.AbstractJdbc2Connection)
- {
- return ((org.postgresql.jdbc2.AbstractJdbc2Connection)con).getStandardConformingStrings();
- }
- return false;
- }
-
- /**
- * Determine if the given connection is connected to a server with
- * a version of at least the given version.
- * This is convenient because we are working with a java.sql.Connection,
- * not an Postgres connection.
- */
- public static boolean haveMinimumServerVersion(Connection con, String version) throws SQLException {
- if (con instanceof org.postgresql.jdbc2.AbstractJdbc2Connection)
- {
- return ((org.postgresql.jdbc2.AbstractJdbc2Connection)con).haveMinimumServerVersion(version);
- }
- return false;
- }
-
- public static boolean haveMinimumJVMVersion(String version) {
- String jvm = java.lang.System.getProperty("java.version");
- return (jvm.compareTo(version) >= 0);
- }
-
- public static boolean isProtocolVersion( Connection con, int version )
- {
- if ( con instanceof AbstractJdbc2Connection )
- {
- return (version == ((AbstractJdbc2Connection)con).getProtocolVersion());
-
- }
- return false;
- }
- /**
- * Print a ResultSet to System.out.
- * This is useful for debugging tests.
- */
- public static void printResultSet(ResultSet rs) throws SQLException {
- ResultSetMetaData rsmd = rs.getMetaData();
- for (int i = 1; i <= rsmd.getColumnCount(); i++)
- {
- if (i != 1)
- {
- System.out.print(", ");
- }
- System.out.print(rsmd.getColumnName(i));
- }
- System.out.println();
- while (rs.next())
- {
- for (int i = 1; i <= rsmd.getColumnCount(); i++)
- {
- if (i != 1)
- {
- System.out.print(", ");
- }
- System.out.print(rs.getString(i));
- }
- System.out.println();
- }
- }
-}
diff --git a/org/postgresql/test/extensions/ExtensionsSuite.java b/org/postgresql/test/extensions/ExtensionsSuite.java
deleted file mode 100644
index 0b8e4a1..0000000
--- a/org/postgresql/test/extensions/ExtensionsSuite.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2007-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.extensions;
-
-import junit.framework.TestSuite;
-
-import java.sql.*;
-import org.postgresql.test.TestUtil;
-
-/*
- * Executes all known tests for PostgreSQL extensions supported by JDBC driver
- */
-public class ExtensionsSuite extends TestSuite
-{
-
- /*
- * The main entry point for JUnit
- */
- public static TestSuite suite() throws Exception
- {
- Class.forName("org.postgresql.Driver");
- TestSuite suite = new TestSuite();
-
- Connection connection = TestUtil.openDB();
- try
- {
- if (isHStoreEnabled(connection)) {
- suite.addTestSuite(HStoreTest.class);
- }
- }
- finally
- {
- connection.close();
- }
-
- return suite;
- }
-
- /**
- * Not all servers have hstore extensions installed.
- */
- private static boolean isHStoreEnabled(Connection conn) {
- try {
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT 'a=>1'::hstore::text");
- rs.close();
- stmt.close();
- return true;
- } catch (SQLException sqle) {
- return false;
- }
- }
-
-}
-
diff --git a/org/postgresql/test/extensions/HStoreTest.java b/org/postgresql/test/extensions/HStoreTest.java
deleted file mode 100644
index 3f1567c..0000000
--- a/org/postgresql/test/extensions/HStoreTest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2007-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.extensions;
-
-import java.sql.*;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.TestCase;
-import org.postgresql.test.TestUtil;
-
-// SELECT 'hstore'::regtype::oid
-// SELECT 'hstore[]'::regtype::oid
-
-public class HStoreTest extends TestCase {
-
- private Connection _conn;
-
- public HStoreTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- _conn = TestUtil.openDB();
- }
-
- protected void tearDown() throws SQLException {
- TestUtil.closeDB(_conn);
- }
-
- public void testHStoreSelect() throws SQLException {
- PreparedStatement pstmt = _conn.prepareStatement("SELECT 'a=>1,b=>2'::hstore");
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- String str = rs.getString(1);
- if (!("\"a\"=>\"1\", \"b\"=>\"2\"".equals(str) || "\"b\"=>\"2\", \"a\"=>\"1\"".equals(str))) {
- fail("Expected " + "\"a\"=>\"1\", \"b\"=>\"2\"" + " but got " + str);
- }
- Map correct = new HashMap();
- correct.put("a", "1");
- correct.put("b", "2");
- assertEquals(correct, rs.getObject(1));
- }
-
- public void testHStoreSelectNullValue() throws SQLException {
- PreparedStatement pstmt = _conn.prepareStatement("SELECT 'a=>NULL'::hstore");
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals("\"a\"=>NULL", rs.getString(1));
- Map correct = Collections.singletonMap("a", null);
- assertEquals(correct, rs.getObject(1));
- }
-
- public void testHStoreSend() throws SQLException {
- Map correct = Collections.singletonMap("a", new Integer(1));
- PreparedStatement pstmt = _conn.prepareStatement("SELECT ?::text");
- pstmt.setObject(1, correct);
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals("\"a\"=>\"1\"", rs.getString(1));
- }
-
- public void testHStoreSendEscaped() throws SQLException {
- Map correct = Collections.singletonMap("a", "t'e\ns\"t");
- PreparedStatement pstmt = _conn.prepareStatement("SELECT ?");
- pstmt.setObject(1, correct);
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(correct, rs.getObject(1));
- assertEquals("\"a\"=>\"t'e\ns\\\"t\"", rs.getString(1));
- }
-
-}
diff --git a/org/postgresql/test/jdbc2/ANTTest.java b/org/postgresql/test/jdbc2/ANTTest.java
deleted file mode 100644
index 6fe9946..0000000
--- a/org/postgresql/test/jdbc2/ANTTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import junit.framework.TestCase;
-
-public class ANTTest extends TestCase
-{
- public ANTTest(String name)
- {
- super(name);
- }
-
- /*
- * This tests the acceptsURL() method with a couple of good and badly formed
- * jdbc urls
- */
- public void testANT()
- {
- String url = System.getProperty("database");
- String usr = System.getProperty("username");
- String psw = System.getProperty("password");
-
- assertNotNull(url);
- assertNotNull(usr);
- assertNotNull(psw);
-
- assertTrue(! url.equals(""));
- assertTrue(! usr.equals(""));
- }
-}
diff --git a/org/postgresql/test/jdbc2/ArrayTest.java b/org/postgresql/test/jdbc2/ArrayTest.java
deleted file mode 100644
index 16b0823..0000000
--- a/org/postgresql/test/jdbc2/ArrayTest.java
+++ /dev/null
@@ -1,416 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import java.sql.*;
-import java.math.BigDecimal;
-
-import org.postgresql.geometric.PGbox;
-import org.postgresql.geometric.PGpoint;
-
-import junit.framework.TestCase;
-
-public class ArrayTest extends TestCase
-{
- private Connection conn;
-
- public ArrayTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- conn = TestUtil.openDB();
- TestUtil.createTable(conn, "arrtest", "intarr int[], decarr decimal(2,1)[], strarr text[]");
- }
-
- protected void tearDown() throws SQLException
- {
- TestUtil.dropTable(conn, "arrtest");
- TestUtil.closeDB(conn);
- }
-
- public void testSetNull() throws SQLException {
- PreparedStatement pstmt = conn.prepareStatement("INSERT INTO arrtest VALUES (?,?,?)");
- pstmt.setNull(1, Types.ARRAY);
- pstmt.setNull(2, Types.ARRAY);
- pstmt.setNull(3, Types.ARRAY);
- pstmt.executeUpdate();
-
- pstmt.setObject(1, null, Types.ARRAY);
- pstmt.setObject(2, null);
- pstmt.setObject(3, null);
- pstmt.executeUpdate();
-
- pstmt.setArray(1, null);
- pstmt.setArray(2, null);
- pstmt.setArray(3, null);
- pstmt.executeUpdate();
-
- pstmt.close();
- }
-
-
- public void testRetrieveArrays() throws SQLException {
- Statement stmt = conn.createStatement();
-
- // you need a lot of backslashes to get a double quote in.
- stmt.executeUpdate("INSERT INTO arrtest VALUES ('{1,2,3}','{3.1,1.4}', '"
- + TestUtil.escapeString(conn, "{abc,f'a,\"fa\\\"b\",def}") + "')");
-
- ResultSet rs = stmt.executeQuery("SELECT intarr, decarr, strarr FROM arrtest");
- assertTrue(rs.next());
-
- Array arr = rs.getArray(1);
- assertEquals(Types.INTEGER, arr.getBaseType());
- Integer intarr[] = (Integer[])arr.getArray();
- assertEquals(3, intarr.length);
- assertEquals(1, intarr[0].intValue());
- assertEquals(2, intarr[1].intValue());
- assertEquals(3, intarr[2].intValue());
-
- arr = rs.getArray(2);
- assertEquals(Types.NUMERIC, arr.getBaseType());
- BigDecimal decarr[] = (BigDecimal[])arr.getArray();
- assertEquals(2, decarr.length);
- assertEquals(new BigDecimal("3.1"), decarr[0]);
- assertEquals(new BigDecimal("1.4"), decarr[1]);
-
- arr = rs.getArray(3);
- assertEquals(Types.VARCHAR, arr.getBaseType());
- String strarr[] = (String[])arr.getArray(2, 2);
- assertEquals(2, strarr.length);
- assertEquals("f'a", strarr[0]);
- assertEquals("fa\"b", strarr[1]);
-
- rs.close();
- stmt.close();
- }
-
- public void testRetrieveResultSets() throws SQLException {
- Statement stmt = conn.createStatement();
-
- // you need a lot of backslashes to get a double quote in.
- stmt.executeUpdate("INSERT INTO arrtest VALUES ('{1,2,3}','{3.1,1.4}', '" +
- TestUtil.escapeString(conn, "{abc,f'a,\"fa\\\"b\",def}") + "')");
-
- ResultSet rs = stmt.executeQuery("SELECT intarr, decarr, strarr FROM arrtest");
- assertTrue(rs.next());
-
- Array arr = rs.getArray(1);
- assertEquals(Types.INTEGER, arr.getBaseType());
- ResultSet arrrs = arr.getResultSet();
- assertTrue(arrrs.next());
- assertEquals(1, arrrs.getInt(1));
- assertEquals(1, arrrs.getInt(2));
- assertTrue(arrrs.next());
- assertEquals(2, arrrs.getInt(1));
- assertEquals(2, arrrs.getInt(2));
- assertTrue(arrrs.next());
- assertEquals(3, arrrs.getInt(1));
- assertEquals(3, arrrs.getInt(2));
- assertTrue(!arrrs.next());
- assertTrue(arrrs.previous());
- assertEquals(3, arrrs.getInt(2));
- arrrs.first();
- assertEquals(1, arrrs.getInt(2));
- arrrs.close();
-
- arr = rs.getArray(2);
- assertEquals(Types.NUMERIC, arr.getBaseType());
- arrrs = arr.getResultSet();
- assertTrue(arrrs.next());
- assertEquals(new BigDecimal("3.1"), arrrs.getBigDecimal(2));
- assertTrue(arrrs.next());
- assertEquals(new BigDecimal("1.4"), arrrs.getBigDecimal(2));
- arrrs.close();
-
- arr = rs.getArray(3);
- assertEquals(Types.VARCHAR, arr.getBaseType());
- arrrs = arr.getResultSet(2, 2);
- assertTrue(arrrs.next());
- assertEquals(2, arrrs.getInt(1));
- assertEquals("f'a", arrrs.getString(2));
- assertTrue(arrrs.next());
- assertEquals(3, arrrs.getInt(1));
- assertEquals("fa\"b", arrrs.getString(2));
- assertTrue(!arrrs.next());
- arrrs.close();
-
- rs.close();
- stmt.close();
- }
-
- public void testSetArray() throws SQLException {
- Statement stmt = conn.createStatement();
- ResultSet arrRS = stmt.executeQuery("SELECT '{1,2,3}'::int4[]");
- assertTrue(arrRS.next());
- Array arr = arrRS.getArray(1);
- arrRS.close();
- stmt.close();
-
- PreparedStatement pstmt = conn.prepareStatement("INSERT INTO arrtest(intarr) VALUES (?)");
- pstmt.setArray(1, arr);
- pstmt.executeUpdate();
-
- pstmt.setObject(1, arr, Types.ARRAY);
- pstmt.executeUpdate();
-
- pstmt.setObject(1, arr);
- pstmt.executeUpdate();
-
- pstmt.close();
-
- Statement select = conn.createStatement();
- ResultSet rs = select.executeQuery("SELECT intarr FROM arrtest");
- int resultCount = 0;
- while(rs.next()) {
- resultCount++;
- Array result = rs.getArray(1);
- assertEquals(Types.INTEGER, result.getBaseType());
- assertEquals("int4", result.getBaseTypeName());
-
- Integer intarr[] = (Integer[])result.getArray();
- assertEquals(3, intarr.length);
- assertEquals(1, intarr[0].intValue());
- assertEquals(2, intarr[1].intValue());
- assertEquals(3, intarr[2].intValue());
- }
- assertEquals(3, resultCount);
- }
-
- /**
- * Starting with 8.0 non-standard (beginning index isn't 1) bounds
- * the dimensions are returned in the data. The following should
- * return "[0:3]={0,1,2,3,4}" when queried. Older versions simply
- * do not return the bounds.
- */
- public void testNonStandardBounds() throws SQLException {
- Statement stmt = conn.createStatement();
- stmt.executeUpdate("INSERT INTO arrtest (intarr) VALUES ('{1,2,3}')");
- stmt.executeUpdate("UPDATE arrtest SET intarr[0] = 0");
- ResultSet rs = stmt.executeQuery("SELECT intarr FROM arrtest");
- assertTrue(rs.next());
- Array result = rs.getArray(1);
- Integer intarr[] = (Integer[])result.getArray();
- assertEquals(4, intarr.length);
- for (int i = 0; i < intarr.length; i++)
- {
- assertEquals(i, intarr[i].intValue());
- }
- }
-
- public void testMultiDimensionalArray() throws SQLException {
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT '{{1,2},{3,4}}'::int[]");
- assertTrue(rs.next());
- Array arr = rs.getArray(1);
- Object oa[] = (Object [])arr.getArray();
- assertEquals(2, oa.length);
- Integer i0[] = (Integer []) oa[0];
- assertEquals(2, i0.length);
- assertEquals(1, i0[0].intValue());
- assertEquals(2, i0[1].intValue());
- Integer i1[] = (Integer []) oa[1];
- assertEquals(2, i1.length);
- assertEquals(3, i1[0].intValue());
- assertEquals(4, i1[1].intValue());
- rs.close();
- stmt.close();
- }
-
- public void testNullValues() throws SQLException {
- if (!TestUtil.haveMinimumServerVersion(conn, "8.2"))
- return;
-
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT ARRAY[1,NULL,3]");
- assertTrue(rs.next());
- Array arr = rs.getArray(1);
- Integer i[] = (Integer[])arr.getArray();
- assertEquals(3, i.length);
- assertEquals(1, i[0].intValue());
- assertNull(i[1]);
- assertEquals(3, i[2].intValue());
- }
-
- public void testUnknownArrayType() throws SQLException {
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT relacl FROM pg_class WHERE relacl IS NOT NULL LIMIT 1");
- ResultSetMetaData rsmd = rs.getMetaData();
- assertEquals(Types.ARRAY, rsmd.getColumnType(1));
-
- assertTrue(rs.next());
- Array arr = rs.getArray(1);
- assertEquals("aclitem", arr.getBaseTypeName());
-
- ResultSet arrRS = arr.getResultSet();
- ResultSetMetaData arrRSMD = arrRS.getMetaData();
- assertEquals("aclitem", arrRSMD.getColumnTypeName(2));
- }
-
- public void testRecursiveResultSets() throws SQLException {
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT '{{1,2},{3,4}}'::int[]");
- assertTrue(rs.next());
- Array arr = rs.getArray(1);
-
- ResultSet arrRS = arr.getResultSet();
- ResultSetMetaData arrRSMD = arrRS.getMetaData();
- assertEquals(Types.ARRAY, arrRSMD.getColumnType(2));
- assertEquals("_int4", arrRSMD.getColumnTypeName(2));
-
- assertTrue(arrRS.next());
- assertEquals(1, arrRS.getInt(1));
- Array a1 = arrRS.getArray(2);
- ResultSet a1RS = a1.getResultSet();
- ResultSetMetaData a1RSMD = a1RS.getMetaData();
- assertEquals(Types.INTEGER, a1RSMD.getColumnType(2));
- assertEquals("int4", a1RSMD.getColumnTypeName(2));
-
- assertTrue(a1RS.next());
- assertEquals(1, a1RS.getInt(2));
- assertTrue(a1RS.next());
- assertEquals(2, a1RS.getInt(2));
- assertTrue(!a1RS.next());
- a1RS.close();
-
- assertTrue(arrRS.next());
- assertEquals(2, arrRS.getInt(1));
- Array a2 = arrRS.getArray(2);
- ResultSet a2RS = a2.getResultSet();
-
- assertTrue(a2RS.next());
- assertEquals(3, a2RS.getInt(2));
- assertTrue(a2RS.next());
- assertEquals(4, a2RS.getInt(2));
- assertTrue(!a2RS.next());
- a2RS.close();
-
- arrRS.close();
- rs.close();
- stmt.close();
- }
-
- public void testNullString() throws SQLException
- {
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT '{a,NULL}'::text[]");
- assertTrue(rs.next());
- Array arr = rs.getArray(1);
-
- String s[] = (String [])arr.getArray();
- assertEquals(2, s.length);
- assertEquals("a", s[0]);
- if (TestUtil.haveMinimumServerVersion(conn, "8.2")) {
- assertNull(s[1]);
- } else {
- assertEquals("NULL", s[1]);
- }
- }
-
- public void testEscaping() throws SQLException
- {
- Statement stmt = conn.createStatement();
- String sql = "SELECT ";
- if (TestUtil.haveMinimumServerVersion(conn, "8.1")) {
- sql += 'E';
- }
- // Uggg. Three levels of escaping: Java, string literal, array.
- sql += "'{{c\\\\\"d, ''}, {\"\\\\\\\\\",\"''\"}}'::text[]";
-
- ResultSet rs = stmt.executeQuery(sql);
- assertTrue(rs.next());
-
- Array arr = rs.getArray(1);
- String s[][] = (String[][])arr.getArray();
- assertEquals("c\"d", s[0][0]);
- assertEquals("'", s[0][1]);
- assertEquals("\\", s[1][0]);
- assertEquals("'", s[1][1]);
-
- ResultSet arrRS = arr.getResultSet();
-
- assertTrue(arrRS.next());
- Array a1 = arrRS.getArray(2);
- ResultSet rs1 = a1.getResultSet();
- assertTrue(rs1.next());
- assertEquals("c\"d", rs1.getString(2));
- assertTrue(rs1.next());
- assertEquals("'", rs1.getString(2));
- assertTrue(!rs1.next());
-
- assertTrue(arrRS.next());
- Array a2 = arrRS.getArray(2);
- ResultSet rs2 = a2.getResultSet();
- assertTrue(rs2.next());
- assertEquals("\\", rs2.getString(2));
- assertTrue(rs2.next());
- assertEquals("'", rs2.getString(2));
- assertTrue(!rs2.next());
- }
-
- public void testWriteMultiDimensional() throws SQLException
- {
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT '{{1,2},{3,4}}'::int[]");
- assertTrue(rs.next());
- Array arr = rs.getArray(1);
- rs.close();
- stmt.close();
-
- String sql = "SELECT ?";
- if (TestUtil.isProtocolVersion(conn, 2)) {
- sql = "SELECT ?::int[]";
- }
- PreparedStatement pstmt = conn.prepareStatement(sql);
- pstmt.setArray(1, arr);
- rs = pstmt.executeQuery();
- assertTrue(rs.next());
- arr = rs.getArray(1);
-
- Integer i[][] = (Integer[][])arr.getArray();
- assertEquals(1, i[0][0].intValue());
- assertEquals(2, i[0][1].intValue());
- assertEquals(3, i[1][0].intValue());
- assertEquals(4, i[1][1].intValue());
- }
-
- /*
- * The box data type uses a semicolon as the array element
- * delimiter instead of a comma which pretty much everything
- * else uses.
- */
- public void testNonStandardDelimiter() throws SQLException
- {
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT '{(3,4),(1,2);(7,8),(5,6)}'::box[]");
- assertTrue(rs.next());
- Array arr = rs.getArray(1);
-
- ResultSet arrRS = arr.getResultSet();
-
- assertTrue(arrRS.next());
- PGbox box1 = (PGbox)arrRS.getObject(2);
- PGpoint p1 = box1.point[0];
- assertEquals(3, p1.x, 0.001);
- assertEquals(4, p1.y, 0.001);
-
- assertTrue(arrRS.next());
- PGbox box2 = (PGbox)arrRS.getObject(2);
- PGpoint p2 = box2.point[1];
- assertEquals(5, p2.x, 0.001);
- assertEquals(6, p2.y, 0.001);
-
- assertTrue(!arrRS.next());
- }
-
-}
-
diff --git a/org/postgresql/test/jdbc2/BatchExecuteTest.java b/org/postgresql/test/jdbc2/BatchExecuteTest.java
deleted file mode 100644
index a04d5c0..0000000
--- a/org/postgresql/test/jdbc2/BatchExecuteTest.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-import java.sql.*;
-
-/* TODO tests that can be added to this test case
- * - SQLExceptions chained to a BatchUpdateException
- * - test PreparedStatement as thoroughly as Statement
- */
-
-/*
- * Test case for Statement.batchExecute()
- */
-public class BatchExecuteTest extends TestCase
-{
-
- private Connection con;
-
- public BatchExecuteTest(String name)
- {
- super(name);
- try
- {
- Class.forName("org.postgresql.Driver");
- }
- catch( Exception ex){}
- }
-
- // Set up the fixture for this testcase: a connection to a database with
- // a table for this test.
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
- Statement stmt = con.createStatement();
-
- // Drop the test table if it already exists for some reason. It is
- // not an error if it doesn't exist.
- TestUtil.createTable(con, "testbatch", "pk INTEGER, col1 INTEGER");
-
- stmt.executeUpdate("INSERT INTO testbatch VALUES (1, 0)");
-
- // Generally recommended with batch updates. By default we run all
- // tests in this test case with autoCommit disabled.
- con.setAutoCommit(false);
- }
-
- // Tear down the fixture for this test case.
- protected void tearDown() throws Exception
- {
- con.setAutoCommit(true);
-
- TestUtil.dropTable(con, "testbatch");
- TestUtil.closeDB(con);
- }
-
- public void testSupportsBatchUpdates() throws Exception
- {
- DatabaseMetaData dbmd = con.getMetaData();
- assertTrue(dbmd.supportsBatchUpdates());
- }
-
- public void testEmptyClearBatch() throws Exception
- {
- Statement stmt = con.createStatement();
- stmt.clearBatch(); // No-op.
-
- PreparedStatement ps = con.prepareStatement("SELECT ?");
- ps.clearBatch(); // No-op.
- }
-
- private void assertCol1HasValue(int expected) throws Exception
- {
- Statement getCol1 = con.createStatement();
-
- ResultSet rs =
- getCol1.executeQuery("SELECT col1 FROM testbatch WHERE pk = 1");
- assertTrue(rs.next());
-
- int actual = rs.getInt("col1");
-
- assertEquals(expected, actual);
-
- assertEquals(false, rs.next());
-
- rs.close();
- getCol1.close();
- }
-
- public void testExecuteEmptyBatch() throws Exception
- {
- Statement stmt = con.createStatement();
- int[] updateCount = stmt.executeBatch();
- assertEquals(0, updateCount.length);
-
- stmt.addBatch("UPDATE testbatch SET col1 = col1 + 1 WHERE pk = 1");
- stmt.clearBatch();
- updateCount = stmt.executeBatch();
- assertEquals(0, updateCount.length);
- stmt.close();
- }
-
- public void testClearBatch() throws Exception
- {
- Statement stmt = con.createStatement();
-
- stmt.addBatch("UPDATE testbatch SET col1 = col1 + 1 WHERE pk = 1");
- assertCol1HasValue(0);
- stmt.addBatch("UPDATE testbatch SET col1 = col1 + 2 WHERE pk = 1");
- assertCol1HasValue(0);
- stmt.clearBatch();
- assertCol1HasValue(0);
- stmt.addBatch("UPDATE testbatch SET col1 = col1 + 4 WHERE pk = 1");
- assertCol1HasValue(0);
- stmt.executeBatch();
- assertCol1HasValue(4);
- con.commit();
- assertCol1HasValue(4);
-
- stmt.close();
- }
-
- public void testSelectThrowsException() throws Exception
- {
- Statement stmt = con.createStatement();
-
- stmt.addBatch("UPDATE testbatch SET col1 = col1 + 1 WHERE pk = 1");
- stmt.addBatch("SELECT col1 FROM testbatch WHERE pk = 1");
- stmt.addBatch("UPDATE testbatch SET col1 = col1 + 2 WHERE pk = 1");
-
- try
- {
- stmt.executeBatch();
- fail("Should raise a BatchUpdateException because of the SELECT");
- }
- catch (BatchUpdateException e)
- {
- int [] updateCounts = e.getUpdateCounts();
- assertEquals(1, updateCounts.length);
- assertEquals(1, updateCounts[0]);
- }
- catch (SQLException e)
- {
- fail( "Should throw a BatchUpdateException instead of " +
- "a generic SQLException: " + e);
- }
-
- stmt.close();
- }
-
- public void testStringAddBatchOnPreparedStatement() throws Exception
- {
- PreparedStatement pstmt = con.prepareStatement("UPDATE testbatch SET col1 = col1 + ? WHERE PK = ?" );
- pstmt.setInt(1, 1);
- pstmt.setInt(2, 1);
- pstmt.addBatch();
-
- try
- {
- pstmt.addBatch("UPDATE testbatch SET col1 = 3");
- fail("Should have thrown an exception about using the string addBatch method on a prepared statement.");
- }
- catch (SQLException sqle)
- {
- }
-
- pstmt.close();
- }
-
- public void testPreparedStatement() throws Exception
- {
- PreparedStatement pstmt = con.prepareStatement(
- "UPDATE testbatch SET col1 = col1 + ? WHERE PK = ?" );
-
- // Note that the first parameter changes for every statement in the
- // batch, whereas the second parameter remains constant.
- pstmt.setInt(1, 1);
- pstmt.setInt(2, 1);
- pstmt.addBatch();
- assertCol1HasValue(0);
-
- pstmt.setInt(1, 2);
- pstmt.addBatch();
- assertCol1HasValue(0);
-
- pstmt.setInt(1, 4);
- pstmt.addBatch();
- assertCol1HasValue(0);
-
- pstmt.executeBatch();
- assertCol1HasValue(7);
-
- //now test to see that we can still use the statement after the execute
- pstmt.setInt(1, 3);
- pstmt.addBatch();
- assertCol1HasValue(7);
-
- pstmt.executeBatch();
- assertCol1HasValue(10);
-
- con.commit();
- assertCol1HasValue(10);
-
- con.rollback();
- assertCol1HasValue(10);
-
- pstmt.close();
- }
-
- public void testTransactionalBehaviour() throws Exception
- {
- Statement stmt = con.createStatement();
-
- stmt.addBatch("UPDATE testbatch SET col1 = col1 + 1 WHERE pk = 1");
- stmt.addBatch("UPDATE testbatch SET col1 = col1 + 2 WHERE pk = 1");
- stmt.executeBatch();
- con.rollback();
- assertCol1HasValue(0);
-
- stmt.addBatch("UPDATE testbatch SET col1 = col1 + 4 WHERE pk = 1");
- stmt.addBatch("UPDATE testbatch SET col1 = col1 + 8 WHERE pk = 1");
-
- // The statement has been added to the batch, but it should not yet
- // have been executed.
- assertCol1HasValue(0);
-
- int[] updateCounts = stmt.executeBatch();
- assertEquals(2, updateCounts.length);
- assertEquals(1, updateCounts[0]);
- assertEquals(1, updateCounts[1]);
-
- assertCol1HasValue(12);
- con.commit();
- assertCol1HasValue(12);
- con.rollback();
- assertCol1HasValue(12);
-
- stmt.close();
- }
-
- public void testWarningsAreCleared() throws SQLException
- {
- Statement stmt = con.createStatement();
- stmt.addBatch("CREATE TEMP TABLE unused (a int primary key)");
- stmt.executeBatch();
- // Execute an empty batch to clear warnings.
- stmt.executeBatch();
- assertNull(stmt.getWarnings());
- stmt.close();
- }
-
- public void testBatchEscapeProcessing() throws SQLException
- {
- Statement stmt = con.createStatement();
- stmt.execute("CREATE TEMP TABLE batchescape (d date)");
-
- stmt.addBatch("INSERT INTO batchescape (d) VALUES ({d '2007-11-20'})");
- stmt.executeBatch();
-
- PreparedStatement pstmt = con.prepareStatement("INSERT INTO batchescape (d) VALUES ({d '2007-11-20'})");
- pstmt.addBatch();
- pstmt.executeBatch();
- pstmt.close();
-
- ResultSet rs = stmt.executeQuery("SELECT d FROM batchescape");
- assertTrue(rs.next());
- assertEquals("2007-11-20", rs.getString(1));
- assertTrue(rs.next());
- assertEquals("2007-11-20", rs.getString(1));
- assertTrue(!rs.next());
- rs.close();
- stmt.close();
- }
-
- public void testBatchWithEmbeddedNulls() throws SQLException
- {
- Statement stmt = con.createStatement();
- stmt.execute("CREATE TEMP TABLE batchstring (a text)");
-
- con.commit();
-
- PreparedStatement pstmt = con.prepareStatement("INSERT INTO batchstring VALUES (?)");
-
- try {
- pstmt.setString(1, "a");
- pstmt.addBatch();
- pstmt.setString(1, "\u0000");
- pstmt.addBatch();
- pstmt.setString(1, "b");
- pstmt.addBatch();
- pstmt.executeBatch();
- fail("Should have thrown an exception.");
- } catch (SQLException sqle) {
- con.rollback();
- }
- pstmt.close();
-
- ResultSet rs = stmt.executeQuery("SELECT COUNT(*) FROM batchstring");
- assertTrue(rs.next());
- assertEquals(0, rs.getInt(1));
- rs.close();
- stmt.close();
- }
-
-}
diff --git a/org/postgresql/test/jdbc2/BlobTest.java b/org/postgresql/test/jdbc2/BlobTest.java
deleted file mode 100644
index 1648330..0000000
--- a/org/postgresql/test/jdbc2/BlobTest.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-import java.io.*;
-import java.sql.*;
-
-import org.postgresql.largeobject.*;
-
-/**
- * Some simple tests based on problems reported by users. Hopefully these will
- * help prevent previous problems from re-occuring ;-)
- *
- */
-public class BlobTest extends TestCase
-{
-
- private Connection con;
-
- private static final int LOOP = 0; // LargeObject API using loop
- private static final int NATIVE_STREAM = 1; // LargeObject API using OutputStream
-
- public BlobTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
- TestUtil.createTable(con, "testblob", "id name,lo oid");
- con.setAutoCommit(false);
- }
-
- protected void tearDown() throws Exception
- {
- con.setAutoCommit(true);
- TestUtil.dropTable(con, "testblob");
- TestUtil.closeDB(con);
- }
-
- public void testSetNull() throws Exception
- {
- PreparedStatement pstmt = con.prepareStatement("INSERT INTO testblob(lo) VALUES (?)");
-
- pstmt.setBlob(1, (Blob)null);
- pstmt.executeUpdate();
-
- pstmt.setNull(1, Types.BLOB);
- pstmt.executeUpdate();
-
- pstmt.setObject(1, null, Types.BLOB);
- pstmt.executeUpdate();
-
- pstmt.setClob(1, (Clob)null);
- pstmt.executeUpdate();
-
- pstmt.setNull(1, Types.CLOB);
- pstmt.executeUpdate();
-
- pstmt.setObject(1, null, Types.CLOB);
- pstmt.executeUpdate();
- }
-
- public void testSet() throws SQLException {
- Statement stmt = con.createStatement();
- stmt.execute("INSERT INTO testblob(id,lo) VALUES ('1', lo_creat(-1))");
- ResultSet rs = stmt.executeQuery("SELECT lo FROM testblob");
- assertTrue(rs.next());
-
- PreparedStatement pstmt = con.prepareStatement("INSERT INTO testblob(id, lo) VALUES(?,?)");
-
- Blob blob = rs.getBlob(1);
- pstmt.setString(1,"setObjectTypeBlob");
- pstmt.setObject(2, blob, Types.BLOB);
- assertEquals(1, pstmt.executeUpdate());
-
- blob = rs.getBlob(1);
- pstmt.setString(1,"setObjectBlob");
- pstmt.setObject(2, blob);
- assertEquals(1, pstmt.executeUpdate());
-
- blob = rs.getBlob(1);
- pstmt.setString(1,"setBlob");
- pstmt.setBlob(2, blob);
- assertEquals(1, pstmt.executeUpdate());
-
- Clob clob = rs.getClob(1);
- pstmt.setString(1,"setObjectTypeClob");
- pstmt.setObject(2, clob, Types.CLOB);
- assertEquals(1, pstmt.executeUpdate());
-
- clob = rs.getClob(1);
- pstmt.setString(1,"setObjectClob");
- pstmt.setObject(2, clob);
- assertEquals(1, pstmt.executeUpdate());
-
- clob = rs.getClob(1);
- pstmt.setString(1,"setClob");
- pstmt.setClob(2, clob);
- assertEquals(1, pstmt.executeUpdate());
- }
-
- /*
- * Tests one method of uploading a blob to the database
- */
- public void testUploadBlob_LOOP() throws Exception
- {
- assertTrue(uploadFile("build.xml", LOOP) > 0);
-
- // Now compare the blob & the file. Note this actually tests the
- // InputStream implementation!
- assertTrue(compareBlobsLOAPI());
- assertTrue(compareBlobs());
- assertTrue(compareClobs());
- }
-
- /*
- * Tests one method of uploading a blob to the database
- */
- public void testUploadBlob_NATIVE() throws Exception
- {
- assertTrue(uploadFile("build.xml", NATIVE_STREAM) > 0);
-
- // Now compare the blob & the file. Note this actually tests the
- // InputStream implementation!
- assertTrue(compareBlobs());
- }
-
- public void testGetBytesOffset() throws Exception
- {
- assertTrue(uploadFile("build.xml", NATIVE_STREAM) > 0);
-
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT lo FROM testblob");
- assertTrue(rs.next());
-
- Blob lob = rs.getBlob(1);
- byte data[] = lob.getBytes(2,4);
- assertEquals(data.length, 4);
- assertEquals(data[0], '?');
- assertEquals(data[1], 'x');
- assertEquals(data[2], 'm');
- assertEquals(data[3], 'l');
- }
-
- public void testMultipleStreams() throws Exception
- {
- assertTrue(uploadFile("build.xml", NATIVE_STREAM) > 0);
-
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT lo FROM testblob");
- assertTrue(rs.next());
-
- Blob lob = rs.getBlob(1);
- byte data[] = new byte[2];
-
- InputStream is = lob.getBinaryStream();
- assertEquals(data.length, is.read(data));
- assertEquals(data[0], '<');
- assertEquals(data[1], '?');
- is.close();
-
- is = lob.getBinaryStream();
- assertEquals(data.length, is.read(data));
- assertEquals(data[0], '<');
- assertEquals(data[1], '?');
- is.close();
- }
-
- public void testParallelStreams() throws Exception
- {
- assertTrue(uploadFile("build.xml", NATIVE_STREAM) > 0);
-
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT lo FROM testblob");
- assertTrue(rs.next());
-
- Blob lob = rs.getBlob(1);
- InputStream is1 = lob.getBinaryStream();
- InputStream is2 = lob.getBinaryStream();
-
- while (true) {
- int i1 = is1.read();
- int i2 = is2.read();
- assertEquals(i1, i2);
- if (i1 == -1)
- break;
- }
-
- is1.close();
- is2.close();
- }
-
- /*
- * Helper - uploads a file into a blob using old style methods. We use this
- * because it always works, and we can use it as a base to test the new
- * methods.
- */
- private long uploadFile(String file, int method) throws Exception
- {
- LargeObjectManager lom = ((org.postgresql.PGConnection)con).getLargeObjectAPI();
-
- FileInputStream fis = new FileInputStream(file);
-
- long oid = lom.createLO(LargeObjectManager.READWRITE);
- LargeObject blob = lom.open(oid);
-
- int s, t;
- byte buf[];
- OutputStream os;
-
- switch (method)
- {
- case LOOP:
- buf = new byte[2048];
- t = 0;
- while ((s = fis.read(buf, 0, buf.length)) > 0)
- {
- t += s;
- blob.write(buf, 0, s);
- }
- break;
-
- case NATIVE_STREAM:
- os = blob.getOutputStream();
- s = fis.read();
- while (s > -1)
- {
- os.write(s);
- s = fis.read();
- }
- os.close();
- break;
-
- default:
- assertTrue("Unknown method in uploadFile", false);
- }
-
- blob.close();
- fis.close();
-
- // Insert into the table
- Statement st = con.createStatement();
- st.executeUpdate(TestUtil.insertSQL("testblob", "id,lo", "'" + file + "'," + oid));
- con.commit();
- st.close();
-
- return oid;
- }
-
- /*
- * Helper - compares the blobs in a table with a local file. Note this uses
- * the postgresql specific Large Object API
- */
- private boolean compareBlobsLOAPI() throws Exception
- {
- boolean result = true;
-
- LargeObjectManager lom = ((org.postgresql.PGConnection)con).getLargeObjectAPI();
-
- Statement st = con.createStatement();
- ResultSet rs = st.executeQuery(TestUtil.selectSQL("testblob", "id,lo"));
- assertNotNull(rs);
-
- while (rs.next())
- {
- String file = rs.getString(1);
- long oid = rs.getLong(2);
-
- FileInputStream fis = new FileInputStream(file);
- LargeObject blob = lom.open(oid);
- InputStream bis = blob.getInputStream();
-
- int f = fis.read();
- int b = bis.read();
- int c = 0;
- while (f >= 0 && b >= 0 & result)
- {
- result = (f == b);
- f = fis.read();
- b = bis.read();
- c++;
- }
- result = result && f == -1 && b == -1;
-
- if (!result)
- assertTrue("Large Object API Blob compare failed at " + c + " of " + blob.size(), false);
-
- blob.close();
- fis.close();
- }
- rs.close();
- st.close();
-
- return result;
- }
-
- /*
- * Helper - compares the blobs in a table with a local file. This uses the
- * jdbc java.sql.Blob api
- */
- private boolean compareBlobs() throws Exception
- {
- boolean result = true;
-
- Statement st = con.createStatement();
- ResultSet rs = st.executeQuery(TestUtil.selectSQL("testblob", "id,lo"));
- assertNotNull(rs);
-
- while (rs.next())
- {
- String file = rs.getString(1);
- Blob blob = rs.getBlob(2);
-
- FileInputStream fis = new FileInputStream(file);
- InputStream bis = blob.getBinaryStream();
-
- int f = fis.read();
- int b = bis.read();
- int c = 0;
- while (f >= 0 && b >= 0 & result)
- {
- result = (f == b);
- f = fis.read();
- b = bis.read();
- c++;
- }
- result = result && f == -1 && b == -1;
-
- if (!result)
- assertTrue("JDBC API Blob compare failed at " + c + " of " + blob.length(), false);
-
- bis.close();
- fis.close();
- }
- rs.close();
- st.close();
-
- return result;
- }
-
- /*
- * Helper - compares the clobs in a table with a local file.
- */
- private boolean compareClobs() throws Exception
- {
- boolean result = true;
-
- Statement st = con.createStatement();
- ResultSet rs = st.executeQuery(TestUtil.selectSQL("testblob", "id,lo"));
- assertNotNull(rs);
-
- while (rs.next())
- {
- String file = rs.getString(1);
- Clob clob = rs.getClob(2);
-
- FileInputStream fis = new FileInputStream(file);
- InputStream bis = clob.getAsciiStream();
-
- int f = fis.read();
- int b = bis.read();
- int c = 0;
- while (f >= 0 && b >= 0 & result)
- {
- result = (f == b);
- f = fis.read();
- b = bis.read();
- c++;
- }
- result = result && f == -1 && b == -1;
-
- if (!result)
- assertTrue("Clob compare failed at " + c + " of " + clob.length(), false);
-
- bis.close();
- fis.close();
- }
- rs.close();
- st.close();
-
- return result;
- }
-}
diff --git a/org/postgresql/test/jdbc2/CallableStmtTest.java b/org/postgresql/test/jdbc2/CallableStmtTest.java
deleted file mode 100644
index f3d5150..0000000
--- a/org/postgresql/test/jdbc2/CallableStmtTest.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import java.sql.*;
-
-import junit.framework.TestCase;
-
-/*
- * CallableStatement tests.
- * @author Paul Bethe
- */
-public class CallableStmtTest extends TestCase
-{
- private Connection con;
-
- public CallableStmtTest (String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
- TestUtil.createTable(con, "int_table", "id int");
- Statement stmt = con.createStatement ();
- stmt.execute ("CREATE OR REPLACE FUNCTION testspg__getString (varchar) " +
- "RETURNS varchar AS ' DECLARE inString alias for $1; begin " +
- "return ''bob''; end; ' LANGUAGE plpgsql;");
- stmt.execute ("CREATE OR REPLACE FUNCTION testspg__getDouble (float) " +
- "RETURNS float AS ' DECLARE inString alias for $1; begin " +
- "return 42.42; end; ' LANGUAGE plpgsql;");
- if (TestUtil.haveMinimumServerVersion(con, "7.3")) {
- stmt.execute ("CREATE OR REPLACE FUNCTION testspg__getVoid (float) " +
- "RETURNS void AS ' DECLARE inString alias for $1; begin " +
- " return; end; ' LANGUAGE plpgsql;");
- }
- stmt.execute ("CREATE OR REPLACE FUNCTION testspg__getInt (int) RETURNS int " +
- " AS 'DECLARE inString alias for $1; begin " +
- "return 42; end;' LANGUAGE plpgsql;");
- stmt.execute ("CREATE OR REPLACE FUNCTION testspg__getShort (int2) RETURNS int2 " +
- " AS 'DECLARE inString alias for $1; begin " +
- "return 42; end;' LANGUAGE plpgsql;");
- stmt.execute ("CREATE OR REPLACE FUNCTION testspg__getNumeric (numeric) " +
- "RETURNS numeric AS ' DECLARE inString alias for $1; " +
- "begin return 42; end; ' LANGUAGE plpgsql;");
-
- stmt.execute ("CREATE OR REPLACE FUNCTION testspg__getNumericWithoutArg() " +
- "RETURNS numeric AS ' " +
- "begin return 42; end; ' LANGUAGE plpgsql;");
- stmt.execute("CREATE OR REPLACE FUNCTION testspg__getarray() RETURNS int[] as 'SELECT ''{1,2}''::int[];' LANGUAGE sql");
- stmt.execute("CREATE OR REPLACE FUNCTION testspg__raisenotice() RETURNS int as 'BEGIN RAISE NOTICE ''hello''; RAISE NOTICE ''goodbye''; RETURN 1; END;' LANGUAGE plpgsql");
- stmt.execute("CREATE OR REPLACE FUNCTION testspg__insertInt(int) RETURNS int as 'BEGIN INSERT INTO int_table(id) VALUES ($1); RETURN 1; END;' LANGUAGE plpgsql");
- stmt.close ();
- }
-
- protected void tearDown() throws Exception
- {
- Statement stmt = con.createStatement ();
- TestUtil.dropTable(con, "int_table");
- stmt.execute ("drop FUNCTION testspg__getString (varchar);");
- stmt.execute ("drop FUNCTION testspg__getDouble (float);");
- if (TestUtil.haveMinimumServerVersion(con, "7.3")) {
- stmt.execute( "drop FUNCTION testspg__getVoid(float);");
- }
- stmt.execute ("drop FUNCTION testspg__getInt (int);");
- stmt.execute ("drop FUNCTION testspg__getShort(int2)");
- stmt.execute ("drop FUNCTION testspg__getNumeric (numeric);");
-
- stmt.execute ("drop FUNCTION testspg__getNumericWithoutArg ();");
- stmt.execute ("DROP FUNCTION testspg__getarray();");
- stmt.execute ("DROP FUNCTION testspg__raisenotice();");
- stmt.execute ("DROP FUNCTION testspg__insertInt(int);");
- TestUtil.closeDB(con);
- }
-
-
- final String func = "{ ? = call ";
- final String pkgName = "testspg__";
-
- public void testGetUpdateCount() throws SQLException
- {
- CallableStatement call = con.prepareCall (func + pkgName + "getDouble (?) }");
- call.setDouble (2, (double)3.04);
- call.registerOutParameter (1, Types.DOUBLE);
- call.execute ();
- assertEquals(-1, call.getUpdateCount());
- assertNull(call.getResultSet());
- assertEquals(42.42, call.getDouble(1), 0.00001);
- call.close();
-
- // test without an out parameter
- call = con.prepareCall( "{ call " + pkgName + "getDouble(?) }");
- call.setDouble( 1, (double)3.04 );
- call.execute();
- assertEquals(-1, call.getUpdateCount());
- ResultSet rs = call.getResultSet();
- assertNotNull(rs);
- assertTrue(rs.next());
- assertEquals(42.42, rs.getDouble(1), 0.00001);
- assertTrue(!rs.next());
- rs.close();
-
- assertEquals(-1, call.getUpdateCount());
- assertTrue(!call.getMoreResults());
- call.close();
- }
-
- public void testGetDouble () throws Throwable
- {
- CallableStatement call = con.prepareCall (func + pkgName + "getDouble (?) }");
- call.setDouble (2, (double)3.04);
- call.registerOutParameter (1, Types.DOUBLE);
- call.execute ();
- assertEquals(42.42, call.getDouble(1), 0.00001);
-
- // test without an out parameter
- call = con.prepareCall( "{ call " + pkgName + "getDouble(?) }");
- call.setDouble( 1, (double)3.04 );
- call.execute();
-
- if (TestUtil.haveMinimumServerVersion(con, "7.3")) {
- call = con.prepareCall( "{ call " + pkgName + "getVoid(?) }");
- call.setDouble( 1, (double)3.04 );
- call.execute();
- }
- }
-
- public void testGetInt () throws Throwable
- {
- CallableStatement call = con.prepareCall (func + pkgName + "getInt (?) }");
- call.setInt (2, 4);
- call.registerOutParameter (1, Types.INTEGER);
- call.execute ();
- assertEquals(42, call.getInt(1));
- }
-
- public void testGetShort () throws Throwable
- {
- if ( TestUtil.isProtocolVersion(con, 3) )
- {
- CallableStatement call = con.prepareCall (func + pkgName + "getShort (?) }");
- call.setShort (2, (short)4);
- call.registerOutParameter (1, Types.SMALLINT);
- call.execute ();
- assertEquals(42, call.getShort(1));
- }
- }
- public void testGetNumeric () throws Throwable
- {
- CallableStatement call = con.prepareCall (func + pkgName + "getNumeric (?) }");
- call.setBigDecimal (2, new java.math.BigDecimal(4));
- call.registerOutParameter (1, Types.NUMERIC);
- call.execute ();
- assertEquals(new java.math.BigDecimal(42), call.getBigDecimal(1));
- }
-
- public void testGetNumericWithoutArg () throws Throwable
- {
- CallableStatement call = con.prepareCall (func + pkgName + "getNumericWithoutArg () }");
- call.registerOutParameter (1, Types.NUMERIC);
- call.execute ();
- assertEquals(new java.math.BigDecimal(42), call.getBigDecimal(1));
- }
-
- public void testGetString () throws Throwable
- {
- CallableStatement call = con.prepareCall (func + pkgName + "getString (?) }");
- call.setString (2, "foo");
- call.registerOutParameter (1, Types.VARCHAR);
- call.execute ();
- assertEquals("bob", call.getString(1));
-
- }
-
- public void testGetArray() throws SQLException
- {
- CallableStatement call = con.prepareCall(func + pkgName + "getarray()}");
- call.registerOutParameter(1, Types.ARRAY);
- call.execute();
- Array arr = call.getArray(1);
- ResultSet rs = arr.getResultSet();
- assertTrue(rs.next());
- assertEquals(1, rs.getInt(1));
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- assertTrue(!rs.next());
- }
-
- public void testRaiseNotice() throws SQLException
- {
- CallableStatement call = con.prepareCall(func + pkgName + "raisenotice()}");
- call.registerOutParameter(1, Types.INTEGER);
- call.execute();
- SQLWarning warn = call.getWarnings();
- assertNotNull(warn);
- assertEquals("hello", warn.getMessage());
- warn = warn.getNextWarning();
- assertNotNull(warn);
- assertEquals("goodbye", warn.getMessage());
- assertEquals(1, call.getInt(1));
- }
-
- public void testWasNullBeforeFetch() throws SQLException {
- CallableStatement cs = con.prepareCall("{? = call lower(?)}");
- cs.registerOutParameter(1, Types.VARCHAR);
- cs.setString(2, "Hi");
- try {
- cs.wasNull();
- fail("expected exception");
- } catch(Exception e) {
- assertTrue(e instanceof SQLException);
- }
- }
-
- public void testFetchBeforeExecute() throws SQLException {
- CallableStatement cs = con.prepareCall("{? = call lower(?)}");
- cs.registerOutParameter(1, Types.VARCHAR);
- cs.setString(2, "Hi");
- try {
- cs.getString(1);
- fail("expected exception");
- } catch(Exception e) {
- assertTrue(e instanceof SQLException);
- }
- }
-
- public void testFetchWithNoResults() throws SQLException {
- CallableStatement cs = con.prepareCall("{call now()}");
- cs.execute();
- try {
- cs.getObject(1);
- fail("expected exception");
- } catch(Exception e) {
- assertTrue(e instanceof SQLException);
- }
- }
-
- public void testBadStmt () throws Throwable
- {
- tryOneBadStmt ("{ ?= " + pkgName + "getString (?) }");
- tryOneBadStmt ("{ ?= call getString (?) ");
- tryOneBadStmt ("{ = ? call getString (?); }");
- }
-
- protected void tryOneBadStmt (String sql) throws SQLException
- {
- try
- {
- con.prepareCall (sql);
- fail("Bad statement (" + sql + ") was not caught.");
-
- }
- catch (SQLException e)
- {
- }
- }
-
- public void testBatchCall() throws SQLException
- {
- CallableStatement call = con.prepareCall ("{ call " + pkgName + "insertInt(?) }");
- call.setInt(1, 1);
- call.addBatch();
- call.setInt(1, 2);
- call.addBatch();
- call.setInt(1, 3);
- call.addBatch();
- call.executeBatch();
- call.close();
-
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT id FROM int_table ORDER BY id");
- assertTrue(rs.next());
- assertEquals(1, rs.getInt(1));
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- assertTrue(rs.next());
- assertEquals(3, rs.getInt(1));
- assertTrue(!rs.next());
- }
-
-}
diff --git a/org/postgresql/test/jdbc2/ConnectionTest.java b/org/postgresql/test/jdbc2/ConnectionTest.java
deleted file mode 100644
index f4ec269..0000000
--- a/org/postgresql/test/jdbc2/ConnectionTest.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-import java.sql.*;
-
-/*
- * TestCase to test the internal functionality of org.postgresql.jdbc2.Connection
- * and it's superclass.
- *
- */
-
-public class ConnectionTest extends TestCase
-{
-
- private Connection con;
-
- /*
- * Constructor
- */
- public ConnectionTest(String name)
- {
- super(name);
- }
-
- // Set up the fixture for this testcase: the tables for this test.
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
-
- TestUtil.createTable(con, "test_a", "imagename name,image oid,id int4");
- TestUtil.createTable(con, "test_c", "source text,cost money,imageid int4");
-
- TestUtil.closeDB(con);
- }
-
- // Tear down the fixture for this test case.
- protected void tearDown() throws Exception
- {
- TestUtil.closeDB(con);
-
- con = TestUtil.openDB();
-
- TestUtil.dropTable(con, "test_a");
- TestUtil.dropTable(con, "test_c");
-
- TestUtil.closeDB(con);
- }
-
- /*
- * Tests the two forms of createStatement()
- */
- public void testCreateStatement() throws Exception
- {
- con = TestUtil.openDB();
-
- // A standard Statement
- Statement stat = con.createStatement();
- assertNotNull(stat);
- stat.close();
-
- // Ask for Updateable ResultSets
- stat = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
- assertNotNull(stat);
- stat.close();
- }
-
- /*
- * Tests the two forms of prepareStatement()
- */
- public void testPrepareStatement() throws Exception
- {
- con = TestUtil.openDB();
-
- String sql = "select source,cost,imageid from test_c";
-
- // A standard Statement
- PreparedStatement stat = con.prepareStatement(sql);
- assertNotNull(stat);
- stat.close();
-
- // Ask for Updateable ResultSets
- stat = con.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
- assertNotNull(stat);
- stat.close();
- }
-
- /*
- * Put the test for createPrepareCall here
- */
- public void testPrepareCall()
- {
- }
-
- /*
- * Test nativeSQL
- */
- public void testNativeSQL() throws Exception
- {
- // test a simple escape
- con = TestUtil.openDB();
- assertEquals("DATE '2005-01-24'",con.nativeSQL("{d '2005-01-24'}"));
- }
-
- /*
- * Test autoCommit (both get & set)
- */
- public void testTransactions() throws Exception
- {
- con = TestUtil.openDB();
- Statement st;
- ResultSet rs;
-
- // Turn it off
- con.setAutoCommit(false);
- assertTrue(!con.getAutoCommit());
-
- // Turn it back on
- con.setAutoCommit(true);
- assertTrue(con.getAutoCommit());
-
- // Now test commit
- st = con.createStatement();
- st.executeUpdate("insert into test_a (imagename,image,id) values ('comttest',1234,5678)");
-
- con.setAutoCommit(false);
-
- // Now update image to 9876 and commit
- st.executeUpdate("update test_a set image=9876 where id=5678");
- con.commit();
- rs = st.executeQuery("select image from test_a where id=5678");
- assertTrue(rs.next());
- assertEquals(9876, rs.getInt(1));
- rs.close();
-
- // Now try to change it but rollback
- st.executeUpdate("update test_a set image=1111 where id=5678");
- con.rollback();
- rs = st.executeQuery("select image from test_a where id=5678");
- assertTrue(rs.next());
- assertEquals(9876, rs.getInt(1)); // Should not change!
- rs.close();
-
- TestUtil.closeDB(con);
- }
-
- /*
- * Simple test to see if isClosed works.
- */
- public void testIsClosed() throws Exception
- {
- con = TestUtil.openDB();
-
- // Should not say closed
- assertTrue(!con.isClosed());
-
- TestUtil.closeDB(con);
-
- // Should now say closed
- assertTrue(con.isClosed());
- }
-
- /*
- * Test the warnings system
- */
- public void testWarnings() throws Exception
- {
- con = TestUtil.openDB();
-
- String testStr = "This Is OuR TeSt message";
-
- // The connection must be ours!
- assertTrue(con instanceof org.postgresql.PGConnection);
-
- // Clear any existing warnings
- con.clearWarnings();
-
- // Set the test warning
- ((org.postgresql.jdbc2.AbstractJdbc2Connection)con).addWarning(new SQLWarning(testStr));
-
- // Retrieve it
- SQLWarning warning = con.getWarnings();
- assertNotNull(warning);
- assertEquals(testStr, warning.getMessage());
-
- // Finally test clearWarnings() this time there must be something to delete
- con.clearWarnings();
- assertTrue(con.getWarnings() == null);
-
- TestUtil.closeDB(con);
- }
-
- /*
- * Transaction Isolation Levels
- */
- public void testTransactionIsolation() throws Exception
- {
- con = TestUtil.openDB();
-
- int defaultLevel = con.getTransactionIsolation();
-
- // Begin a transaction
- con.setAutoCommit(false);
-
- // The isolation level should not have changed
- assertEquals(defaultLevel, con.getTransactionIsolation());
-
- // Now run some tests with autocommit enabled.
- con.setAutoCommit(true);
-
- assertEquals(defaultLevel, con.getTransactionIsolation());
-
- con.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
- assertEquals(Connection.TRANSACTION_SERIALIZABLE,
- con.getTransactionIsolation());
-
- con.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
- assertEquals(Connection.TRANSACTION_READ_COMMITTED, con.getTransactionIsolation());
-
- // Test if a change of isolation level before beginning the
- // transaction affects the isolation level inside the transaction.
- con.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
- assertEquals(Connection.TRANSACTION_SERIALIZABLE,
- con.getTransactionIsolation());
- con.setAutoCommit(false);
- assertEquals(Connection.TRANSACTION_SERIALIZABLE,
- con.getTransactionIsolation());
- con.setAutoCommit(true);
- assertEquals(Connection.TRANSACTION_SERIALIZABLE,
- con.getTransactionIsolation());
- con.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
- assertEquals(Connection.TRANSACTION_READ_COMMITTED,
- con.getTransactionIsolation());
- con.setAutoCommit(false);
- assertEquals(Connection.TRANSACTION_READ_COMMITTED,
- con.getTransactionIsolation());
- con.commit();
-
- // Test that getTransactionIsolation() does not actually start a new txn.
- con.getTransactionIsolation(); // Shouldn't start a new transaction.
- con.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE); // Should be ok -- we're not in a transaction.
- con.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED); // Should still be ok.
-
- // Test that we can't change isolation mid-transaction
- Statement stmt = con.createStatement();
- stmt.executeQuery("SELECT 1"); // Start transaction.
- stmt.close();
-
- try
- {
- con.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
- fail("Expected an exception when changing transaction isolation mid-transaction");
- }
- catch (SQLException e)
- {
- // Ok.
- }
-
- con.rollback();
- TestUtil.closeDB(con);
- }
-
- /*
- * JDBC2 Type mappings
- */
- public void testTypeMaps() throws Exception
- {
- con = TestUtil.openDB();
-
- // preserve the current map
- java.util.Map oldmap = con.getTypeMap();
-
- // now change it for an empty one
- java.util.Map newmap = new java.util.HashMap();
- con.setTypeMap(newmap);
- assertEquals(newmap, con.getTypeMap());
-
- // restore the old one
- con.setTypeMap(oldmap);
- assertEquals(oldmap, con.getTypeMap());
-
- TestUtil.closeDB(con);
- }
-
- /**
- * Closing a Connection more than once is not an error.
- */
- public void testDoubleClose() throws Exception
- {
- con = TestUtil.openDB();
- con.close();
- con.close();
- }
-}
diff --git a/org/postgresql/test/jdbc2/CopyTest.java b/org/postgresql/test/jdbc2/CopyTest.java
deleted file mode 100644
index 88cefe7..0000000
--- a/org/postgresql/test/jdbc2/CopyTest.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2008-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintStream;
-import java.io.IOException;
-import java.io.StringReader;
-
-import junit.framework.TestCase;
-
-import org.postgresql.PGConnection;
-import org.postgresql.copy.*;
-import org.postgresql.test.TestUtil;
-import org.postgresql.util.PSQLState;
-
-/**
- * @author kato at iki.fi
- *
- */
-public class CopyTest extends TestCase {
-
- private Connection con;
- private CopyManager copyAPI;
- private String[] origData =
- { "First Row\t1\t1.10\n", // 0's required to match DB output for numeric(5,2)
- "Second Row\t2\t-22.20\n",
- "\\N\t\\N\t\\N\n",
- "\t4\t444.40\n" };
- private int dataRows = origData.length;
-
- public CopyTest(String name) {
- super(name);
- }
-
- private byte[] getData(String[] origData) {
- ByteArrayOutputStream buf = new ByteArrayOutputStream();
- PrintStream ps = new PrintStream(buf);
- for(int i=0; i<origData.length; i++)
- ps.print(origData[i]);
- return buf.toByteArray();
- }
-
- protected void setUp() throws Exception {
- con = TestUtil.openDB();
-
- TestUtil.createTable(con, "copytest", "stringvalue text, intvalue int, numvalue numeric(5,2)");
-
- copyAPI = ((PGConnection)con).getCopyAPI();
- }
-
- protected void tearDown() throws Exception {
- TestUtil.dropTable(con, "copytest");
- TestUtil.closeDB(con);
- }
-
- private int getCount() throws SQLException {
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT count(*) FROM copytest");
- rs.next();
- int result = rs.getInt(1);
- rs.close();
- return result;
- }
-
- public void testCopyInByRow() throws SQLException {
- String sql = "COPY copytest FROM STDIN";
- CopyIn cp = copyAPI.copyIn(sql);
- for(int i=0; i<origData.length; i++) {
- byte[] buf = origData[i].getBytes();
- cp.writeToCopy(buf, 0, buf.length);
- }
-
- long count1 = cp.endCopy();
- long count2 = cp.getHandledRowCount();
- long expectedResult = -1;
- if (TestUtil.haveMinimumServerVersion(con, "8.2")) {
- expectedResult = dataRows;
- }
- assertEquals(expectedResult, count1);
- assertEquals(expectedResult, count2);
-
- try {
- cp.cancelCopy();
- } catch(SQLException se) { // should fail with obsolete operation
- if(! PSQLState.OBJECT_NOT_IN_STATE.getState().equals(se.getSQLState()) )
- fail("should have thrown object not in state exception.");
- }
- int rowCount = getCount();
- assertEquals(dataRows, rowCount);
- }
-
- public void testCopyInAsOutputStream() throws SQLException, IOException {
- String sql = "COPY copytest FROM STDIN";
- OutputStream os = new PGCopyOutputStream((PGConnection)con, sql, 1000);
- for(int i=0; i<origData.length; i++) {
- byte[] buf = origData[i].getBytes();
- os.write(buf);
- }
- os.close();
- int rowCount = getCount();
- assertEquals(dataRows, rowCount);
- }
-
- public void testCopyInFromInputStream() throws SQLException, IOException {
- String sql = "COPY copytest FROM STDIN";
- copyAPI.copyIn(sql, new ByteArrayInputStream(getData(origData)), 3);
- int rowCount = getCount();
- assertEquals(dataRows, rowCount);
- }
-
- public void testCopyInFromStreamFail() throws SQLException {
- String sql = "COPY copytest FROM STDIN";
- try {
- copyAPI.copyIn(sql, new InputStream() {
- public int read() { throw new RuntimeException("COPYTEST"); }
- }, 3 );
- } catch(Exception e) {
- if(e.toString().indexOf("COPYTEST") == -1)
- fail("should have failed trying to read from our bogus stream.");
- }
- int rowCount = getCount();
- assertEquals(0, rowCount);
- }
-
- public void testCopyInFromReader() throws SQLException, IOException {
- String sql = "COPY copytest FROM STDIN";
- copyAPI.copyIn(sql, new StringReader(new String(getData(origData))), 3);
- int rowCount = getCount();
- assertEquals(dataRows, rowCount);
- }
-
- public void testSkipping() {
- String sql = "COPY copytest FROM STDIN";
- String at = "init";
- int rowCount = -1;
- int skip = 0;
- int skipChar = 1;
- try {
- while(skipChar > 0) {
- at = "buffering";
- InputStream ins = new ByteArrayInputStream(getData(origData));
- at = "skipping";
- ins.skip(skip++);
- skipChar = ins.read();
- at = "copying";
- copyAPI.copyIn(sql, ins, 3);
- at = "using connection after writing copy";
- rowCount = getCount();
- }
- } catch(Exception e) {
- if( !( skipChar=='\t' ) ) // error expected when field separator consumed
- fail("testSkipping at " + at + " round " + skip + ": " + e.toString());
- }
- assertEquals(dataRows*(skip-1), rowCount);
- }
-
- public void testCopyOutByRow() throws SQLException, IOException {
- testCopyInByRow(); // ensure we have some data.
- String sql = "COPY copytest TO STDOUT";
- CopyOut cp = copyAPI.copyOut(sql);
- int count = 0;
- byte buf[];
- while ( (buf = cp.readFromCopy()) != null) {
- count++;
- }
- assertEquals(false, cp.isActive());
- assertEquals(dataRows, count);
-
- long rowCount = cp.getHandledRowCount();
- long expectedResult = -1;
- if (TestUtil.haveMinimumServerVersion(con, "8.2")) {
- expectedResult = dataRows;
- }
- assertEquals(expectedResult, rowCount);
-
- assertEquals(dataRows, getCount());
- }
-
- public void testCopyOut() throws SQLException, IOException {
- testCopyInByRow(); // ensure we have some data.
- String sql = "COPY copytest TO STDOUT";
- ByteArrayOutputStream copydata = new ByteArrayOutputStream();
- copyAPI.copyOut(sql, copydata);
- assertEquals(dataRows, getCount());
- // deep comparison of data written and read
- byte[] copybytes = copydata.toByteArray();
- assertTrue(copybytes != null);
- for(int i=0, l=0; i<origData.length; i++) {
- byte[] origBytes = origData[i].getBytes();
- assertTrue(origBytes != null);
- assertTrue("Copy is shorter than original", copybytes.length >= l + origBytes.length);
- for(int j=0; j<origBytes.length; j++, l++)
- assertEquals("content changed at byte#" + j + ": " +origBytes[j] +copybytes[l], origBytes[j], copybytes[l]);
- }
- }
-
- public void testNonCopyOut() throws SQLException, IOException {
- String sql = "SELECT 1";
- try {
- copyAPI.copyOut(sql, new ByteArrayOutputStream());
- fail("Can't use a non-copy query.");
- } catch (SQLException sqle) {
- }
- // Ensure connection still works.
- assertEquals(0, getCount());
- }
-
- public void testNonCopyIn() throws SQLException, IOException {
- String sql = "SELECT 1";
- try {
- copyAPI.copyIn(sql, new ByteArrayInputStream(new byte[0]));
- fail("Can't use a non-copy query.");
- } catch (SQLException sqle) {
- }
- // Ensure connection still works.
- assertEquals(0, getCount());
- }
-
- public void testStatementCopyIn() throws SQLException {
- Statement stmt = con.createStatement();
- try {
- stmt.execute("COPY copytest FROM STDIN");
- fail("Should have failed because copy doesn't work from a Statement.");
- } catch (SQLException sqle) { }
- stmt.close();
-
- assertEquals(0, getCount());
- }
-
- public void testStatementCopyOut() throws SQLException {
- testCopyInByRow(); // ensure we have some data.
-
- Statement stmt = con.createStatement();
- try {
- stmt.execute("COPY copytest TO STDOUT");
- fail("Should have failed because copy doesn't work from a Statement.");
- } catch (SQLException sqle) { }
- stmt.close();
-
- assertEquals(dataRows, getCount());
- }
-
- public void testCopyQuery() throws SQLException, IOException {
- if (!TestUtil.haveMinimumServerVersion(con, "8.2"))
- return;
-
- testCopyInByRow(); // ensure we have some data.
-
- long count = copyAPI.copyOut("COPY (SELECT generate_series(1,1000)) TO STDOUT", new ByteArrayOutputStream());
- assertEquals(1000, count);
- }
-
- public void testCopyRollback() throws SQLException {
- con.setAutoCommit(false);
- testCopyInByRow();
- con.rollback();
- assertEquals(0, getCount());
- }
-
-}
diff --git a/org/postgresql/test/jdbc2/CursorFetchTest.java b/org/postgresql/test/jdbc2/CursorFetchTest.java
deleted file mode 100644
index a44e901..0000000
--- a/org/postgresql/test/jdbc2/CursorFetchTest.java
+++ /dev/null
@@ -1,432 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import java.sql.*;
-
-import junit.framework.TestCase;
-
-import org.postgresql.test.TestUtil;
-
-/*
- * Tests for using non-zero setFetchSize().
- */
-public class CursorFetchTest extends TestCase
-{
- private Connection con;
-
- public CursorFetchTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
- TestUtil.createTable(con, "test_fetch", "value integer");
- con.setAutoCommit(false);
- }
-
- protected void tearDown() throws Exception
- {
- if (!con.getAutoCommit())
- con.rollback();
-
- con.setAutoCommit(true);
- TestUtil.dropTable(con, "test_fetch");
- TestUtil.closeDB(con);
- }
-
- protected void createRows(int count) throws Exception
- {
- PreparedStatement stmt = con.prepareStatement("insert into test_fetch(value) values(?)");
- for (int i = 0; i < count; ++i)
- {
- stmt.setInt(1, i);
- stmt.executeUpdate();
- }
- }
-
- // Test various fetchsizes.
- public void testBasicFetch() throws Exception
- {
- createRows(100);
-
- PreparedStatement stmt = con.prepareStatement("select * from test_fetch order by value");
- int[] testSizes = { 0, 1, 49, 50, 51, 99, 100, 101 };
- for (int i = 0; i < testSizes.length; ++i)
- {
- stmt.setFetchSize(testSizes[i]);
- assertEquals(testSizes[i], stmt.getFetchSize());
-
- ResultSet rs = stmt.executeQuery();
- assertEquals(testSizes[i], rs.getFetchSize());
-
- int count = 0;
- while (rs.next())
- {
- assertEquals("query value error with fetch size " + testSizes[i], count, rs.getInt(1));
- ++count;
- }
-
- assertEquals("total query size error with fetch size " + testSizes[i], 100, count);
- }
- }
-
-
- // Similar, but for scrollable resultsets.
- public void testScrollableFetch() throws Exception
- {
- createRows(100);
-
- PreparedStatement stmt = con.prepareStatement("select * from test_fetch order by value",
- ResultSet.TYPE_SCROLL_INSENSITIVE,
- ResultSet.CONCUR_READ_ONLY);
-
- int[] testSizes = { 0, 1, 49, 50, 51, 99, 100, 101 };
- for (int i = 0; i < testSizes.length; ++i)
- {
- stmt.setFetchSize(testSizes[i]);
- assertEquals(testSizes[i], stmt.getFetchSize());
-
- ResultSet rs = stmt.executeQuery();
- assertEquals(testSizes[i], rs.getFetchSize());
-
- for (int j = 0; j <= 50; ++j)
- {
- assertTrue("ran out of rows at position " + j + " with fetch size " + testSizes[i], rs.next());
- assertEquals("query value error with fetch size " + testSizes[i], j, rs.getInt(1));
- }
-
- int position = 50;
- for (int j = 1; j < 100; ++j)
- {
- for (int k = 0; k < j; ++k)
- {
- if (j % 2 == 0)
- {
- ++position;
- assertTrue("ran out of rows doing a forward fetch on iteration " + j + "/" + k + " at position " + position + " with fetch size " + testSizes[i], rs.next());
- }
- else
- {
- --position;
- assertTrue("ran out of rows doing a reverse fetch on iteration " + j + "/" + k + " at position " + position + " with fetch size " + testSizes[i], rs.previous());
- }
-
- assertEquals("query value error on iteration " + j + "/" + k + " with fetch size " + testSizes[i], position, rs.getInt(1));
- }
- }
- }
- }
-
- public void testScrollableAbsoluteFetch() throws Exception
- {
- createRows(100);
-
- PreparedStatement stmt = con.prepareStatement("select * from test_fetch order by value",
- ResultSet.TYPE_SCROLL_INSENSITIVE,
- ResultSet.CONCUR_READ_ONLY);
-
- int[] testSizes = { 0, 1, 49, 50, 51, 99, 100, 101 };
- for (int i = 0; i < testSizes.length; ++i)
- {
- stmt.setFetchSize(testSizes[i]);
- assertEquals(testSizes[i], stmt.getFetchSize());
-
- ResultSet rs = stmt.executeQuery();
- assertEquals(testSizes[i], rs.getFetchSize());
-
- int position = 50;
- assertTrue("ran out of rows doing an absolute fetch at " + position + " with fetch size " + testSizes[i], rs.absolute(position + 1));
- assertEquals("query value error with fetch size " + testSizes[i], position, rs.getInt(1));
-
- for (int j = 1; j < 100; ++j)
- {
- if (j % 2 == 0)
- position += j;
- else
- position -= j;
-
- assertTrue("ran out of rows doing an absolute fetch at " + position + " on iteration " + j + " with fetchsize" + testSizes[i], rs.absolute(position + 1));
- assertEquals("query value error with fetch size " + testSizes[i], position, rs.getInt(1));
- }
- }
- }
-
- //
- // Tests for ResultSet.setFetchSize().
- //
-
- // test one:
- // set fetchsize = 0
- // run query (all rows should be fetched)
- // set fetchsize = 50 (should have no effect)
- // process results
- public void testResultSetFetchSizeOne() throws Exception
- {
- createRows(100);
-
- PreparedStatement stmt = con.prepareStatement("select * from test_fetch order by value");
- stmt.setFetchSize(0);
- ResultSet rs = stmt.executeQuery();
- rs.setFetchSize(50); // Should have no effect.
-
- int count = 0;
- while (rs.next())
- {
- assertEquals(count, rs.getInt(1));
- ++count;
- }
-
- assertEquals(100, count);
- }
-
- // test two:
- // set fetchsize = 25
- // run query (25 rows fetched)
- // set fetchsize = 0
- // process results:
- // process 25 rows
- // should do a FETCH ALL to get more data
- // process 75 rows
- public void testResultSetFetchSizeTwo() throws Exception
- {
- createRows(100);
-
- PreparedStatement stmt = con.prepareStatement("select * from test_fetch order by value");
- stmt.setFetchSize(25);
- ResultSet rs = stmt.executeQuery();
- rs.setFetchSize(0);
-
- int count = 0;
- while (rs.next())
- {
- assertEquals(count, rs.getInt(1));
- ++count;
- }
-
- assertEquals(100, count);
- }
-
- // test three:
- // set fetchsize = 25
- // run query (25 rows fetched)
- // set fetchsize = 50
- // process results:
- // process 25 rows. should NOT hit end-of-results here.
- // do a FETCH FORWARD 50
- // process 50 rows
- // do a FETCH FORWARD 50
- // process 25 rows. end of results.
- public void testResultSetFetchSizeThree() throws Exception
- {
- createRows(100);
-
- PreparedStatement stmt = con.prepareStatement("select * from test_fetch order by value");
- stmt.setFetchSize(25);
- ResultSet rs = stmt.executeQuery();
- rs.setFetchSize(50);
-
- int count = 0;
- while (rs.next())
- {
- assertEquals(count, rs.getInt(1));
- ++count;
- }
-
- assertEquals(100, count);
- }
-
- // test four:
- // set fetchsize = 50
- // run query (50 rows fetched)
- // set fetchsize = 25
- // process results:
- // process 50 rows.
- // do a FETCH FORWARD 25
- // process 25 rows
- // do a FETCH FORWARD 25
- // process 25 rows. end of results.
- public void testResultSetFetchSizeFour() throws Exception
- {
- createRows(100);
-
- PreparedStatement stmt = con.prepareStatement("select * from test_fetch order by value");
- stmt.setFetchSize(50);
- ResultSet rs = stmt.executeQuery();
- rs.setFetchSize(25);
-
- int count = 0;
- while (rs.next())
- {
- assertEquals(count, rs.getInt(1));
- ++count;
- }
-
- assertEquals(100, count);
- }
-
- public void testSingleRowResultPositioning() throws Exception
- {
- String msg;
- createRows(1);
-
- int[] sizes = { 0, 1, 10 };
- for (int i = 0; i < sizes.length; ++i)
- {
- Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
- stmt.setFetchSize(sizes[i]);
-
- // Create a one row result set.
- ResultSet rs = stmt.executeQuery("select * from test_fetch order by value");
-
- msg = "before-first row positioning error with fetchsize=" + sizes[i];
- assertTrue(msg, rs.isBeforeFirst());
- assertTrue(msg, !rs.isAfterLast());
- assertTrue(msg, !rs.isFirst());
- assertTrue(msg, !rs.isLast());
-
- msg = "row 1 positioning error with fetchsize=" + sizes[i];
- assertTrue(msg, rs.next());
-
- assertTrue(msg, !rs.isBeforeFirst());
- assertTrue(msg, !rs.isAfterLast());
- assertTrue(msg, rs.isFirst());
- assertTrue(msg, rs.isLast());
- assertEquals(msg, 0, rs.getInt(1));
-
- msg = "after-last row positioning error with fetchsize=" + sizes[i];
- assertTrue(msg, !rs.next());
-
- assertTrue(msg, !rs.isBeforeFirst());
- assertTrue(msg, rs.isAfterLast());
- assertTrue(msg, !rs.isFirst());
- assertTrue(msg, !rs.isLast());
-
- rs.close();
- stmt.close();
- }
- }
-
- public void testMultiRowResultPositioning() throws Exception
- {
- String msg;
-
- createRows(100);
-
- int[] sizes = { 0, 1, 10, 100 };
- for (int i = 0; i < sizes.length; ++i)
- {
- Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
- stmt.setFetchSize(sizes[i]);
-
- ResultSet rs = stmt.executeQuery("select * from test_fetch order by value");
- msg = "before-first row positioning error with fetchsize=" + sizes[i];
- assertTrue(msg, rs.isBeforeFirst());
- assertTrue(msg, !rs.isAfterLast());
- assertTrue(msg, !rs.isFirst());
- assertTrue(msg, !rs.isLast());
-
- for (int j = 0; j < 100; ++j)
- {
- msg = "row " + j + " positioning error with fetchsize=" + sizes[i];
- assertTrue(msg, rs.next());
- assertEquals(msg, j, rs.getInt(1));
-
- assertTrue(msg, !rs.isBeforeFirst());
- assertTrue(msg, !rs.isAfterLast());
- if (j == 0)
- assertTrue(msg, rs.isFirst());
- else
- assertTrue(msg, !rs.isFirst());
-
- if (j == 99)
- assertTrue(msg, rs.isLast());
- else
- assertTrue(msg, !rs.isLast());
- }
-
- msg = "after-last row positioning error with fetchsize=" + sizes[i];
- assertTrue(msg, !rs.next());
-
- assertTrue(msg, !rs.isBeforeFirst());
- assertTrue(msg, rs.isAfterLast());
- assertTrue(msg, !rs.isFirst());
- assertTrue(msg, !rs.isLast());
-
- rs.close();
- stmt.close();
- }
- }
-
- // Test odd queries that should not be transformed into cursor-based fetches.
- public void testInsert() throws Exception
- {
- // INSERT should not be transformed.
- PreparedStatement stmt = con.prepareStatement("insert into test_fetch(value) values(1)");
- stmt.setFetchSize(100); // Should be meaningless.
- stmt.executeUpdate();
- }
-
- public void testMultistatement() throws Exception
- {
- // Queries with multiple statements should not be transformed.
-
- createRows(100); // 0 .. 99
- PreparedStatement stmt = con.prepareStatement("insert into test_fetch(value) values(100); select * from test_fetch order by value");
- stmt.setFetchSize(10);
-
- assertTrue(!stmt.execute()); // INSERT
- assertTrue(stmt.getMoreResults()); // SELECT
- ResultSet rs = stmt.getResultSet();
- int count = 0;
- while (rs.next())
- {
- assertEquals(count, rs.getInt(1));
- ++count;
- }
-
- assertEquals(101, count);
- }
-
- // if the driver tries to use a cursor with autocommit on
- // it will fail because the cursor will disappear partway
- // through execution
- public void testNoCursorWithAutoCommit() throws Exception
- {
- createRows(10); // 0 .. 9
- con.setAutoCommit(true);
- Statement stmt = con.createStatement();
- stmt.setFetchSize(3);
- ResultSet rs = stmt.executeQuery("SELECT * FROM test_fetch ORDER BY value");
- int count = 0;
- while (rs.next())
- {
- assertEquals(count++, rs.getInt(1));
- }
-
- assertEquals(10, count);
- }
-
- public void testGetRow() throws SQLException
- {
- Statement stmt = con.createStatement();
- stmt.setFetchSize(1);
- ResultSet rs = stmt.executeQuery("SELECT 1 UNION SELECT 2 UNION SELECT 3");
- int count = 0;
- while (rs.next())
- {
- count++;
- assertEquals(count, rs.getInt(1));
- assertEquals(count, rs.getRow());
- }
- assertEquals(3, count);
- }
-
-}
diff --git a/org/postgresql/test/jdbc2/DatabaseEncodingTest.java b/org/postgresql/test/jdbc2/DatabaseEncodingTest.java
deleted file mode 100644
index a72cd60..0000000
--- a/org/postgresql/test/jdbc2/DatabaseEncodingTest.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-import java.sql.*;
-import org.postgresql.core.Encoding;
-import java.io.IOException;
-import java.util.Arrays;
-
-/*
- * Test case for various encoding problems.
- *
- * Ensure that we can do a round-trip of all server-supported unicode
- * values without trashing them, and that bad encodings are
- * detected.
- */
-public class DatabaseEncodingTest extends TestCase
-{
- private Connection con;
-
- public DatabaseEncodingTest(String name)
- {
- super(name);
- }
-
- private static final int STEP = 100;
-
- // Set up the fixture for this testcase: a connection to a database with
- // a table for this test.
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
- TestUtil.createTable(con,
- "testdbencoding",
- "unicode_ordinal integer primary key not null, unicode_string varchar(" + STEP + ")");
- // disabling auto commit makes the test run faster
- // by not committing each insert individually.
- con.setAutoCommit(false);
- }
-
- // Tear down the fixture for this test case.
- protected void tearDown() throws Exception
- {
- con.setAutoCommit(true);
- TestUtil.dropTable(con, "testdbencoding");
- TestUtil.closeDB(con);
- }
-
- private static String dumpString(String s) {
- StringBuffer sb = new StringBuffer(s.length() * 6);
- for (int i = 0; i < s.length(); ++i)
- {
- sb.append("\\u");
- char c = s.charAt(i);
- sb.append(Integer.toHexString((c >> 12)&15));
- sb.append(Integer.toHexString((c >> 8)&15));
- sb.append(Integer.toHexString((c >> 4)&15));
- sb.append(Integer.toHexString(c&15));
- }
- return sb.toString();
- }
-
- public void testEncoding() throws Exception {
- // Check that we have a UTF8 server encoding, or we must skip this test.
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT getdatabaseencoding()");
- assertTrue(rs.next());
-
- String dbEncoding = rs.getString(1);
- if (!dbEncoding.equals("UTF8"))
- {
- System.err.println("DatabaseEncodingTest: Skipping UTF8 database tests as test database encoding is " + dbEncoding);
- rs.close();
- return ; // not a UTF8 database.
- }
-
- rs.close();
-
- boolean testHighUnicode = TestUtil.haveMinimumServerVersion(con, "8.1");
-
- // Create data.
- // NB: we avoid d800-dfff as those are reserved for surrogates in UTF-16
- PreparedStatement insert = con.prepareStatement("INSERT INTO testdbencoding(unicode_ordinal, unicode_string) VALUES (?,?)");
- for (int i = 1; i < 0xd800; i += STEP)
- {
- int count = (i + STEP) > 0xd800 ? 0xd800 - i : STEP;
- char[] testChars = new char[count];
- for (int j = 0; j < count; ++j)
- testChars[j] = (char)(i + j);
-
- String testString = new String(testChars);
-
- insert.setInt(1, i);
- insert.setString(2, testString);
- assertEquals(1, insert.executeUpdate());
- }
-
- for (int i = 0xe000; i < 0x10000; i += STEP)
- {
- int count = (i + STEP) > 0x10000 ? 0x10000 - i : STEP;
- char[] testChars = new char[count];
- for (int j = 0; j < count; ++j)
- testChars[j] = (char)(i + j);
-
- String testString = new String(testChars);
-
- insert.setInt(1, i);
- insert.setString(2, testString);
- assertEquals(1, insert.executeUpdate());
- }
-
- if (testHighUnicode) {
- for (int i = 0x10000; i < 0x110000; i += STEP)
- {
- int count = (i + STEP) > 0x110000 ? 0x110000 - i : STEP;
- char[] testChars = new char[count*2];
- for (int j = 0; j < count; ++j) {
- testChars[j*2] = (char)(0xd800 + ((i + j - 0x10000) >> 10));
- testChars[j*2+1] = (char)(0xdc00 + ((i + j - 0x10000) & 0x3ff));
- }
-
- String testString = new String(testChars);
-
- insert.setInt(1, i);
- insert.setString(2, testString);
-
- //System.err.println("Inserting: " + dumpString(testString));
-
- assertEquals(1, insert.executeUpdate());
- }
- }
-
- con.commit();
-
- // Check data.
- stmt.setFetchSize(1);
- rs = stmt.executeQuery("SELECT unicode_ordinal, unicode_string FROM testdbencoding ORDER BY unicode_ordinal");
- for (int i = 1; i < 0xd800; i += STEP)
- {
- assertTrue(rs.next());
- assertEquals(i, rs.getInt(1));
-
- int count = (i + STEP) > 0xd800 ? 0xd800 - i : STEP;
- char[] testChars = new char[count];
- for (int j = 0; j < count; ++j)
- testChars[j] = (char)(i + j);
-
- String testString = new String(testChars);
-
- assertEquals("Test string: " + dumpString(testString), dumpString(testString), dumpString(rs.getString(2)));
- }
-
- for (int i = 0xe000; i < 0x10000; i += STEP)
- {
- assertTrue(rs.next());
- assertEquals(i, rs.getInt(1));
-
- int count = (i + STEP) > 0x10000 ? 0x10000 - i : STEP;
- char[] testChars = new char[count];
- for (int j = 0; j < count; ++j)
- testChars[j] = (char)(i + j);
-
- String testString = new String(testChars);
-
- assertEquals("Test string: " + dumpString(testString), dumpString(testString), dumpString(rs.getString(2)));
- }
-
- if (testHighUnicode) {
- for (int i = 0x10000; i < 0x110000; i += STEP)
- {
- assertTrue(rs.next());
- assertEquals(i, rs.getInt(1));
-
- int count = (i + STEP) > 0x110000 ? 0x110000 - i : STEP;
- char[] testChars = new char[count*2];
- for (int j = 0; j < count; ++j) {
- testChars[j*2] = (char)(0xd800 + ((i + j - 0x10000) >> 10));
- testChars[j*2+1] = (char)(0xdc00 + ((i + j - 0x10000) & 0x3ff));
- }
-
- String testString = new String(testChars);
-
- assertEquals("Test string: " + dumpString(testString), dumpString(testString), dumpString(rs.getString(2)));
- }
- }
- }
-
- public void testUTF8Decode() throws Exception {
- // Tests for our custom UTF-8 decoder.
-
- Encoding utf8Encoding = Encoding.getJVMEncoding("UTF-8");
-
- for (int ch = 0; ch < 0x110000; ++ch) {
- if (ch >= 0xd800 && ch < 0xe000)
- continue; // Surrogate range.
-
- String testString;
- if (ch >= 0x10000) {
- testString = new String(new char[] {
- (char) (0xd800 + ((ch-0x10000) >> 10)),
- (char) (0xdc00 + ((ch-0x10000) & 0x3ff)) });
- } else {
- testString = new String(new char[] { (char)ch });
- }
-
- byte[] jvmEncoding = testString.getBytes("UTF-8");
- String jvmDecoding = new String(jvmEncoding, 0, jvmEncoding.length, "UTF-8");
- String ourDecoding = utf8Encoding.decode(jvmEncoding, 0, jvmEncoding.length);
-
- assertEquals("Test string: " + dumpString(testString), dumpString(testString), dumpString(jvmDecoding));
- assertEquals("Test string: " + dumpString(testString), dumpString(testString), dumpString(ourDecoding));
- }
- }
-
- public void testBadUTF8Decode() throws Exception {
- Encoding utf8Encoding = Encoding.getJVMEncoding("UTF-8");
-
- byte[][] badSequences = new byte[][] {
- // One-byte illegal sequences
- { (byte)0x80 }, // First byte may not be 10xxxxxx
-
- // Two-byte illegal sequences
- { (byte)0xc0, (byte)0x00 }, // Second byte must be 10xxxxxx
- { (byte)0xc0, (byte)0x80 }, // Can't represent a value < 0x80
-
- // Three-byte illegal sequences
- { (byte)0xe0, (byte)0x00 }, // Second byte must be 10xxxxxx
- { (byte)0xe0, (byte)0x80, (byte)0x00 }, // Third byte must be 10xxxxxx
- { (byte)0xe0, (byte)0x80, (byte)0x80 }, // Can't represent a value < 0x800
- { (byte)0xed, (byte)0xa0, (byte)0x80 }, // Not allowed to encode the range d800..dfff
-
- // Four-byte illegal sequences
- { (byte)0xf0, (byte)0x00 }, // Second byte must be 10xxxxxx
- { (byte)0xf0, (byte)0x80, (byte)0x00 }, // Third byte must be 10xxxxxx
- { (byte)0xf0, (byte)0x80, (byte)0x80, (byte)0x00 }, // Fourth byte must be 10xxxxxx
- { (byte)0xf0, (byte)0x80, (byte)0x80, (byte)0x80 }, // Can't represent a value < 0x10000
-
- // Five-byte illegal sequences
- { (byte)0xf8 }, // Can't have a five-byte sequence.
-
- // Six-byte illegal sequences
- { (byte)0xfc }, // Can't have a six-byte sequence.
-
- // Seven-byte illegal sequences
- { (byte)0xfe }, // Can't have a seven-byte sequence.
-
- // Eigth-byte illegal sequences
- { (byte)0xff }, // Can't have an eight-byte sequence.
- };
-
- byte[] paddedSequence = new byte[32];
- for (int i = 0; i < badSequences.length; ++i) {
- byte[] sequence = badSequences[i];
-
- try {
- String str = utf8Encoding.decode(sequence, 0, sequence.length);
- fail("Expected an IOException on sequence " + i + ", but decoded to <" + str + ">");
- } catch (IOException ioe) {
- // Expected exception.
- }
-
- // Try it with padding.
- Arrays.fill(paddedSequence, (byte)0);
- System.arraycopy(sequence, 0, paddedSequence, 0, sequence.length);
-
- try {
- String str = utf8Encoding.decode(paddedSequence, 0, paddedSequence.length);
- fail("Expected an IOException on sequence " + i + ", but decoded to <" + str + ">");
- } catch (IOException ioe) {
- // Expected exception.
- }
- }
- }
-
- public void testTruncatedUTF8Decode() throws Exception {
- Encoding utf8Encoding = Encoding.getJVMEncoding("UTF-8");
-
- byte[][] shortSequences = new byte[][] {
- { (byte)0xc0 }, // Second byte must be present
-
- { (byte)0xe0 }, // Second byte must be present
- { (byte)0xe0, (byte)0x80 }, // Third byte must be present
-
- { (byte)0xf0 }, // Second byte must be present
- { (byte)0xf0, (byte)0x80 }, // Third byte must be present
- { (byte)0xf0, (byte)0x80, (byte)0x80 }, // Fourth byte must be present
- };
-
- byte[] paddedSequence = new byte[32];
- for (int i = 0; i < shortSequences.length; ++i) {
- byte[] sequence = shortSequences[i];
-
- try {
- String str = utf8Encoding.decode(sequence, 0, sequence.length);
- fail("Expected an IOException on sequence " + i + ", but decoded to <" + str + ">");
- } catch (IOException ioe) {
- // Expected exception.
- }
-
-
- // Try it with padding and a truncated length.
- Arrays.fill(paddedSequence, (byte)0);
- System.arraycopy(sequence, 0, paddedSequence, 0, sequence.length);
-
- try {
- String str = utf8Encoding.decode(paddedSequence, 0, sequence.length);
- fail("Expected an IOException on sequence " + i + ", but decoded to <" + str + ">");
- } catch (IOException ioe) {
- // Expected exception.
- }
- }
- }
-}
diff --git a/org/postgresql/test/jdbc2/DatabaseMetaDataPropertiesTest.java b/org/postgresql/test/jdbc2/DatabaseMetaDataPropertiesTest.java
deleted file mode 100644
index d6cb1c7..0000000
--- a/org/postgresql/test/jdbc2/DatabaseMetaDataPropertiesTest.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-import java.sql.*;
-
-/*
- * TestCase to test the internal functionality of
- * org.postgresql.jdbc2.DatabaseMetaData's various properties.
- * Methods which return a ResultSet are tested elsewhere.
- * This avoids a complicated setUp/tearDown for something like
- * assertTrue(dbmd.nullPlusNonNullIsNull());
- */
-
-public class DatabaseMetaDataPropertiesTest extends TestCase
-{
-
- private Connection con;
- /*
- * Constructor
- */
- public DatabaseMetaDataPropertiesTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
- }
- protected void tearDown() throws Exception
- {
- TestUtil.closeDB( con );
- }
-
- /*
- * The spec says this may return null, but we always do!
- */
- public void testGetMetaData() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
- }
-
- /*
- * Test default capabilities
- */
- public void testCapabilities() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
-
- assertTrue(dbmd.allProceduresAreCallable());
- assertTrue(dbmd.allTablesAreSelectable()); // not true all the time
-
- // This should always be false for postgresql (at least for 7.x)
- assertTrue(!dbmd.isReadOnly());
-
- // we support multiple resultsets via multiple statements in one execute() now
- assertTrue(dbmd.supportsMultipleResultSets());
-
- // yes, as multiple backends can have transactions open
- assertTrue(dbmd.supportsMultipleTransactions());
-
- assertTrue(dbmd.supportsMinimumSQLGrammar());
- assertTrue(!dbmd.supportsCoreSQLGrammar());
- assertTrue(!dbmd.supportsExtendedSQLGrammar());
- if (TestUtil.haveMinimumServerVersion(con, "7.3"))
- assertTrue(dbmd.supportsANSI92EntryLevelSQL());
- else
- assertTrue(!dbmd.supportsANSI92EntryLevelSQL());
- assertTrue(!dbmd.supportsANSI92IntermediateSQL());
- assertTrue(!dbmd.supportsANSI92FullSQL());
-
- assertTrue(dbmd.supportsIntegrityEnhancementFacility());
-
- }
-
- public void testJoins() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
-
- assertTrue(dbmd.supportsOuterJoins());
- assertTrue(dbmd.supportsFullOuterJoins());
- assertTrue(dbmd.supportsLimitedOuterJoins());
- }
-
- public void testCursors() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
-
- assertTrue(!dbmd.supportsPositionedDelete());
- assertTrue(!dbmd.supportsPositionedUpdate());
- }
-
- public void testValues() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
- int indexMaxKeys = dbmd.getMaxColumnsInIndex();
- if (TestUtil.haveMinimumServerVersion(con, "7.3"))
- {
- assertEquals(32, indexMaxKeys);
- }
- else
- {
- assertEquals(16, indexMaxKeys);
- }
- }
-
- public void testNulls() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
-
- assertTrue(!dbmd.nullsAreSortedAtStart());
- assertTrue( dbmd.nullsAreSortedAtEnd() != TestUtil.haveMinimumServerVersion(con, "7.2"));
- assertTrue( dbmd.nullsAreSortedHigh() == TestUtil.haveMinimumServerVersion(con, "7.2"));
- assertTrue(!dbmd.nullsAreSortedLow());
-
- assertTrue(dbmd.nullPlusNonNullIsNull());
-
- assertTrue(dbmd.supportsNonNullableColumns());
- }
-
- public void testLocalFiles() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
-
- assertTrue(!dbmd.usesLocalFilePerTable());
- assertTrue(!dbmd.usesLocalFiles());
- }
-
- public void testIdentifiers() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
-
- assertTrue(!dbmd.supportsMixedCaseIdentifiers()); // always false
- assertTrue(dbmd.supportsMixedCaseQuotedIdentifiers()); // always true
-
- assertTrue(!dbmd.storesUpperCaseIdentifiers()); // always false
- assertTrue(dbmd.storesLowerCaseIdentifiers()); // always true
- assertTrue(!dbmd.storesUpperCaseQuotedIdentifiers()); // always false
- assertTrue(!dbmd.storesLowerCaseQuotedIdentifiers()); // always false
- assertTrue(!dbmd.storesMixedCaseQuotedIdentifiers()); // always false
-
- assertTrue(dbmd.getIdentifierQuoteString().equals("\""));
-
- }
-
- public void testTables() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
-
- // we can add columns
- assertTrue(dbmd.supportsAlterTableWithAddColumn());
-
- // we can only drop columns in >= 7.3
- if (TestUtil.haveMinimumServerVersion(con, "7.3"))
- {
- assertTrue(dbmd.supportsAlterTableWithDropColumn());
- }
- else
- {
- assertTrue(!dbmd.supportsAlterTableWithDropColumn());
- }
- }
-
- public void testSelect() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
-
- // yes we can?: SELECT col a FROM a;
- assertTrue(dbmd.supportsColumnAliasing());
-
- // yes we can have expressions in ORDERBY
- assertTrue(dbmd.supportsExpressionsInOrderBy());
-
- // Yes, an ORDER BY clause can contain columns that are not in the
- // SELECT clause.
- assertTrue(dbmd.supportsOrderByUnrelated());
-
- assertTrue(dbmd.supportsGroupBy());
- assertTrue(dbmd.supportsGroupByUnrelated());
- assertTrue(dbmd.supportsGroupByBeyondSelect()); // needs checking
- }
-
- public void testDBParams() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
-
- assertTrue(dbmd.getURL().equals(TestUtil.getURL()));
- assertTrue(dbmd.getUserName().equals(TestUtil.getUser()));
- }
-
- public void testDbProductDetails() throws SQLException
- {
- assertTrue(con instanceof org.postgresql.PGConnection);
-
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
-
- assertTrue(dbmd.getDatabaseProductName().equals("PostgreSQL"));
- }
-
- public void testDriverVersioning() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
-
- assertTrue(dbmd.getDriverVersion().equals(org.postgresql.Driver.getVersion()));
- assertTrue(dbmd.getDriverMajorVersion() == org.postgresql.Driver.MAJORVERSION);
- assertTrue(dbmd.getDriverMinorVersion() == org.postgresql.Driver.MINORVERSION);
- }
-}
-
diff --git a/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java b/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java
deleted file mode 100644
index c147597..0000000
--- a/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java
+++ /dev/null
@@ -1,1128 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-import java.sql.*;
-import java.util.ArrayList;
-import java.util.List;
-
-/*
- * TestCase to test the internal functionality of org.postgresql.jdbc2.DatabaseMetaData
- *
- */
-
-public class DatabaseMetaDataTest extends TestCase
-{
-
- private Connection con;
- /*
- * Constructor
- */
- public DatabaseMetaDataTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
- TestUtil.createTable( con, "metadatatest", "id int4, name text, updated timestamptz, colour text, quest text" );
- TestUtil.dropSequence( con, "sercoltest_b_seq");
- TestUtil.dropSequence( con, "sercoltest_c_seq");
- TestUtil.createTable( con, "sercoltest", "a int, b serial, c bigserial");
- TestUtil.createTable( con, "\"a\\\"", "a int4");
- TestUtil.createTable( con, "\"a'\"", "a int4");
- TestUtil.createTable( con, "arraytable", "a numeric(5,2)[], b varchar(100)[]");
-
- Statement stmt = con.createStatement();
- //we add the following comments to ensure the joins to the comments
- //are done correctly. This ensures we correctly test that case.
- stmt.execute("comment on table metadatatest is 'this is a table comment'");
- stmt.execute("comment on column metadatatest.id is 'this is a column comment'");
-
- stmt.execute("CREATE OR REPLACE FUNCTION f1(int, varchar) RETURNS int AS 'SELECT 1;' LANGUAGE SQL");
- if (TestUtil.haveMinimumServerVersion(con, "8.0")) {
- stmt.execute("CREATE OR REPLACE FUNCTION f2(a int, b varchar) RETURNS int AS 'SELECT 1;' LANGUAGE SQL");
- }
- if (TestUtil.haveMinimumServerVersion(con, "8.1")) {
- stmt.execute("CREATE OR REPLACE FUNCTION f3(IN a int, INOUT b varchar, OUT c timestamptz) AS $f$ BEGIN b := 'a'; c := now(); return; END; $f$ LANGUAGE plpgsql");
- }
- stmt.execute("CREATE OR REPLACE FUNCTION f4(int) RETURNS metadatatest AS 'SELECT 1, ''a''::text, now(), ''c''::text, ''q''::text' LANGUAGE SQL");
-
- if (TestUtil.haveMinimumServerVersion(con, "7.3")) {
- stmt.execute("CREATE DOMAIN nndom AS int not null");
- stmt.execute("CREATE TABLE domaintable (id nndom)");
- }
- stmt.close();
- }
-
- protected void tearDown() throws Exception
- {
- // Drop function first because it depends on the
- // metadatatest table's type
- Statement stmt = con.createStatement();
- stmt.execute("DROP FUNCTION f4(int)");
-
- TestUtil.dropTable( con, "metadatatest" );
- TestUtil.dropTable( con, "sercoltest");
- TestUtil.dropSequence( con, "sercoltest_b_seq");
- TestUtil.dropSequence( con, "sercoltest_c_seq");
- TestUtil.dropTable( con, "\"a\\\"");
- TestUtil.dropTable( con, "\"a'\"");
- TestUtil.dropTable( con, "arraytable");
-
- stmt.execute("DROP FUNCTION f1(int, varchar)");
- if (TestUtil.haveMinimumServerVersion(con, "8.0")) {
- stmt.execute("DROP FUNCTION f2(int, varchar)");
- }
- if (TestUtil.haveMinimumServerVersion(con, "8.1")) {
- stmt.execute("DROP FUNCTION f3(int, varchar)");
- }
- if (TestUtil.haveMinimumServerVersion(con, "7.3")) {
- stmt.execute("DROP TABLE domaintable");
- stmt.execute("DROP DOMAIN nndom");
- }
-
- TestUtil.closeDB( con );
- }
-
- public void testTables() throws Exception
- {
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
-
- ResultSet rs = dbmd.getTables( null, null, "metadatates%", new String[] {"TABLE"});
- assertTrue( rs.next() );
- String tableName = rs.getString("TABLE_NAME");
- assertEquals( "metadatatest", tableName );
- String tableType = rs.getString("TABLE_TYPE");
- assertEquals( "TABLE", tableType );
- //There should only be one row returned
- assertTrue( "getTables() returned too many rows", rs.next() == false);
- rs.close();
-
- rs = dbmd.getColumns("", "", "meta%", "%" );
- assertTrue( rs.next() );
- assertEquals( "metadatatest", rs.getString("TABLE_NAME") );
- assertEquals( "id", rs.getString("COLUMN_NAME") );
- assertEquals( java.sql.Types.INTEGER, rs.getInt("DATA_TYPE") );
-
- assertTrue( rs.next() );
- assertEquals( "metadatatest", rs.getString("TABLE_NAME") );
- assertEquals( "name", rs.getString("COLUMN_NAME") );
- assertEquals( java.sql.Types.VARCHAR, rs.getInt("DATA_TYPE") );
-
- assertTrue( rs.next() );
- assertEquals( "metadatatest", rs.getString("TABLE_NAME") );
- assertEquals( "updated", rs.getString("COLUMN_NAME") );
- assertEquals( java.sql.Types.TIMESTAMP, rs.getInt("DATA_TYPE") );
- }
-
- public void testCrossReference() throws Exception
- {
- Connection con1 = TestUtil.openDB();
-
- TestUtil.createTable( con1, "vv", "a int not null, b int not null, primary key ( a, b )" );
-
- TestUtil.createTable( con1, "ww", "m int not null, n int not null, primary key ( m, n ), foreign key ( m, n ) references vv ( a, b )" );
-
-
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
-
- ResultSet rs = dbmd.getCrossReference(null, "", "vv", null, "", "ww" );
-
- for (int j = 1; rs.next(); j++ )
- {
-
- String pkTableName = rs.getString( "PKTABLE_NAME" );
- assertEquals ( "vv", pkTableName );
-
- String pkColumnName = rs.getString( "PKCOLUMN_NAME" );
- assertTrue( pkColumnName.equals("a") || pkColumnName.equals("b"));
-
- String fkTableName = rs.getString( "FKTABLE_NAME" );
- assertEquals( "ww", fkTableName );
-
- String fkColumnName = rs.getString( "FKCOLUMN_NAME" );
- assertTrue( fkColumnName.equals( "m" ) || fkColumnName.equals( "n" ) ) ;
-
- String fkName = rs.getString( "FK_NAME" );
- if (TestUtil.haveMinimumServerVersion(con1, "8.0"))
- {
- assertEquals("ww_m_fkey", fkName);
- }
- else if (TestUtil.haveMinimumServerVersion(con1, "7.3"))
- {
- assertTrue(fkName.startsWith("$1"));
- }
- else
- {
- assertTrue( fkName.startsWith( "<unnamed>") );
- }
-
- String pkName = rs.getString( "PK_NAME" );
- assertEquals( "vv_pkey", pkName );
-
- int keySeq = rs.getInt( "KEY_SEQ" );
- assertEquals( j, keySeq );
- }
-
-
- TestUtil.dropTable( con1, "vv" );
- TestUtil.dropTable( con1, "ww" );
- TestUtil.closeDB(con1);
- }
-
- public void testForeignKeyActions() throws Exception
- {
- Connection conn = TestUtil.openDB();
- TestUtil.createTable(conn, "pkt", "id int primary key");
- TestUtil.createTable(conn, "fkt1", "id int references pkt on update restrict on delete cascade");
- TestUtil.createTable(conn, "fkt2", "id int references pkt on update set null on delete set default");
- DatabaseMetaData dbmd = conn.getMetaData();
-
- ResultSet rs = dbmd.getImportedKeys(null, "", "fkt1");
- assertTrue(rs.next());
- assertTrue(rs.getInt("UPDATE_RULE") == DatabaseMetaData.importedKeyRestrict);
- assertTrue(rs.getInt("DELETE_RULE") == DatabaseMetaData.importedKeyCascade);
- rs.close();
-
- rs = dbmd.getImportedKeys(null, "", "fkt2");
- assertTrue(rs.next());
- assertTrue(rs.getInt("UPDATE_RULE") == DatabaseMetaData.importedKeySetNull);
- assertTrue(rs.getInt("DELETE_RULE") == DatabaseMetaData.importedKeySetDefault);
- rs.close();
-
- TestUtil.dropTable(conn, "fkt2");
- TestUtil.dropTable(conn, "fkt1");
- TestUtil.dropTable(conn, "pkt");
- TestUtil.closeDB(conn);
- }
-
- public void testForeignKeysToUniqueIndexes() throws Exception
- {
- if (!TestUtil.haveMinimumServerVersion(con, "7.4"))
- return ;
-
- Connection con1 = TestUtil.openDB();
- TestUtil.createTable( con1, "pkt", "a int not null, b int not null, CONSTRAINT pkt_pk_a PRIMARY KEY (a), CONSTRAINT pkt_un_b UNIQUE (b)");
- TestUtil.createTable( con1, "fkt", "c int, d int, CONSTRAINT fkt_fk_c FOREIGN KEY (c) REFERENCES pkt(b)");
-
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getImportedKeys("", "", "fkt");
- int j = 0;
- for (; rs.next(); j++)
- {
- assertTrue("pkt".equals(rs.getString("PKTABLE_NAME")));
- assertTrue("fkt".equals(rs.getString("FKTABLE_NAME")));
- assertTrue("pkt_un_b".equals(rs.getString("PK_NAME")));
- assertTrue("b".equals(rs.getString("PKCOLUMN_NAME")));
- }
- assertTrue(j == 1);
-
- TestUtil.dropTable(con1, "fkt");
- TestUtil.dropTable(con1, "pkt");
- con1.close();
- }
-
- public void testMultiColumnForeignKeys() throws Exception
- {
- Connection con1 = TestUtil.openDB();
- TestUtil.createTable( con1, "pkt", "a int not null, b int not null, CONSTRAINT pkt_pk PRIMARY KEY (a,b)");
- TestUtil.createTable( con1, "fkt", "c int, d int, CONSTRAINT fkt_fk_pkt FOREIGN KEY (c,d) REFERENCES pkt(b,a)");
-
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getImportedKeys("", "", "fkt");
- int j = 0;
- for (; rs.next(); j++)
- {
- assertTrue("pkt".equals(rs.getString("PKTABLE_NAME")));
- assertTrue("fkt".equals(rs.getString("FKTABLE_NAME")));
- assertTrue(j + 1 == rs.getInt("KEY_SEQ"));
- if (j == 0)
- {
- assertTrue("b".equals(rs.getString("PKCOLUMN_NAME")));
- assertTrue("c".equals(rs.getString("FKCOLUMN_NAME")));
- }
- else
- {
- assertTrue("a".equals(rs.getString("PKCOLUMN_NAME")));
- assertTrue("d".equals(rs.getString("FKCOLUMN_NAME")));
- }
- }
- assertTrue(j == 2);
-
- TestUtil.dropTable(con1, "fkt");
- TestUtil.dropTable(con1, "pkt");
- con1.close();
- }
-
- public void testSameTableForeignKeys() throws Exception
- {
- Connection con1 = TestUtil.openDB();
-
- TestUtil.createTable( con1, "person", "FIRST_NAME character varying(100) NOT NULL,"+
- "LAST_NAME character varying(100) NOT NULL,"+
- "FIRST_NAME_PARENT_1 character varying(100),"+
- "LAST_NAME_PARENT_1 character varying(100),"+
- "FIRST_NAME_PARENT_2 character varying(100),"+
- "LAST_NAME_PARENT_2 character varying(100),"+
- "CONSTRAINT PERSON_pkey PRIMARY KEY (FIRST_NAME , LAST_NAME ),"+
- "CONSTRAINT PARENT_1_fkey FOREIGN KEY (FIRST_NAME_PARENT_1, LAST_NAME_PARENT_1)"+
- "REFERENCES PERSON (FIRST_NAME, LAST_NAME) MATCH SIMPLE "+
- "ON UPDATE CASCADE ON DELETE CASCADE,"+
- "CONSTRAINT PARENT_2_fkey FOREIGN KEY (FIRST_NAME_PARENT_2, LAST_NAME_PARENT_2)"+
- "REFERENCES PERSON (FIRST_NAME, LAST_NAME) MATCH SIMPLE "+
- "ON UPDATE CASCADE ON DELETE CASCADE" );
-
-
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
- ResultSet rs = dbmd.getImportedKeys(null, "", "person");
-
- final List<String> fkNames = new ArrayList<String>();
-
- int lastFieldCount = -1;
- while (rs.next()) {
- // destination table (all foreign keys point to the same)
- String pkTableName = rs.getString("PKTABLE_NAME");
- assertEquals("person", pkTableName);
-
- // destination fields
- String pkColumnName = rs.getString("PKCOLUMN_NAME");
- assertTrue("first_name".equals(pkColumnName) || "last_name".equals(pkColumnName));
-
- // source table (all foreign keys are in the same)
- String fkTableName = rs.getString("FKTABLE_NAME");
- assertEquals("person", fkTableName);
-
- // foreign key name
- String fkName = rs.getString("FK_NAME");
- // sequence number within the foreign key
- int seq = rs.getInt("KEY_SEQ");
- if (seq == 1) {
- // begin new foreign key
- assertFalse(fkNames.contains(fkName));
- fkNames.add(fkName);
- // all foreign keys have 2 fields
- assertTrue(lastFieldCount < 0 || lastFieldCount == 2);
- } else {
- // continue foreign key, i.e. fkName matches the last foreign key
- assertEquals(fkNames.get(fkNames.size() - 1), fkName);
- // see always increases by 1
- assertTrue(seq == lastFieldCount + 1);
- }
- lastFieldCount = seq;
- }
- // there's more than one foreign key from a table to another
- assertEquals(2, fkNames.size());
-
- TestUtil.dropTable( con1, "person" );
- TestUtil.closeDB(con1);
-
-
-
-
- }
- public void testForeignKeys() throws Exception
- {
- Connection con1 = TestUtil.openDB();
- TestUtil.createTable( con1, "people", "id int4 primary key, name text" );
- TestUtil.createTable( con1, "policy", "id int4 primary key, name text" );
-
- TestUtil.createTable( con1, "users", "id int4 primary key, people_id int4, policy_id int4," +
- "CONSTRAINT people FOREIGN KEY (people_id) references people(id)," +
- "constraint policy FOREIGN KEY (policy_id) references policy(id)" );
-
-
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
-
- ResultSet rs = dbmd.getImportedKeys(null, "", "users" );
- int j = 0;
- for (; rs.next(); j++ )
- {
-
- String pkTableName = rs.getString( "PKTABLE_NAME" );
- assertTrue ( pkTableName.equals("people") || pkTableName.equals("policy") );
-
- String pkColumnName = rs.getString( "PKCOLUMN_NAME" );
- assertEquals( "id", pkColumnName );
-
- String fkTableName = rs.getString( "FKTABLE_NAME" );
- assertEquals( "users", fkTableName );
-
- String fkColumnName = rs.getString( "FKCOLUMN_NAME" );
- assertTrue( fkColumnName.equals( "people_id" ) || fkColumnName.equals( "policy_id" ) ) ;
-
- String fkName = rs.getString( "FK_NAME" );
- assertTrue( fkName.startsWith( "people") || fkName.startsWith( "policy" ) );
-
- String pkName = rs.getString( "PK_NAME" );
- assertTrue( pkName.equals( "people_pkey") || pkName.equals( "policy_pkey" ) );
-
- }
-
- assertTrue ( j == 2 );
-
- rs = dbmd.getExportedKeys( null, "", "people" );
-
- // this is hacky, but it will serve the purpose
- assertTrue ( rs.next() );
-
- assertEquals( "people", rs.getString( "PKTABLE_NAME" ) );
- assertEquals( "id", rs.getString( "PKCOLUMN_NAME" ) );
-
- assertEquals( "users", rs.getString( "FKTABLE_NAME" ) );
- assertEquals( "people_id", rs.getString( "FKCOLUMN_NAME" ) );
-
- assertTrue( rs.getString( "FK_NAME" ).startsWith( "people" ) );
-
-
- TestUtil.dropTable( con1, "users" );
- TestUtil.dropTable( con1, "people" );
- TestUtil.dropTable( con1, "policy" );
- TestUtil.closeDB(con1);
- }
-
- public void testColumns() throws SQLException
- {
- // At the moment just test that no exceptions are thrown KJ
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
- ResultSet rs = dbmd.getColumns(null, null, "pg_class", null);
- rs.close();
- }
-
- public void testDroppedColumns() throws SQLException
- {
- if (!TestUtil.haveMinimumServerVersion(con, "8.4"))
- return;
-
- Statement stmt = con.createStatement();
- stmt.execute("ALTER TABLE metadatatest DROP name");
- stmt.execute("ALTER TABLE metadatatest DROP colour");
- stmt.close();
-
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getColumns(null, null, "metadatatest", null);
-
- assertTrue(rs.next());
- assertEquals("id", rs.getString("COLUMN_NAME"));
- assertEquals(1, rs.getInt("ORDINAL_POSITION"));
-
- assertTrue(rs.next());
- assertEquals("updated", rs.getString("COLUMN_NAME"));
- assertEquals(2, rs.getInt("ORDINAL_POSITION"));
-
- assertTrue(rs.next());
- assertEquals("quest", rs.getString("COLUMN_NAME"));
- assertEquals(3, rs.getInt("ORDINAL_POSITION"));
-
- rs.close();
-
- rs = dbmd.getColumns(null, null, "metadatatest", "quest");
- assertTrue(rs.next());
- assertEquals("quest", rs.getString("COLUMN_NAME"));
- assertEquals(3, rs.getInt("ORDINAL_POSITION"));
- assertTrue(!rs.next());
- rs.close();
- }
-
- public void testSerialColumns() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getColumns(null, null, "sercoltest", null);
- int rownum = 0;
- while (rs.next())
- {
- assertEquals("sercoltest", rs.getString("TABLE_NAME"));
- assertEquals(rownum + 1, rs.getInt("ORDINAL_POSITION"));
- if (rownum == 0)
- {
- assertEquals("int4", rs.getString("TYPE_NAME"));
- }
- else if (rownum == 1)
- {
- assertEquals("serial", rs.getString("TYPE_NAME"));
- }
- else if (rownum == 2)
- {
- assertEquals("bigserial", rs.getString("TYPE_NAME"));
- }
- rownum++;
- }
- assertEquals(3, rownum);
- rs.close();
- }
-
- public void testColumnPrivileges() throws SQLException
- {
- // At the moment just test that no exceptions are thrown KJ
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
- ResultSet rs = dbmd.getColumnPrivileges(null, null, "pg_statistic", null);
- rs.close();
- }
-
- public void testTablePrivileges() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
- ResultSet rs = dbmd.getTablePrivileges(null, null, "metadatatest");
- boolean l_foundSelect = false;
- while (rs.next())
- {
- if (rs.getString("GRANTEE").equals(TestUtil.getUser())
- && rs.getString("PRIVILEGE").equals("SELECT"))
- l_foundSelect = true;
- }
- rs.close();
- //Test that the table owner has select priv
- assertTrue("Couldn't find SELECT priv on table metadatatest for " + TestUtil.getUser(), l_foundSelect);
- }
-
- public void testNoTablePrivileges() throws SQLException
- {
- Statement stmt = con.createStatement();
- stmt.execute("REVOKE ALL ON metadatatest FROM PUBLIC");
- stmt.execute("REVOKE ALL ON metadatatest FROM " + TestUtil.getUser());
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getTablePrivileges(null, null, "metadatatest");
- assertTrue(!rs.next());
- }
-
- public void testPrimaryKeys() throws SQLException
- {
- // At the moment just test that no exceptions are thrown KJ
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
- ResultSet rs = dbmd.getPrimaryKeys(null, null, "pg_class");
- rs.close();
- }
-
- public void testIndexInfo() throws SQLException
- {
- Statement stmt = con.createStatement();
- stmt.execute("create index idx_id on metadatatest (id)");
- stmt.execute("create index idx_func_single on metadatatest (upper(colour))");
- stmt.execute("create unique index idx_un_id on metadatatest(id)");
- if (TestUtil.haveMinimumServerVersion(con, "7.4")) {
- stmt.execute("create index idx_func_multi on metadatatest (upper(colour), upper(quest))");
- stmt.execute("create index idx_func_mixed on metadatatest (colour, upper(quest))");
- }
-
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
- ResultSet rs = dbmd.getIndexInfo(null, null, "metadatatest", false, false);
-
- assertTrue(rs.next());
- assertEquals("idx_un_id", rs.getString("INDEX_NAME"));
- assertEquals(1, rs.getInt("ORDINAL_POSITION"));
- assertEquals("id", rs.getString("COLUMN_NAME"));
- assertTrue(!rs.getBoolean("NON_UNIQUE"));
-
- if (TestUtil.haveMinimumServerVersion(con, "7.4")) {
- assertTrue(rs.next());
- assertEquals("idx_func_mixed", rs.getString("INDEX_NAME"));
- assertEquals(1, rs.getInt("ORDINAL_POSITION"));
- assertEquals("colour", rs.getString("COLUMN_NAME"));
-
- assertTrue(rs.next());
- assertEquals("idx_func_mixed", rs.getString("INDEX_NAME"));
- assertEquals(2, rs.getInt("ORDINAL_POSITION"));
- assertEquals("upper(quest)", rs.getString("COLUMN_NAME"));
-
- assertTrue(rs.next());
- assertEquals("idx_func_multi", rs.getString("INDEX_NAME"));
- assertEquals(1, rs.getInt("ORDINAL_POSITION"));
- assertEquals("upper(colour)", rs.getString("COLUMN_NAME"));
-
- assertTrue(rs.next());
- assertEquals("idx_func_multi", rs.getString("INDEX_NAME"));
- assertEquals(2, rs.getInt("ORDINAL_POSITION"));
- assertEquals("upper(quest)", rs.getString("COLUMN_NAME"));
- }
-
- assertTrue(rs.next());
- assertEquals("idx_func_single", rs.getString("INDEX_NAME"));
- assertEquals(1, rs.getInt("ORDINAL_POSITION"));
- assertEquals("upper(colour)", rs.getString("COLUMN_NAME"));
-
- assertTrue(rs.next());
- assertEquals("idx_id", rs.getString("INDEX_NAME"));
- assertEquals(1, rs.getInt("ORDINAL_POSITION"));
- assertEquals("id", rs.getString("COLUMN_NAME"));
- assertTrue(rs.getBoolean("NON_UNIQUE"));
-
- assertTrue(!rs.next());
-
- rs.close();
- }
-
- public void testNotNullDomainColumn() throws SQLException
- {
- if (!TestUtil.haveMinimumServerVersion(con, "7.3"))
- return;
-
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getColumns("", "", "domaintable", "");
- assertTrue(rs.next());
- assertEquals("id", rs.getString("COLUMN_NAME"));
- assertEquals("NO", rs.getString("IS_NULLABLE"));
- assertTrue(!rs.next());
- }
-
- public void testAscDescIndexInfo() throws SQLException
- {
- if (!TestUtil.haveMinimumServerVersion(con, "8.3"))
- return;
-
- Statement stmt = con.createStatement();
- stmt.execute("CREATE INDEX idx_a_d ON metadatatest (id ASC, quest DESC)");
- stmt.close();
-
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getIndexInfo(null, null, "metadatatest", false, false);
-
- assertTrue(rs.next());
- assertEquals("idx_a_d", rs.getString("INDEX_NAME"));
- assertEquals("id", rs.getString("COLUMN_NAME"));
- assertEquals("A", rs.getString("ASC_OR_DESC"));
-
- assertTrue(rs.next());
- assertEquals("idx_a_d", rs.getString("INDEX_NAME"));
- assertEquals("quest", rs.getString("COLUMN_NAME"));
- assertEquals("D", rs.getString("ASC_OR_DESC"));
- }
-
- public void testPartialIndexInfo() throws SQLException
- {
- Statement stmt = con.createStatement();
- stmt.execute("create index idx_p_name_id on metadatatest (name) where id > 5");
- stmt.close();
-
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getIndexInfo(null, null, "metadatatest", false, false);
-
- assertTrue(rs.next());
- assertEquals("idx_p_name_id", rs.getString("INDEX_NAME"));
- assertEquals(1, rs.getInt("ORDINAL_POSITION"));
- assertEquals("name", rs.getString("COLUMN_NAME"));
- assertEquals("(id > 5)", rs.getString("FILTER_CONDITION"));
- assertTrue(rs.getBoolean("NON_UNIQUE"));
-
- rs.close();
- }
-
- public void testTableTypes() throws SQLException
- {
- // At the moment just test that no exceptions are thrown KJ
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
- ResultSet rs = dbmd.getTableTypes();
- rs.close();
- }
-
- public void testFuncWithoutNames() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
- ResultSet rs = dbmd.getProcedureColumns(null, null, "f1", null);
-
- assertTrue(rs.next());
- assertEquals("returnValue", rs.getString(4));
- assertEquals(DatabaseMetaData.procedureColumnReturn, rs.getInt(5));
-
- assertTrue(rs.next());
- assertEquals("$1", rs.getString(4));
- assertEquals(DatabaseMetaData.procedureColumnIn, rs.getInt(5));
- assertEquals(Types.INTEGER, rs.getInt(6));
-
- assertTrue(rs.next());
- assertEquals("$2", rs.getString(4));
- assertEquals(DatabaseMetaData.procedureColumnIn, rs.getInt(5));
- assertEquals(Types.VARCHAR, rs.getInt(6));
-
- assertTrue(!rs.next());
-
- rs.close();
- }
-
- public void testFuncWithNames() throws SQLException
- {
- if (!TestUtil.haveMinimumServerVersion(con, "8.0"))
- return;
-
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getProcedureColumns(null, null, "f2", null);
-
- assertTrue(rs.next());
-
- assertTrue(rs.next());
- assertEquals("a", rs.getString(4));
-
- assertTrue(rs.next());
- assertEquals("b", rs.getString(4));
-
- assertTrue(!rs.next());
-
- rs.close();
- }
-
- public void testFuncWithDirection() throws SQLException
- {
- if (!TestUtil.haveMinimumServerVersion(con, "8.1"))
- return;
-
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getProcedureColumns(null, null, "f3", null);
-
- assertTrue(rs.next());
- assertEquals("a", rs.getString(4));
- assertEquals(DatabaseMetaData.procedureColumnIn, rs.getInt(5));
- assertEquals(Types.INTEGER, rs.getInt(6));
-
- assertTrue(rs.next());
- assertEquals("b", rs.getString(4));
- assertEquals(DatabaseMetaData.procedureColumnInOut, rs.getInt(5));
- assertEquals(Types.VARCHAR, rs.getInt(6));
-
- assertTrue(rs.next());
- assertEquals("c", rs.getString(4));
- assertEquals(DatabaseMetaData.procedureColumnOut, rs.getInt(5));
- assertEquals(Types.TIMESTAMP, rs.getInt(6));
-
- rs.close();
- }
-
- public void testFuncReturningComposite() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getProcedureColumns(null, null, "f4", null);
-
- assertTrue(rs.next());
- assertEquals("$1", rs.getString(4));
- assertEquals(DatabaseMetaData.procedureColumnIn, rs.getInt(5));
- assertEquals(Types.INTEGER, rs.getInt(6));
-
- assertTrue(rs.next());
- assertEquals("id", rs.getString(4));
- assertEquals(DatabaseMetaData.procedureColumnResult, rs.getInt(5));
- assertEquals(Types.INTEGER, rs.getInt(6));
-
- assertTrue(rs.next());
- assertEquals("name", rs.getString(4));
- assertEquals(DatabaseMetaData.procedureColumnResult, rs.getInt(5));
- assertEquals(Types.VARCHAR, rs.getInt(6));
-
- assertTrue(rs.next());
- assertEquals("updated", rs.getString(4));
- assertEquals(DatabaseMetaData.procedureColumnResult, rs.getInt(5));
- assertEquals(Types.TIMESTAMP, rs.getInt(6));
-
- assertTrue(rs.next());
- assertEquals("colour", rs.getString(4));
- assertEquals(DatabaseMetaData.procedureColumnResult, rs.getInt(5));
- assertEquals(Types.VARCHAR, rs.getInt(6));
-
- assertTrue(rs.next());
- assertEquals("quest", rs.getString(4));
- assertEquals(DatabaseMetaData.procedureColumnResult, rs.getInt(5));
- assertEquals(Types.VARCHAR, rs.getInt(6));
-
- assertTrue(!rs.next());
- rs.close();
- }
-
- public void testVersionColumns() throws SQLException
- {
- // At the moment just test that no exceptions are thrown KJ
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
- ResultSet rs = dbmd.getVersionColumns(null, null, "pg_class");
- rs.close();
- }
-
- public void testBestRowIdentifier() throws SQLException
- {
- // At the moment just test that no exceptions are thrown KJ
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
- ResultSet rs = dbmd.getBestRowIdentifier(null, null, "pg_type", DatabaseMetaData.bestRowSession, false);
- rs.close();
- }
-
- public void testProcedures() throws SQLException
- {
- // At the moment just test that no exceptions are thrown KJ
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
- ResultSet rs = dbmd.getProcedures(null, null, null);
- rs.close();
- }
-
- public void testCatalogs() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getCatalogs();
- assertTrue(rs.next());
- assertEquals(con.getCatalog(), rs.getString(1));
- assertTrue(!rs.next());
- }
-
- public void testSchemas() throws Exception
- {
- DatabaseMetaData dbmd = con.getMetaData();
- assertNotNull(dbmd);
-
- ResultSet rs = dbmd.getSchemas();
- boolean foundPublic = false;
- boolean foundEmpty = false;
- boolean foundPGCatalog = false;
- int count;
-
- for (count = 0; rs.next(); count++)
- {
- String schema = rs.getString("TABLE_SCHEM");
- if ("public".equals(schema))
- {
- foundPublic = true;
- }
- else if ("".equals(schema))
- {
- foundEmpty = true;
- }
- else if ("pg_catalog".equals(schema))
- {
- foundPGCatalog = true;
- }
- }
- rs.close();
- if (TestUtil.haveMinimumServerVersion(con, "7.3"))
- {
- assertTrue(count >= 2);
- assertTrue(foundPublic);
- assertTrue(foundPGCatalog);
- assertTrue(!foundEmpty);
- }
- else
- {
- assertEquals(count, 1);
- assertTrue(foundEmpty);
- assertTrue(!foundPublic);
- assertTrue(!foundPGCatalog);
- }
- }
-
- public void testEscaping() throws SQLException {
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getTables( null, null, "a'", new String[] {"TABLE"});
- assertTrue(rs.next());
- rs = dbmd.getTables( null, null, "a\\\\", new String[] {"TABLE"});
- assertTrue(rs.next());
- rs = dbmd.getTables( null, null, "a\\", new String[] {"TABLE"});
- assertTrue(!rs.next());
- }
-
- public void testSearchStringEscape() throws Exception {
- DatabaseMetaData dbmd = con.getMetaData();
- String pattern = dbmd.getSearchStringEscape() + "_";
- PreparedStatement pstmt = con.prepareStatement("SELECT 'a' LIKE ?, '_' LIKE ?");
- pstmt.setString(1, pattern);
- pstmt.setString(2, pattern);
- ResultSet rs = pstmt.executeQuery();
- assertTrue (rs.next());
- assertTrue(!rs.getBoolean(1));
- assertTrue(rs.getBoolean(2));
- rs.close();
- pstmt.close();
- }
-
- public void testGetUDTQualified() throws Exception
- {
- if (!TestUtil.haveMinimumServerVersion(con, "7.3"))
- return ;
-
- Statement stmt = null;
- try
- {
- stmt = con.createStatement();
- stmt.execute("create schema jdbc");
- stmt.execute("create type jdbc.testint8 as (i int8)");
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getUDTs(null, null , "jdbc.testint8" , null);
- assertTrue(rs.next());
- String cat, schema, typeName, remarks, className;
- int dataType;
- int baseType;
-
- cat = rs.getString("type_cat");
- schema = rs.getString("type_schem");
- typeName = rs.getString( "type_name");
- className = rs.getString("class_name");
- dataType = rs.getInt("data_type");
- remarks = rs.getString( "remarks" );
- baseType = rs.getInt("base_type");
- this.assertEquals("type name ", "testint8", typeName);
- this.assertEquals("schema name ", "jdbc", schema);
-
- // now test to see if the fully qualified stuff works as planned
- rs = dbmd.getUDTs("catalog", "public" , "catalog.jdbc.testint8" , null);
- assertTrue(rs.next());
- cat = rs.getString("type_cat");
- schema = rs.getString("type_schem");
- typeName = rs.getString( "type_name");
- className = rs.getString("class_name");
- dataType = rs.getInt("data_type");
- remarks = rs.getString( "remarks" );
- baseType = rs.getInt("base_type");
- this.assertEquals("type name ", "testint8", typeName);
- this.assertEquals("schema name ", "jdbc", schema);
- }
- finally
- {
- try
- {
- if (stmt != null )
- stmt.close();
- stmt = con.createStatement();
- stmt.execute("drop type jdbc.testint8");
- stmt.execute("drop schema jdbc");
- }
- catch ( Exception ex )
- {
- }
- }
-
- }
-
- public void testGetUDT1() throws Exception
- {
- if (!TestUtil.haveMinimumServerVersion(con, "7.3"))
- return ;
-
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("create domain testint8 as int8");
- stmt.execute("comment on domain testint8 is 'jdbc123'" );
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getUDTs(null, null , "testint8" , null);
- assertTrue(rs.next());
- String cat, schema, typeName, remarks, className;
- int dataType;
- int baseType;
-
- cat = rs.getString("type_cat");
- schema = rs.getString("type_schem");
- typeName = rs.getString( "type_name");
- className = rs.getString("class_name");
- dataType = rs.getInt("data_type");
- remarks = rs.getString( "remarks" );
-
- baseType = rs.getInt("base_type");
- this.assertTrue("base type", !rs.wasNull() );
- this.assertEquals("data type", Types.DISTINCT, dataType );
- this.assertEquals("type name ", "testint8", typeName);
- this.assertEquals("remarks", "jdbc123", remarks);
-
- }
- finally
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("drop domain testint8");
- }
- catch ( Exception ex )
- {
- }
- }
- }
-
-
- public void testGetUDT2() throws Exception
- {
- if (!TestUtil.haveMinimumServerVersion(con, "7.3"))
- return ;
-
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("create domain testint8 as int8");
- stmt.execute("comment on domain testint8 is 'jdbc123'");
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getUDTs(null, null, "testint8", new int[]
- {Types.DISTINCT, Types.STRUCT});
- assertTrue(rs.next());
- String cat, schema, typeName, remarks, className;
- int dataType;
- int baseType;
-
- cat = rs.getString("type_cat");
- schema = rs.getString("type_schem");
- typeName = rs.getString("type_name");
- className = rs.getString("class_name");
- dataType = rs.getInt("data_type");
- remarks = rs.getString("remarks");
-
- baseType = rs.getInt("base_type");
- this.assertTrue("base type", !rs.wasNull());
- this.assertEquals("data type", Types.DISTINCT, dataType);
- this.assertEquals("type name ", "testint8", typeName);
- this.assertEquals("remarks", "jdbc123", remarks);
-
- }
- finally
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("drop domain testint8");
- }
- catch (Exception ex)
- {
- }
- }
- }
-
- public void testGetUDT3() throws Exception
- {
- if (!TestUtil.haveMinimumServerVersion(con, "7.3"))
- return ;
-
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("create domain testint8 as int8");
- stmt.execute("comment on domain testint8 is 'jdbc123'");
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getUDTs(null, null, "testint8", new int[]
- {Types.DISTINCT});
- assertTrue(rs.next());
- String cat, schema, typeName, remarks, className;
- int dataType;
- int baseType;
-
- cat = rs.getString("type_cat");
- schema = rs.getString("type_schem");
- typeName = rs.getString("type_name");
- className = rs.getString("class_name");
- dataType = rs.getInt("data_type");
- remarks = rs.getString("remarks");
-
- baseType = rs.getInt("base_type");
- this.assertTrue("base type", !rs.wasNull());
- this.assertEquals("data type", Types.DISTINCT, dataType);
- this.assertEquals("type name ", "testint8", typeName);
- this.assertEquals("remarks", "jdbc123", remarks);
-
- }
- finally
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("drop domain testint8");
- }
- catch (Exception ex)
- {
- }
- }
- }
-
- public void testGetUDT4() throws Exception
- {
- if (!TestUtil.haveMinimumServerVersion(con, "7.3"))
- return ;
-
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("create type testint8 as (i int8)");
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getUDTs(null, null , "testint8" , null);
- assertTrue(rs.next());
- String cat, schema, typeName, remarks, className;
- int dataType;
- int baseType;
-
- cat = rs.getString("type_cat");
- schema = rs.getString("type_schem");
- typeName = rs.getString( "type_name");
- className = rs.getString("class_name");
- dataType = rs.getInt("data_type");
- remarks = rs.getString( "remarks" );
-
- baseType = rs.getInt("base_type");
- this.assertTrue("base type", rs.wasNull() );
- this.assertEquals("data type", Types.STRUCT, dataType );
- this.assertEquals("type name ", "testint8", typeName);
-
- }
- finally
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("drop type testint8");
- }
- catch ( Exception ex )
- {
- }
- }
- }
-
- public void testTypeInfoSigned() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getTypeInfo();
- while (rs.next()) {
- if ("int4".equals(rs.getString("TYPE_NAME"))) {
- assertEquals(false, rs.getBoolean("UNSIGNED_ATTRIBUTE"));
- } else if ("float8".equals(rs.getString("TYPE_NAME"))) {
- assertEquals(false, rs.getBoolean("UNSIGNED_ATTRIBUTE"));
- } else if ("text".equals(rs.getString("TYPE_NAME"))) {
- assertEquals(true, rs.getBoolean("UNSIGNED_ATTRIBUTE"));
- }
- }
- }
-
- public void testTypeInfoQuoting() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getTypeInfo();
- while (rs.next()) {
- if ("int4".equals(rs.getString("TYPE_NAME"))) {
- assertNull(rs.getString("LITERAL_PREFIX"));
- } else if ("text".equals(rs.getString("TYPE_NAME"))) {
- assertEquals("'", rs.getString("LITERAL_PREFIX"));
- assertEquals("'", rs.getString("LITERAL_SUFFIX"));
- }
- }
- }
-
- public void testInformationAboutArrayTypes() throws SQLException
- {
- DatabaseMetaData dbmd = con.getMetaData();
- ResultSet rs = dbmd.getColumns("", "", "arraytable", "");
- assertTrue(rs.next());
- assertEquals("a", rs.getString("COLUMN_NAME"));
- assertEquals(5, rs.getInt("COLUMN_SIZE"));
- assertEquals(2, rs.getInt("DECIMAL_DIGITS"));
- assertTrue(rs.next());
- assertEquals("b", rs.getString("COLUMN_NAME"));
- assertEquals(100, rs.getInt("COLUMN_SIZE"));
- assertTrue(!rs.next());
- }
-
-}
diff --git a/org/postgresql/test/jdbc2/DateTest.java b/org/postgresql/test/jdbc2/DateTest.java
deleted file mode 100644
index 81a42c9..0000000
--- a/org/postgresql/test/jdbc2/DateTest.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-import java.sql.*;
-
-/*
- * Some simple tests based on problems reported by users. Hopefully these will
- * help prevent previous problems from re-occuring ;-)
- *
- */
-public class DateTest extends TestCase
-{
-
- private Connection con;
-
- public DateTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
- TestUtil.createTable(con, "testdate", "dt date");
- }
-
- protected void tearDown() throws Exception
- {
- TestUtil.dropTable(con, "testdate");
- TestUtil.closeDB(con);
- }
-
- /*
- * Tests the time methods in ResultSet
- */
- public void testGetDate() throws SQLException
- {
- Statement stmt = con.createStatement();
-
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'1950-02-07'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'1970-06-02'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'1999-08-11'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'2001-02-13'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'1950-04-02'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'1970-11-30'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'1988-01-01'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'2003-07-09'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'1934-02-28'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'1969-04-03'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'1982-08-03'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'2012-03-15'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'1912-05-01'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'1971-12-15'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'1984-12-03'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'2000-01-01'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'3456-01-01'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testdate", "'0101-01-01 BC'")));
-
- /* dateTest() contains all of the tests */
- dateTest();
-
- assertEquals(18, stmt.executeUpdate("DELETE FROM " + "testdate"));
- stmt.close();
- }
-
- /*
- * Tests the time methods in PreparedStatement
- */
- public void testSetDate() throws SQLException
- {
- Statement stmt = con.createStatement();
- PreparedStatement ps = con.prepareStatement(TestUtil.insertSQL("testdate", "?"));
-
- ps.setDate(1, makeDate(1950, 2, 7));
- assertEquals(1, ps.executeUpdate());
-
- ps.setDate(1, makeDate(1970, 6, 2));
- assertEquals(1, ps.executeUpdate());
-
- ps.setDate(1, makeDate(1999, 8, 11));
- assertEquals(1, ps.executeUpdate());
-
- ps.setDate(1, makeDate(2001, 2, 13));
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, java.sql.Timestamp.valueOf("1950-04-02 12:00:00"), java.sql.Types.DATE);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, java.sql.Timestamp.valueOf("1970-11-30 3:00:00"), java.sql.Types.DATE);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, java.sql.Timestamp.valueOf("1988-01-01 13:00:00"), java.sql.Types.DATE);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, java.sql.Timestamp.valueOf("2003-07-09 12:00:00"), java.sql.Types.DATE);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, "1934-02-28", java.sql.Types.DATE);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, "1969-04-03", java.sql.Types.DATE);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, "1982-08-03", java.sql.Types.DATE);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, "2012-03-15", java.sql.Types.DATE);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, java.sql.Date.valueOf("1912-05-01"), java.sql.Types.DATE);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, java.sql.Date.valueOf("1971-12-15"), java.sql.Types.DATE);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, java.sql.Date.valueOf("1984-12-03"), java.sql.Types.DATE);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, java.sql.Date.valueOf("2000-01-01"), java.sql.Types.DATE);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, java.sql.Date.valueOf("3456-01-01"), java.sql.Types.DATE);
- assertEquals(1, ps.executeUpdate());
-
- // We can't use valueOf on BC dates.
- ps.setObject(1, makeDate(-100,1,1));
- assertEquals(1, ps.executeUpdate());
-
- ps.close();
-
- dateTest();
-
- assertEquals(18, stmt.executeUpdate("DELETE FROM testdate"));
- stmt.close();
- }
-
- /*
- * Helper for the date tests. It tests what should be in the db
- */
- private void dateTest() throws SQLException
- {
- Statement st = con.createStatement();
- ResultSet rs;
- java.sql.Date d;
-
- rs = st.executeQuery(TestUtil.selectSQL("testdate", "dt"));
- assertNotNull(rs);
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(1950, 2, 7), d);
-
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(1970, 6, 2), d);
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(1999, 8, 11), d);
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(2001, 2, 13), d);
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(1950, 4, 2), d);
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(1970, 11, 30), d);
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(1988, 1, 1), d);
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(2003, 7, 9), d);
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(1934, 2, 28), d);
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(1969, 4, 3), d);
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(1982, 8, 3), d);
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(2012, 3, 15), d);
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(1912, 5, 1), d);
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(1971, 12, 15), d);
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(1984, 12, 3), d);
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(2000, 1, 1), d);
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(3456, 1, 1), d);
-
- assertTrue(rs.next());
- d = rs.getDate(1);
- assertNotNull(d);
- assertEquals(makeDate(-100, 1, 1), d);
-
- assertTrue(!rs.next());
-
- rs.close();
- st.close();
- }
-
- private java.sql.Date makeDate(int y, int m, int d)
- {
- return new java.sql.Date(y - 1900, m - 1, d);
- }
-}
diff --git a/org/postgresql/test/jdbc2/DriverTest.java b/org/postgresql/test/jdbc2/DriverTest.java
deleted file mode 100644
index 9df5751..0000000
--- a/org/postgresql/test/jdbc2/DriverTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.Driver;
-import org.postgresql.test.TestUtil;
-
-import junit.framework.TestCase;
-
-import java.lang.reflect.Method;
-import java.sql.*;
-import java.util.Properties;
-
-/*
- * Tests the dynamically created class org.postgresql.Driver
- *
- */
-public class DriverTest extends TestCase
-{
-
- public DriverTest(String name)
- {
- super(name);
- }
-
- /*
- * This tests the acceptsURL() method with a couple of well and poorly
- * formed jdbc urls.
- */
- public void testAcceptsURL() throws Exception
- {
- TestUtil.initDriver(); // Set up log levels, etc.
-
- // Load the driver (note clients should never do it this way!)
- org.postgresql.Driver drv = new org.postgresql.Driver();
- assertNotNull(drv);
-
- // These are always correct
- verifyUrl(drv, "jdbc:postgresql:test", "localhost", "5432", "test");
- verifyUrl(drv, "jdbc:postgresql://localhost/test", "localhost", "5432", "test");
- verifyUrl(drv, "jdbc:postgresql://localhost:5432/test", "localhost", "5432", "test");
- verifyUrl(drv, "jdbc:postgresql://127.0.0.1/anydbname", "127.0.0.1", "5432", "anydbname");
- verifyUrl(drv, "jdbc:postgresql://127.0.0.1:5433/hidden", "127.0.0.1", "5433", "hidden");
- verifyUrl(drv, "jdbc:postgresql://[::1]:5740/db", "[::1]", "5740", "db");
-
- // Badly formatted url's
- assertTrue(!drv.acceptsURL("jdbc:postgres:test"));
- assertTrue(!drv.acceptsURL("postgresql:test"));
- assertTrue(!drv.acceptsURL("db"));
- assertTrue(!drv.acceptsURL("jdbc:postgresql://localhost:5432a/test"));
-
- // failover urls
- verifyUrl(drv, "jdbc:postgresql://localhost,127.0.0.1:5432/test", "localhost,127.0.0.1", "5432,5432", "test");
- verifyUrl(drv, "jdbc:postgresql://localhost:5433,127.0.0.1:5432/test", "localhost,127.0.0.1", "5433,5432", "test");
- verifyUrl(drv, "jdbc:postgresql://[::1],[::1]:5432/db", "[::1],[::1]", "5432,5432", "db");
- verifyUrl(drv, "jdbc:postgresql://[::1]:5740,127.0.0.1:5432/db", "[::1],127.0.0.1", "5740,5432", "db");
- }
-
- private void verifyUrl(Driver drv, String url, String hosts, String ports, String dbName) throws Exception {
- assertTrue(url, drv.acceptsURL(url));
- Method parseMethod = drv.getClass().getDeclaredMethod("parseURL", new Class[]{String.class, Properties.class});
- parseMethod.setAccessible(true);
- Properties p = (Properties) parseMethod.invoke(drv, new Object[]{url, null});
- assertEquals(url, dbName, p.getProperty("PGDBNAME"));
- assertEquals(url, hosts, p.getProperty("PGHOST"));
- assertEquals(url, ports, p.getProperty("PGPORT"));
- }
-
- /*
- * Tests parseURL (internal)
- */
- /*
- * Tests the connect method by connecting to the test database
- */
- public void testConnect() throws Exception
- {
- TestUtil.initDriver(); // Set up log levels, etc.
-
- // Test with the url, username & password
- Connection con = DriverManager.getConnection(TestUtil.getURL(), TestUtil.getUser(), TestUtil.getPassword());
- assertNotNull(con);
- con.close();
-
- // Test with the username in the url
- con = DriverManager.getConnection(TestUtil.getURL() + "&user=" + TestUtil.getUser() + "&password=" + TestUtil.getPassword());
- assertNotNull(con);
- con.close();
-
- // Test with failover url
- String url = "jdbc:postgresql://invalidhost.not.here," + TestUtil.getServer() + ":" + TestUtil.getPort() + "/" + TestUtil.getDatabase();
- con = DriverManager.getConnection(url, TestUtil.getUser(), TestUtil.getPassword());
- assertNotNull(con);
- con.close();
-
- }
-}
diff --git a/org/postgresql/test/jdbc2/EncodingTest.java b/org/postgresql/test/jdbc2/EncodingTest.java
deleted file mode 100644
index 02d7efd..0000000
--- a/org/postgresql/test/jdbc2/EncodingTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-
-package org.postgresql.test.jdbc2;
-
-import junit.framework.*;
-import org.postgresql.core.Encoding;
-import java.io.*;
-import java.util.Locale;
-
-/*
- * Tests for the Encoding class.
- *
- */
-
-
-public class EncodingTest extends TestCase
-{
-
- public EncodingTest(String name)
- {
- super(name);
- }
-
- public void testCreation() throws Exception
- {
- Encoding encoding;
- encoding = Encoding.getDatabaseEncoding("UTF8");
- assertEquals("UTF", encoding.name().substring(0, 3).toUpperCase(Locale.US));
- encoding = Encoding.getDatabaseEncoding("SQL_ASCII");
- assertTrue(encoding.name().toUpperCase(Locale.US).indexOf("ASCII") != -1);
- assertEquals("When encoding is unknown the default encoding should be used",
- Encoding.defaultEncoding(),
- Encoding.getDatabaseEncoding("UNKNOWN"));
- }
-
- public void testTransformations() throws Exception
- {
- Encoding encoding = Encoding.getDatabaseEncoding("UTF8");
- assertEquals("ab", encoding.decode(new byte[] { 97, 98 }));
-
- assertEquals(2, encoding.encode("ab").length);
- assertEquals(97, encoding.encode("a")[0]);
- assertEquals(98, encoding.encode("b")[0]);
-
- encoding = Encoding.defaultEncoding();
- assertEquals("a".getBytes()[0], encoding.encode("a")[0]);
- assertEquals(new String(new byte[] { 97 }),
- encoding.decode(new byte[] { 97 }));
- }
-
- public void testReader() throws Exception
- {
- Encoding encoding = Encoding.getDatabaseEncoding("SQL_ASCII");
- InputStream stream = new ByteArrayInputStream(new byte[] { 97, 98 });
- Reader reader = encoding.getDecodingReader(stream);
- assertEquals(97, reader.read());
- assertEquals(98, reader.read());
- assertEquals( -1, reader.read());
- }
-}
diff --git a/org/postgresql/test/jdbc2/GeometricTest.java b/org/postgresql/test/jdbc2/GeometricTest.java
deleted file mode 100644
index 199c916..0000000
--- a/org/postgresql/test/jdbc2/GeometricTest.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import org.postgresql.util.PGobject;
-import org.postgresql.geometric.*;
-import junit.framework.TestCase;
-import java.sql.*;
-
-/*
- * Test case for geometric type I/O
- */
-public class GeometricTest extends TestCase
-{
- private Connection con;
-
- public GeometricTest(String name)
- {
- super(name);
- }
-
- // Set up the fixture for this testcase: a connection to a database with
- // a table for this test.
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
- TestUtil.createTable(con,
- "testgeometric",
- "boxval box, circleval circle, lsegval lseg, pathval path, polygonval polygon, pointval point");
- }
-
- // Tear down the fixture for this test case.
- protected void tearDown() throws Exception
- {
- TestUtil.dropTable(con, "testgeometric");
- TestUtil.closeDB(con);
- }
-
- private void checkReadWrite(PGobject obj, String column) throws Exception {
- PreparedStatement insert = con.prepareStatement("INSERT INTO testgeometric(" + column + ") VALUES (?)");
- insert.setObject(1, obj);
- insert.executeUpdate();
- insert.close();
-
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT " + column + " FROM testgeometric");
- assertTrue(rs.next());
- assertEquals(obj, rs.getObject(1));
- rs.close();
-
- stmt.executeUpdate("DELETE FROM testgeometric");
- stmt.close();
- }
-
- public void testPGbox() throws Exception {
- checkReadWrite(new PGbox(1.0, 2.0, 3.0, 4.0), "boxval");
- checkReadWrite(new PGbox( -1.0, 2.0, 3.0, 4.0), "boxval");
- checkReadWrite(new PGbox(1.0, -2.0, 3.0, 4.0), "boxval");
- checkReadWrite(new PGbox(1.0, 2.0, -3.0, 4.0), "boxval");
- checkReadWrite(new PGbox(1.0, 2.0, 3.0, -4.0), "boxval");
- }
-
- public void testPGcircle() throws Exception {
- checkReadWrite(new PGcircle(1.0, 2.0, 3.0), "circleval");
- checkReadWrite(new PGcircle( -1.0, 2.0, 3.0), "circleval");
- checkReadWrite(new PGcircle(1.0, -2.0, 3.0), "circleval");
- }
-
- public void testPGlseg() throws Exception {
- checkReadWrite(new PGlseg(1.0, 2.0, 3.0, 4.0), "lsegval");
- checkReadWrite(new PGlseg( -1.0, 2.0, 3.0, 4.0), "lsegval");
- checkReadWrite(new PGlseg(1.0, -2.0, 3.0, 4.0), "lsegval");
- checkReadWrite(new PGlseg(1.0, 2.0, -3.0, 4.0), "lsegval");
- checkReadWrite(new PGlseg(1.0, 2.0, 3.0, -4.0), "lsegval");
- }
-
- public void testPGpath() throws Exception {
- PGpoint[] points = new PGpoint[] {
- new PGpoint(0.0, 0.0),
- new PGpoint(0.0, 5.0),
- new PGpoint(5.0, 5.0),
- new PGpoint(5.0, -5.0),
- new PGpoint( -5.0, -5.0),
- new PGpoint( -5.0, 5.0),
- };
-
- checkReadWrite(new PGpath(points, true), "pathval");
- checkReadWrite(new PGpath(points, false), "pathval");
- }
-
- public void testPGpolygon() throws Exception {
- PGpoint[] points = new PGpoint[] {
- new PGpoint(0.0, 0.0),
- new PGpoint(0.0, 5.0),
- new PGpoint(5.0, 5.0),
- new PGpoint(5.0, -5.0),
- new PGpoint( -5.0, -5.0),
- new PGpoint( -5.0, 5.0),
- };
-
- checkReadWrite(new PGpolygon(points), "polygonval");
- }
-
- public void testPGpoint() throws Exception {
- checkReadWrite(new PGpoint(1.0, 2.0), "pointval");
- }
-}
diff --git a/org/postgresql/test/jdbc2/GetXXXTest.java b/org/postgresql/test/jdbc2/GetXXXTest.java
deleted file mode 100644
index f033d71..0000000
--- a/org/postgresql/test/jdbc2/GetXXXTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import java.util.Calendar;
-import junit.framework.*;
-import java.sql.*;
-import java.util.HashMap;
-/*
- * Test for getObject
- */
-
-public class GetXXXTest extends TestCase
-{
- Connection con = null;
-
- public GetXXXTest(String name )
- {
- super(name);
- }
- protected void setUp() throws Exception
- {
- super.setUp();
-
- con = TestUtil.openDB();
- TestUtil.createTempTable(con, "test_interval",
- "initial timestamp with time zone, final timestamp with time zone");
- PreparedStatement pstmt = con.prepareStatement(
- "insert into test_interval values (?,?)");
- Calendar cal = Calendar.getInstance();
- cal.add(Calendar.DAY_OF_YEAR, -1);
-
- pstmt.setTimestamp(1, new Timestamp(cal.getTime().getTime()));
- pstmt.setTimestamp(2, new Timestamp(System.currentTimeMillis()));
- assertTrue(pstmt.executeUpdate() == 1);
- pstmt.close();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TestUtil.dropTable( con, "test_interval" );
- con.close();
- }
-
- public void testGetObject() throws SQLException
- {
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery(
- "select (final-initial) as diff from test_interval");
- while (rs.next())
- {
- String str = (String) rs.getString(1);
-
- assertNotNull(str);
- Object obj = rs.getObject(1);
- assertNotNull(obj);
- }
- }
-
- public void testGetUDT() throws SQLException
- {
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("select (final-initial) as diff from test_interval");
-
- while (rs.next() )
- {
- // make this return a PGobject
- Object obj = rs.getObject(1, new HashMap());
-
- // it should not be an instance of PGInterval
- assertTrue(obj instanceof org.postgresql.util.PGInterval);
-
- }
-
- }
-
-}
diff --git a/org/postgresql/test/jdbc2/IntervalTest.java b/org/postgresql/test/jdbc2/IntervalTest.java
deleted file mode 100644
index 9f7661a..0000000
--- a/org/postgresql/test/jdbc2/IntervalTest.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2005-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.sql.*;
-
-import junit.framework.TestCase;
-
-import org.postgresql.util.PGInterval;
-import org.postgresql.test.TestUtil;
-
-public class IntervalTest extends TestCase
-{
-
- private Connection _conn;
-
- public IntervalTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- _conn = TestUtil.openDB();
- TestUtil.createTable(_conn, "testinterval", "v interval");
- }
-
- protected void tearDown() throws Exception
- {
- TestUtil.dropTable(_conn, "testinterval");
- TestUtil.closeDB(_conn);
- }
-
- public void testOnlineTests() throws SQLException
- {
- PreparedStatement pstmt = _conn.prepareStatement("INSERT INTO testinterval VALUES (?)");
- pstmt.setObject(1, new PGInterval(2004, 13, 28, 0, 0, 43000.9013));
- pstmt.executeUpdate();
- pstmt.close();
-
- Statement stmt = _conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT v FROM testinterval");
- assertTrue(rs.next());
- PGInterval pgi = (PGInterval)rs.getObject(1);
- assertEquals(2005, pgi.getYears());
- assertEquals(1, pgi.getMonths());
- assertEquals(28, pgi.getDays());
- assertEquals(11, pgi.getHours());
- assertEquals(56, pgi.getMinutes());
- assertEquals(40.9013, pgi.getSeconds(), 0.000001);
- assertTrue(!rs.next());
- rs.close();
- stmt.close();
- }
-
- public void testDaysHours() throws SQLException
- {
- Statement stmt = _conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT '101:12:00'::interval");
- assertTrue(rs.next());
- PGInterval i = (PGInterval)rs.getObject(1);
- // 8.1 servers store hours and days separately.
- if (TestUtil.haveMinimumServerVersion(_conn, "8.1")) {
- assertEquals(0, i.getDays());
- assertEquals(101, i.getHours());
- } else {
- assertEquals(4, i.getDays());
- assertEquals(5, i.getHours());
- }
- assertEquals(12, i.getMinutes());
- }
-
- public void testAddRounding() {
- PGInterval pgi = new PGInterval(0, 0, 0, 0, 0, 0.6006);
- Calendar cal = Calendar.getInstance();
- long origTime = cal.getTime().getTime();
- pgi.add(cal);
- long newTime = cal.getTime().getTime();
- assertEquals(601, newTime - origTime);
- pgi.setSeconds(-0.6006);
- pgi.add(cal);
- assertEquals(origTime, cal.getTime().getTime());
- }
-
- public void testOfflineTests()
- throws Exception
- {
- PGInterval pgi = new PGInterval(2004, 4, 20, 15, 57, 12.1);
-
- assertEquals(2004, pgi.getYears());
- assertEquals(4, pgi.getMonths());
- assertEquals(20, pgi.getDays());
- assertEquals(15, pgi.getHours());
- assertEquals(57, pgi.getMinutes());
- assertEquals(12.1, pgi.getSeconds(), 0);
-
- PGInterval pgi2 = new PGInterval("@ 2004 years 4 mons 20 days 15 hours 57 mins 12.1 secs");
- assertEquals(pgi, pgi2);
-
- // Singular units
- PGInterval pgi3 = new PGInterval("@ 2004 year 4 mon 20 day 15 hour 57 min 12.1 sec");
- assertEquals(pgi, pgi3);
-
- PGInterval pgi4 = new PGInterval("2004 years 4 mons 20 days 15:57:12.1");
- assertEquals(pgi, pgi4);
-
- // Ago test
- pgi = new PGInterval("@ 2004 years 4 mons 20 days 15 hours 57 mins 12.1 secs ago");
- assertEquals(-2004, pgi.getYears());
- assertEquals(-4, pgi.getMonths());
- assertEquals(-20, pgi.getDays());
- assertEquals(-15, pgi.getHours());
- assertEquals(-57, pgi.getMinutes());
- assertEquals(-12.1, pgi.getSeconds(), 0);
-
- // Char test
- pgi = new PGInterval("@ +2004 years -4 mons +20 days -15 hours +57 mins -12.1 secs");
- assertEquals(2004, pgi.getYears());
- assertEquals(-4, pgi.getMonths());
- assertEquals(20, pgi.getDays());
- assertEquals(-15, pgi.getHours());
- assertEquals(57, pgi.getMinutes());
- assertEquals(-12.1, pgi.getSeconds(), 0);
- }
-
- Calendar getStartCalendar()
- {
- Calendar cal = new GregorianCalendar();
- cal.set(Calendar.YEAR, 2005);
- cal.set(Calendar.MONTH, 4);
- cal.set(Calendar.DAY_OF_MONTH, 29);
- cal.set(Calendar.HOUR_OF_DAY, 15);
- cal.set(Calendar.MINUTE, 35);
- cal.set(Calendar.SECOND, 42);
- cal.set(Calendar.MILLISECOND, 100);
-
- return cal;
- }
-
- public void testCalendar()
- throws Exception
- {
- Calendar cal = getStartCalendar();
-
- PGInterval pgi = new PGInterval("@ 1 year 1 mon 1 day 1 hour 1 minute 1 secs");
- pgi.add(cal);
-
- assertEquals(2006, cal.get(Calendar.YEAR));
- assertEquals(5, cal.get(Calendar.MONTH));
- assertEquals(30, cal.get(Calendar.DAY_OF_MONTH));
- assertEquals(16, cal.get(Calendar.HOUR_OF_DAY));
- assertEquals(36, cal.get(Calendar.MINUTE));
- assertEquals(43, cal.get(Calendar.SECOND));
- assertEquals(100, cal.get(Calendar.MILLISECOND));
-
- pgi = new PGInterval("@ 1 year 1 mon 1 day 1 hour 1 minute 1 secs ago");
- pgi.add(cal);
-
- assertEquals(2005, cal.get(Calendar.YEAR));
- assertEquals(4, cal.get(Calendar.MONTH));
- assertEquals(29, cal.get(Calendar.DAY_OF_MONTH));
- assertEquals(15, cal.get(Calendar.HOUR_OF_DAY));
- assertEquals(35, cal.get(Calendar.MINUTE));
- assertEquals(42, cal.get(Calendar.SECOND));
- assertEquals(100, cal.get(Calendar.MILLISECOND));
-
- cal = getStartCalendar();
-
- pgi = new PGInterval("@ 1 year -23 hours -3 mins -3.30 secs");
- pgi.add(cal);
-
- assertEquals(2006, cal.get(Calendar.YEAR));
- assertEquals(4, cal.get(Calendar.MONTH));
- assertEquals(28, cal.get(Calendar.DAY_OF_MONTH));
- assertEquals(16, cal.get(Calendar.HOUR_OF_DAY));
- assertEquals(32, cal.get(Calendar.MINUTE));
- assertEquals(38, cal.get(Calendar.SECOND));
- assertEquals(800, cal.get(Calendar.MILLISECOND));
-
- pgi = new PGInterval("@ 1 year -23 hours -3 mins -3.30 secs ago");
- pgi.add(cal);
-
- assertEquals(2005, cal.get(Calendar.YEAR));
- assertEquals(4, cal.get(Calendar.MONTH));
- assertEquals(29, cal.get(Calendar.DAY_OF_MONTH));
- assertEquals(15, cal.get(Calendar.HOUR_OF_DAY));
- assertEquals(35, cal.get(Calendar.MINUTE));
- assertEquals(42, cal.get(Calendar.SECOND));
- assertEquals(100, cal.get(Calendar.MILLISECOND));
- }
-
- public void testDate()
- throws Exception
- {
- Date date = getStartCalendar().getTime();
- Date date2 = getStartCalendar().getTime();
-
- PGInterval pgi = new PGInterval("@ +2004 years -4 mons +20 days -15 hours +57 mins -12.1 secs");
- pgi.add(date);
-
- PGInterval pgi2 = new PGInterval("@ +2004 years -4 mons +20 days -15 hours +57 mins -12.1 secs ago");
- pgi2.add(date);
-
- assertEquals(date2, date);
- }
-
- public void testISODate()
- throws Exception
- {
- Date date = getStartCalendar().getTime();
- Date date2 = getStartCalendar().getTime();
-
- PGInterval pgi = new PGInterval("+2004 years -4 mons +20 days -15:57:12.1");
- pgi.add(date);
-
- PGInterval pgi2 = new PGInterval("-2004 years 4 mons -20 days 15:57:12.1");
- pgi2.add(date);
-
- assertEquals(date2, date);
- }
-
-}
diff --git a/org/postgresql/test/jdbc2/JBuilderTest.java b/org/postgresql/test/jdbc2/JBuilderTest.java
deleted file mode 100644
index 5ae31cf..0000000
--- a/org/postgresql/test/jdbc2/JBuilderTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import java.sql.*;
-
-import junit.framework.TestCase;
-
-/*
- * Some simple tests to check that the required components needed for JBuilder
- * stay working
- *
- */
-public class JBuilderTest extends TestCase
-{
-
- public JBuilderTest(String name)
- {
- super(name);
- }
-
- // Set up the fixture for this testcase: the tables for this test.
- protected void setUp() throws Exception
- {
- Connection con = TestUtil.openDB();
-
- TestUtil.createTable( con, "test_c",
- "source text,cost money,imageid int4" );
-
- TestUtil.closeDB(con);
- }
-
- // Tear down the fixture for this test case.
- protected void tearDown() throws Exception
- {
- Connection con = TestUtil.openDB();
- TestUtil.dropTable(con, "test_c");
- TestUtil.closeDB(con);
- }
-
- /*
- * This tests that Money types work. JDBCExplorer barfs if this fails.
- */
- public void testMoney() throws Exception
- {
- Connection con = TestUtil.openDB();
-
- Statement st = con.createStatement();
- ResultSet rs = st.executeQuery("select cost from test_c");
- assertNotNull(rs);
-
- while (rs.next())
- {
- rs.getDouble(1);
- }
-
- rs.close();
- st.close();
-
- TestUtil.closeDB(con);
- }
-}
diff --git a/org/postgresql/test/jdbc2/Jdbc2TestSuite.java b/org/postgresql/test/jdbc2/Jdbc2TestSuite.java
deleted file mode 100644
index 128009c..0000000
--- a/org/postgresql/test/jdbc2/Jdbc2TestSuite.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import java.sql.Connection;
-
-import junit.framework.TestSuite;
-
-import org.postgresql.test.TestUtil;
-
-/*
- * Executes all known tests for JDBC2 and includes some utility methods.
- */
-public class Jdbc2TestSuite extends TestSuite
-{
-
- /*
- * The main entry point for JUnit
- */
- public static TestSuite suite() throws Exception
- {
- TestSuite suite = new TestSuite();
-
- //
- // Add one line per class in our test cases. These should be in order of
- // complexity.
-
- // ANTTest should be first as it ensures that test parameters are
- // being sent to the suite.
- //
- suite.addTestSuite(ANTTest.class);
-
- // Basic Driver internals
- suite.addTestSuite(DriverTest.class);
- suite.addTestSuite(ConnectionTest.class);
- suite.addTestSuite(DatabaseMetaDataTest.class);
- suite.addTestSuite(DatabaseMetaDataPropertiesTest.class);
- suite.addTestSuite(EncodingTest.class);
-
- // Connectivity/Protocols
-
- // ResultSet
- suite.addTestSuite(ResultSetTest.class);
- suite.addTestSuite(ResultSetMetaDataTest.class);
- suite.addTestSuite(ArrayTest.class);
- suite.addTestSuite(RefCursorTest.class);
-
- // Time, Date, Timestamp
- suite.addTestSuite(DateTest.class);
- suite.addTestSuite(TimeTest.class);
- suite.addTestSuite(TimestampTest.class);
- suite.addTestSuite(TimezoneTest.class);
-
- // PreparedStatement
- suite.addTestSuite(PreparedStatementTest.class);
- suite.addTestSuite(StatementTest.class);
-
- // ServerSide Prepared Statements
- suite.addTestSuite(ServerPreparedStmtTest.class);
-
- // BatchExecute
- suite.addTestSuite(BatchExecuteTest.class);
-
-
- // Other misc tests, based on previous problems users have had or specific
- // features some applications require.
- suite.addTestSuite(JBuilderTest.class);
- suite.addTestSuite(MiscTest.class);
- suite.addTestSuite(NotifyTest.class);
- suite.addTestSuite(DatabaseEncodingTest.class);
-
- // Fastpath/LargeObject
- suite.addTestSuite(BlobTest.class);
- suite.addTestSuite(OID74Test.class);
-
- suite.addTestSuite(UpdateableResultTest.class );
-
- suite.addTestSuite(CallableStmtTest.class );
- suite.addTestSuite(CursorFetchTest.class);
- suite.addTestSuite(ServerCursorTest.class);
-
- suite.addTestSuite(IntervalTest.class);
- suite.addTestSuite(GeometricTest.class);
-
- suite.addTestSuite(LoginTimeoutTest.class);
- suite.addTestSuite(TestACL.class);
-
- Connection conn = TestUtil.openDB();
- if (TestUtil.isProtocolVersion(conn, 3)) {
- suite.addTestSuite(CopyTest.class);
- }
- conn.close();
-
- // That's all folks
- return suite;
- }
-}
diff --git a/org/postgresql/test/jdbc2/LoginTimeoutTest.java b/org/postgresql/test/jdbc2/LoginTimeoutTest.java
deleted file mode 100644
index e1b329a..0000000
--- a/org/postgresql/test/jdbc2/LoginTimeoutTest.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2005-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-import java.sql.*;
-
-import java.net.Socket;
-import java.net.ServerSocket;
-import java.net.InetAddress;
-import java.io.IOException;
-import java.util.Properties;
-
-public class LoginTimeoutTest extends TestCase
-{
- public LoginTimeoutTest(String name)
- {
- super(name);
- }
-
- public void setUp() throws Exception {
- TestUtil.initDriver(); // Set up log levels, etc.
- }
-
- public void testIntTimeout() throws Exception {
- Properties props = new Properties();
- props.setProperty("user", TestUtil.getUser());
- props.setProperty("password", TestUtil.getPassword());
- props.setProperty("loginTimeout", "10");
-
- Connection conn = java.sql.DriverManager.getConnection(TestUtil.getURL(), props);
- conn.close();
- }
-
- public void testFloatTimeout() throws Exception {
- Properties props = new Properties();
- props.setProperty("user", TestUtil.getUser());
- props.setProperty("password", TestUtil.getPassword());
- props.setProperty("loginTimeout", "10.0");
-
- Connection conn = java.sql.DriverManager.getConnection(TestUtil.getURL(), props);
- conn.close();
- }
-
- public void testZeroTimeout() throws Exception {
- Properties props = new Properties();
- props.setProperty("user", TestUtil.getUser());
- props.setProperty("password", TestUtil.getPassword());
- props.setProperty("loginTimeout", "0");
-
- Connection conn = java.sql.DriverManager.getConnection(TestUtil.getURL(), props);
- conn.close();
- }
-
- public void testNegativeTimeout() throws Exception {
- Properties props = new Properties();
- props.setProperty("user", TestUtil.getUser());
- props.setProperty("password", TestUtil.getPassword());
- props.setProperty("loginTimeout", "-1");
-
- Connection conn = java.sql.DriverManager.getConnection(TestUtil.getURL(), props);
- conn.close();
- }
-
- public void testBadTimeout() throws Exception {
- Properties props = new Properties();
- props.setProperty("user", TestUtil.getUser());
- props.setProperty("password", TestUtil.getPassword());
- props.setProperty("loginTimeout", "zzzz");
-
- Connection conn = java.sql.DriverManager.getConnection(TestUtil.getURL(), props);
- conn.close();
- }
-
- private static class TimeoutHelper implements Runnable {
- TimeoutHelper() throws IOException {
- InetAddress localAddr;
- try {
- localAddr = InetAddress.getLocalHost();
- } catch (java.net.UnknownHostException ex) {
- System.err.println("WARNING: Could not resolve local host name, trying 'localhost'. " + ex);
- localAddr = InetAddress.getByName("localhost");
- }
- this.listenSocket = new ServerSocket(0, 1, localAddr);
- }
-
- String getHost() {
- return listenSocket.getInetAddress().getHostAddress();
- }
-
- int getPort() {
- return listenSocket.getLocalPort();
- }
-
- public void run() {
- try {
- Socket newSocket = listenSocket.accept();
- try {
- Thread.sleep(30000);
- } catch (InterruptedException e) {
- // Ignore it.
- }
- newSocket.close();
- } catch (IOException e) {
- // Ignore it.
- }
- }
-
- void kill() {
- try {
- listenSocket.close();
- } catch (IOException e) {}
- }
-
- private final ServerSocket listenSocket;
- }
-
-
- public void testTimeoutOccurs() throws Exception {
- // Spawn a helper thread to accept a connection and do nothing with it;
- // this should trigger a timeout.
- TimeoutHelper helper = new TimeoutHelper();
- new Thread(helper, "timeout listen helper").start();
-
- try {
- String url = "jdbc:postgresql://" + helper.getHost() + ":" + helper.getPort() + "/dummy";
- Properties props = new Properties();
- props.setProperty("user", "dummy");
- props.setProperty("loginTimeout", "5");
-
- // This is a pretty crude check, but should help distinguish
- // "can't connect" from "timed out".
- long startTime = System.currentTimeMillis();
- Connection conn = null;
- try {
- conn = java.sql.DriverManager.getConnection(url, props);
- fail("connection was unexpectedly successful");
- } catch (SQLException e) {
- // Ignored.
- } finally {
- if (conn != null)
- conn.close();
- }
-
- long endTime = System.currentTimeMillis();
- assertTrue(endTime > startTime + 2500);
- } finally {
- helper.kill();
- }
- }
-}
-
-
-
diff --git a/org/postgresql/test/jdbc2/MiscTest.java b/org/postgresql/test/jdbc2/MiscTest.java
deleted file mode 100644
index 01bc88b..0000000
--- a/org/postgresql/test/jdbc2/MiscTest.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-import java.sql.*;
-import java.io.*;
-
-/*
- * Some simple tests based on problems reported by users. Hopefully these will
- * help prevent previous problems from re-occuring ;-)
- *
- */
-public class MiscTest extends TestCase
-{
-
- public MiscTest(String name)
- {
- super(name);
- }
-
- /*
- * Some versions of the driver would return rs as a null?
- *
- * Sasha <ber0806 at iperbole.bologna.it> was having this problem.
- *
- * Added Feb 13 2001
- */
- public void testDatabaseSelectNullBug() throws Exception
- {
- Connection con = TestUtil.openDB();
-
- Statement st = con.createStatement();
- ResultSet rs = st.executeQuery("select datname from pg_database");
- assertNotNull(rs);
-
- while (rs.next())
- {
- rs.getString(1);
- }
-
- rs.close();
- st.close();
-
- TestUtil.closeDB(con);
- }
-
- /**
- * Ensure the cancel call does not return before it has completed.
- * Previously it did which cancelled future queries.
- */
- public void testSingleThreadCancel() throws Exception
- {
- Connection con = TestUtil.openDB();
- Statement stmt = con.createStatement();
- for (int i=0; i<100; i++) {
- ResultSet rs = stmt.executeQuery("SELECT 1");
- rs.close();
- stmt.cancel();
- }
- TestUtil.closeDB(con);
- }
-
- public void testError() throws Exception
- {
- Connection con = TestUtil.openDB();
- try
- {
-
- // transaction mode
- con.setAutoCommit(false);
- Statement stmt = con.createStatement();
- stmt.execute("select 1/0");
- fail( "Should not execute this, as a SQLException s/b thrown" );
- con.commit();
- }
- catch ( SQLException ex )
- {
- // Verify that the SQLException is serializable.
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(ex);
- oos.close();
- }
-
- con.commit();
- con.close();
- }
-
- public void testWarning() throws Exception
- {
- Connection con = TestUtil.openDB();
- Statement stmt = con.createStatement();
- stmt.execute("CREATE TEMP TABLE t(a int primary key)");
- SQLWarning warning = stmt.getWarnings();
- // We should get a warning about primary key index creation
- // it's possible we won't depending on the server's
- // client_min_messages setting.
- while (warning != null) {
- // Verify that the SQLWarning is serializable.
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(warning);
- oos.close();
- warning = warning.getNextWarning();
- }
-
- stmt.close();
- con.close();
- }
-
- public void xtestLocking() throws Exception
- {
- Connection con = TestUtil.openDB();
- Connection con2 = TestUtil.openDB();
-
- TestUtil.createTable(con, "test_lock", "name text");
- Statement st = con.createStatement();
- Statement st2 = con2.createStatement();
- con.setAutoCommit(false);
- st.execute("lock table test_lock");
- st2.executeUpdate( "insert into test_lock ( name ) values ('hello')" );
- con.commit();
- TestUtil.dropTable(con, "test_lock");
- con.close();
- con2.close();
- }
-}
diff --git a/org/postgresql/test/jdbc2/NotifyTest.java b/org/postgresql/test/jdbc2/NotifyTest.java
deleted file mode 100644
index 8c14042..0000000
--- a/org/postgresql/test/jdbc2/NotifyTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-import java.sql.*;
-
-import org.postgresql.PGNotification;
-
-public class NotifyTest extends TestCase
-{
- private Connection conn;
-
- public NotifyTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- conn = TestUtil.openDB();
- }
-
- protected void tearDown() throws SQLException
- {
- TestUtil.closeDB(conn);
- }
-
- public void testNotify() throws SQLException
- {
- Statement stmt = conn.createStatement();
- stmt.executeUpdate("LISTEN mynotification");
- stmt.executeUpdate("NOTIFY mynotification");
-
- PGNotification notifications[] = ((org.postgresql.PGConnection)conn).getNotifications();
- assertNotNull(notifications);
- assertEquals(1, notifications.length);
- assertEquals("mynotification", notifications[0].getName());
- assertEquals("", notifications[0].getParameter());
-
- stmt.close();
- }
-
- public void testNotifyArgument() throws Exception
- {
- if (!TestUtil.haveMinimumServerVersion(conn, "9.0") || TestUtil.isProtocolVersion(conn, 2))
- return;
-
- Statement stmt = conn.createStatement();
- stmt.executeUpdate("LISTEN mynotification");
- stmt.executeUpdate("NOTIFY mynotification, 'message'");
-
- PGNotification notifications[] = ((org.postgresql.PGConnection)conn).getNotifications();
- assertNotNull(notifications);
- assertEquals(1, notifications.length);
- assertEquals("mynotification", notifications[0].getName());
- assertEquals("message", notifications[0].getParameter());
-
- stmt.close();
- }
-
- public void testAsyncNotify() throws Exception
- {
- Statement stmt = conn.createStatement();
- stmt.executeUpdate("LISTEN mynotification");
-
- // Notify on a separate connection to get an async notify on the first.
- Connection conn2 = TestUtil.openDB();
- try {
- Statement stmt2 = conn2.createStatement();
- stmt2.executeUpdate("NOTIFY mynotification");
- stmt2.close();
- } finally {
- conn2.close();
- }
-
- // Wait a bit to let the notify come through..
- try {
- Thread.sleep(2000);
- } catch (InterruptedException ie) {}
-
- PGNotification notifications[] = ((org.postgresql.PGConnection)conn).getNotifications();
- assertNotNull(notifications);
- assertEquals(1, notifications.length);
- assertEquals("mynotification", notifications[0].getName());
- assertEquals("", notifications[0].getParameter());
-
- stmt.close();
- }
-}
diff --git a/org/postgresql/test/jdbc2/OID74Test.java b/org/postgresql/test/jdbc2/OID74Test.java
deleted file mode 100644
index 408ac0f..0000000
--- a/org/postgresql/test/jdbc2/OID74Test.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.Properties;
-import java.sql.*;
-
-/**
- * User: alexei
- */
-public class OID74Test extends TestCase
-{
- private Connection conn;
-
- public OID74Test( String name )
- {
- super(name);
- }
- public void setUp() throws Exception
- {
- //set up conection here
- Properties props = new Properties();
- props.setProperty("compatible", "7.1");
- conn = TestUtil.openDB(props);
-
- TestUtil.createTable(conn, "temp", "col oid");
- conn.setAutoCommit(false);
- }
-
- public void tearDown() throws Exception
- {
- conn.setAutoCommit(true);
- TestUtil.dropTable(conn, "temp");
- TestUtil.closeDB(conn);
- }
-
- public void testSetNull() throws SQLException {
- PreparedStatement pstmt = conn.prepareStatement("INSERT INTO temp VALUES (?)");
- pstmt.setNull(1, Types.VARBINARY);
- pstmt.executeUpdate();
- pstmt.setNull(1, Types.BLOB);
- pstmt.executeUpdate();
- pstmt.setNull(1, Types.CLOB);
- pstmt.executeUpdate();
- pstmt.close();
- }
-
- public void testBinaryStream() throws Exception
- {
-
- PreparedStatement pstmt = null;
-
- pstmt = conn.prepareStatement("INSERT INTO temp VALUES (?)");
- pstmt.setBinaryStream(1, new ByteArrayInputStream(new byte[]{1, 2, 3, 4, 5}), 5);
- assertTrue( (pstmt.executeUpdate() == 1) );
- pstmt.close();
-
- pstmt = conn.prepareStatement("SELECT col FROM temp LIMIT 1");
- ResultSet rs = pstmt.executeQuery();
-
- assertTrue("No results from query", rs.next() );
-
- InputStream in = rs.getBinaryStream(1);
- int data;
- int i = 1;
- while ((data = in.read()) != -1)
- assertEquals(i++, data);
- rs.close();
- pstmt.close();
- }
-}
diff --git a/org/postgresql/test/jdbc2/PreparedStatementTest.java b/org/postgresql/test/jdbc2/PreparedStatementTest.java
deleted file mode 100644
index eac1367..0000000
--- a/org/postgresql/test/jdbc2/PreparedStatementTest.java
+++ /dev/null
@@ -1,832 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import org.postgresql.test.util.BrokenInputStream;
-import junit.framework.TestCase;
-import java.io.*;
-import java.sql.*;
-import java.math.BigDecimal;
-
-
-public class PreparedStatementTest extends TestCase
-{
-
- private Connection conn;
-
- public PreparedStatementTest(String name)
- {
- super(name);
-
- try
- {
- org.postgresql.Driver driver = new org.postgresql.Driver();
- }
- catch (Exception ex)
- {;}
- }
-
- protected void setUp() throws Exception
- {
- conn = TestUtil.openDB();
- TestUtil.createTable(conn, "streamtable", "bin bytea, str text");
- TestUtil.createTable(conn, "texttable", "ch char(3), te text, vc varchar(3)");
- TestUtil.createTable(conn, "intervaltable", "i interval");
- }
-
- protected void tearDown() throws SQLException
- {
- TestUtil.dropTable(conn, "streamtable");
- TestUtil.dropTable(conn, "texttable");
- TestUtil.dropTable(conn, "intervaltable");
- TestUtil.closeDB(conn);
- }
-
- public void testSetBinaryStream() throws SQLException
- {
- ByteArrayInputStream bais;
- byte buf[] = new byte[10];
- for (int i = 0; i < buf.length; i++)
- {
- buf[i] = (byte)i;
- }
-
- bais = null;
- doSetBinaryStream(bais, 0);
-
- bais = new ByteArrayInputStream(new byte[0]);
- doSetBinaryStream(bais, 0);
-
- bais = new ByteArrayInputStream(buf);
- doSetBinaryStream(bais, 0);
-
- bais = new ByteArrayInputStream(buf);
- doSetBinaryStream(bais, 10);
- }
-
- public void testSetAsciiStream() throws Exception
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- PrintWriter pw = new PrintWriter(new OutputStreamWriter(baos, "ASCII"));
- pw.println("Hello");
- pw.flush();
-
- ByteArrayInputStream bais;
-
- bais = new ByteArrayInputStream(baos.toByteArray());
- doSetAsciiStream(bais, 0);
-
- bais = new ByteArrayInputStream(baos.toByteArray());
- doSetAsciiStream(bais, 6);
-
- bais = new ByteArrayInputStream(baos.toByteArray());
- doSetAsciiStream(bais, 100);
- }
-
- public void testExecuteStringOnPreparedStatement() throws Exception {
- PreparedStatement pstmt = conn.prepareStatement("SELECT 1");
-
- try
- {
- pstmt.executeQuery("SELECT 2");
- fail("Expected an exception when executing a new SQL query on a prepared statement");
- }
- catch (SQLException e)
- {
- }
-
- try
- {
- pstmt.executeUpdate("UPDATE streamtable SET bin=bin");
- fail("Expected an exception when executing a new SQL update on a prepared statement");
- }
- catch (SQLException e)
- {
- }
-
- try
- {
- pstmt.execute("UPDATE streamtable SET bin=bin");
- fail("Expected an exception when executing a new SQL statement on a prepared statement");
- }
- catch (SQLException e)
- {
- }
- }
-
- public void testBinaryStreamErrorsRestartable() throws SQLException {
- // The V2 protocol does not have the ability to recover when
- // streaming data to the server. We could potentially try
- // introducing a syntax error to force the query to fail, but
- // that seems dangerous.
- //
- if (!TestUtil.isProtocolVersion(conn, 3))
- {
- return ;
- }
-
- byte buf[] = new byte[10];
- for (int i = 0; i < buf.length; i++)
- {
- buf[i] = (byte)i;
- }
-
- // InputStream is shorter than the length argument implies.
- InputStream is = new ByteArrayInputStream(buf);
- runBrokenStream(is, buf.length + 1);
-
- // InputStream throws an Exception during read.
- is = new BrokenInputStream(new ByteArrayInputStream(buf), buf.length / 2);
- runBrokenStream(is, buf.length);
-
- // Invalid length < 0.
- is = new ByteArrayInputStream(buf);
- runBrokenStream(is, -1);
-
- // Total Bind message length too long.
- is = new ByteArrayInputStream(buf);
- runBrokenStream(is, Integer.MAX_VALUE);
- }
-
- private void runBrokenStream(InputStream is, int length) throws SQLException
- {
- PreparedStatement pstmt = null;
- try
- {
- pstmt = conn.prepareStatement("INSERT INTO streamtable (bin,str) VALUES (?,?)");
- pstmt.setBinaryStream(1, is, length);
- pstmt.setString(2, "Other");
- pstmt.executeUpdate();
- fail("This isn't supposed to work.");
- }
- catch (SQLException sqle)
- {
- // don't need to rollback because we're in autocommit mode
- pstmt.close();
-
- // verify the connection is still valid and the row didn't go in.
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT COUNT(*) FROM streamtable");
- assertTrue(rs.next());
- assertEquals(0, rs.getInt(1));
- rs.close();
- stmt.close();
- }
- }
-
- private void doSetBinaryStream(ByteArrayInputStream bais, int length) throws SQLException
- {
- PreparedStatement pstmt = conn.prepareStatement("INSERT INTO streamtable (bin,str) VALUES (?,?)");
- pstmt.setBinaryStream(1, bais, length);
- pstmt.setString(2, null);
- pstmt.executeUpdate();
- pstmt.close();
- }
-
- private void doSetAsciiStream(InputStream is, int length) throws SQLException
- {
- PreparedStatement pstmt = conn.prepareStatement("INSERT INTO streamtable (bin,str) VALUES (?,?)");
- pstmt.setBytes(1, null);
- pstmt.setAsciiStream(2, is, length);
- pstmt.executeUpdate();
- pstmt.close();
- }
-
- public void testTrailingSpaces() throws SQLException {
- PreparedStatement pstmt = conn.prepareStatement("INSERT INTO texttable (ch, te, vc) VALUES (?, ?, ?) ");
- String str = "a ";
- pstmt.setString(1, str);
- pstmt.setString(2, str);
- pstmt.setString(3, str);
- pstmt.executeUpdate();
- pstmt.close();
-
- pstmt = conn.prepareStatement("SELECT ch, te, vc FROM texttable WHERE ch=? AND te=? AND vc=?");
- pstmt.setString(1, str);
- pstmt.setString(2, str);
- pstmt.setString(3, str);
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(str, rs.getString(1));
- assertEquals(str, rs.getString(2));
- assertEquals(str, rs.getString(3));
- rs.close();
- pstmt.close();
- }
-
- public void testSetNull() throws SQLException {
- // valid: fully qualified type to setNull()
- PreparedStatement pstmt = conn.prepareStatement("INSERT INTO texttable (te) VALUES (?)");
- pstmt.setNull(1, Types.VARCHAR);
- pstmt.executeUpdate();
-
- // valid: fully qualified type to setObject()
- pstmt.setObject(1, null, Types.VARCHAR);
- pstmt.executeUpdate();
-
- // valid: setObject() with partial type info and a typed "null object instance"
- org.postgresql.util.PGobject dummy = new org.postgresql.util.PGobject();
- dummy.setType("text");
- dummy.setValue(null);
- pstmt.setObject(1, dummy, Types.OTHER);
- pstmt.executeUpdate();
-
- // setObject() with no type info
- pstmt.setObject(1, null);
- pstmt.executeUpdate();
-
- // setObject() with insufficient type info
- pstmt.setObject(1, null, Types.OTHER);
- pstmt.executeUpdate();
-
- // setNull() with insufficient type info
- pstmt.setNull(1, Types.OTHER);
- pstmt.executeUpdate();
-
- pstmt.close();
- }
-
- public void testSingleQuotes() throws SQLException {
- String[] testStrings = new String[] {
- "bare ? question mark",
- "quoted \\' single quote",
- "doubled '' single quote",
- "octal \\060 constant",
- "escaped \\? question mark",
- "double \\\\ backslash",
- "double \" quote",
- };
-
- String[] testStringsStdConf = new String[] {
- "bare ? question mark",
- "quoted '' single quote",
- "doubled '' single quote",
- "octal 0 constant",
- "escaped ? question mark",
- "double \\ backslash",
- "double \" quote",
- };
-
- String[] expected = new String[] {
- "bare ? question mark",
- "quoted ' single quote",
- "doubled ' single quote",
- "octal 0 constant",
- "escaped ? question mark",
- "double \\ backslash",
- "double \" quote",
- };
-
- if (! TestUtil.haveMinimumServerVersion(conn, "8.2"))
- {
- for (int i = 0; i < testStrings.length; ++i)
- {
- PreparedStatement pstmt = conn.prepareStatement("SELECT '" + testStrings[i] + "'");
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(expected[i], rs.getString(1));
- rs.close();
- pstmt.close();
- }
- }
- else
- {
- boolean oldStdStrings = TestUtil.getStandardConformingStrings(conn);
- Statement stmt = conn.createStatement();
-
- // Test with standard_conforming_strings turned off.
- stmt.execute("SET standard_conforming_strings TO off");
- for (int i = 0; i < testStrings.length; ++i)
- {
- PreparedStatement pstmt = conn.prepareStatement("SELECT '" + testStrings[i] + "'");
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(expected[i], rs.getString(1));
- rs.close();
- pstmt.close();
- }
-
- // Test with standard_conforming_strings turned off...
- // ... using the escape string syntax (E'').
- stmt.execute("SET standard_conforming_strings TO on");
- for (int i = 0; i < testStrings.length; ++i)
- {
- PreparedStatement pstmt = conn.prepareStatement("SELECT E'" + testStrings[i] + "'");
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(expected[i], rs.getString(1));
- rs.close();
- pstmt.close();
- }
- // ... using standard conforming input strings.
- for (int i = 0; i < testStrings.length; ++i)
- {
- PreparedStatement pstmt = conn.prepareStatement("SELECT '" + testStringsStdConf[i] + "'");
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(expected[i], rs.getString(1));
- rs.close();
- pstmt.close();
- }
-
- stmt.execute("SET standard_conforming_strings TO " + (oldStdStrings ? "on" : "off"));
- stmt.close();
- }
- }
-
- public void testDoubleQuotes() throws SQLException {
- String[] testStrings = new String[] {
- "bare ? question mark",
- "single ' quote",
- "doubled '' single quote",
- "doubled \"\" double quote",
- "no backslash interpretation here: \\",
- };
-
- for (int i = 0; i < testStrings.length; ++i)
- {
- PreparedStatement pstmt = conn.prepareStatement("CREATE TABLE \"" + testStrings[i] + "\" (i integer)");
- pstmt.executeUpdate();
- pstmt.close();
-
- pstmt = conn.prepareStatement("DROP TABLE \"" + testStrings[i] + "\"");
- pstmt.executeUpdate();
- pstmt.close();
- }
- }
-
- public void testDollarQuotes() throws SQLException {
- // dollar-quotes are supported in the backend since version 8.0
- if (!TestUtil.haveMinimumServerVersion(conn, "8.0"))
- return;
-
- PreparedStatement st;
- ResultSet rs;
-
- st = conn.prepareStatement("SELECT $$;$$ WHERE $x$?$x$=$_0$?$_0$ AND $$?$$=?");
- st.setString(1, "?");
- rs = st.executeQuery();
- assertTrue(rs.next());
- assertEquals(";", rs.getString(1));
- assertFalse(rs.next());
- st.close();
-
- st = conn.prepareStatement(
- "SELECT $__$;$__$ WHERE ''''=$q_1$'$q_1$ AND ';'=?;"
- + "SELECT $x$$a$;$x $a$$x$ WHERE $$;$$=? OR ''=$c$c$;$c$;"
- + "SELECT ?");
- st.setString(1, ";");
- st.setString(2, ";");
- st.setString(3, "$a$ $a$");
-
- assertTrue(st.execute());
- rs = st.getResultSet();
- assertTrue(rs.next());
- assertEquals(";", rs.getString(1));
- assertFalse(rs.next());
-
- assertTrue(st.getMoreResults());
- rs = st.getResultSet();
- assertTrue(rs.next());
- assertEquals("$a$;$x $a$", rs.getString(1));
- assertFalse(rs.next());
-
- assertTrue(st.getMoreResults());
- rs = st.getResultSet();
- assertTrue(rs.next());
- assertEquals("$a$ $a$", rs.getString(1));
- assertFalse(rs.next());
- st.close();
- }
-
- public void testDollarQuotesAndIdentifiers() throws SQLException {
- // dollar-quotes are supported in the backend since version 8.0
- if (!TestUtil.haveMinimumServerVersion(conn, "8.0"))
- return;
-
- PreparedStatement st;
-
- conn.createStatement().execute("CREATE TEMP TABLE a$b$c(a varchar, b varchar)");
- st = conn.prepareStatement("INSERT INTO a$b$c (a, b) VALUES (?, ?)");
- st.setString(1, "a");
- st.setString(2, "b");
- st.executeUpdate();
- st.close();
-
- conn.createStatement().execute("CREATE TEMP TABLE e$f$g(h varchar, e$f$g varchar) ");
- st = conn.prepareStatement("UPDATE e$f$g SET h = ? || e$f$g");
- st.setString(1, "a");
- st.executeUpdate();
- st.close();
- }
-
- public void testComments() throws SQLException {
- PreparedStatement st;
- ResultSet rs;
-
- st = conn.prepareStatement("SELECT /*?*/ /*/*/*/**/*/*/*/1;SELECT ?;--SELECT ?");
- st.setString(1, "a");
- assertTrue(st.execute());
- assertTrue(st.getMoreResults());
- assertFalse(st.getMoreResults());
- st.close();
-
- st = conn.prepareStatement("SELECT /**/'?'/*/**/*/ WHERE '?'=/*/*/*?*/*/*/--?\n?");
- st.setString(1, "?");
- rs = st.executeQuery();
- assertTrue(rs.next());
- assertEquals("?", rs.getString(1));
- assertFalse(rs.next());
- st.close();
- }
-
- public void testDouble() throws SQLException
- {
- PreparedStatement pstmt = conn.prepareStatement("CREATE TEMP TABLE double_tab (max_double float, min_double float, null_value float)");
- pstmt.executeUpdate();
- pstmt.close();
-
- pstmt = conn.prepareStatement( "insert into double_tab values (?,?,?)");
- pstmt.setDouble(1, 1.0E125);
- pstmt.setDouble(2, 1.0E-130);
- pstmt.setNull(3,Types.DOUBLE);
- pstmt.executeUpdate();
- pstmt.close();
-
- pstmt = conn.prepareStatement( "select * from double_tab");
- ResultSet rs = pstmt.executeQuery();
- assertTrue( rs.next());
- double d = rs.getDouble(1);
- assertTrue( rs.getDouble(1) == 1.0E125 );
- assertTrue( rs.getDouble(2) == 1.0E-130 );
- rs.getDouble(3);
- assertTrue( rs.wasNull() );
- rs.close();
- pstmt.close();
-
- }
-
- public void testFloat() throws SQLException
- {
- PreparedStatement pstmt = conn.prepareStatement("CREATE TEMP TABLE float_tab (max_float real, min_float real, null_value real)");
- pstmt.executeUpdate();
- pstmt.close();
-
- pstmt = conn.prepareStatement( "insert into float_tab values (?,?,?)");
- pstmt.setFloat(1,(float)1.0E37 );
- pstmt.setFloat(2, (float)1.0E-37);
- pstmt.setNull(3,Types.FLOAT);
- pstmt.executeUpdate();
- pstmt.close();
-
- pstmt = conn.prepareStatement( "select * from float_tab");
- ResultSet rs = pstmt.executeQuery();
- assertTrue( rs.next());
- float f = rs.getFloat(1);
- assertTrue( "expected 1.0E37,received " + rs.getFloat(1), rs.getFloat(1) == (float)1.0E37 );
- assertTrue( "expected 1.0E-37,received " + rs.getFloat(2), rs.getFloat(2) == (float)1.0E-37 );
- rs.getDouble(3);
- assertTrue( rs.wasNull() );
- rs.close();
- pstmt.close();
-
- }
-
- public void testBoolean() throws SQLException
- {
- PreparedStatement pstmt = conn.prepareStatement("CREATE TEMP TABLE bool_tab (max_val boolean, min_val boolean, null_val boolean)");
- pstmt.executeUpdate();
- pstmt.close();
-
- pstmt = conn.prepareStatement( "insert into bool_tab values (?,?,?)");
- pstmt.setBoolean(1,true );
- pstmt.setBoolean(2, false);
- pstmt.setNull(3,Types.BIT);
- pstmt.executeUpdate();
- pstmt.close();
-
- pstmt = conn.prepareStatement( "select * from bool_tab");
- ResultSet rs = pstmt.executeQuery();
- assertTrue( rs.next());
-
- assertTrue( "expected true,received " + rs.getBoolean(1), rs.getBoolean(1) == true );
- assertTrue( "expected false,received " + rs.getBoolean(2), rs.getBoolean(2) == false );
- rs.getFloat(3);
- assertTrue( rs.wasNull() );
- rs.close();
- pstmt.close();
-
- }
-
- public void testSetFloatInteger() throws SQLException
- {
- PreparedStatement pstmt = conn.prepareStatement("CREATE temp TABLE float_tab (max_val float8, min_val float, null_val float8)");
- pstmt.executeUpdate();
- pstmt.close();
-
- Integer maxInteger= new Integer(2147483647), minInteger = new Integer(-2147483648);
-
- Double maxFloat=new Double( 2147483647), minFloat = new Double( -2147483648 );
-
- pstmt = conn.prepareStatement( "insert into float_tab values (?,?,?)");
- pstmt.setObject(1,maxInteger,Types.FLOAT );
- pstmt.setObject(2,minInteger,Types.FLOAT);
- pstmt.setNull(3,Types.FLOAT);
- pstmt.executeUpdate();
- pstmt.close();
-
- pstmt = conn.prepareStatement( "select * from float_tab");
- ResultSet rs = pstmt.executeQuery();
- assertTrue( rs.next());
-
- assertTrue( "expected "+maxFloat+" ,received " + rs.getObject(1), ((Double)rs.getObject(1)).equals(maxFloat) );
- assertTrue( "expected "+minFloat+" ,received " + rs.getObject(2), ((Double)rs.getObject(2)).equals( minFloat) );
- rs.getFloat(3);
- assertTrue( rs.wasNull() );
- rs.close();
- pstmt.close();
-
- }
- public void testSetFloatString() throws SQLException
- {
- PreparedStatement pstmt = conn.prepareStatement("CREATE temp TABLE float_tab (max_val float8, min_val float8, null_val float8)");
- pstmt.executeUpdate();
- pstmt.close();
-
- String maxStringFloat = new String("1.0E37"), minStringFloat = new String("1.0E-37");
- Double maxFloat=new Double(1.0E37), minFloat = new Double( 1.0E-37 );
-
- pstmt = conn.prepareStatement( "insert into float_tab values (?,?,?)");
- pstmt.setObject(1,maxStringFloat,Types.FLOAT );
- pstmt.setObject(2,minStringFloat,Types.FLOAT );
- pstmt.setNull(3,Types.FLOAT);
- pstmt.executeUpdate();
- pstmt.close();
-
- pstmt = conn.prepareStatement( "select * from float_tab");
- ResultSet rs = pstmt.executeQuery();
- assertTrue( rs.next());
-
- assertTrue( "expected true,received " + rs.getObject(1), ((Double)rs.getObject(1)).equals(maxFloat) );
- assertTrue( "expected false,received " + rs.getBoolean(2), ((Double)rs.getObject(2)).equals( minFloat) );
- rs.getFloat(3);
- assertTrue( rs.wasNull() );
- rs.close();
- pstmt.close();
-
- }
-
- public void testSetFloatBigDecimal() throws SQLException
- {
- PreparedStatement pstmt = conn.prepareStatement("CREATE temp TABLE float_tab (max_val float8, min_val float8, null_val float8)");
- pstmt.executeUpdate();
- pstmt.close();
-
- BigDecimal maxBigDecimalFloat = new BigDecimal("1.0E37"), minBigDecimalFloat = new BigDecimal("1.0E-37");
- Double maxFloat=new Double(1.0E37), minFloat = new Double( 1.0E-37 );
-
- pstmt = conn.prepareStatement( "insert into float_tab values (?,?,?)");
- pstmt.setObject(1,maxBigDecimalFloat,Types.FLOAT );
- pstmt.setObject(2,minBigDecimalFloat,Types.FLOAT );
- pstmt.setNull(3,Types.FLOAT);
- pstmt.executeUpdate();
- pstmt.close();
-
- pstmt = conn.prepareStatement( "select * from float_tab");
- ResultSet rs = pstmt.executeQuery();
- assertTrue( rs.next());
-
- assertTrue( "expected " + maxFloat + " ,received " + rs.getObject(1), ((Double)rs.getObject(1)).equals(maxFloat) );
- assertTrue( "expected " + minFloat + " ,received " + rs.getObject(2), ((Double)rs.getObject(2)).equals( minFloat) );
- rs.getFloat(3);
- assertTrue( rs.wasNull() );
- rs.close();
- pstmt.close();
-
- }
- public void testSetTinyIntFloat() throws SQLException
- {
- PreparedStatement pstmt = conn.prepareStatement("CREATE temp TABLE tiny_int (max_val int4, min_val int4, null_val int4)");
- pstmt.executeUpdate();
- pstmt.close();
-
- Integer maxInt = new Integer( 127 ), minInt = new Integer(-127);
- Float maxIntFloat = new Float( 127 ), minIntFloat = new Float( -127 );
-
- pstmt = conn.prepareStatement( "insert into tiny_int values (?,?,?)");
- pstmt.setObject(1,maxIntFloat,Types.TINYINT );
- pstmt.setObject(2,minIntFloat,Types.TINYINT );
- pstmt.setNull(3,Types.TINYINT);
- pstmt.executeUpdate();
- pstmt.close();
-
- pstmt = conn.prepareStatement( "select * from tiny_int");
- ResultSet rs = pstmt.executeQuery();
- assertTrue( rs.next());
-
- assertTrue( "expected " + maxInt+" ,received " + rs.getObject(1), ((Integer)rs.getObject(1)).equals( maxInt ) );
- assertTrue( "expected " + minInt+" ,received " + rs.getObject(2), ((Integer)rs.getObject(2)).equals( minInt ) );
- rs.getFloat(3);
- assertTrue( rs.wasNull() );
- rs.close();
- pstmt.close();
-
- }
-
- public void testSetSmallIntFloat() throws SQLException
- {
- PreparedStatement pstmt = conn.prepareStatement("CREATE temp TABLE small_int (max_val int4, min_val int4, null_val int4)");
- pstmt.executeUpdate();
- pstmt.close();
-
- Integer maxInt = new Integer( 32767 ), minInt = new Integer(-32768);
- Float maxIntFloat = new Float( 32767 ), minIntFloat = new Float( -32768 );
-
- pstmt = conn.prepareStatement( "insert into small_int values (?,?,?)");
- pstmt.setObject(1,maxIntFloat,Types.SMALLINT );
- pstmt.setObject(2,minIntFloat,Types.SMALLINT );
- pstmt.setNull(3,Types.TINYINT);
- pstmt.executeUpdate();
- pstmt.close();
-
- pstmt = conn.prepareStatement( "select * from small_int");
- ResultSet rs = pstmt.executeQuery();
- assertTrue( rs.next());
-
- assertTrue( "expected " + maxInt+" ,received " + rs.getObject(1), ((Integer)rs.getObject(1)).equals( maxInt ) );
- assertTrue( "expected " + minInt+" ,received " + rs.getObject(2), ((Integer)rs.getObject(2)).equals( minInt ) );
- rs.getFloat(3);
- assertTrue( rs.wasNull() );
- rs.close();
- pstmt.close();
-
- }
- public void testSetIntFloat() throws SQLException
- {
- PreparedStatement pstmt = conn.prepareStatement("CREATE temp TABLE int_TAB (max_val int4, min_val int4, null_val int4)");
- pstmt.executeUpdate();
- pstmt.close();
-
- Integer maxInt = new Integer( 1000 ), minInt = new Integer(-1000);
- Float maxIntFloat = new Float( 1000 ), minIntFloat = new Float( -1000 );
-
- pstmt = conn.prepareStatement( "insert into int_tab values (?,?,?)");
- pstmt.setObject(1,maxIntFloat,Types.INTEGER );
- pstmt.setObject(2,minIntFloat,Types.INTEGER );
- pstmt.setNull(3,Types.INTEGER);
- pstmt.executeUpdate();
- pstmt.close();
-
- pstmt = conn.prepareStatement( "select * from int_tab");
- ResultSet rs = pstmt.executeQuery();
- assertTrue( rs.next());
-
- assertTrue( "expected " + maxInt+" ,received " + rs.getObject(1), ((Integer)rs.getObject(1)).equals( maxInt ) );
- assertTrue( "expected " + minInt+" ,received " + rs.getObject(2), ((Integer)rs.getObject(2)).equals( minInt ) );
- rs.getFloat(3);
- assertTrue( rs.wasNull() );
- rs.close();
- pstmt.close();
-
- }
- public void testSetBooleanDouble() throws SQLException
- {
- PreparedStatement pstmt = conn.prepareStatement("CREATE temp TABLE double_tab (max_val float, min_val float, null_val float)");
- pstmt.executeUpdate();
- pstmt.close();
-
- Boolean trueVal = Boolean.TRUE, falseVal = Boolean.FALSE;
- Double dBooleanTrue = new Double(1), dBooleanFalse = new Double( 0 );
-
- pstmt = conn.prepareStatement( "insert into double_tab values (?,?,?)");
- pstmt.setObject(1,trueVal,Types.DOUBLE );
- pstmt.setObject(2,falseVal,Types.DOUBLE );
- pstmt.setNull(3,Types.DOUBLE);
- pstmt.executeUpdate();
- pstmt.close();
-
- pstmt = conn.prepareStatement( "select * from double_tab");
- ResultSet rs = pstmt.executeQuery();
- assertTrue( rs.next());
-
- assertTrue( "expected " + dBooleanTrue + " ,received " + rs.getObject(1), ((Double)rs.getObject(1)).equals( dBooleanTrue ) );
- assertTrue( "expected " + dBooleanFalse + " ,received " + rs.getObject(2), ((Double)rs.getObject(2)).equals( dBooleanFalse ) );
- rs.getFloat(3);
- assertTrue( rs.wasNull() );
- rs.close();
- pstmt.close();
-
- }
- public void testSetBooleanNumeric() throws SQLException
- {
- PreparedStatement pstmt = conn.prepareStatement("CREATE temp TABLE numeric_tab (max_val numeric(30,15), min_val numeric(30,15), null_val numeric(30,15))");
- pstmt.executeUpdate();
- pstmt.close();
-
- Boolean trueVal = Boolean.TRUE, falseVal = Boolean.FALSE;
- BigDecimal dBooleanTrue = new BigDecimal(1), dBooleanFalse = new BigDecimal( 0 );
-
- pstmt = conn.prepareStatement( "insert into numeric_tab values (?,?,?)");
- pstmt.setObject(1,trueVal,Types.NUMERIC,2 );
- pstmt.setObject(2,falseVal,Types.NUMERIC,2 );
- pstmt.setNull(3,Types.DOUBLE);
- pstmt.executeUpdate();
- pstmt.close();
-
- pstmt = conn.prepareStatement( "select * from numeric_tab");
- ResultSet rs = pstmt.executeQuery();
- assertTrue( rs.next());
-
- assertTrue( "expected " + dBooleanTrue + " ,received " + rs.getObject(1), ((BigDecimal)rs.getObject(1)).compareTo( dBooleanTrue )==0 );
- assertTrue( "expected " + dBooleanFalse + " ,received " + rs.getObject(2), ((BigDecimal)rs.getObject(2)).compareTo( dBooleanFalse )==0 );
- rs.getFloat(3);
- assertTrue( rs.wasNull() );
- rs.close();
- pstmt.close();
-
- }
- public void testSetBooleanDecimal() throws SQLException
- {
- PreparedStatement pstmt = conn.prepareStatement("CREATE temp TABLE DECIMAL_TAB (max_val numeric(30,15), min_val numeric(30,15), null_val numeric(30,15))");
- pstmt.executeUpdate();
- pstmt.close();
-
- Boolean trueVal = Boolean.TRUE, falseVal = Boolean.FALSE;
- BigDecimal dBooleanTrue = new BigDecimal(1), dBooleanFalse = new BigDecimal( 0 );
-
- pstmt = conn.prepareStatement( "insert into DECIMAL_TAB values (?,?,?)");
- pstmt.setObject(1,trueVal,Types.DECIMAL,2 );
- pstmt.setObject(2,falseVal,Types.DECIMAL,2 );
- pstmt.setNull(3,Types.DOUBLE);
- pstmt.executeUpdate();
- pstmt.close();
-
- pstmt = conn.prepareStatement( "select * from DECIMAL_TAB");
- ResultSet rs = pstmt.executeQuery();
- assertTrue( rs.next());
-
- assertTrue( "expected " + dBooleanTrue + " ,received " + rs.getObject(1), ((BigDecimal)rs.getObject(1)).compareTo( dBooleanTrue )==0 );
- assertTrue( "expected " + dBooleanFalse + " ,received " + rs.getObject(2), ((BigDecimal)rs.getObject(2)).compareTo( dBooleanFalse )==0 );
- rs.getFloat(3);
- assertTrue( rs.wasNull() );
- rs.close();
- pstmt.close();
-
- }
-
- public void testUnknownSetObject() throws SQLException
- {
- PreparedStatement pstmt = conn.prepareStatement("INSERT INTO intervaltable(i) VALUES (?)");
-
- if (TestUtil.isProtocolVersion(conn, 3))
- {
- pstmt.setString(1, "1 week");
- try {
- pstmt.executeUpdate();
- fail("Should have failed with type mismatch.");
- } catch (SQLException sqle) {
- }
- }
-
- pstmt.setObject(1, "1 week", Types.OTHER);
- pstmt.executeUpdate();
- pstmt.close();
- }
-
- /**
- * With autoboxing this apparently happens more often now.
- */
- public void testSetObjectCharacter() throws SQLException
- {
- PreparedStatement ps = conn.prepareStatement("INSERT INTO texttable(te) VALUES (?)");
- ps.setObject(1, new Character('z'));
- ps.executeUpdate();
- ps.close();
- }
-
- /**
- * When we have parameters of unknown type and it's not using
- * the unnamed statement, we issue a protocol level statment
- * describe message for the V3 protocol. This test just makes
- * sure that works.
- */
- public void testStatementDescribe() throws SQLException
- {
- PreparedStatement pstmt = conn.prepareStatement("SELECT ?::int");
- pstmt.setObject(1, new Integer(2), Types.OTHER);
- for (int i=0; i<10; i++) {
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- rs.close();
- }
- pstmt.close();
- }
-
-}
diff --git a/org/postgresql/test/jdbc2/RefCursorTest.java b/org/postgresql/test/jdbc2/RefCursorTest.java
deleted file mode 100644
index 0c91c44..0000000
--- a/org/postgresql/test/jdbc2/RefCursorTest.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import java.sql.*;
-import junit.framework.TestCase;
-
-/*
- * RefCursor ResultSet tests.
- * This test case is basically the same as the ResultSet test case.
- *
- * @author Nic Ferrier <nferrier at tapsellferrier.co.uk>
- */
-public class RefCursorTest extends TestCase
-{
- private Connection con;
-
- public RefCursorTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- // this is the same as the ResultSet setup.
- con = TestUtil.openDB();
- Statement stmt = con.createStatement();
-
- TestUtil.createTable(con, "testrs", "id integer primary key");
-
- stmt.executeUpdate("INSERT INTO testrs VALUES (1)");
- stmt.executeUpdate("INSERT INTO testrs VALUES (2)");
- stmt.executeUpdate("INSERT INTO testrs VALUES (3)");
- stmt.executeUpdate("INSERT INTO testrs VALUES (4)");
- stmt.executeUpdate("INSERT INTO testrs VALUES (6)");
- stmt.executeUpdate("INSERT INTO testrs VALUES (9)");
-
-
- // Create the functions.
- stmt.execute ("CREATE OR REPLACE FUNCTION testspg__getRefcursor () RETURNS refcursor AS '"
- + "declare v_resset refcursor; begin open v_resset for select id from testrs order by id; "
- + "return v_resset; end;' LANGUAGE plpgsql;");
- stmt.execute ("CREATE OR REPLACE FUNCTION testspg__getEmptyRefcursor () RETURNS refcursor AS '"
- + "declare v_resset refcursor; begin open v_resset for select id from testrs where id < 1 order by id; "
- + "return v_resset; end;' LANGUAGE plpgsql;");
- stmt.close();
- con.setAutoCommit(false);
- }
-
- protected void tearDown() throws Exception
- {
- con.setAutoCommit(true);
- Statement stmt = con.createStatement ();
- stmt.execute ("drop FUNCTION testspg__getRefcursor ();");
- stmt.execute ("drop FUNCTION testspg__getEmptyRefcursor ();");
- TestUtil.dropTable(con, "testrs");
- TestUtil.closeDB(con);
- }
-
- public void testResult() throws SQLException
- {
- CallableStatement call = con.prepareCall("{ ? = call testspg__getRefcursor () }");
- call.registerOutParameter(1, Types.OTHER);
- call.execute();
- ResultSet rs = (ResultSet) call.getObject(1);
-
- assertTrue(rs.next());
- assertTrue(rs.getInt(1) == 1);
-
- assertTrue(rs.next());
- assertTrue(rs.getInt(1) == 2);
-
- assertTrue(rs.next());
- assertTrue(rs.getInt(1) == 3);
-
- assertTrue(rs.next());
- assertTrue(rs.getInt(1) == 4);
-
- assertTrue(rs.next());
- assertTrue(rs.getInt(1) == 6);
-
- assertTrue(rs.next());
- assertTrue(rs.getInt(1) == 9);
-
- assertTrue(!rs.next());
-
- call.close();
- }
-
-
- public void testEmptyResult() throws SQLException
- {
- CallableStatement call = con.prepareCall("{ ? = call testspg__getEmptyRefcursor () }");
- call.registerOutParameter(1, Types.OTHER);
- call.execute();
-
- ResultSet rs = (ResultSet) call.getObject(1);
- assertTrue(!rs.next());
-
- call.close();
- }
-
- public void testMetaData() throws SQLException
- {
- if (!TestUtil.haveMinimumServerVersion(con, "7.4"))
- return;
-
- CallableStatement call = con.prepareCall("{ ? = call testspg__getRefcursor () }");
- call.registerOutParameter(1, Types.OTHER);
- call.execute();
-
- ResultSet rs = (ResultSet) call.getObject(1);
- ResultSetMetaData rsmd = rs.getMetaData();
- assertNotNull(rsmd);
- assertEquals(1, rsmd.getColumnCount());
- assertEquals(Types.INTEGER, rsmd.getColumnType(1));
- assertEquals("int4", rsmd.getColumnTypeName(1));
- rs.close();
-
- call.close();
- }
-
- public void testResultType() throws SQLException
- {
- CallableStatement call = con.prepareCall("{ ? = call testspg__getRefcursor () }", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
- call.registerOutParameter(1, Types.OTHER);
- call.execute();
- ResultSet rs = (ResultSet) call.getObject(1);
-
- assertEquals(rs.getType(), ResultSet.TYPE_SCROLL_INSENSITIVE);
- assertEquals(rs.getConcurrency(), ResultSet.CONCUR_READ_ONLY);
-
- assertTrue(rs.last());
- assertEquals(6, rs.getRow());
- }
-
-}
diff --git a/org/postgresql/test/jdbc2/ResultSetMetaDataTest.java b/org/postgresql/test/jdbc2/ResultSetMetaDataTest.java
deleted file mode 100644
index dda0843..0000000
--- a/org/postgresql/test/jdbc2/ResultSetMetaDataTest.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.PGResultSetMetaData;
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-import java.sql.*;
-
-public class ResultSetMetaDataTest extends TestCase
-{
-
- private Connection conn;
-
- public ResultSetMetaDataTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- conn = TestUtil.openDB();
- TestUtil.createTable(conn, "rsmd1", "a int primary key, b text, c decimal(10,2)", true);
- TestUtil.createTable(conn, "timetest", "tm time(3), tmtz timetz, ts timestamp without time zone, tstz timestamp(6) with time zone");
-
- TestUtil.dropSequence( conn, "serialtest_a_seq");
- TestUtil.dropSequence( conn, "serialtest_b_seq");
- TestUtil.createTable(conn, "serialtest", "a serial, b bigserial, c int");
- TestUtil.createTable(conn, "alltypes", "bool boolean, i2 int2, i4 int4, i8 int8, num numeric(10,2), re real, fl float, ch char(3), vc varchar(3), tx text, d date, t time without time zone, tz time with time zone, ts timestamp without time zone, tsz timestamp with time zone, bt bytea");
- TestUtil.createTable(conn, "sizetest", "fixedchar char(5), fixedvarchar varchar(5), unfixedvarchar varchar, txt text, bytearr bytea, num64 numeric(6,4), num60 numeric(6,0), num numeric, ip inet");
- TestUtil.createTable(conn, "compositetest", "col rsmd1");
- }
-
- protected void tearDown() throws Exception
- {
- TestUtil.dropTable(conn, "compositetest");
- TestUtil.dropTable(conn, "rsmd1");
- TestUtil.dropTable(conn, "timetest");
- TestUtil.dropTable(conn, "serialtest");
- TestUtil.dropTable(conn, "alltypes");
- TestUtil.dropTable(conn, "sizetest");
- TestUtil.dropSequence( conn, "serialtest_a_seq");
- TestUtil.dropSequence( conn, "serialtest_b_seq");
- TestUtil.closeDB(conn);
- }
-
- public void testStandardResultSet() throws SQLException {
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT a,b,c,a+c as total,oid,b as d FROM rsmd1");
- runStandardTests(rs.getMetaData());
- rs.close();
- stmt.close();
- }
-
- public void testPreparedResultSet() throws SQLException {
- if (!TestUtil.isProtocolVersion(conn, 3))
- return;
-
- PreparedStatement pstmt = conn.prepareStatement("SELECT a,b,c,a+c as total,oid,b as d FROM rsmd1 WHERE b = ?");
- runStandardTests(pstmt.getMetaData());
- pstmt.close();
- }
-
- private void runStandardTests(ResultSetMetaData rsmd) throws SQLException {
- PGResultSetMetaData pgrsmd = (PGResultSetMetaData)rsmd;
-
- assertEquals(6, rsmd.getColumnCount());
-
- assertEquals("a", rsmd.getColumnLabel(1));
- assertEquals("total", rsmd.getColumnLabel(4));
-
- assertEquals("a", rsmd.getColumnName(1));
- assertEquals("oid", rsmd.getColumnName(5));
- if (TestUtil.isProtocolVersion(conn, 3))
- {
- assertEquals("", pgrsmd.getBaseColumnName(4));
- assertEquals("b", pgrsmd.getBaseColumnName(6));
- }
-
- assertEquals(Types.INTEGER, rsmd.getColumnType(1));
- assertEquals(Types.VARCHAR, rsmd.getColumnType(2));
-
- assertEquals("int4", rsmd.getColumnTypeName(1));
- assertEquals("text", rsmd.getColumnTypeName(2));
-
- assertEquals(10, rsmd.getPrecision(3));
-
- assertEquals(2, rsmd.getScale(3));
-
- assertEquals("", rsmd.getSchemaName(1));
- assertEquals("", rsmd.getSchemaName(4));
- if (TestUtil.isProtocolVersion(conn, 3))
- {
- assertEquals("public", pgrsmd.getBaseSchemaName(1));
- assertEquals("", pgrsmd.getBaseSchemaName(4));
- }
-
- assertEquals("", rsmd.getTableName(1));
- assertEquals("", rsmd.getTableName(4));
- if (TestUtil.isProtocolVersion(conn, 3))
- {
- assertEquals("rsmd1", pgrsmd.getBaseTableName(1));
- assertEquals("", pgrsmd.getBaseTableName(4));
- }
-
- if (TestUtil.isProtocolVersion(conn, 3))
- {
- assertEquals(ResultSetMetaData.columnNoNulls, rsmd.isNullable(1));
- assertEquals(ResultSetMetaData.columnNullable, rsmd.isNullable(2));
- assertEquals(ResultSetMetaData.columnNullableUnknown, rsmd.isNullable(4));
- }
- else
- {
- assertEquals(ResultSetMetaData.columnNullableUnknown, rsmd.isNullable(1));
- }
- }
-
- // verify that a prepared update statement returns no metadata and doesn't execute.
- public void testPreparedUpdate() throws SQLException {
- PreparedStatement pstmt = conn.prepareStatement("INSERT INTO rsmd1(a,b) VALUES(?,?)");
- pstmt.setInt(1,1);
- pstmt.setString(2,"hello");
- ResultSetMetaData rsmd = pstmt.getMetaData();
- assertNull(rsmd);
- pstmt.close();
-
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT COUNT(*) FROM rsmd1");
- assertTrue(rs.next());
- assertEquals(0, rs.getInt(1));
- rs.close();
- stmt.close();
- }
-
-
-
- public void testDatabaseMetaDataNames() throws SQLException {
- DatabaseMetaData databaseMetaData = conn.getMetaData();
- ResultSet resultSet = databaseMetaData.getTableTypes();
- ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
- assertEquals(1, resultSetMetaData.getColumnCount());
- assertEquals("TABLE_TYPE", resultSetMetaData.getColumnName(1));
- resultSet.close();
- }
-
- public void testTimestampInfo() throws SQLException {
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT tm, tmtz, ts, tstz FROM timetest");
- ResultSetMetaData rsmd = rs.getMetaData();
-
- // For reference:
- // TestUtil.createTable(conn, "timetest", "tm time(3), tmtz timetz, ts timestamp without time zone, tstz timestamp(6) with time zone");
-
- assertEquals(3, rsmd.getScale(1));
- assertEquals(6, rsmd.getScale(2));
- assertEquals(6, rsmd.getScale(3));
- assertEquals(6, rsmd.getScale(4));
-
- assertEquals(12, rsmd.getColumnDisplaySize(1));
- assertEquals(21, rsmd.getColumnDisplaySize(2));
- assertEquals(29, rsmd.getColumnDisplaySize(3));
- assertEquals(35, rsmd.getColumnDisplaySize(4));
-
- rs.close();
- stmt.close();
- }
-
- public void testColumnDisplaySize() throws SQLException {
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT fixedchar, fixedvarchar, unfixedvarchar, txt, bytearr, num64, num60, num, ip FROM sizetest");
- ResultSetMetaData rsmd = rs.getMetaData();
-
- assertEquals(5, rsmd.getColumnDisplaySize(1));
- assertEquals(5, rsmd.getColumnDisplaySize(2));
- assertEquals(Integer.MAX_VALUE, rsmd.getColumnDisplaySize(3));
- assertEquals(Integer.MAX_VALUE, rsmd.getColumnDisplaySize(4));
- assertEquals(Integer.MAX_VALUE, rsmd.getColumnDisplaySize(5));
- assertEquals(8, rsmd.getColumnDisplaySize(6));
- assertEquals(7, rsmd.getColumnDisplaySize(7));
- assertEquals(131089, rsmd.getColumnDisplaySize(8));
- assertEquals(Integer.MAX_VALUE, rsmd.getColumnDisplaySize(9));
- }
-
- public void testIsAutoIncrement() throws SQLException {
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT c,b,a FROM serialtest");
- ResultSetMetaData rsmd = rs.getMetaData();
-
- assertTrue(!rsmd.isAutoIncrement(1));
- if (TestUtil.isProtocolVersion(conn, 3))
- {
- assertTrue(rsmd.isAutoIncrement(2));
- assertTrue(rsmd.isAutoIncrement(3));
- assertEquals("bigserial", rsmd.getColumnTypeName(2));
- assertEquals("serial", rsmd.getColumnTypeName(3));
- }
-
- rs.close();
- stmt.close();
- }
-
- public void testClassesMatch() throws SQLException {
- Statement stmt = conn.createStatement();
- stmt.executeUpdate("INSERT INTO alltypes (bool, i2, i4, i8, num, re, fl, ch, vc, tx, d, t, tz, ts, tsz, bt) VALUES ('t', 2, 4, 8, 3.1, 3.14, 3.141, 'c', 'vc', 'tx', '2004-04-09', '09:01:00', '11:11:00-01','2004-04-09 09:01:00','1999-09-19 14:23:12-09', '\\\\123')");
- ResultSet rs = stmt.executeQuery("SELECT * FROM alltypes");
- ResultSetMetaData rsmd = rs.getMetaData();
- assertTrue(rs.next());
- for (int i=0; i<rsmd.getColumnCount(); i++) {
- assertEquals(rs.getObject(i+1).getClass().getName(), rsmd.getColumnClassName(i+1));
- }
- }
-
- public void testComposite() throws Exception {
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT col FROM compositetest");
- ResultSetMetaData rsmd = rs.getMetaData();
- assertEquals(Types.STRUCT, rsmd.getColumnType(1));
- assertEquals("rsmd1", rsmd.getColumnTypeName(1));
- }
-
-}
diff --git a/org/postgresql/test/jdbc2/ResultSetTest.java b/org/postgresql/test/jdbc2/ResultSetTest.java
deleted file mode 100644
index 3ec2b27..0000000
--- a/org/postgresql/test/jdbc2/ResultSetTest.java
+++ /dev/null
@@ -1,727 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.Statement;
-import java.sql.SQLException;
-import java.util.Locale;
-
-import junit.framework.TestCase;
-
-/*
- * ResultSet tests.
- */
-public class ResultSetTest extends TestCase
-{
- private Connection con;
-
- public ResultSetTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
- Statement stmt = con.createStatement();
-
- TestUtil.createTable(con, "testrs", "id integer");
-
- stmt.executeUpdate("INSERT INTO testrs VALUES (1)");
- stmt.executeUpdate("INSERT INTO testrs VALUES (2)");
- stmt.executeUpdate("INSERT INTO testrs VALUES (3)");
- stmt.executeUpdate("INSERT INTO testrs VALUES (4)");
- stmt.executeUpdate("INSERT INTO testrs VALUES (6)");
- stmt.executeUpdate("INSERT INTO testrs VALUES (9)");
-
- TestUtil.createTable(con, "teststring", "a text");
- stmt.executeUpdate("INSERT INTO teststring VALUES ('12345')");
-
- TestUtil.createTable(con, "testint", "a int");
- stmt.executeUpdate("INSERT INTO testint VALUES (12345)");
-
- TestUtil.createTable(con, "testbool", "a boolean");
-
- //TestUtil.createTable(con, "testbit", "a bit");
-
- TestUtil.createTable(con, "testboolstring", "a varchar(30)");
-
- stmt.executeUpdate("INSERT INTO testboolstring VALUES('true')");
- stmt.executeUpdate("INSERT INTO testboolstring VALUES('false')");
- stmt.executeUpdate("INSERT INTO testboolstring VALUES('t')");
- stmt.executeUpdate("INSERT INTO testboolstring VALUES('f')");
- stmt.executeUpdate("INSERT INTO testboolstring VALUES('1.0')");
- stmt.executeUpdate("INSERT INTO testboolstring VALUES('0.0')");
- stmt.executeUpdate("INSERT INTO testboolstring VALUES('TRUE')");
- stmt.executeUpdate(
- "INSERT INTO testboolstring VALUES('this is not true')");
-
- TestUtil.createTable(con, "testnumeric", "a numeric");
- stmt.executeUpdate("INSERT INTO testnumeric VALUES('1.0')");
- stmt.executeUpdate("INSERT INTO testnumeric VALUES('0.0')");
- stmt.executeUpdate("INSERT INTO testnumeric VALUES('-1.0')");
- stmt.executeUpdate("INSERT INTO testnumeric VALUES('1.2')");
- stmt.executeUpdate("INSERT INTO testnumeric VALUES('-2.5')");
- stmt.executeUpdate("INSERT INTO testnumeric VALUES('99999.2')");
- stmt.executeUpdate("INSERT INTO testnumeric VALUES('99999')");
- stmt.executeUpdate("INSERT INTO testnumeric VALUES('-99999.2')");
- stmt.executeUpdate("INSERT INTO testnumeric VALUES('-99999')");
-
- // Integer.MaxValue
- stmt.execute("INSERT INTO testnumeric VALUES('2147483647')");
-
- // Integer.MinValue
- stmt.execute("INSERT INTO testnumeric VALUES('-2147483648')");
-
- stmt.executeUpdate("INSERT INTO testnumeric VALUES('2147483648')");
- stmt.executeUpdate("INSERT INTO testnumeric VALUES('-2147483649')");
-
- // Long.MaxValue
- stmt.executeUpdate("INSERT INTO testnumeric VALUES('9223372036854775807')");
-
- // Long.MinValue
- stmt.executeUpdate("INSERT INTO testnumeric VALUES('-9223372036854775808')");
-
- stmt.executeUpdate("INSERT INTO testnumeric VALUES('9223372036854775808')");
- stmt.executeUpdate("INSERT INTO testnumeric VALUES('-9223372036854775809')");
-
- stmt.close();
-
-
- }
-
- protected void tearDown() throws SQLException
- {
- TestUtil.dropTable(con, "testrs");
- TestUtil.dropTable(con, "teststring");
- TestUtil.dropTable(con, "testint");
- TestUtil.dropTable(con, "testbool");
- //TestUtil.dropTable(con, "testbit");
- TestUtil.dropTable(con, "testboolstring");
- TestUtil.dropTable(con, "testnumeric");
- TestUtil.closeDB(con);
- }
-
- public void testBackward() throws SQLException
- {
- Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
- ResultSet rs = stmt.executeQuery("SELECT * FROM testrs");
- rs.afterLast();
- assertTrue(rs.previous());
- rs.close();
- stmt.close();
- }
-
- public void testAbsolute() throws SQLException
- {
- Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
- ResultSet rs = stmt.executeQuery("SELECT * FROM testrs");
-
- assertTrue(!rs.absolute(0));
- assertEquals(0, rs.getRow());
-
- assertTrue(rs.absolute( -1));
- assertEquals(6, rs.getRow());
-
- assertTrue(rs.absolute(1));
- assertEquals(1, rs.getRow());
-
- assertTrue(!rs.absolute( -10));
- assertEquals(0, rs.getRow());
- assertTrue(rs.next());
- assertEquals(1, rs.getRow());
-
- assertTrue(!rs.absolute(10));
- assertEquals(0, rs.getRow());
- assertTrue(rs.previous());
- assertEquals(6, rs.getRow());
-
- stmt.close();
- }
-
- public void testEmptyResult() throws SQLException
- {
- Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
- ResultSet rs = stmt.executeQuery("SELECT * FROM testrs where id=100");
- rs.beforeFirst();
- rs.afterLast();
- assertTrue(!rs.first());
- assertTrue(!rs.last());
- assertTrue(!rs.next());
- }
-
- public void testMaxFieldSize() throws SQLException
- {
- Statement stmt = con.createStatement();
- stmt.setMaxFieldSize(2);
-
- ResultSet rs = stmt.executeQuery("select * from testint");
-
- //max should not apply to the following since per the spec
- //it should apply only to binary and char/varchar columns
- rs.next();
- assertEquals("12345", rs.getString(1));
- // getBytes returns 5 bytes for txt transfer, 4 for bin transfer
- assertTrue(rs.getBytes(1).length >= 4);
-
- //max should apply to the following since the column is
- //a varchar column
- rs = stmt.executeQuery("select * from teststring");
- rs.next();
- assertEquals("12", rs.getString(1));
- assertEquals("12", new String(rs.getBytes(1)));
- }
-
- public void booleanTests(boolean useServerPrepare) throws SQLException
- {
- java.sql.PreparedStatement pstmt = con.prepareStatement("insert into testbool values (?)");
- if (useServerPrepare)
- ((org.postgresql.PGStatement)pstmt).setUseServerPrepare(true);
-
- pstmt.setObject(1, new Float(0), java.sql.Types.BIT);
- pstmt.executeUpdate();
-
- pstmt.setObject(1, new Float(1), java.sql.Types.BIT);
- pstmt.executeUpdate();
-
- pstmt.setObject(1, "False", java.sql.Types.BIT);
- pstmt.executeUpdate();
-
- pstmt.setObject(1, "True", java.sql.Types.BIT);
- pstmt.executeUpdate();
-
- ResultSet rs = con.createStatement().executeQuery("select * from testbool");
- for (int i = 0; i < 2; i++)
- {
- assertTrue(rs.next());
- assertEquals(false, rs.getBoolean(1));
- assertTrue(rs.next());
- assertEquals(true, rs.getBoolean(1));
- }
-
- /*
- pstmt = con.prepareStatement("insert into testbit values (?)");
-
- pstmt.setObject(1, new Float(0), java.sql.Types.BIT);
- pstmt.executeUpdate();
-
- pstmt.setObject(1, new Float(1), java.sql.Types.BIT);
- pstmt.executeUpdate();
-
- pstmt.setObject(1, "false", java.sql.Types.BIT);
- pstmt.executeUpdate();
-
- pstmt.setObject(1, "true", java.sql.Types.BIT);
- pstmt.executeUpdate();
-
- rs = con.createStatement().executeQuery("select * from testbit");
-
- for (int i = 0;i<2; i++)
- {
- assertTrue(rs.next());
- assertEquals(false, rs.getBoolean(1));
- assertTrue(rs.next());
- assertEquals(true, rs.getBoolean(1));
- }
- */
-
- rs = con.createStatement().executeQuery("select * from testboolstring");
-
- for (int i = 0;i < 4; i++)
- {
- assertTrue(rs.next());
- assertEquals(true, rs.getBoolean(1));
- assertTrue(rs.next());
- assertEquals(false, rs.getBoolean(1));
- }
- }
-
- public void testBoolean() throws SQLException
- {
- booleanTests(true);
- booleanTests(false);
- }
-
- public void testgetByte() throws SQLException
- {
- ResultSet rs = con.createStatement().executeQuery(
- "select * from testnumeric");
-
- assertTrue(rs.next());
- assertEquals(1, rs.getByte(1));
-
- assertTrue(rs.next());
- assertEquals(0, rs.getByte(1));
-
- assertTrue(rs.next());
- assertEquals( -1, rs.getByte(1));
-
- assertTrue(rs.next());
- assertEquals(1, rs.getByte(1));
-
- assertTrue(rs.next());
- assertEquals( -2, rs.getByte(1));
-
- while (rs.next())
- {
- try
- {
- rs.getByte(1);
- fail("Exception expected.");
- }
- catch (Exception e)
- {
- }
- }
- rs.close();
- }
-
- public void testgetShort() throws SQLException
- {
- ResultSet rs = con.createStatement().executeQuery(
- "select * from testnumeric");
-
- assertTrue(rs.next());
- assertEquals(1, rs.getShort(1));
-
- assertTrue(rs.next());
- assertEquals(0, rs.getShort(1));
-
- assertTrue(rs.next());
- assertEquals( -1, rs.getShort(1));
-
- assertTrue(rs.next());
- assertEquals(1, rs.getShort(1));
-
- assertTrue(rs.next());
- assertEquals( -2, rs.getShort(1));
-
- while (rs.next())
- {
- try
- {
- rs.getShort(1);
- fail("Exception expected.");
- }
- catch (Exception e)
- {
- }
- }
- rs.close();
- }
-
- public void testgetInt() throws SQLException
- {
- ResultSet rs = con.createStatement().executeQuery(
- "select * from testnumeric");
-
- assertTrue(rs.next());
- assertEquals(1, rs.getInt(1));
-
- assertTrue(rs.next());
- assertEquals(0, rs.getInt(1));
-
- assertTrue(rs.next());
- assertEquals( -1, rs.getInt(1));
-
- assertTrue(rs.next());
- assertEquals(1, rs.getInt(1));
-
- assertTrue(rs.next());
- assertEquals( -2, rs.getInt(1));
-
- assertTrue(rs.next());
- assertEquals(99999, rs.getInt(1));
-
- assertTrue(rs.next());
- assertEquals(99999, rs.getInt(1));
-
- assertTrue(rs.next());
- assertEquals( -99999, rs.getInt(1));
-
- assertTrue(rs.next());
- assertEquals( -99999, rs.getInt(1));
-
- assertTrue(rs.next());
- assertEquals(Integer.MAX_VALUE, rs.getInt(1));
-
- assertTrue(rs.next());
- assertEquals(Integer.MIN_VALUE, rs.getInt(1));
-
- while (rs.next())
- {
- try
- {
- rs.getInt(1);
- fail("Exception expected." + rs.getString(1));
- }
- catch (Exception e)
- {
- }
- }
- rs.close();
- }
-
- public void testgetLong() throws SQLException
- {
- ResultSet rs = con.createStatement().executeQuery(
- "select * from testnumeric");
-
- assertTrue(rs.next());
- assertEquals(1, rs.getLong(1));
-
- assertTrue(rs.next());
- assertEquals(0, rs.getLong(1));
-
- assertTrue(rs.next());
- assertEquals( -1, rs.getLong(1));
-
- assertTrue(rs.next());
- assertEquals(1, rs.getLong(1));
-
- assertTrue(rs.next());
- assertEquals( -2, rs.getLong(1));
-
- assertTrue(rs.next());
- assertEquals(99999, rs.getLong(1));
-
- assertTrue(rs.next());
- assertEquals(99999, rs.getLong(1));
-
- assertTrue(rs.next());
- assertEquals( -99999, rs.getLong(1));
-
- assertTrue(rs.next());
- assertEquals( -99999, rs.getLong(1));
-
- assertTrue(rs.next());
- assertEquals( ((long)Integer.MAX_VALUE), rs.getLong(1));
-
- assertTrue(rs.next());
- assertEquals( ((long)Integer.MIN_VALUE), rs.getLong(1));
-
- assertTrue(rs.next());
- assertEquals( ((long)Integer.MAX_VALUE) + 1, rs.getLong(1));
-
- assertTrue(rs.next());
- assertEquals( ((long)Integer.MIN_VALUE) - 1, rs.getLong(1));
-
- assertTrue(rs.next());
- assertEquals( Long.MAX_VALUE, rs.getLong(1));
-
- assertTrue(rs.next());
- assertEquals( Long.MIN_VALUE, rs.getLong(1));
-
- while (rs.next())
- {
- try
- {
- rs.getLong(1);
- fail("Exception expected." + rs.getString(1) );
- }
- catch (Exception e)
- {
- }
- }
- rs.close();
- }
-
- public void testParameters() throws SQLException
- {
- Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
- stmt.setFetchSize(100);
- stmt.setFetchDirection(ResultSet.FETCH_UNKNOWN);
-
- ResultSet rs = stmt.executeQuery("SELECT * FROM testrs");
-
- assertEquals(ResultSet.CONCUR_UPDATABLE, stmt.getResultSetConcurrency());
- assertEquals(ResultSet.TYPE_SCROLL_SENSITIVE, stmt.getResultSetType());
- assertEquals(100, stmt.getFetchSize());
- assertEquals(ResultSet.FETCH_UNKNOWN, stmt.getFetchDirection());
-
- assertEquals(ResultSet.CONCUR_UPDATABLE, rs.getConcurrency());
- assertEquals(ResultSet.TYPE_SCROLL_SENSITIVE, rs.getType());
- assertEquals(100, rs.getFetchSize());
- assertEquals(ResultSet.FETCH_UNKNOWN, rs.getFetchDirection());
-
- rs.close();
- stmt.close();
- }
-
- public void testZeroRowResultPositioning() throws SQLException
- {
- Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
- ResultSet rs = stmt.executeQuery("SELECT * FROM pg_database WHERE datname='nonexistantdatabase'");
- assertTrue(!rs.previous());
- assertTrue(!rs.previous());
- assertTrue(!rs.next());
- assertTrue(!rs.next());
- assertTrue(!rs.next());
- assertTrue(!rs.next());
- assertTrue(!rs.next());
- assertTrue(!rs.previous());
- assertTrue(!rs.first());
- assertTrue(!rs.last());
- assertEquals(0, rs.getRow());
- assertTrue(!rs.absolute(1));
- assertTrue(!rs.relative(1));
- assertTrue(!rs.isBeforeFirst());
- assertTrue(!rs.isAfterLast());
- assertTrue(!rs.isFirst());
- assertTrue(!rs.isLast());
- rs.close();
- stmt.close();
- }
-
- public void testRowResultPositioning() throws SQLException
- {
- Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
- // Create a one row result set.
- ResultSet rs = stmt.executeQuery("SELECT * FROM pg_database WHERE datname='template1'");
-
- assertTrue(rs.isBeforeFirst());
- assertTrue(!rs.isAfterLast());
- assertTrue(!rs.isFirst());
- assertTrue(!rs.isLast());
-
- assertTrue(rs.next());
-
- assertTrue(!rs.isBeforeFirst());
- assertTrue(!rs.isAfterLast());
- assertTrue(rs.isFirst());
- assertTrue(rs.isLast());
-
- assertTrue(!rs.next());
-
- assertTrue(!rs.isBeforeFirst());
- assertTrue(rs.isAfterLast());
- assertTrue(!rs.isFirst());
- assertTrue(!rs.isLast());
-
- assertTrue(rs.previous());
-
- assertTrue(!rs.isBeforeFirst());
- assertTrue(!rs.isAfterLast());
- assertTrue(rs.isFirst());
- assertTrue(rs.isLast());
-
- assertTrue(rs.absolute(1));
-
- assertTrue(!rs.isBeforeFirst());
- assertTrue(!rs.isAfterLast());
- assertTrue(rs.isFirst());
- assertTrue(rs.isLast());
-
- assertTrue(!rs.absolute(0));
-
- assertTrue(rs.isBeforeFirst());
- assertTrue(!rs.isAfterLast());
- assertTrue(!rs.isFirst());
- assertTrue(!rs.isLast());
-
- assertTrue(!rs.absolute(2));
-
- assertTrue(!rs.isBeforeFirst());
- assertTrue(rs.isAfterLast());
- assertTrue(!rs.isFirst());
- assertTrue(!rs.isLast());
-
- rs.close();
- stmt.close();
- }
-
- public void testForwardOnlyExceptions() throws SQLException
- {
- // Test that illegal operations on a TYPE_FORWARD_ONLY resultset
- // correctly result in throwing an exception.
- Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
- ResultSet rs = stmt.executeQuery("SELECT * FROM testnumeric");
-
- try
- {
- rs.absolute(1);
- fail("absolute() on a TYPE_FORWARD_ONLY resultset did not throw an exception");
- }
- catch (SQLException e)
- {
- }
- try
- {
- rs.afterLast();
- fail("afterLast() on a TYPE_FORWARD_ONLY resultset did not throw an exception on a TYPE_FORWARD_ONLY resultset");
- }
- catch (SQLException e)
- {
- }
- try
- {
- rs.beforeFirst();
- fail("beforeFirst() on a TYPE_FORWARD_ONLY resultset did not throw an exception");
- }
- catch (SQLException e)
- {
- }
- try
- {
- rs.first();
- fail("first() on a TYPE_FORWARD_ONLY resultset did not throw an exception");
- }
- catch (SQLException e)
- {
- }
- try
- {
- rs.last();
- fail("last() on a TYPE_FORWARD_ONLY resultset did not throw an exception");
- }
- catch (SQLException e)
- {
- }
- try
- {
- rs.previous();
- fail("previous() on a TYPE_FORWARD_ONLY resultset did not throw an exception");
- }
- catch (SQLException e)
- {
- }
- try
- {
- rs.relative(1);
- fail("relative() on a TYPE_FORWARD_ONLY resultset did not throw an exception");
- }
- catch (SQLException e)
- {
- }
-
- try
- {
- rs.setFetchDirection(ResultSet.FETCH_REVERSE);
- fail("setFetchDirection(FETCH_REVERSE) on a TYPE_FORWARD_ONLY resultset did not throw an exception");
- }
- catch (SQLException e)
- {
- }
-
- try
- {
- rs.setFetchDirection(ResultSet.FETCH_UNKNOWN);
- fail("setFetchDirection(FETCH_UNKNOWN) on a TYPE_FORWARD_ONLY resultset did not throw an exception");
- }
- catch (SQLException e)
- {
- }
-
- rs.close();
- stmt.close();
- }
-
- public void testCaseInsensitiveFindColumn() throws SQLException
- {
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT id, id AS \"ID2\" FROM testrs");
- assertEquals(1, rs.findColumn("id"));
- assertEquals(1, rs.findColumn("ID"));
- assertEquals(1, rs.findColumn("Id"));
- assertEquals(2, rs.findColumn("id2"));
- assertEquals(2, rs.findColumn("ID2"));
- assertEquals(2, rs.findColumn("Id2"));
- try
- {
- rs.findColumn("id3");
- fail("There isn't an id3 column in the ResultSet.");
- }
- catch (SQLException sqle)
- {
- }
- }
-
- public void testGetOutOfBounds() throws SQLException
- {
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT id FROM testrs");
- assertTrue(rs.next());
-
- try {
- rs.getInt(-9);
- } catch (SQLException sqle) {
- }
-
- try {
- rs.getInt(1000);
- } catch (SQLException sqle) {
- }
- }
-
- public void testClosedResult() throws SQLException
- {
- Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
- ResultSet rs = stmt.executeQuery("SELECT id FROM testrs");
- rs.close();
-
- rs.close(); // Closing twice is allowed.
- try { rs.getInt(1); fail("Expected SQLException"); }
- catch (SQLException e) { }
- try { rs.getInt("id"); fail("Expected SQLException"); }
- catch (SQLException e) { }
- try { rs.getType(); fail("Expected SQLException"); }
- catch (SQLException e) { }
- try { rs.wasNull(); fail("Expected SQLException"); }
- catch (SQLException e) { }
- try { rs.absolute(3); fail("Expected SQLException"); }
- catch (SQLException e) { }
- try { rs.isBeforeFirst(); fail("Expected SQLException"); }
- catch (SQLException e) { }
- try { rs.setFetchSize(10); fail("Expected SQLException"); }
- catch (SQLException e) { }
- try { rs.getMetaData(); fail("Expected SQLException"); }
- catch (SQLException e) { }
- try { rs.rowUpdated(); fail("Expected SQLException"); }
- catch (SQLException e) { }
- try { rs.updateInt(1,1); fail("Expected SQLException"); }
- catch (SQLException e) { }
- try { rs.moveToInsertRow(); fail("Expected SQLException"); }
- catch (SQLException e) { }
- try { rs.clearWarnings(); fail("Expected SQLException"); }
- catch (SQLException e) { }
- }
-
- /*
- * The JDBC spec says when you have duplicate column names,
- * the first one should be returned.
- */
- public void testDuplicateColumnNameOrder() throws SQLException
- {
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT 1 AS a, 2 AS a");
- assertTrue(rs.next());
- assertEquals(1, rs.getInt("a"));
- }
-
- public void testTurkishLocale() throws SQLException
- {
- Locale current = Locale.getDefault();
- try {
- Locale.setDefault(new Locale("tr", "TR"));
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT id FROM testrs");
- int sum = 0;
- while (rs.next()) {
- sum += rs.getInt("ID");
- }
- rs.close();
- assertEquals(25, sum);
- } finally {
- Locale.setDefault(current);
- }
- }
-
-}
diff --git a/org/postgresql/test/jdbc2/ServerCursorTest.java b/org/postgresql/test/jdbc2/ServerCursorTest.java
deleted file mode 100644
index e81d56c..0000000
--- a/org/postgresql/test/jdbc2/ServerCursorTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import java.sql.*;
-
-import junit.framework.TestCase;
-
-import org.postgresql.test.TestUtil;
-
-/*
- * Tests for using non-zero setFetchSize().
- */
-public class ServerCursorTest extends TestCase
-{
- private Connection con;
-
- public ServerCursorTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
- TestUtil.createTable(con, "test_fetch", "value integer,data bytea");
- con.setAutoCommit(false);
- }
-
- protected void tearDown() throws Exception
- {
- con.rollback();
- con.setAutoCommit(true);
- TestUtil.dropTable(con, "test_fetch");
- TestUtil.closeDB(con);
- }
-
- protected void createRows(int count) throws Exception
- {
- PreparedStatement stmt = con.prepareStatement("insert into test_fetch(value,data) values(?,?)");
- for (int i = 0; i < count; ++i)
- {
- stmt.setInt(1, i + 1);
- stmt.setBytes(2, DATA_STRING.getBytes("UTF8"));
- stmt.executeUpdate();
- }
- con.commit();
- }
-
- //Test regular cursor fetching
- public void testBasicFetch() throws Exception
- {
- createRows(1);
-
- PreparedStatement stmt = con.prepareStatement("declare test_cursor cursor for select * from test_fetch");
- stmt.execute();
-
- stmt = con.prepareStatement("fetch forward from test_cursor");
- ResultSet rs = stmt.executeQuery();
- while (rs.next())
- {
- //there should only be one row returned
- assertEquals("query value error", 1, rs.getInt(1));
- byte[] dataBytes = rs.getBytes(2);
- assertEquals("binary data got munged", DATA_STRING, new String(dataBytes, "UTF8"));
- }
-
- }
-
- //Test binary cursor fetching
- public void testBinaryFetch() throws Exception
- {
- createRows(1);
-
- PreparedStatement stmt = con.prepareStatement("declare test_cursor binary cursor for select * from test_fetch");
- stmt.execute();
-
- stmt = con.prepareStatement("fetch forward from test_cursor");
- ResultSet rs = stmt.executeQuery();
- while (rs.next())
- {
- //there should only be one row returned
- byte[] dataBytes = rs.getBytes(2);
- assertEquals("binary data got munged", DATA_STRING, new String(dataBytes, "UTF8"));
- }
-
- }
-
- //This string contains a variety different data:
- // three japanese characters representing "japanese" in japanese
- // the four characters "\000"
- // a null character
- // the seven ascii characters "english"
- private static final String DATA_STRING = "\u65E5\u672C\u8A9E\\000\u0000english";
-
-}
diff --git a/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java b/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java
deleted file mode 100644
index fddd10a..0000000
--- a/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.PGStatement;
-import org.postgresql.jdbc2.AbstractJdbc2Statement;
-import org.postgresql.test.TestUtil;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.Statement;
-
-import junit.framework.TestCase;
-
-/*
- * Tests for using server side prepared statements
- */
-public class ServerPreparedStmtTest extends TestCase
-{
- private Connection con;
-
- public ServerPreparedStmtTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
- Statement stmt = con.createStatement();
-
- TestUtil.createTable(con, "testsps", "id integer, value boolean");
-
- stmt.executeUpdate("INSERT INTO testsps VALUES (1,'t')");
- stmt.executeUpdate("INSERT INTO testsps VALUES (2,'t')");
- stmt.executeUpdate("INSERT INTO testsps VALUES (3,'t')");
- stmt.executeUpdate("INSERT INTO testsps VALUES (4,'t')");
- stmt.executeUpdate("INSERT INTO testsps VALUES (6,'t')");
- stmt.executeUpdate("INSERT INTO testsps VALUES (9,'f')");
-
- stmt.close();
- }
-
- protected void tearDown() throws Exception
- {
- TestUtil.dropTable(con, "testsps");
- TestUtil.closeDB(con);
- }
-
- public void testEmptyResults() throws Exception
- {
- PreparedStatement pstmt = con.prepareStatement("SELECT * FROM testsps WHERE id = ?");
- ((PGStatement)pstmt).setUseServerPrepare(true);
- for (int i=0; i<10; ++i) {
- pstmt.setInt(1, -1);
- ResultSet rs = pstmt.executeQuery();
- assertFalse(rs.next());
- rs.close();
- }
- pstmt.close();
- }
-
- public void testPreparedExecuteCount() throws Exception
- {
- PreparedStatement pstmt = con.prepareStatement("UPDATE testsps SET id = id + 44");
- ((PGStatement)pstmt).setUseServerPrepare(true);
- int count = pstmt.executeUpdate();
- assertEquals(6, count);
- pstmt.close();
- }
-
-
- public void testPreparedStatementsNoBinds() throws Exception
- {
- PreparedStatement pstmt = con.prepareStatement("SELECT * FROM testsps WHERE id = 2");
- ((PGStatement)pstmt).setUseServerPrepare(true);
- assertTrue(((PGStatement)pstmt).isUseServerPrepare());
-
- //Test that basic functionality works
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- rs.close();
-
- //Verify that subsequent calls still work
- rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- rs.close();
-
- //Verify that using the statement still works after turning off prepares
- if (AbstractJdbc2Statement.ForceBinaryTransfers) {
- return;
- }
- ((PGStatement)pstmt).setUseServerPrepare(false);
- assertTrue(!((PGStatement)pstmt).isUseServerPrepare());
-
- rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- rs.close();
-
- pstmt.close();
- }
-
- public void testPreparedStatementsWithOneBind() throws Exception
- {
- PreparedStatement pstmt = con.prepareStatement("SELECT * FROM testsps WHERE id = ?");
- ((PGStatement)pstmt).setUseServerPrepare(true);
- assertTrue(((PGStatement)pstmt).isUseServerPrepare());
-
- //Test that basic functionality works
- pstmt.setInt(1, 2);
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- rs.close();
-
- //Verify that subsequent calls still work
- rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- rs.close();
-
- //Verify that using the statement still works after turning off prepares
- if (AbstractJdbc2Statement.ForceBinaryTransfers) {
- return;
- }
-
- ((PGStatement)pstmt).setUseServerPrepare(false);
- assertTrue(!((PGStatement)pstmt).isUseServerPrepare());
-
- pstmt.setInt(1, 9);
- rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(9, rs.getInt(1));
- rs.close();
-
- pstmt.close();
- }
-
- // Verify we can bind booleans-as-objects ok.
- public void testBooleanObjectBind() throws Exception
- {
- PreparedStatement pstmt = con.prepareStatement("SELECT * FROM testsps WHERE value = ?");
- ((PGStatement)pstmt).setUseServerPrepare(true);
- assertTrue(((PGStatement)pstmt).isUseServerPrepare());
-
- pstmt.setObject(1, new Boolean(false), java.sql.Types.BIT);
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(9, rs.getInt(1));
- rs.close();
- }
-
- // Verify we can bind booleans-as-integers ok.
- public void testBooleanIntegerBind() throws Exception
- {
- PreparedStatement pstmt = con.prepareStatement("SELECT * FROM testsps WHERE id = ?");
- ((PGStatement)pstmt).setUseServerPrepare(true);
- assertTrue(((PGStatement)pstmt).isUseServerPrepare());
-
- pstmt.setObject(1, new Boolean(true), java.sql.Types.INTEGER);
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(1, rs.getInt(1));
- rs.close();
- }
-
- // Verify we can bind booleans-as-native-types ok.
- public void testBooleanBind() throws Exception
- {
- PreparedStatement pstmt = con.prepareStatement("SELECT * FROM testsps WHERE value = ?");
- ((PGStatement)pstmt).setUseServerPrepare(true);
- assertTrue(((PGStatement)pstmt).isUseServerPrepare());
-
- pstmt.setBoolean(1, false);
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(9, rs.getInt(1));
- rs.close();
- }
-
- public void testPreparedStatementsWithBinds() throws Exception
- {
- PreparedStatement pstmt = con.prepareStatement("SELECT * FROM testsps WHERE id = ? or id = ?");
- ((PGStatement)pstmt).setUseServerPrepare(true);
- assertTrue(((PGStatement)pstmt).isUseServerPrepare());
-
- //Test that basic functionality works
- //bind different datatypes
- pstmt.setInt(1, 2);
- pstmt.setLong(2, 2);
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- rs.close();
-
- //Verify that subsequent calls still work
- rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- rs.close();
-
- pstmt.close();
- }
-
- public void testSPSToggle() throws Exception
- {
- // Verify we can toggle UseServerPrepare safely before a query is executed.
- PreparedStatement pstmt = con.prepareStatement("SELECT * FROM testsps WHERE id = 2");
- ((PGStatement)pstmt).setUseServerPrepare(true);
- ((PGStatement)pstmt).setUseServerPrepare(false);
- }
-
- public void testBytea() throws Exception
- {
- // Verify we can use setBytes() with a server-prepared update.
- try
- {
- TestUtil.createTable(con, "testsps_bytea", "data bytea");
-
- PreparedStatement pstmt = con.prepareStatement("INSERT INTO testsps_bytea(data) VALUES (?)");
- ((PGStatement)pstmt).setUseServerPrepare(true);
- pstmt.setBytes(1, new byte[100]);
- pstmt.executeUpdate();
- }
- finally
- {
- TestUtil.dropTable(con, "testsps_bytea");
- }
- }
-
- // Check statements are not transformed when they shouldn't be.
- public void testCreateTable() throws Exception {
- // CREATE TABLE isn't supported by PREPARE; the driver should realize this and
- // still complete without error.
- PreparedStatement pstmt = con.prepareStatement("CREATE TABLE testsps_bad(data int)");
- ((PGStatement)pstmt).setUseServerPrepare(true);
- pstmt.executeUpdate();
- TestUtil.dropTable(con, "testsps_bad");
- }
-
- public void testMultistatement() throws Exception {
- // Shouldn't try to PREPARE this one, if we do we get:
- // PREPARE x(int,int) AS INSERT .... $1 ; INSERT ... $2 -- syntax error
- try
- {
- TestUtil.createTable(con, "testsps_multiple", "data int");
- PreparedStatement pstmt = con.prepareStatement("INSERT INTO testsps_multiple(data) VALUES (?); INSERT INTO testsps_multiple(data) VALUES (?)");
- ((PGStatement)pstmt).setUseServerPrepare(true);
- pstmt.setInt(1, 1);
- pstmt.setInt(2, 2);
- pstmt.executeUpdate(); // Two inserts.
-
- pstmt.setInt(1, 3);
- pstmt.setInt(2, 4);
- pstmt.executeUpdate(); // Two more inserts.
-
- ResultSet check = con.createStatement().executeQuery("SELECT COUNT(*) FROM testsps_multiple");
- assertTrue(check.next());
- assertEquals(4, check.getInt(1));
- }
- finally
- {
- TestUtil.dropTable(con, "testsps_multiple");
- }
- }
-
- public void testTypeChange() throws Exception {
- PreparedStatement pstmt = con.prepareStatement("SELECT CAST (? AS TEXT)");
- ((PGStatement)pstmt).setUseServerPrepare(true);
-
- // Prepare with int parameter.
- pstmt.setInt(1, 1);
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals(1, rs.getInt(1));
- assertTrue(!rs.next());
-
- // Change to text parameter, check it still works.
- pstmt.setString(1, "test string");
- rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals("test string", rs.getString(1));
- assertTrue(!rs.next());
- }
-}
diff --git a/org/postgresql/test/jdbc2/StatementTest.java b/org/postgresql/test/jdbc2/StatementTest.java
deleted file mode 100644
index 0fb9373..0000000
--- a/org/postgresql/test/jdbc2/StatementTest.java
+++ /dev/null
@@ -1,514 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.*;
-import java.sql.*;
-import java.util.Timer;
-import java.util.TimerTask;
-/*
- * Test for getObject
- */
-
-public class StatementTest extends TestCase
-{
- Connection con = null;
-
- public StatementTest(String name )
- {
- super(name);
- }
- protected void setUp() throws Exception
- {
- super.setUp();
-
- con = TestUtil.openDB();
- TestUtil.createTempTable(con, "test_statement",
- "i int");
- TestUtil.createTempTable(con, "escapetest",
- "ts timestamp, d date, t time, \")\" varchar(5), \"\"\"){a}'\" text ");
- TestUtil.createTempTable(con, "comparisontest","str1 varchar(5), str2 varchar(15)");
- Statement stmt = con.createStatement();
- stmt.executeUpdate(TestUtil.insertSQL("comparisontest","str1,str2","'_abcd','_found'"));
- stmt.executeUpdate(TestUtil.insertSQL("comparisontest","str1,str2","'%abcd','%found'"));
- stmt.close();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TestUtil.dropTable( con, "test_statement" );
- TestUtil.dropTable( con, "escapetest" );
- TestUtil.dropTable(con,"comparisontest");
- con.close();
- }
-
- public void testClose() throws SQLException
- {
- Statement stmt = null;
- stmt = con.createStatement();
- stmt.close();
-
- try
- {
- stmt.getResultSet();
- this.fail( "statements should not be re-used after close" );
- }
- catch (SQLException ex)
- {
- }
- }
-
- /**
- * Closing a Statement twice is not an error.
- */
- public void testDoubleClose() throws SQLException
- {
- Statement stmt = con.createStatement();
- stmt.close();
- stmt.close();
- }
-
- public void testMultiExecute() throws SQLException
- {
- Statement stmt = con.createStatement();
- assertTrue(stmt.execute("SELECT 1; UPDATE test_statement SET i=1; SELECT 2"));
-
- ResultSet rs = stmt.getResultSet();
- assertTrue(rs.next());
- assertEquals(1, rs.getInt(1));
- rs.close();
-
- assertTrue(!stmt.getMoreResults());
- assertEquals(0, stmt.getUpdateCount());
-
- assertTrue(stmt.getMoreResults());
- rs = stmt.getResultSet();
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- rs.close();
-
- assertTrue(!stmt.getMoreResults());
- assertEquals(-1, stmt.getUpdateCount());
- stmt.close();
- }
-
- public void testEmptyQuery() throws SQLException
- {
- Statement stmt = con.createStatement();
- stmt.execute("");
- assertNull(stmt.getResultSet());
- assertTrue(!stmt.getMoreResults());
- }
-
- public void testUpdateCount() throws SQLException
- {
- Statement stmt = con.createStatement();
- int count;
-
- count = stmt.executeUpdate("INSERT INTO test_statement VALUES (3)");
- assertEquals(1, count);
- count = stmt.executeUpdate("INSERT INTO test_statement VALUES (3)");
- assertEquals(1, count);
-
- count = stmt.executeUpdate("UPDATE test_statement SET i=4");
- assertEquals(2, count);
-
- count = stmt.executeUpdate("CREATE TEMP TABLE another_table (a int)");
- assertEquals(0, count);
- }
-
- public void testEscapeProcessing() throws SQLException
- {
- Statement stmt = con.createStatement();
- int count;
-
- count = stmt.executeUpdate("insert into escapetest (ts) values ({ts '1900-01-01 00:00:00'})");
- assertEquals(1, count);
-
- count = stmt.executeUpdate("insert into escapetest (d) values ({d '1900-01-01'})");
- assertEquals(1, count);
-
- count = stmt.executeUpdate("insert into escapetest (t) values ({t '00:00:00'})");
- assertEquals(1, count);
-
- ResultSet rs = stmt.executeQuery( "select {fn version()} as version" );
- assertTrue(rs.next());
-
- // check nested and multiple escaped functions
- rs = stmt.executeQuery( "select {fn version()} as version, {fn log({fn log(3.0)})} as log" );
- assertTrue(rs.next());
- assertEquals(Math.log(Math.log(3)), rs.getDouble(2), 0.00001);
-
- stmt.executeUpdate("UPDATE escapetest SET \")\" = 'a', \"\"\"){a}'\" = 'b'");
-
- // check "difficult" values
- rs = stmt.executeQuery("select {fn concat(')',escapetest.\")\")} as concat" +
- ", {fn concat('{','}')} " +
- ", {fn concat('''','\"')} " +
- ", {fn concat(\"\"\"){a}'\", '''}''')} " +
- " FROM escapetest");
- assertTrue(rs.next());
- assertEquals(")a", rs.getString(1));
- assertEquals("{}", rs.getString(2));
- assertEquals("'\"", rs.getString(3));
- assertEquals("b'}'", rs.getString(4));
-
- count = stmt.executeUpdate( "create temp table b (i int)" );
- assertEquals(0, count);
-
- rs = stmt.executeQuery( "select * from {oj test_statement a left outer join b on (a.i=b.i)} ");
- assertTrue(!rs.next());
- // test escape escape character
- rs = stmt.executeQuery("select str2 from comparisontest where str1 like '|_abcd' {escape '|'} ");
- assertTrue(rs.next());
- assertEquals("_found",rs.getString(1));
- rs = stmt.executeQuery("select str2 from comparisontest where str1 like '|%abcd' {escape '|'} ");
- assertTrue(rs.next());
- assertEquals("%found",rs.getString(1));
- }
-
-
- public void testPreparedFunction() throws SQLException
- {
- PreparedStatement pstmt = con.prepareStatement("SELECT {fn concat('a', ?)}");
- pstmt.setInt(1, 5);
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals("a5", rs.getString(1));
- }
-
- public void testNumericFunctions() throws SQLException
- {
- Statement stmt = con.createStatement();
-
- ResultSet rs = stmt.executeQuery("select {fn abs(-2.3)} as abs ");
- assertTrue(rs.next());
- assertEquals(2.3f, rs.getFloat(1), 0.00001);
-
- rs = stmt.executeQuery("select {fn acos(-0.6)} as acos ");
- assertTrue(rs.next());
- assertEquals(Math.acos(-0.6), rs.getDouble(1), 0.00001);
-
- rs = stmt.executeQuery("select {fn asin(-0.6)} as asin ");
- assertTrue(rs.next());
- assertEquals(Math.asin(-0.6), rs.getDouble(1), 0.00001);
-
- rs = stmt.executeQuery("select {fn atan(-0.6)} as atan ");
- assertTrue(rs.next());
- assertEquals(Math.atan(-0.6), rs.getDouble(1), 0.00001);
-
- rs = stmt.executeQuery("select {fn atan2(-2.3,7)} as atan2 ");
- assertTrue(rs.next());
- assertEquals(Math.atan2(-2.3,7), rs.getDouble(1), 0.00001);
-
- rs = stmt.executeQuery("select {fn ceiling(-2.3)} as ceiling ");
- assertTrue(rs.next());
- assertEquals(-2, rs.getDouble(1), 0.00001);
-
- rs = stmt.executeQuery("select {fn cos(-2.3)} as cos, {fn cot(-2.3)} as cot ");
- assertTrue(rs.next());
- assertEquals(Math.cos(-2.3), rs.getDouble(1), 0.00001);
- assertEquals(1/Math.tan(-2.3), rs.getDouble(2), 0.00001);
-
- rs = stmt.executeQuery("select {fn degrees({fn pi()})} as degrees ");
- assertTrue(rs.next());
- assertEquals(180, rs.getDouble(1), 0.00001);
-
- rs = stmt.executeQuery("select {fn exp(-2.3)}, {fn floor(-2.3)}," +
- " {fn log(2.3)},{fn log10(2.3)},{fn mod(3,2)}");
- assertTrue(rs.next());
- assertEquals(Math.exp(-2.3), rs.getDouble(1), 0.00001);
- assertEquals(-3, rs.getDouble(2), 0.00001);
- assertEquals(Math.log(2.3), rs.getDouble(3), 0.00001);
- assertEquals(Math.log(2.3)/Math.log(10), rs.getDouble(4), 0.00001);
- assertEquals(1, rs.getDouble(5), 0.00001);
-
- rs = stmt.executeQuery("select {fn pi()}, {fn power(7,-2.3)}," +
- " {fn radians(-180)},{fn round(3.1294,2)}");
- assertTrue(rs.next());
- assertEquals(Math.PI, rs.getDouble(1), 0.00001);
- assertEquals(Math.pow(7,-2.3), rs.getDouble(2), 0.00001);
- assertEquals(-Math.PI, rs.getDouble(3), 0.00001);
- assertEquals(3.13, rs.getDouble(4), 0.00001);
-
- rs = stmt.executeQuery("select {fn sign(-2.3)}, {fn sin(-2.3)}," +
- " {fn sqrt(2.3)},{fn tan(-2.3)},{fn truncate(3.1294,2)}");
- assertTrue(rs.next());
- assertEquals(-1, rs.getInt(1));
- assertEquals(Math.sin(-2.3), rs.getDouble(2), 0.00001);
- assertEquals(Math.sqrt(2.3), rs.getDouble(3), 0.00001);
- assertEquals(Math.tan(-2.3), rs.getDouble(4), 0.00001);
- assertEquals(3.12, rs.getDouble(5), 0.00001);
- }
-
- public void testStringFunctions() throws SQLException
- {
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("select {fn ascii(' test')},{fn char(32)}" +
- ",{fn concat('ab','cd')}" +
- ",{fn lcase('aBcD')},{fn left('1234',2)},{fn length('123 ')}" +
- ",{fn locate('bc','abc')},{fn locate('bc','abc',3)}");
- assertTrue(rs.next());
- assertEquals(32,rs.getInt(1));
- assertEquals(" ",rs.getString(2));
- assertEquals("abcd",rs.getString(3));
- assertEquals("abcd",rs.getString(4));
- assertEquals("12",rs.getString(5));
- assertEquals(3,rs.getInt(6));
- assertEquals(2,rs.getInt(7));
- assertEquals(0,rs.getInt(8));
-
- if (TestUtil.haveMinimumServerVersion(con, "7.3")) {
- rs = stmt.executeQuery("SELECT {fn insert('abcdef',3,2,'xxxx')}" +
- ",{fn replace('abcdbc','bc','x')}");
- assertTrue(rs.next());
- assertEquals("abxxxxef",rs.getString(1));
- assertEquals("axdx",rs.getString(2));
- }
-
- rs = stmt.executeQuery("select {fn ltrim(' ab')},{fn repeat('ab',2)}" +
- ",{fn right('abcde',2)},{fn rtrim('ab ')}" +
- ",{fn space(3)},{fn substring('abcd',2,2)}" +
- ",{fn ucase('aBcD')}");
- assertTrue(rs.next());
- assertEquals("ab",rs.getString(1));
- assertEquals("abab",rs.getString(2));
- assertEquals("de",rs.getString(3));
- assertEquals("ab",rs.getString(4));
- assertEquals(" ",rs.getString(5));
- assertEquals("bc",rs.getString(6));
- assertEquals("ABCD",rs.getString(7));
- }
-
- public void testDateFuncWithParam() throws SQLException
- {
- // Prior to 8.0 there is not an interval + timestamp operator,
- // so timestampadd does not work.
- //
- if (!TestUtil.haveMinimumServerVersion(con, "8.0"))
- return;
-
- PreparedStatement ps = con.prepareStatement("SELECT {fn timestampadd(SQL_TSI_QUARTER, ? ,{fn now()})}, {fn timestampadd(SQL_TSI_MONTH, ?, {fn now()})} ");
- ps.setInt(1, 4);
- ps.setInt(2, 12);
- ResultSet rs = ps.executeQuery();
- assertTrue(rs.next());
- assertEquals(rs.getTimestamp(1), rs.getTimestamp(2));
- }
-
- public void testDateFunctions() throws SQLException
- {
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("select {fn curdate()},{fn curtime()}" +
- ",{fn dayname({fn now()})}, {fn dayofmonth({fn now()})}" +
- ",{fn dayofweek({ts '2005-01-17 12:00:00'})},{fn dayofyear({fn now()})}" +
- ",{fn hour({fn now()})},{fn minute({fn now()})}" +
- ",{fn month({fn now()})}" +
- ",{fn monthname({fn now()})},{fn quarter({fn now()})}" +
- ",{fn second({fn now()})},{fn week({fn now()})}" +
- ",{fn year({fn now()})} ");
- assertTrue(rs.next());
- // ensure sunday =>1 and monday =>2
- assertEquals(2,rs.getInt(5));
-
- // Prior to 8.0 there is not an interval + timestamp operator,
- // so timestampadd does not work.
- //
- if (!TestUtil.haveMinimumServerVersion(con, "8.0"))
- return;
-
- // second
- rs = stmt.executeQuery("select {fn timestampdiff(SQL_TSI_SECOND,{fn now()},{fn timestampadd(SQL_TSI_SECOND,3,{fn now()})})} ");
- assertTrue(rs.next());
- assertEquals(3,rs.getInt(1));
- // MINUTE
- rs = stmt.executeQuery("select {fn timestampdiff(SQL_TSI_MINUTE,{fn now()},{fn timestampadd(SQL_TSI_MINUTE,3,{fn now()})})} ");
- assertTrue(rs.next());
- assertEquals(3,rs.getInt(1));
- // HOUR
- rs = stmt.executeQuery("select {fn timestampdiff(SQL_TSI_HOUR,{fn now()},{fn timestampadd(SQL_TSI_HOUR,3,{fn now()})})} ");
- assertTrue(rs.next());
- assertEquals(3,rs.getInt(1));
- // day
- rs = stmt.executeQuery("select {fn timestampdiff(SQL_TSI_DAY,{fn now()},{fn timestampadd(SQL_TSI_DAY,-3,{fn now()})})} ");
- assertTrue(rs.next());
- assertEquals(-3,rs.getInt(1));
- // WEEK => extract week from interval is not supported by backend
- //rs = stmt.executeQuery("select {fn timestampdiff(SQL_TSI_WEEK,{fn now()},{fn timestampadd(SQL_TSI_WEEK,3,{fn now()})})} ");
- //assertTrue(rs.next());
- //assertEquals(3,rs.getInt(1));
- // MONTH => backend assume there are 0 month in an interval of 92 days...
- //rs = stmt.executeQuery("select {fn timestampdiff(SQL_TSI_MONTH,{fn now()},{fn timestampadd(SQL_TSI_MONTH,3,{fn now()})})} ");
- //assertTrue(rs.next());
- //assertEquals(3,rs.getInt(1));
- // QUARTER => backend assume there are 1 quater even in 270 days...
- //rs = stmt.executeQuery("select {fn timestampdiff(SQL_TSI_QUARTER,{fn now()},{fn timestampadd(SQL_TSI_QUARTER,3,{fn now()})})} ");
- //assertTrue(rs.next());
- //assertEquals(3,rs.getInt(1));
- // YEAR
- //rs = stmt.executeQuery("select {fn timestampdiff(SQL_TSI_YEAR,{fn now()},{fn timestampadd(SQL_TSI_YEAR,3,{fn now()})})} ");
- //assertTrue(rs.next());
- //assertEquals(3,rs.getInt(1));
- }
-
- public void testSystemFunctions() throws SQLException
- {
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("select {fn ifnull(null,'2')}" +
- ",{fn user()} ");
- assertTrue(rs.next());
- assertEquals("2",rs.getString(1));
- assertEquals(TestUtil.getUser(),rs.getString(2));
-
- if (TestUtil.haveMinimumServerVersion(con, "7.3")) {
- rs = stmt.executeQuery("select {fn database()} ");
- assertTrue(rs.next());
- assertEquals(TestUtil.getDatabase(),rs.getString(1));
- }
- }
-
- public void testWarningsAreCleared() throws SQLException
- {
- Statement stmt = con.createStatement();
- // Will generate a NOTICE: for primary key index creation
- stmt.execute("CREATE TEMP TABLE unused (a int primary key)");
- stmt.executeQuery("SELECT 1");
- // Executing another query should clear the warning from the first one.
- assertNull(stmt.getWarnings());
- stmt.close();
- }
-
- /**
- * The parser tries to break multiple statements into individual
- * queries as required by the V3 extended query protocol. It can
- * be a little overzealous sometimes and this test ensures we
- * keep multiple rule actions together in one statement.
- */
- public void testParsingSemiColons() throws SQLException
- {
- Statement stmt = con.createStatement();
- stmt.execute("CREATE RULE r1 AS ON INSERT TO escapetest DO (DELETE FROM test_statement ; INSERT INTO test_statement VALUES (1); INSERT INTO test_statement VALUES (2); );");
- stmt.executeUpdate("INSERT INTO escapetest(ts) VALUES (NULL)");
- ResultSet rs = stmt.executeQuery("SELECT i from test_statement ORDER BY i");
- assertTrue(rs.next());
- assertEquals(1, rs.getInt(1));
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- assertTrue(!rs.next());
- }
-
- public void testParsingDollarQuotes() throws SQLException
- {
- // dollar-quotes are supported in the backend since version 8.0
- if (!TestUtil.haveMinimumServerVersion(con, "8.0"))
- return;
-
- Statement st = con.createStatement();
- ResultSet rs;
-
- rs = st.executeQuery("SELECT '$a$ ; $a$'");
- assertTrue(rs.next());
- assertEquals("$a$ ; $a$", rs.getObject(1));
- rs.close();
-
- rs = st.executeQuery("SELECT $$;$$");
- assertTrue(rs.next());
- assertEquals(";", rs.getObject(1));
- rs.close();
-
- rs = st.executeQuery("SELECT $OR$$a$'$b$a$$OR$ WHERE '$a$''$b$a$'=$OR$$a$'$b$a$$OR$OR ';'=''");
- assertTrue(rs.next());
- assertEquals("$a$'$b$a$", rs.getObject(1));
- assertFalse(rs.next());
- rs.close();
-
- rs = st.executeQuery("SELECT $B$;$b$B$");
- assertTrue(rs.next());
- assertEquals(";$b", rs.getObject(1));
- rs.close();
-
- rs = st.executeQuery("SELECT $c$c$;$c$");
- assertTrue(rs.next());
- assertEquals("c$;", rs.getObject(1));
- rs.close();
-
- rs = st.executeQuery("SELECT $A0$;$A0$ WHERE ''=$t$t$t$ OR ';$t$'=';$t$'");
- assertTrue(rs.next());
- assertEquals(";", rs.getObject(1));
- assertFalse(rs.next());
- rs.close();
-
- st.executeQuery("SELECT /* */$$;$$/**//*;*/").close();
- st.executeQuery("SELECT /* */--;\n$$a$$/**/--\n--;\n").close();
-
- st.close();
- }
-
- public void testUnbalancedParensParseError() throws SQLException
- {
- Statement stmt = con.createStatement();
- try {
- stmt.executeQuery("SELECT i FROM test_statement WHERE (1 > 0)) ORDER BY i");
- fail("Should have thrown a parse error.");
- } catch (SQLException sqle) { }
- }
-
- public void testExecuteUpdateFailsOnSelect() throws SQLException
- {
- Statement stmt = con.createStatement();
- try {
- stmt.executeUpdate("SELECT 1");
- fail("Should have thrown an error.");
- } catch (SQLException sqle) { }
- }
-
- public void testExecuteUpdateFailsOnMultiStatementSelect() throws SQLException
- {
- Statement stmt = con.createStatement();
- try {
- stmt.executeUpdate("/* */; SELECT 1");
- fail("Should have thrown an error.");
- } catch (SQLException sqle) { }
- }
- public void testSetQueryTimeout() throws SQLException
- {
- Statement stmt = con.createStatement();
- Timer timer = new Timer(true);
- try
- {
-
- timer.schedule( new TimerTask(){
- public void run()
- {
- fail("Query timeout should have occured and cleaned this up");
- }
- }, 5000);
- stmt.setQueryTimeout(1);
- stmt.execute("select pg_sleep(10)");
-
- }catch( SQLException sqle )
- {
- // state for cancel
- if (sqle.getSQLState().compareTo("57014") == 0)
- timer.cancel();
- }
- }
-
- public void testResultSetTwice() throws SQLException
- {
- Statement stmt = con.createStatement();
-
- ResultSet rs = stmt.executeQuery("select {fn abs(-2.3)} as abs ");
- assertNotNull(rs);
-
- ResultSet rsOther = stmt.getResultSet();
- assertNotNull(rsOther);
- }
-}
diff --git a/org/postgresql/test/jdbc2/TestACL.java b/org/postgresql/test/jdbc2/TestACL.java
deleted file mode 100644
index c0cf0a8..0000000
--- a/org/postgresql/test/jdbc2/TestACL.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.jdbc2.AbstractJdbc2Connection;
-import org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData;
-
-import junit.framework.TestCase;
-
-public class TestACL extends TestCase {
-
- @Override
- protected void setUp() throws Exception {
- // TODO Auto-generated method stub
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- // TODO Auto-generated method stub
- super.tearDown();
- }
- public void testParseACL()
- {
- AbstractJdbc2Connection _a = null;
- AbstractJdbc2DatabaseMetaData a = new AbstractJdbc2DatabaseMetaData(_a) {
- };
- a.parseACL("{jurka=arwdRxt/jurka,permuser=rw*/jurka}","jurka");
- a.parseACL("{jurka=a*r*w*d*R*x*t*/jurka,permuser=rw*/jurka}", "jurka");
- a.parseACL("{=,jurka=arwdRxt,permuser=rw}","jurka");
- a.parseACL("{jurka=arwdRxt/jurka,permuser=rw*/jurka,grantuser=w/permuser}","jurka");
- a.parseACL("{jurka=a*r*w*d*R*x*t*/jurka,permuser=rw*/jurka,grantuser=w/permuser}","jurka");
- a.parseACL("{jurka=arwdRxt/jurka,permuser=rw*/jurka,grantuser=w/permuser,\"group permgroup=a/jurka\"}", "jurka");
- a.parseACL("{jurka=a*r*w*d*R*x*t*/jurka,permuser=rw*/jurka,grantuser=w/permuser,\"group permgroup=a/jurka\"}","jurka");
- }
-}
diff --git a/org/postgresql/test/jdbc2/TimeTest.java b/org/postgresql/test/jdbc2/TimeTest.java
deleted file mode 100644
index 5f0be3b..0000000
--- a/org/postgresql/test/jdbc2/TimeTest.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-import java.sql.*;
-import java.util.Calendar;
-import java.util.TimeZone;
-
-/*
- * Some simple tests based on problems reported by users. Hopefully these will
- * help prevent previous problems from re-occuring ;-)
- *
- */
-public class TimeTest extends TestCase
-{
-
- private Connection con;
- private boolean testSetTime = false;
-
- public TimeTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
- TestUtil.createTempTable(con, "testtime", "tm time, tz time with time zone");
- }
-
- protected void tearDown() throws Exception
- {
- TestUtil.dropTable(con, "testtime");
- TestUtil.closeDB(con);
- }
-
- private long extractMillis(long time) {
- return (time >= 0) ? (time % 1000) : (time % 1000 + 1000);
- }
-
- /*
- *
- * Test use of calendar
- */
- public void testGetTimeZone() throws Exception
- {
- final Time midnight = new Time(0, 0, 0);
- Statement stmt = con.createStatement();
- Calendar cal = Calendar.getInstance();
-
- cal.setTimeZone(TimeZone.getTimeZone("GMT"));
-
- int localOffset=Calendar.getInstance().getTimeZone().getOffset(midnight.getTime());
-
- // set the time to midnight to make this easy
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testtime", "'00:00:00','00:00:00'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testtime", "'00:00:00.1','00:00:00.01'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testtime", "CAST(CAST(now() AS timestamp without time zone) AS time),now()")));
- ResultSet rs = stmt.executeQuery(TestUtil.selectSQL("testtime", "tm,tz"));
- assertNotNull(rs);
- assertTrue(rs.next());
-
-
- Time time = rs.getTime(1);
- Timestamp timestamp = rs.getTimestamp(1);
- assertNotNull(timestamp);
-
- Timestamp timestamptz = rs.getTimestamp(2);
- assertNotNull(timestamptz);
-
- Time timetz = rs.getTime(2);
- assertEquals(midnight, time);
-
- time = rs.getTime(1, cal);
- assertEquals(midnight.getTime() , time.getTime() - localOffset);
-
- assertTrue(rs.next());
-
- time = rs.getTime(1);
- assertNotNull(time);
- assertEquals(100, extractMillis(time.getTime()));
- timestamp = rs.getTimestamp(1);
- assertNotNull(timestamp);
-
- // Pre 1.4 JVM's considered the nanos field completely separate
- // and wouldn't return it in getTime()
- if (TestUtil.haveMinimumJVMVersion("1.4"))
- {
- assertEquals(100, extractMillis(timestamp.getTime()));
- }
- else
- {
- assertEquals(100, extractMillis(timestamp.getTime() + timestamp.getNanos() / 1000000));
- }
- assertEquals(100000000, timestamp.getNanos());
-
- timetz = rs.getTime(2);
- assertNotNull(timetz);
- assertEquals(10, extractMillis(timetz.getTime()));
- timestamptz = rs.getTimestamp(2);
- assertNotNull(timestamptz);
-
- // Pre 1.4 JVM's considered the nanos field completely separate
- // and wouldn't return it in getTime()
- if (TestUtil.haveMinimumJVMVersion("1.4"))
- {
- assertEquals(10, extractMillis(timestamptz.getTime()));
- }
- else
- {
- assertEquals(10, extractMillis(timestamptz.getTime() + timestamptz.getNanos() / 1000000));
- }
- assertEquals(10000000, timestamptz.getNanos());
-
- assertTrue(rs.next());
-
- time = rs.getTime(1);
- assertNotNull(time);
- timestamp = rs.getTimestamp(1);
- assertNotNull(timestamp);
-
- timetz = rs.getTime(2);
- assertNotNull(timetz);
- timestamptz = rs.getTimestamp(2);
- assertNotNull(timestamptz);
- }
- /*
- * Tests the time methods in ResultSet
- */
- public void testGetTime() throws SQLException
- {
- Statement stmt = con.createStatement();
-
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testtime", "'01:02:03'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testtime", "'23:59:59'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testtime", "'12:00:00'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testtime", "'05:15:21'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testtime", "'16:21:51'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testtime", "'12:15:12'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testtime", "'22:12:01'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL("testtime", "'08:46:44'")));
-
-
- // Fall through helper
- timeTest();
-
- assertEquals(8, stmt.executeUpdate("DELETE FROM testtime"));
- stmt.close();
- }
-
- /*
- * Tests the time methods in PreparedStatement
- */
- public void testSetTime() throws SQLException
- {
- PreparedStatement ps = con.prepareStatement(TestUtil.insertSQL("testtime", "?"));
- Statement stmt = con.createStatement();
-
- ps.setTime(1, makeTime(1, 2, 3));
- assertEquals(1, ps.executeUpdate());
-
- ps.setTime(1, makeTime(23, 59, 59));
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, java.sql.Time.valueOf("12:00:00"), java.sql.Types.TIME);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, java.sql.Time.valueOf("05:15:21"), java.sql.Types.TIME);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, java.sql.Time.valueOf("16:21:51"), java.sql.Types.TIME);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, java.sql.Time.valueOf("12:15:12"), java.sql.Types.TIME);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, "22:12:1", java.sql.Types.TIME);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, "8:46:44", java.sql.Types.TIME);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, "5:1:2-03", java.sql.Types.TIME);
- assertEquals(1, ps.executeUpdate());
-
- ps.setObject(1, "23:59:59+11", java.sql.Types.TIME);
- assertEquals(1, ps.executeUpdate());
-
- // Need to let the test know this one has extra test cases.
- testSetTime = true;
- // Fall through helper
- timeTest();
- testSetTime = false;
-
- assertEquals(10, stmt.executeUpdate("DELETE FROM testtime"));
- stmt.close();
- ps.close();
- }
-
- /*
- * Helper for the TimeTests. It tests what should be in the db
- */
- private void timeTest() throws SQLException
- {
- Statement st = con.createStatement();
- ResultSet rs;
- java.sql.Time t;
-
- rs = st.executeQuery(TestUtil.selectSQL("testtime", "tm"));
- assertNotNull(rs);
-
- assertTrue(rs.next());
- t = rs.getTime(1);
- assertNotNull(t);
- assertEquals(makeTime(1, 2, 3), t);
-
- assertTrue(rs.next());
- t = rs.getTime(1);
- assertNotNull(t);
- assertEquals(makeTime(23, 59, 59), t);
-
- assertTrue(rs.next());
- t = rs.getTime(1);
- assertNotNull(t);
- assertEquals(makeTime(12, 0, 0), t);
-
- assertTrue(rs.next());
- t = rs.getTime(1);
- assertNotNull(t);
- assertEquals(makeTime(5, 15, 21), t);
-
- assertTrue(rs.next());
- t = rs.getTime(1);
- assertNotNull(t);
- assertEquals(makeTime(16, 21, 51), t);
-
- assertTrue(rs.next());
- t = rs.getTime(1);
- assertNotNull(t);
- assertEquals(makeTime(12, 15, 12), t);
-
- assertTrue(rs.next());
- t = rs.getTime(1);
- assertNotNull(t);
- assertEquals(makeTime(22, 12, 1), t);
-
- assertTrue(rs.next());
- t = rs.getTime(1);
- assertNotNull(t);
- assertEquals(makeTime(8, 46, 44), t);
-
- // If we're checking for timezones.
- if (testSetTime)
- {
- assertTrue(rs.next());
- t = rs.getTime(1);
- assertNotNull(t);
- java.sql.Time tmpTime = java.sql.Time.valueOf("5:1:2");
- int localoffset=java.util.Calendar.getInstance().getTimeZone().getOffset(tmpTime.getTime());
- int Timeoffset = 3 * 60 * 60 * 1000;
- tmpTime.setTime(tmpTime.getTime() + Timeoffset + localoffset);
- assertEquals(makeTime(tmpTime.getHours(), tmpTime.getMinutes(), tmpTime.getSeconds()), t);
-
- assertTrue(rs.next());
- t = rs.getTime(1);
- assertNotNull(t);
- tmpTime = java.sql.Time.valueOf("23:59:59");
- localoffset=java.util.Calendar.getInstance().getTimeZone().getOffset(tmpTime.getTime());
- Timeoffset = -11 * 60 * 60 * 1000;
- tmpTime.setTime(tmpTime.getTime() + Timeoffset + localoffset);
- assertEquals(makeTime(tmpTime.getHours(), tmpTime.getMinutes(), tmpTime.getSeconds()), t);
- }
-
- assertTrue(! rs.next());
-
- rs.close();
- }
-
- private java.sql.Time makeTime(int h, int m, int s)
- {
- return java.sql.Time.valueOf(TestUtil.fix(h, 2) + ":" +
- TestUtil.fix(m, 2) + ":" +
- TestUtil.fix(s, 2));
- }
-}
diff --git a/org/postgresql/test/jdbc2/TimestampTest.java b/org/postgresql/test/jdbc2/TimestampTest.java
deleted file mode 100644
index a37f273..0000000
--- a/org/postgresql/test/jdbc2/TimestampTest.java
+++ /dev/null
@@ -1,695 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-
-import java.sql.*;
-import java.util.TimeZone;
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-
-import org.postgresql.PGStatement;
-import org.postgresql.jdbc2.TimestampUtils;
-import org.postgresql.core.BaseConnection;
-
-/*
- * Test get/setTimestamp for both timestamp with time zone and
- * timestamp without time zone datatypes
- *
- */
-public class TimestampTest extends TestCase
-{
-
- private Connection con;
-
- public TimestampTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
- TestUtil.createTable(con, TSWTZ_TABLE, "ts timestamp with time zone");
- TestUtil.createTable(con, TSWOTZ_TABLE, "ts timestamp without time zone");
- TestUtil.createTable(con, DATE_TABLE, "ts date");
- }
-
- protected void tearDown() throws Exception
- {
- TestUtil.dropTable(con, TSWTZ_TABLE);
- TestUtil.dropTable(con, TSWOTZ_TABLE);
- TestUtil.dropTable(con, DATE_TABLE);
- TestUtil.closeDB(con);
- }
-
- /**
- * Ensure the driver doesn't modify a Calendar that is passed in.
- */
- public void testCalendarModification() throws SQLException
- {
- Calendar cal = Calendar.getInstance();
- Calendar origCal = (Calendar)cal.clone();
- PreparedStatement ps = con.prepareStatement("INSERT INTO " + TSWOTZ_TABLE + " VALUES (?)");
-
- ps.setDate(1, new Date(0), cal);
- ps.executeUpdate();
- assertEquals(origCal, cal);
-
- ps.setTimestamp(1, new Timestamp(0), cal);
- ps.executeUpdate();
- assertEquals(origCal, cal);
-
- ps.setTime(1, new Time(0), cal);
- // Can't actually execute this one because of type mismatch,
- // but all we're really concerned about is the set call.
- // ps.executeUpdate();
- assertEquals(origCal, cal);
-
- ps.close();
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT ts FROM " + TSWOTZ_TABLE);
- assertTrue(rs.next());
-
- rs.getDate(1, cal);
- assertEquals(origCal, cal);
-
- rs.getTimestamp(1, cal);
- assertEquals(origCal, cal);
-
- rs.getTime(1, cal);
- assertEquals(origCal, cal);
-
- rs.close();
- stmt.close();
- }
-
- public void testInfinity() throws SQLException
- {
- runInfinityTests(TSWTZ_TABLE, PGStatement.DATE_POSITIVE_INFINITY);
- runInfinityTests(TSWTZ_TABLE, PGStatement.DATE_NEGATIVE_INFINITY);
- runInfinityTests(TSWOTZ_TABLE, PGStatement.DATE_POSITIVE_INFINITY);
- runInfinityTests(TSWOTZ_TABLE, PGStatement.DATE_NEGATIVE_INFINITY);
- if (TestUtil.haveMinimumServerVersion(con, "8.4"))
- {
- runInfinityTests(DATE_TABLE, PGStatement.DATE_POSITIVE_INFINITY);
- runInfinityTests(DATE_TABLE, PGStatement.DATE_NEGATIVE_INFINITY);
- }
- }
-
- private void runInfinityTests(String table, long value) throws SQLException
- {
- GregorianCalendar cal = new GregorianCalendar();
- // Pick some random timezone that is hopefully different than ours
- // and exists in this JVM.
- cal.setTimeZone(TimeZone.getTimeZone("Europe/Warsaw"));
-
- String strValue;
- if (value == PGStatement.DATE_POSITIVE_INFINITY) {
- strValue = "infinity";
- } else {
- strValue = "-infinity";
- }
-
- Statement stmt = con.createStatement();
- stmt.executeUpdate(TestUtil.insertSQL(table, "'" + strValue + "'"));
- stmt.close();
-
- PreparedStatement ps = con.prepareStatement(TestUtil.insertSQL(table, "?"));
- ps.setTimestamp(1, new Timestamp(value));
- ps.executeUpdate();
- ps.setTimestamp(1, new Timestamp(value), cal);
- ps.executeUpdate();
- ps.close();
-
- stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("select ts from " + table);
- while (rs.next()) {
- assertEquals(strValue, rs.getString(1));
-
- Timestamp ts = rs.getTimestamp(1);
- assertEquals(value, ts.getTime());
-
- Date d = rs.getDate(1);
- assertEquals(value, d.getTime());
-
- Timestamp tscal = rs.getTimestamp(1, cal);
- assertEquals(value, tscal.getTime());
- }
- rs.close();
-
- assertEquals(3, stmt.executeUpdate("DELETE FROM " + table));
- stmt.close();
- }
-
- /*
- * Tests the timestamp methods in ResultSet on timestamp with time zone
- * we insert a known string value (don't use setTimestamp) then see that
- * we get back the same value from getTimestamp
- */
- public void testGetTimestampWTZ() throws SQLException
- {
- Statement stmt = con.createStatement();
- TimestampUtils tsu = ((BaseConnection)con).getTimestampUtils();
-
- //Insert the three timestamp values in raw pg format
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + TS1WTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + TS2WTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + TS3WTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + TS4WTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + TS1WTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + TS2WTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + TS3WTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + TS4WTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + TS1WTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + TS2WTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + TS3WTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + TS4WTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpDate1.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpDate2.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpDate3.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpDate4.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpTime1.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpTime2.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpTime3.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpTime4.getTime())) + "'")));
-
-
- // Fall through helper
- timestampTestWTZ();
-
- assertEquals(20, stmt.executeUpdate("DELETE FROM " + TSWTZ_TABLE));
-
- stmt.close();
- }
-
- /*
- * Tests the timestamp methods in PreparedStatement on timestamp with time zone
- * we insert a value using setTimestamp then see that
- * we get back the same value from getTimestamp (which we know works as it was tested
- * independently of setTimestamp
- */
- public void testSetTimestampWTZ() throws SQLException
- {
- Statement stmt = con.createStatement();
- PreparedStatement pstmt = con.prepareStatement(TestUtil.insertSQL(TSWTZ_TABLE, "?"));
-
- pstmt.setTimestamp(1, TS1WTZ);
- assertEquals(1, pstmt.executeUpdate());
-
- pstmt.setTimestamp(1, TS2WTZ);
- assertEquals(1, pstmt.executeUpdate());
-
- pstmt.setTimestamp(1, TS3WTZ);
- assertEquals(1, pstmt.executeUpdate());
-
- pstmt.setTimestamp(1, TS4WTZ);
- assertEquals(1, pstmt.executeUpdate());
-
- // With java.sql.Timestamp
- pstmt.setObject(1, TS1WTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, TS2WTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, TS3WTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, TS4WTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
-
- // With Strings
- pstmt.setObject(1, TS1WTZ_PGFORMAT, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, TS2WTZ_PGFORMAT, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, TS3WTZ_PGFORMAT, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, TS4WTZ_PGFORMAT, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
-
- // With java.sql.Date
- pstmt.setObject(1, tmpDate1, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, tmpDate2, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, tmpDate3, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, tmpDate4, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
-
- // With java.sql.Time
- pstmt.setObject(1, tmpTime1, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, tmpTime2, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, tmpTime3, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, tmpTime4, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- // Fall through helper
- timestampTestWTZ();
-
- assertEquals(20, stmt.executeUpdate("DELETE FROM " + TSWTZ_TABLE));
-
- pstmt.close();
- stmt.close();
- }
-
- /*
- * Tests the timestamp methods in ResultSet on timestamp without time zone
- * we insert a known string value (don't use setTimestamp) then see that
- * we get back the same value from getTimestamp
- */
- public void testGetTimestampWOTZ() throws SQLException
- {
- Statement stmt = con.createStatement();
- TimestampUtils tsu = ((BaseConnection)con).getTimestampUtils();
-
- //Insert the three timestamp values in raw pg format
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS1WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS2WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS3WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS4WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS5WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS6WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS1WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS2WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS3WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS4WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS5WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS6WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS1WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS2WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS3WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS4WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS5WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS6WOTZ_PGFORMAT + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpDate1WOTZ.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpDate2WOTZ.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpDate3WOTZ.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpDate4WOTZ.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpDate5WOTZ.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpDate6WOTZ.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpTime1WOTZ.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpTime2WOTZ.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpTime3WOTZ.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpTime4WOTZ.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpTime5WOTZ.getTime())) + "'")));
- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + tsu.toString(null, new java.sql.Timestamp(tmpTime6WOTZ.getTime())) + "'")));
-
- // Fall through helper
- timestampTestWOTZ();
-
- assertEquals(30, stmt.executeUpdate("DELETE FROM " + TSWOTZ_TABLE));
-
- stmt.close();
- }
-
- /*
- * Tests the timestamp methods in PreparedStatement on timestamp without time zone
- * we insert a value using setTimestamp then see that
- * we get back the same value from getTimestamp (which we know works as it was tested
- * independently of setTimestamp
- */
- public void testSetTimestampWOTZ() throws SQLException
- {
- Statement stmt = con.createStatement();
- PreparedStatement pstmt = con.prepareStatement(TestUtil.insertSQL(TSWOTZ_TABLE, "?"));
-
- pstmt.setTimestamp(1, TS1WOTZ);
- assertEquals(1, pstmt.executeUpdate());
-
- pstmt.setTimestamp(1, TS2WOTZ);
- assertEquals(1, pstmt.executeUpdate());
-
- pstmt.setTimestamp(1, TS3WOTZ);
- assertEquals(1, pstmt.executeUpdate());
-
- pstmt.setTimestamp(1, TS4WOTZ);
- assertEquals(1, pstmt.executeUpdate());
-
- pstmt.setTimestamp(1, TS5WOTZ);
- assertEquals(1, pstmt.executeUpdate());
-
- pstmt.setTimestamp(1, TS6WOTZ);
- assertEquals(1, pstmt.executeUpdate());
-
- // With java.sql.Timestamp
- pstmt.setObject(1, TS1WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, TS2WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, TS3WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, TS4WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, TS5WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, TS6WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
-
- // With Strings
- pstmt.setObject(1, TS1WOTZ_PGFORMAT, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, TS2WOTZ_PGFORMAT, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, TS3WOTZ_PGFORMAT, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, TS4WOTZ_PGFORMAT, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, TS5WOTZ_PGFORMAT, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, TS6WOTZ_PGFORMAT, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
-
- // With java.sql.Date
- pstmt.setObject(1, tmpDate1WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, tmpDate2WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, tmpDate3WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, tmpDate4WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, tmpDate5WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, tmpDate6WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
-
- // With java.sql.Time
- pstmt.setObject(1, tmpTime1WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, tmpTime2WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, tmpTime3WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, tmpTime4WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, tmpTime5WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- pstmt.setObject(1, tmpTime6WOTZ, java.sql.Types.TIMESTAMP);
- assertEquals(1, pstmt.executeUpdate());
- // Fall through helper
- timestampTestWOTZ();
-
- assertEquals(30, stmt.executeUpdate("DELETE FROM " + TSWOTZ_TABLE));
-
- pstmt.close();
- stmt.close();
- }
-
- /*
- * Helper for the TimestampTests. It tests what should be in the db
- */
- private void timestampTestWTZ() throws SQLException
- {
- Statement stmt = con.createStatement();
- ResultSet rs;
- java.sql.Timestamp t;
-
- rs = stmt.executeQuery("select ts from " + TSWTZ_TABLE); //removed the order by ts
- assertNotNull(rs);
-
- for (int i = 0; i < 3; i++)
- {
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(TS1WTZ, t);
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(TS2WTZ, t);
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(TS3WTZ, t);
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(TS4WTZ, t);
- }
-
- // Testing for Date
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpDate1.getTime(), t.getTime());
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpDate2.getTime(), t.getTime());
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpDate3.getTime(), t.getTime());
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpDate4.getTime(), t.getTime());
-
- // Testing for Time
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpTime1.getTime(), t.getTime());
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpTime2.getTime(), t.getTime());
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpTime3.getTime(), t.getTime());
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpTime4.getTime(), t.getTime());
-
- assertTrue(! rs.next()); // end of table. Fail if more entries exist.
-
- rs.close();
- stmt.close();
- }
-
- /*
- * Helper for the TimestampTests. It tests what should be in the db
- */
- private void timestampTestWOTZ() throws SQLException
- {
- Statement stmt = con.createStatement();
- ResultSet rs;
- java.sql.Timestamp t;
-
- rs = stmt.executeQuery("select ts from " + TSWOTZ_TABLE); //removed the order by ts
- assertNotNull(rs);
-
- for (int i = 0; i < 3; i++)
- {
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertTrue(t.equals(TS1WOTZ));
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertTrue(t.equals(TS2WOTZ));
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertTrue(t.equals(TS3WOTZ));
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertTrue(t.equals(TS4WOTZ));
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertTrue(t.equals(TS5WOTZ));
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertTrue(t.equals(TS6WOTZ));
- }
-
- // Testing for Date
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpDate1WOTZ.getTime(), t.getTime());
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpDate2WOTZ.getTime(), t.getTime());
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpDate3WOTZ.getTime(), t.getTime());
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpDate4WOTZ.getTime(), t.getTime());
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpDate5WOTZ.getTime(), t.getTime());
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpDate6WOTZ.getTime(), t.getTime());
-
- // Testing for Time
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpTime1WOTZ.getTime(), t.getTime());
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpTime2WOTZ.getTime(), t.getTime());
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpTime3WOTZ.getTime(), t.getTime());
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpTime4WOTZ.getTime(), t.getTime());
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpTime5WOTZ.getTime(), t.getTime());
-
- assertTrue(rs.next());
- t = rs.getTimestamp(1);
- assertNotNull(t);
- assertEquals(tmpTime6WOTZ.getTime(), t.getTime());
-
- assertTrue(! rs.next()); // end of table. Fail if more entries exist.
-
- rs.close();
- stmt.close();
- }
-
- private static java.sql.Timestamp getTimestamp(int y, int m, int d, int h, int mn, int se, int f, String tz)
- {
- java.sql.Timestamp l_return = null;
- java.text.DateFormat l_df;
- try
- {
- String l_ts;
- l_ts = TestUtil.fix(y, 4) + "-" +
- TestUtil.fix(m, 2) + "-" +
- TestUtil.fix(d, 2) + " " +
- TestUtil.fix(h, 2) + ":" +
- TestUtil.fix(mn, 2) + ":" +
- TestUtil.fix(se, 2) + " ";
-
- if (tz == null)
- {
- l_df = new java.text.SimpleDateFormat("y-M-d H:m:s");
- }
- else
- {
- l_ts = l_ts + tz;
- l_df = new java.text.SimpleDateFormat("y-M-d H:m:s z");
- }
- java.util.Date l_date = l_df.parse(l_ts);
- l_return = new java.sql.Timestamp(l_date.getTime());
- l_return.setNanos(f);
- }
- catch (Exception ex)
- {
- fail(ex.getMessage());
- }
- return l_return;
- }
-
- private static final java.sql.Timestamp TS1WTZ = getTimestamp(1950, 2, 7, 15, 0, 0, 100000000, "PST");
- private static final String TS1WTZ_PGFORMAT = "1950-02-07 15:00:00.1-08";
-
- private static final java.sql.Timestamp TS2WTZ = getTimestamp(2000, 2, 7, 15, 0, 0, 120000000, "GMT");
- private static final String TS2WTZ_PGFORMAT = "2000-02-07 15:00:00.12+00";
-
- private static final java.sql.Timestamp TS3WTZ = getTimestamp(2000, 7, 7, 15, 0, 0, 123000000, "GMT");
- private static final String TS3WTZ_PGFORMAT = "2000-07-07 15:00:00.123+00";
-
- private static final java.sql.Timestamp TS4WTZ = getTimestamp(2000, 7, 7, 15, 0, 0, 123456000, "GMT");
- private static final String TS4WTZ_PGFORMAT = "2000-07-07 15:00:00.123456+00";
-
-
- private static final java.sql.Timestamp TS1WOTZ = getTimestamp(1950, 2, 7, 15, 0, 0, 100000000, null);
- private static final String TS1WOTZ_PGFORMAT = "1950-02-07 15:00:00.1";
-
- private static final java.sql.Timestamp TS2WOTZ = getTimestamp(2000, 2, 7, 15, 0, 0, 120000000, null);
- private static final String TS2WOTZ_PGFORMAT = "2000-02-07 15:00:00.12";
-
- private static final java.sql.Timestamp TS3WOTZ = getTimestamp(2000, 7, 7, 15, 0, 0, 123000000, null);
- private static final String TS3WOTZ_PGFORMAT = "2000-07-07 15:00:00.123";
-
- private static final java.sql.Timestamp TS4WOTZ = getTimestamp(2000, 7, 7, 15, 0, 0, 123456000, null);
- private static final String TS4WOTZ_PGFORMAT = "2000-07-07 15:00:00.123456";
-
- private static final java.sql.Timestamp TS5WOTZ = new Timestamp(PGStatement.DATE_NEGATIVE_INFINITY);
- private static final String TS5WOTZ_PGFORMAT = "-infinity";
-
- private static final java.sql.Timestamp TS6WOTZ = new Timestamp(PGStatement.DATE_POSITIVE_INFINITY);
- private static final String TS6WOTZ_PGFORMAT = "infinity";
-
- private static final String TSWTZ_TABLE = "testtimestampwtz";
- private static final String TSWOTZ_TABLE = "testtimestampwotz";
- private static final String DATE_TABLE = "testtimestampdate";
-
- private static final java.sql.Date tmpDate1 = new java.sql.Date(TS1WTZ.getTime());
- private static final java.sql.Time tmpTime1 = new java.sql.Time(TS1WTZ.getTime());
- private static final java.sql.Date tmpDate2 = new java.sql.Date(TS2WTZ.getTime());
- private static final java.sql.Time tmpTime2 = new java.sql.Time(TS2WTZ.getTime());
- private static final java.sql.Date tmpDate3 = new java.sql.Date(TS3WTZ.getTime());
- private static final java.sql.Time tmpTime3 = new java.sql.Time(TS3WTZ.getTime());
- private static final java.sql.Date tmpDate4 = new java.sql.Date(TS4WTZ.getTime());
- private static final java.sql.Time tmpTime4 = new java.sql.Time(TS4WTZ.getTime());
-
- private static final java.sql.Date tmpDate1WOTZ = new java.sql.Date(TS1WOTZ.getTime());
- private static final java.sql.Time tmpTime1WOTZ = new java.sql.Time(TS1WOTZ.getTime());
- private static final java.sql.Date tmpDate2WOTZ = new java.sql.Date(TS2WOTZ.getTime());
- private static final java.sql.Time tmpTime2WOTZ = new java.sql.Time(TS2WOTZ.getTime());
- private static final java.sql.Date tmpDate3WOTZ = new java.sql.Date(TS3WOTZ.getTime());
- private static final java.sql.Time tmpTime3WOTZ = new java.sql.Time(TS3WOTZ.getTime());
- private static final java.sql.Date tmpDate4WOTZ = new java.sql.Date(TS4WOTZ.getTime());
- private static final java.sql.Time tmpTime4WOTZ = new java.sql.Time(TS4WOTZ.getTime());
- private static final java.sql.Date tmpDate5WOTZ = new java.sql.Date(TS5WOTZ.getTime());
- private static final java.sql.Date tmpTime5WOTZ = new java.sql.Date(TS5WOTZ.getTime());
- private static final java.sql.Date tmpDate6WOTZ = new java.sql.Date(TS6WOTZ.getTime());
- private static final java.sql.Date tmpTime6WOTZ = new java.sql.Date(TS6WOTZ.getTime());
-
-
-}
diff --git a/org/postgresql/test/jdbc2/TimezoneTest.java b/org/postgresql/test/jdbc2/TimezoneTest.java
deleted file mode 100644
index ec58cf2..0000000
--- a/org/postgresql/test/jdbc2/TimezoneTest.java
+++ /dev/null
@@ -1,754 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2005-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-
-import java.sql.*;
-import java.util.TimeZone;
-import java.util.Calendar;
-
-/*
- * Tests for time and date types with calendars involved.
- * TimestampTest was melting my brain, so I started afresh. -O
- *
- * Conversions that this code tests:
- *
- * setTimestamp -> timestamp, timestamptz, date, time, timetz
- * setDate -> timestamp, timestamptz, date
- * setTime -> time, timetz
- *
- * getTimestamp <- timestamp, timestamptz, date, time, timetz
- * getDate <- timestamp, timestamptz, date
- * getTime <- timestamp, timestamptz, time, timetz
- *
- * (this matches what we must support per JDBC 3.0, tables B-5 and B-6)
- */
-public class TimezoneTest extends TestCase
-{
- private static final int DAY = 24 * 3600 * 1000;
- private Connection con;
- private static final TimeZone saveTZ = TimeZone.getDefault();;
-
- //
- // We set up everything in different timezones to try to exercise many cases:
- //
- // default JVM timezone: GMT+0100
- // server timezone: GMT+0300
- // test timezones: GMT+0000 GMT+0100 GMT+0300 GMT+1300 GMT-0500
-
- private Calendar cUTC;
- private Calendar cGMT03;
- private Calendar cGMT05;
- private Calendar cGMT13;
-
- private boolean min73;
- private boolean min74;
-
- public TimezoneTest(String name)
- {
- super(name);
-
- TimeZone UTC = TimeZone.getTimeZone("UTC"); // +0000 always
- TimeZone GMT03 = TimeZone.getTimeZone("GMT+03"); // +0300 always
- TimeZone GMT05 = TimeZone.getTimeZone("GMT-05"); // -0500 always
- TimeZone GMT13 = TimeZone.getTimeZone("GMT+13"); // +1000 always
-
- cUTC = Calendar.getInstance(UTC);
- cGMT03 = Calendar.getInstance(GMT03);
- cGMT05 = Calendar.getInstance(GMT05);
- cGMT13 = Calendar.getInstance(GMT13);
- }
-
- protected void setUp() throws Exception
- {
- // We must change the default TZ before establishing the connection.
- TimeZone.setDefault(TimeZone.getTimeZone("GMT+01")); // Arbitary timezone that doesn't match our test timezones
-
- con = TestUtil.openDB();
- TestUtil.createTable(con, "testtimezone",
- "seq int4, tstz timestamp with time zone, ts timestamp without time zone, t time without time zone, tz time with time zone, d date");
-
- // This is not obvious, but the "gmt-3" timezone is actually 3 hours *ahead* of GMT
- // so will produce +03 timestamptz output
- con.createStatement().executeUpdate("set timezone = 'gmt-3'");
-
- min73 = TestUtil.haveMinimumServerVersion(con, "7.3");
- min74 = TestUtil.haveMinimumServerVersion(con, "7.4");
-
- //System.err.println("++++++ TESTS START (" + getName() + ") ++++++");
- }
-
- protected void tearDown() throws Exception
- {
- //System.err.println("++++++ TESTS END (" + getName() + ") ++++++");
- TimeZone.setDefault(saveTZ);
-
- TestUtil.dropTable(con, "testtimezone");
- TestUtil.closeDB(con);
- }
-
- public void testGetTimestamp() throws Exception
- {
- con.createStatement().executeUpdate("INSERT INTO testtimezone(tstz,ts,t,tz,d) VALUES('2005-01-01 15:00:00 +0300', '2005-01-01 15:00:00', '15:00:00', '15:00:00 +0300', '2005-01-01')");
-
- ResultSet rs = con.createStatement().executeQuery("SELECT tstz,ts,t,tz,d from testtimezone");
-
- assertTrue(rs.next());
- checkDatabaseContents("SELECT tstz::text,ts::text,t::text,tz::text,d::text from testtimezone",
- new String[]{"2005-01-01 12:00:00+00",
- "2005-01-01 15:00:00",
- "15:00:00",
- "15:00:00+03",
- "2005-01-01"});
-
- Timestamp ts;
-
- // timestamptz: 2005-01-01 15:00:00+03
- ts = rs.getTimestamp(1); // Represents an instant in time, timezone is irrelevant.
- assertEquals(1104580800000L, ts.getTime()); // 2005-01-01 12:00:00 UTC
- ts = rs.getTimestamp(1, cUTC); // Represents an instant in time, timezone is irrelevant.
- assertEquals(1104580800000L, ts.getTime()); // 2005-01-01 12:00:00 UTC
- ts = rs.getTimestamp(1, cGMT03); // Represents an instant in time, timezone is irrelevant.
- assertEquals(1104580800000L, ts.getTime()); // 2005-01-01 12:00:00 UTC
- ts = rs.getTimestamp(1, cGMT05); // Represents an instant in time, timezone is irrelevant.
- assertEquals(1104580800000L, ts.getTime()); // 2005-01-01 12:00:00 UTC
- ts = rs.getTimestamp(1, cGMT13); // Represents an instant in time, timezone is irrelevant.
- assertEquals(1104580800000L, ts.getTime()); // 2005-01-01 12:00:00 UTC
-
- // timestamp: 2005-01-01 15:00:00
- ts = rs.getTimestamp(2); // Convert timestamp to +0100
- assertEquals(1104588000000L, ts.getTime()); // 2005-01-01 15:00:00 +0100
- ts = rs.getTimestamp(2, cUTC); // Convert timestamp to UTC
- assertEquals(1104591600000L, ts.getTime()); // 2005-01-01 15:00:00 +0000
- ts = rs.getTimestamp(2, cGMT03); // Convert timestamp to +0300
- assertEquals(1104580800000L, ts.getTime()); // 2005-01-01 15:00:00 +0300
- ts = rs.getTimestamp(2, cGMT05); // Convert timestamp to -0500
- assertEquals(1104609600000L, ts.getTime()); // 2005-01-01 15:00:00 -0500
- ts = rs.getTimestamp(2, cGMT13); // Convert timestamp to +1300
- assertEquals(1104544800000L, ts.getTime()); // 2005-01-01 15:00:00 +1300
-
- // time: 15:00:00
- ts = rs.getTimestamp(3);
- assertEquals(50400000L, ts.getTime()); // 1970-01-01 15:00:00 +0100
- ts = rs.getTimestamp(3, cUTC);
- assertEquals(54000000L, ts.getTime()); // 1970-01-01 15:00:00 +0000
- ts = rs.getTimestamp(3, cGMT03);
- assertEquals(43200000L, ts.getTime()); // 1970-01-01 15:00:00 +0300
- ts = rs.getTimestamp(3, cGMT05);
- assertEquals(72000000L, ts.getTime()); // 1970-01-01 15:00:00 -0500
- ts = rs.getTimestamp(3, cGMT13);
- assertEquals(7200000L, ts.getTime()); // 1970-01-01 15:00:00 +1300
-
- // timetz: 15:00:00+03
- ts = rs.getTimestamp(4);
- assertEquals(43200000L, ts.getTime()); // 1970-01-01 15:00:00 +0300 -> 1970-01-01 13:00:00 +0100
- ts = rs.getTimestamp(4, cUTC);
- assertEquals(43200000L, ts.getTime()); // 1970-01-01 15:00:00 +0300 -> 1970-01-01 12:00:00 +0000
- ts = rs.getTimestamp(4, cGMT03);
- assertEquals(43200000L, ts.getTime()); // 1970-01-01 15:00:00 +0300 -> 1970-01-01 15:00:00 +0300
- ts = rs.getTimestamp(4, cGMT05);
- assertEquals(43200000L, ts.getTime()); // 1970-01-01 15:00:00 +0300 -> 1970-01-01 07:00:00 -0500
- ts = rs.getTimestamp(4, cGMT13);
- assertEquals(43200000L, ts.getTime()); // 1970-01-01 15:00:00 +0300 -> 1970-01-02 01:00:00 +1300 (CHECK ME)
-
- // date: 2005-01-01
- ts = rs.getTimestamp(5);
- assertEquals(1104534000000L, ts.getTime()); // 2005-01-01 00:00:00 +0100
- ts = rs.getTimestamp(5, cUTC);
- assertEquals(1104537600000L, ts.getTime()); // 2005-01-01 00:00:00 +0000
- ts = rs.getTimestamp(5, cGMT03);
- assertEquals(1104526800000L, ts.getTime()); // 2005-01-01 00:00:00 +0300
- ts = rs.getTimestamp(5, cGMT05);
- assertEquals(1104555600000L, ts.getTime()); // 2005-01-01 00:00:00 -0500
- ts = rs.getTimestamp(5, cGMT13);
- assertEquals(1104490800000L, ts.getTime()); // 2005-01-01 00:00:00 +1300
-
- assertTrue(!rs.next());
- }
-
- public void testGetDate() throws Exception
- {
- con.createStatement().executeUpdate("INSERT INTO testtimezone(tstz,ts,d) VALUES('2005-01-01 15:00:00 +0300', '2005-01-01 15:00:00', '2005-01-01')");
-
- ResultSet rs = con.createStatement().executeQuery("SELECT tstz,ts,d from testtimezone");
-
- assertTrue(rs.next());
- checkDatabaseContents("SELECT tstz::text,ts::text,d::text from testtimezone",
- new String[]{"2005-01-01 12:00:00+00",
- "2005-01-01 15:00:00",
- "2005-01-01"});
-
- Date d;
-
- // timestamptz: 2005-01-01 15:00:00+03
- d = rs.getDate(1); // 2005-01-01 13:00:00 +0100 -> 2005-01-01 00:00:00 +0100
- assertEquals(1104534000000L, d.getTime());
- d = rs.getDate(1, cUTC); // 2005-01-01 12:00:00 +0000 -> 2005-01-01 00:00:00 +0000
- assertEquals(1104537600000L, d.getTime());
- d = rs.getDate(1, cGMT03); // 2005-01-01 15:00:00 +0300 -> 2005-01-01 00:00:00 +0300
- assertEquals(1104526800000L, d.getTime());
- d = rs.getDate(1, cGMT05); // 2005-01-01 07:00:00 -0500 -> 2005-01-01 00:00:00 -0500
- assertEquals(1104555600000L, d.getTime());
- d = rs.getDate(1, cGMT13); // 2005-01-02 01:00:00 +1300 -> 2005-01-02 00:00:00 +1300
- assertEquals(1104577200000L, d.getTime());
-
- // timestamp: 2005-01-01 15:00:00
- d = rs.getDate(2); // 2005-01-01 00:00:00 +0100
- assertEquals(1104534000000L, d.getTime());
- d = rs.getDate(2, cUTC); // 2005-01-01 00:00:00 +0000
- assertEquals(1104537600000L, d.getTime());
- d = rs.getDate(2, cGMT03); // 2005-01-01 00:00:00 +0300
- assertEquals(1104526800000L, d.getTime());
- d = rs.getDate(2, cGMT05); // 2005-01-01 00:00:00 -0500
- assertEquals(1104555600000L, d.getTime());
- d = rs.getDate(2, cGMT13); // 2005-01-01 00:00:00 +1300
- assertEquals(1104490800000L, d.getTime());
-
- // date: 2005-01-01
- d = rs.getDate(3); // 2005-01-01 00:00:00 +0100
- assertEquals(1104534000000L, d.getTime());
- d = rs.getDate(3, cUTC); // 2005-01-01 00:00:00 +0000
- assertEquals(1104537600000L, d.getTime());
- d = rs.getDate(3, cGMT03); // 2005-01-01 00:00:00 +0300
- assertEquals(1104526800000L, d.getTime());
- d = rs.getDate(3, cGMT05); // 2005-01-01 00:00:00 -0500
- assertEquals(1104555600000L, d.getTime());
- d = rs.getDate(3, cGMT13); // 2005-01-01 00:00:00 +1300
- assertEquals(1104490800000L, d.getTime());
-
- assertTrue(!rs.next());
- }
-
- public void testGetTime() throws Exception
- {
-
- con.createStatement().executeUpdate("INSERT INTO testtimezone(tstz,ts,t,tz) VALUES('2005-01-01 15:00:00 +0300', '2005-01-01 15:00:00', '15:00:00', '15:00:00 +0300')");
-
- ResultSet rs = con.createStatement().executeQuery("SELECT tstz,ts,t,tz from testtimezone");
-
- assertTrue(rs.next());
- checkDatabaseContents("SELECT tstz::text,ts::text,t::text,tz::text,d::text from testtimezone",
- new String[]{"2005-01-01 12:00:00+00",
- "2005-01-01 15:00:00",
- "15:00:00",
- "15:00:00+03"});
-
- Time t;
-
- // timestamptz: 2005-01-01 15:00:00+03
- t = rs.getTime(1);
- assertEquals(43200000L, t.getTime()); // 2005-01-01 13:00:00 +0100 -> 1970-01-01 13:00:00 +0100
- t = rs.getTime(1, cUTC);
- assertEquals(43200000L, t.getTime()); // 2005-01-01 12:00:00 +0000 -> 1970-01-01 12:00:00 +0000
- t = rs.getTime(1, cGMT03);
- assertEquals(43200000L, t.getTime()); // 2005-01-01 15:00:00 +0300 -> 1970-01-01 15:00:00 +0300
- t = rs.getTime(1, cGMT05);
- assertEquals(43200000L, t.getTime()); // 2005-01-01 07:00:00 -0500 -> 1970-01-01 07:00:00 -0500
- t = rs.getTime(1, cGMT13);
- assertEquals(-43200000L, t.getTime()); // 2005-01-02 01:00:00 +1300 -> 1970-01-01 01:00:00 +1300
-
- // timestamp: 2005-01-01 15:00:00
- t = rs.getTime(2);
- assertEquals(50400000L, t.getTime()); // 1970-01-01 15:00:00 +0100
- t = rs.getTime(2, cUTC);
- assertEquals(54000000L, t.getTime()); // 1970-01-01 15:00:00 +0000
- t = rs.getTime(2, cGMT03);
- assertEquals(43200000L, t.getTime()); // 1970-01-01 15:00:00 +0300
- t = rs.getTime(2, cGMT05);
- assertEquals(72000000L, t.getTime()); // 1970-01-01 15:00:00 -0500
- t = rs.getTime(2, cGMT13);
- assertEquals(7200000L, t.getTime()); // 1970-01-01 15:00:00 +1300
-
- // time: 15:00:00
- t = rs.getTime(3);
- assertEquals(50400000L, t.getTime()); // 1970-01-01 15:00:00 +0100
- t = rs.getTime(3, cUTC);
- assertEquals(54000000L, t.getTime()); // 1970-01-01 15:00:00 +0000
- t = rs.getTime(3, cGMT03);
- assertEquals(43200000L, t.getTime()); // 1970-01-01 15:00:00 +0300
- t = rs.getTime(3, cGMT05);
- assertEquals(72000000L, t.getTime()); // 1970-01-01 15:00:00 -0500
- t = rs.getTime(3, cGMT13);
- assertEquals(7200000L, t.getTime()); // 1970-01-01 15:00:00 +1300
-
- // timetz: 15:00:00+03
- t = rs.getTime(4);
- assertEquals(43200000L, t.getTime()); // 1970-01-01 13:00:00 +0100
- t = rs.getTime(4, cUTC);
- assertEquals(43200000L, t.getTime()); // 1970-01-01 12:00:00 +0000
- t = rs.getTime(4, cGMT03);
- assertEquals(43200000L, t.getTime()); // 1970-01-01 15:00:00 +0300
- t = rs.getTime(4, cGMT05);
- assertEquals(43200000L, t.getTime()); // 1970-01-01 07:00:00 -0500
- t = rs.getTime(4, cGMT13);
- assertEquals(43200000L, t.getTime()); // 1970-01-01 01:00:00 +1300
- }
-
- /**
- * This test is broken off from testSetTimestamp because it does not work
- * for pre-7.4 servers and putting tons of conditionals in that test makes
- * it largely unreadable. The time data type does not accept timestamp
- * with time zone style input on these servers.
- */
- public void testSetTimestampOnTime() throws Exception
- {
- // Pre-7.4 servers cannot convert timestamps with timezones to times.
- if (!min74)
- return;
-
- PreparedStatement insertTimestamp = con.prepareStatement("INSERT INTO testtimezone(seq,t) VALUES (?,?)");
- int seq = 1;
-
- Timestamp instant = new Timestamp(1104580800000L); // 2005-01-01 12:00:00 UTC
- Timestamp instantTime = new Timestamp(instant.getTime() % DAY);
-
- // +0100 (JVM default)
- insertTimestamp.setInt(1, seq++);
- insertTimestamp.setTimestamp(2,instant); // 13:00:00
- insertTimestamp.executeUpdate();
-
- // UTC
- insertTimestamp.setInt(1, seq++);
- insertTimestamp.setTimestamp(2,instant,cUTC); // 12:00:00
- insertTimestamp.executeUpdate();
-
- // +0300
- insertTimestamp.setInt(1, seq++);
- insertTimestamp.setTimestamp(2,instant,cGMT03); // 15:00:00
- insertTimestamp.executeUpdate();
-
- // -0500
- insertTimestamp.setInt(1, seq++);
- insertTimestamp.setTimestamp(2,instant,cGMT05); // 07:00:00
- insertTimestamp.executeUpdate();
-
- if (min73) {
- // +1300
- insertTimestamp.setInt(1, seq++);
- insertTimestamp.setTimestamp(2,instant,cGMT13); // 01:00:00
- insertTimestamp.executeUpdate();
- }
-
- checkDatabaseContents("SELECT seq::text,t::text from testtimezone ORDER BY seq",
- new String[][]{new String[]{"1", "13:00:00"},
- new String[]{"2", "12:00:00"},
- new String[]{"3", "15:00:00"},
- new String[]{"4", "07:00:00"},
- new String[]{"5", "01:00:00"}});
-
- seq = 1;
- ResultSet rs = con.createStatement().executeQuery("SELECT seq,t FROM testtimezone ORDER BY seq");
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(instantTime, rs.getTimestamp(2));
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(instantTime, rs.getTimestamp(2, cUTC));
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(instantTime, rs.getTimestamp(2, cGMT03));
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(instantTime, rs.getTimestamp(2, cGMT05));
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(normalizeTimeOfDayPart(instantTime, cGMT13), rs.getTimestamp(2, cGMT13));
-
- assertTrue(!rs.next());
- }
-
-
- public void testSetTimestamp() throws Exception
- {
- PreparedStatement insertTimestamp = con.prepareStatement("INSERT INTO testtimezone(seq,tstz,ts,tz,d) VALUES (?,?,?,?,?)");
- int seq = 1;
-
- Timestamp instant = new Timestamp(1104580800000L); // 2005-01-01 12:00:00 UTC
- Timestamp instantTime = new Timestamp(instant.getTime() % DAY);
- Timestamp instantDateJVM = new Timestamp(instant.getTime() - (instant.getTime() % DAY) - TimeZone.getDefault().getRawOffset());
- Timestamp instantDateUTC = new Timestamp(instant.getTime() - (instant.getTime() % DAY) - cUTC.getTimeZone().getRawOffset());
- Timestamp instantDateGMT03 = new Timestamp(instant.getTime() - (instant.getTime() % DAY) - cGMT03.getTimeZone().getRawOffset());
- Timestamp instantDateGMT05 = new Timestamp(instant.getTime() - (instant.getTime() % DAY) - cGMT05.getTimeZone().getRawOffset());
- Timestamp instantDateGMT13 = new Timestamp(instant.getTime() - (instant.getTime() % DAY) - cGMT13.getTimeZone().getRawOffset() + DAY);
-
- // +0100 (JVM default)
- insertTimestamp.setInt(1,seq++);
- insertTimestamp.setTimestamp(2,instant); // 2005-01-01 13:00:00 +0100
- insertTimestamp.setTimestamp(3,instant); // 2005-01-01 13:00:00
- insertTimestamp.setTimestamp(4,instant); // 13:00:00 +0100
- insertTimestamp.setTimestamp(5,instant); // 2005-01-01
- insertTimestamp.executeUpdate();
-
- // UTC
- insertTimestamp.setInt(1,seq++);
- insertTimestamp.setTimestamp(2,instant,cUTC); // 2005-01-01 12:00:00 +0000
- insertTimestamp.setTimestamp(3,instant,cUTC); // 2005-01-01 12:00:00
- insertTimestamp.setTimestamp(4,instant,cUTC); // 12:00:00 +0000
- insertTimestamp.setTimestamp(5,instant,cUTC); // 2005-01-01
- insertTimestamp.executeUpdate();
-
- // +0300
- insertTimestamp.setInt(1,seq++);
- insertTimestamp.setTimestamp(2,instant,cGMT03); // 2005-01-01 15:00:00 +0300
- insertTimestamp.setTimestamp(3,instant,cGMT03); // 2005-01-01 15:00:00
- insertTimestamp.setTimestamp(4,instant,cGMT03); // 15:00:00 +0300
- insertTimestamp.setTimestamp(5,instant,cGMT03); // 2005-01-01
- insertTimestamp.executeUpdate();
-
- // -0500
- insertTimestamp.setInt(1,seq++);
- insertTimestamp.setTimestamp(2,instant,cGMT05); // 2005-01-01 07:00:00 -0500
- insertTimestamp.setTimestamp(3,instant,cGMT05); // 2005-01-01 07:00:00
- insertTimestamp.setTimestamp(4,instant,cGMT05); // 07:00:00 -0500
- insertTimestamp.setTimestamp(5,instant,cGMT05); // 2005-01-01
- insertTimestamp.executeUpdate();
-
- if (min73) {
- // +1300
- insertTimestamp.setInt(1,seq++);
- insertTimestamp.setTimestamp(2,instant,cGMT13); // 2005-01-02 01:00:00 +1300
- insertTimestamp.setTimestamp(3,instant,cGMT13); // 2005-01-02 01:00:00
- insertTimestamp.setTimestamp(4,instant,cGMT13); // 01:00:00 +1300
- insertTimestamp.setTimestamp(5,instant,cGMT13); // 2005-01-02
- insertTimestamp.executeUpdate();
- }
-
- insertTimestamp.close();
-
- // check that insert went correctly by parsing the raw contents in UTC
- checkDatabaseContents("SELECT seq::text,tstz::text,ts::text,tz::text,d::text from testtimezone ORDER BY seq",
- new String[][]{new String[]{"1", "2005-01-01 12:00:00+00", "2005-01-01 13:00:00", "13:00:00+01", "2005-01-01"},
- new String[]{"2", "2005-01-01 12:00:00+00", "2005-01-01 12:00:00", "12:00:00+00", "2005-01-01"},
- new String[]{"3", "2005-01-01 12:00:00+00", "2005-01-01 15:00:00", "15:00:00+03", "2005-01-01"},
- new String[]{"4", "2005-01-01 12:00:00+00", "2005-01-01 07:00:00", "07:00:00-05", "2005-01-01"},
- new String[]{"5", "2005-01-01 12:00:00+00", "2005-01-02 01:00:00", "01:00:00+13", "2005-01-02"}});
-
- //
- // check results
- //
-
- seq = 1;
- ResultSet rs = con.createStatement().executeQuery("SELECT seq,tstz,ts,tz,d FROM testtimezone ORDER BY seq");
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(instant, rs.getTimestamp(2));
- assertEquals(instant, rs.getTimestamp(3));
- assertEquals(instantTime, rs.getTimestamp(4));
- assertEquals(instantDateJVM, rs.getTimestamp(5));
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(instant, rs.getTimestamp(2, cUTC));
- assertEquals(instant, rs.getTimestamp(3, cUTC));
- assertEquals(instantTime, rs.getTimestamp(4, cUTC));
- assertEquals(instantDateUTC, rs.getTimestamp(5, cUTC));
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(instant, rs.getTimestamp(2, cGMT03));
- assertEquals(instant, rs.getTimestamp(3, cGMT03));
- assertEquals(instantTime, rs.getTimestamp(4, cGMT03));
- assertEquals(instantDateGMT03, rs.getTimestamp(5, cGMT03));
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(instant, rs.getTimestamp(2, cGMT05));
- assertEquals(instant, rs.getTimestamp(3, cGMT05));
- assertEquals(instantTime, rs.getTimestamp(4, cGMT05));
- assertEquals(instantDateGMT05, rs.getTimestamp(5, cGMT05));
-
- if (min73) {
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(instant, rs.getTimestamp(2, cGMT13));
- assertEquals(instant, rs.getTimestamp(3, cGMT13));
- assertEquals(normalizeTimeOfDayPart(instantTime, cGMT13), rs.getTimestamp(4, cGMT13));
- assertEquals(instantDateGMT13, rs.getTimestamp(5, cGMT13));
- }
-
- assertTrue(!rs.next());
- }
-
- public void testSetDate() throws Exception
- {
- PreparedStatement insertTimestamp = con.prepareStatement("INSERT INTO testtimezone(seq,tstz,ts,d) VALUES (?,?,?,?)");
-
- int seq = 1;
-
- Date dJVM, dUTC, dGMT03, dGMT05, dGMT13 = null;
-
- // +0100 (JVM default)
- dJVM = new Date(1104534000000L); // 2005-01-01 00:00:00 +0100
- insertTimestamp.setInt(1,seq++);
- insertTimestamp.setDate(2,dJVM); // 2005-01-01 00:00:00 +0100
- insertTimestamp.setDate(3,dJVM); // 2005-01-01 00:00:00
- insertTimestamp.setDate(4,dJVM); // 2005-01-01
- insertTimestamp.executeUpdate();
-
- // UTC
- dUTC = new Date(1104537600000L); // 2005-01-01 00:00:00 +0000
- insertTimestamp.setInt(1,seq++);
- insertTimestamp.setDate(2,dUTC,cUTC); // 2005-01-01 00:00:00 +0000
- insertTimestamp.setDate(3,dUTC,cUTC); // 2005-01-01 00:00:00
- insertTimestamp.setDate(4,dUTC,cUTC); // 2005-01-01
- insertTimestamp.executeUpdate();
-
- // +0300
- dGMT03 = new Date(1104526800000L); // 2005-01-01 00:00:00 +0300
- insertTimestamp.setInt(1,seq++);
- insertTimestamp.setDate(2,dGMT03,cGMT03); // 2005-01-01 00:00:00 +0300
- insertTimestamp.setDate(3,dGMT03,cGMT03); // 2005-01-01 00:00:00
- insertTimestamp.setDate(4,dGMT03,cGMT03); // 2005-01-01
- insertTimestamp.executeUpdate();
-
- // -0500
- dGMT05 = new Date(1104555600000L); // 2005-01-01 00:00:00 -0500
- insertTimestamp.setInt(1,seq++);
- insertTimestamp.setDate(2,dGMT05,cGMT05); // 2005-01-01 00:00:00 -0500
- insertTimestamp.setDate(3,dGMT05,cGMT05); // 2005-01-01 00:00:00
- insertTimestamp.setDate(4,dGMT05,cGMT05); // 2005-01-01
- insertTimestamp.executeUpdate();
-
- if (min73) {
- // +1300
- dGMT13 = new Date(1104490800000L); // 2005-01-01 00:00:00 +1300
- insertTimestamp.setInt(1,seq++);
- insertTimestamp.setDate(2,dGMT13,cGMT13); // 2005-01-01 00:00:00 +1300
- insertTimestamp.setDate(3,dGMT13,cGMT13); // 2005-01-01 00:00:00
- insertTimestamp.setDate(4,dGMT13,cGMT13); // 2005-01-01
- insertTimestamp.executeUpdate();
- }
-
- insertTimestamp.close();
-
- // check that insert went correctly by parsing the raw contents in UTC
- checkDatabaseContents("SELECT seq::text,tstz::text,ts::text,d::text from testtimezone ORDER BY seq",
- new String[][]{new String[]{"1", "2004-12-31 23:00:00+00", "2005-01-01 00:00:00", "2005-01-01"},
- new String[]{"2", "2005-01-01 00:00:00+00", "2005-01-01 00:00:00", "2005-01-01"},
- new String[]{"3", "2004-12-31 21:00:00+00", "2005-01-01 00:00:00", "2005-01-01"},
- new String[]{"4", "2005-01-01 05:00:00+00", "2005-01-01 00:00:00", "2005-01-01"},
- new String[]{"5", "2004-12-31 11:00:00+00", "2005-01-01 00:00:00", "2005-01-01"}});
- //
- // check results
- //
-
- seq = 1;
- ResultSet rs = con.createStatement().executeQuery("SELECT seq,tstz,ts,d FROM testtimezone ORDER BY seq");
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(dJVM, rs.getDate(2));
- assertEquals(dJVM, rs.getDate(3));
- assertEquals(dJVM, rs.getDate(4));
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(dUTC, rs.getDate(2, cUTC));
- assertEquals(dUTC, rs.getDate(3, cUTC));
- assertEquals(dUTC, rs.getDate(4, cUTC));
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(dGMT03, rs.getDate(2, cGMT03));
- assertEquals(dGMT03, rs.getDate(3, cGMT03));
- assertEquals(dGMT03, rs.getDate(4, cGMT03));
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(dGMT05, rs.getDate(2, cGMT05));
- assertEquals(dGMT05, rs.getDate(3, cGMT05));
- assertEquals(dGMT05, rs.getDate(4, cGMT05));
-
- if (min73) {
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(dGMT13, rs.getDate(2, cGMT13));
- assertEquals(dGMT13, rs.getDate(3, cGMT13));
- assertEquals(dGMT13, rs.getDate(4, cGMT13));
- }
-
- assertTrue(!rs.next());
- }
-
- public void testSetTime() throws Exception
- {
- if (!min74) {
- // We can't do timezones properly for time/timetz values before 7.4
- System.err.println("Skipping TimezoneTest.testSetTime on a pre-7.4 server");
- return;
- }
-
- PreparedStatement insertTimestamp = con.prepareStatement("INSERT INTO testtimezone(seq,t,tz) VALUES (?,?,?)");
-
- int seq = 1;
-
- Time tJVM, tUTC, tGMT03, tGMT05, tGMT13;
-
- // +0100 (JVM default)
- tJVM = new Time(50400000L); // 1970-01-01 15:00:00 +0100
- insertTimestamp.setInt(1,seq++);
- insertTimestamp.setTime(2,tJVM); // 15:00:00
- insertTimestamp.setTime(3,tJVM); // 15:00:00+03
- insertTimestamp.executeUpdate();
-
- // UTC
- tUTC = new Time(54000000L); // 1970-01-01 15:00:00 +0000
- insertTimestamp.setInt(1,seq++);
- insertTimestamp.setTime(2,tUTC,cUTC); // 15:00:00
- insertTimestamp.setTime(3,tUTC,cUTC); // 15:00:00+00
- insertTimestamp.executeUpdate();
-
- // +0300
- tGMT03 = new Time(43200000L); // 1970-01-01 15:00:00 +0300
- insertTimestamp.setInt(1,seq++);
- insertTimestamp.setTime(2,tGMT03,cGMT03); // 15:00:00
- insertTimestamp.setTime(3,tGMT03,cGMT03); // 15:00:00+03
- insertTimestamp.executeUpdate();
-
- // -0500
- tGMT05 = new Time(72000000L); // 1970-01-01 15:00:00 -0500
- insertTimestamp.setInt(1,seq++);
- insertTimestamp.setTime(2,tGMT05,cGMT05); // 15:00:00
- insertTimestamp.setTime(3,tGMT05,cGMT05); // 15:00:00-05
- insertTimestamp.executeUpdate();
-
- // +1300
- tGMT13 = new Time(7200000L); // 1970-01-01 15:00:00 +1300
- insertTimestamp.setInt(1,seq++);
- insertTimestamp.setTime(2,tGMT13,cGMT13); // 15:00:00
- insertTimestamp.setTime(3,tGMT13,cGMT13); // 15:00:00+13
- insertTimestamp.executeUpdate();
-
- insertTimestamp.close();
-
- // check that insert went correctly by parsing the raw contents in UTC
- checkDatabaseContents("SELECT seq::text,t::text,tz::text from testtimezone ORDER BY seq",
- new String[][]{new String[]{"1", "15:00:00", "15:00:00+01",},
- new String[]{"2", "15:00:00", "15:00:00+00",},
- new String[]{"3", "15:00:00", "15:00:00+03",},
- new String[]{"4", "15:00:00", "15:00:00-05",},
- new String[]{"5", "15:00:00", "15:00:00+13",}});
-
- //
- // check results
- //
-
- seq = 1;
- ResultSet rs = con.createStatement().executeQuery("SELECT seq,t,tz FROM testtimezone ORDER BY seq");
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(tJVM, rs.getTime(2));
- assertEquals(tJVM, rs.getTime(3));
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(tUTC, rs.getTime(2, cUTC));
- assertEquals(tUTC, rs.getTime(2, cUTC));
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(tGMT03, rs.getTime(2, cGMT03));
- assertEquals(tGMT03, rs.getTime(2, cGMT03));
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(tGMT05, rs.getTime(2, cGMT05));
- assertEquals(tGMT05, rs.getTime(2, cGMT05));
-
- assertTrue(rs.next());
- assertEquals(seq++, rs.getInt(1));
- assertEquals(tGMT13, rs.getTime(2, cGMT13));
- assertEquals(tGMT13, rs.getTime(2, cGMT13));
-
- assertTrue(!rs.next());
- }
-
- public void testHalfHourTimezone() throws Exception
- {
- Statement stmt = con.createStatement();
- stmt.execute("SET TimeZone = 'GMT+3:30'");
- ResultSet rs = stmt.executeQuery("SELECT '1969-12-31 20:30:00'::timestamptz");
- assertTrue(rs.next());
- assertEquals(0L, rs.getTimestamp(1).getTime());
- }
-
- public void testTimezoneWithSeconds() throws SQLException
- {
- if (!TestUtil.haveMinimumServerVersion(con, "8.2"))
- return;
-
- Statement stmt = con.createStatement();
- stmt.execute("SET TimeZone = 'Europe/Helsinki'");
- ResultSet rs = stmt.executeQuery("SELECT '1920-01-01'::timestamptz");
- rs.next();
- // select extract(epoch from '1920-01-01'::timestamptz - 'epoch'::timestamptz) * 1000;
-
- assertEquals(-1577929192000L, rs.getTimestamp(1).getTime());
- }
-
- /**
- * Does a query in UTC time zone to database to check that the
- * inserted values are correct.
- *
- * @param query The query to run.
- * @param correct The correct answers in UTC time zone as formatted by backend.
- */
- private void checkDatabaseContents(String query, String[] correct) throws Exception {
- checkDatabaseContents(query, new String[][]{correct});
- }
-
- private void checkDatabaseContents(String query, String[][] correct) throws Exception {
- Connection con2 = TestUtil.openDB();
- Statement s = con2.createStatement();
- assertFalse(s.execute("set time zone 'UTC'"));
- assertTrue(s.execute(query));
- ResultSet rs = s.getResultSet();
- for (int j = 0; j < correct.length; ++j) {
- assertTrue(rs.next());
- for (int i = 0; i < correct[j].length; ++i) {
- assertEquals("On row " + (j+1), correct[j][i], rs.getString(i+1));
- }
- }
- assertFalse(rs.next());
- rs.close();
- s.close();
- con2.close();
- }
-
- /**
- * Converts the given time
- *
- * @param t The time of day. Must be within -24 and + 24 hours of epoc.
- * @param tz The timezone to normalize to.
- * @return the Time nomralized to 0 to 24 hours of epoc adjusted with given timezone.
- */
- private Timestamp normalizeTimeOfDayPart(Timestamp t, Calendar tz) {
- return new Timestamp(normalizeTimeOfDayPart(t.getTime(), tz.getTimeZone()));
- }
-
- private long normalizeTimeOfDayPart(long t, TimeZone tz) {
- long millis = t;
- long low = - tz.getOffset(millis);
- long high = low + DAY;
- if (millis < low) {
- do { millis += DAY; } while (millis < low);
- } else if (millis >= high) {
- do { millis -= DAY; } while (millis > high);
- }
- return millis;
- }
-}
diff --git a/org/postgresql/test/jdbc2/UpdateableResultTest.java b/org/postgresql/test/jdbc2/UpdateableResultTest.java
deleted file mode 100644
index fd98531..0000000
--- a/org/postgresql/test/jdbc2/UpdateableResultTest.java
+++ /dev/null
@@ -1,503 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2001-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2;
-
-import java.sql.*;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-import java.io.InputStream;
-import java.io.ByteArrayInputStream;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-import java.util.TimeZone;
-
-import org.postgresql.test.TestUtil;
-
-public class UpdateableResultTest extends TestCase
-{
- private Connection con;
-
- public UpdateableResultTest( String name )
- {
- super( name );
- try
- {
- Class.forName("org.postgresql.Driver");
- }
- catch( Exception ex ){}
-
- }
-
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
- TestUtil.createTable(con, "updateable", "id int primary key, name text, notselected text, ts timestamp with time zone, intarr int[]", true);
- TestUtil.createTable(con, "second", "id1 int primary key, name1 text");
- TestUtil.createTable(con, "stream", "id int primary key, asi text, chr text, bin bytea");
-
- // put some dummy data into second
- Statement st2 = con.createStatement();
- st2.execute( "insert into second values (1,'anyvalue' )");
- st2.close();
-
- }
-
- protected void tearDown() throws Exception
- {
- TestUtil.dropTable(con, "updateable");
- TestUtil.dropTable(con, "second");
- TestUtil.dropTable(con, "stream");
- TestUtil.closeDB(con);
- }
-
- public void testDeleteRows() throws SQLException
- {
- Statement st = con.createStatement();
- st.executeUpdate("INSERT INTO second values (2,'two')");
- st.executeUpdate("INSERT INTO second values (3,'three')");
- st.executeUpdate("INSERT INTO second values (4,'four')");
- st.close();
-
- st = con.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE );
- ResultSet rs = st.executeQuery( "select id1,name1 from second order by id1");
-
- assertTrue(rs.next());
- assertEquals(1, rs.getInt("id1"));
- rs.deleteRow();
- assertTrue(rs.isBeforeFirst());
-
- assertTrue(rs.next());
- assertTrue(rs.next());
- assertEquals(3, rs.getInt("id1"));
- rs.deleteRow();
- assertEquals(2, rs.getInt("id1"));
-
- rs.close();
- st.close();
- }
-
-
-
- public void testCancelRowUpdates() throws Exception
- {
- Statement st = con.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE );
- ResultSet rs = st.executeQuery( "select * from second");
-
- // make sure we're dealing with the correct row.
- rs.first();
- assertEquals(1, rs.getInt(1));
- assertEquals("anyvalue", rs.getString(2));
-
- // update, cancel and make sure nothings changed.
- rs.updateInt(1, 99);
- rs.cancelRowUpdates();
- assertEquals(1, rs.getInt(1));
- assertEquals("anyvalue", rs.getString(2));
-
- // real update
- rs.updateInt(1, 999);
- rs.updateRow();
- assertEquals(999, rs.getInt(1));
- assertEquals("anyvalue", rs.getString(2));
-
- // scroll some and make sure the update is still there
- rs.beforeFirst();
- rs.next();
- assertEquals(999, rs.getInt(1));
- assertEquals("anyvalue", rs.getString(2));
-
-
- // make sure the update got to the db and the driver isn't lying to us.
- rs.close();
- rs = st.executeQuery( "select * from second");
- rs.first();
- assertEquals(999, rs.getInt(1));
- assertEquals("anyvalue", rs.getString(2));
-
- rs.close();
- st.close();
- }
-
- private void checkPositioning(ResultSet rs) throws SQLException
- {
- try
- {
- rs.getInt(1);
- fail("Can't use an incorrectly positioned result set.");
- }
- catch (SQLException sqle)
- {
- }
-
- try
- {
- rs.updateInt(1, 2);
- fail("Can't use an incorrectly positioned result set.");
- }
- catch (SQLException sqle)
- {
- }
-
- try
- {
- rs.updateRow();
- fail("Can't use an incorrectly positioned result set.");
- }
- catch (SQLException sqle)
- {
- }
-
- try
- {
- rs.deleteRow();
- fail("Can't use an incorrectly positioned result set.");
- }
- catch (SQLException sqle)
- {
- }
- }
-
- public void testPositioning() throws SQLException
- {
- Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
- ResultSet rs = stmt.executeQuery("SELECT id1,name1 FROM second");
-
- checkPositioning(rs);
-
- assertTrue(rs.next());
- rs.beforeFirst();
- checkPositioning(rs);
-
- rs.afterLast();
- checkPositioning(rs);
-
- rs.beforeFirst();
- assertTrue(rs.next());
- assertTrue(!rs.next());
- checkPositioning(rs);
-
- rs.afterLast();
- assertTrue(rs.previous());
- assertTrue(!rs.previous());
- checkPositioning(rs);
-
- rs.close();
- stmt.close();
- }
-
- public void testUpdateTimestamp() throws SQLException
- {
- TimeZone origTZ = TimeZone.getDefault();
- try {
- // We choose a timezone which has a partial hour portion
- // Asia/Tehran is +3:30
- TimeZone.setDefault(TimeZone.getTimeZone("Asia/Tehran"));
- Timestamp ts = Timestamp.valueOf("2006-11-20 16:17:18");
-
- Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
- ResultSet rs = stmt.executeQuery("SELECT id, ts FROM updateable");
- rs.moveToInsertRow();
- rs.updateInt(1,1);
- rs.updateTimestamp(2,ts);
- rs.insertRow();
- rs.first();
- assertEquals(ts, rs.getTimestamp(2));
- } finally {
- TimeZone.setDefault(origTZ);
- }
- }
-
- public void testUpdateStreams() throws SQLException, UnsupportedEncodingException
- {
- String string = "Hello";
- byte[] bytes = new byte[]{0,'\\',(byte) 128,(byte) 255};
-
- Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
- ResultSet rs = stmt.executeQuery("SELECT id, asi, chr, bin FROM stream");
-
- rs.moveToInsertRow();
- rs.updateInt(1, 1);
- rs.updateAsciiStream("asi", null, 17);
- rs.updateCharacterStream("chr", null, 81);
- rs.updateBinaryStream("bin", null, 0);
- rs.insertRow();
-
- rs.moveToInsertRow();
- rs.updateInt(1, 3);
- rs.updateAsciiStream("asi", new ByteArrayInputStream(string.getBytes("US-ASCII")), 5);
- rs.updateCharacterStream("chr", new StringReader(string), 5);
- rs.updateBinaryStream("bin", new ByteArrayInputStream(bytes), bytes.length);
- rs.insertRow();
-
- rs.beforeFirst();
- rs.next();
-
- assertEquals(1, rs.getInt(1));
- assertNull(rs.getString(2));
- assertNull(rs.getString(3));
- assertNull(rs.getBytes(4));
-
- rs.updateInt("id", 2);
- rs.updateAsciiStream("asi", new ByteArrayInputStream(string.getBytes("US-ASCII")), 5);
- rs.updateCharacterStream("chr", new StringReader(string), 5);
- rs.updateBinaryStream("bin", new ByteArrayInputStream(bytes), bytes.length);
- rs.updateRow();
-
- assertEquals(2, rs.getInt(1));
- assertEquals(string, rs.getString(2));
- assertEquals(string, rs.getString(3));
- assertTrue(Arrays.equals(bytes, rs.getBytes(4)));
-
- rs.refreshRow();
-
- assertEquals(2, rs.getInt(1));
- assertEquals(string, rs.getString(2));
- assertEquals(string, rs.getString(3));
- assertTrue(Arrays.equals(bytes, rs.getBytes(4)));
-
- rs.next();
-
- assertEquals(3, rs.getInt(1));
- assertEquals(string, rs.getString(2));
- assertEquals(string, rs.getString(3));
- assertTrue(Arrays.equals(bytes, rs.getBytes(4)));
-
- rs.close();
- stmt.close();
- }
-
- public void testZeroRowResult() throws SQLException
- {
- Statement st = con.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE );
- ResultSet rs = st.executeQuery( "select * from updateable WHERE 0 > 1");
- assertTrue(!rs.next());
- rs.moveToInsertRow();
- rs.moveToCurrentRow();
- }
-
- public void testUpdateable() throws SQLException
- {
- Statement st = con.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE );
- ResultSet rs = st.executeQuery( "select * from updateable");
- assertNotNull( rs );
- rs.moveToInsertRow();
- rs.updateInt( 1, 1 );
- rs.updateString( 2, "jake" );
- rs.updateString( 3, "avalue" );
- rs.insertRow();
- rs.first();
-
- rs.updateInt( "id", 2 );
- rs.updateString( "name", "dave" );
- rs.updateRow();
-
- assertEquals(2, rs.getInt("id"));
- assertEquals("dave", rs.getString("name"));
- assertEquals("avalue", rs.getString("notselected"));
-
- rs.deleteRow();
- rs.moveToInsertRow();
- rs.updateInt("id", 3);
- rs.updateString("name", "paul");
-
- rs.insertRow();
-
- try
- {
- rs.refreshRow();
- fail("Can't refresh when on the insert row.");
- }
- catch (SQLException sqle)
- {
- }
-
- assertEquals(3, rs.getInt("id"));
- assertEquals("paul", rs.getString("name"));
- assertNull(rs.getString("notselected"));
-
- rs.close();
-
- rs = st.executeQuery("select id1, id, name, name1 from updateable, second" );
- try
- {
- while ( rs.next() )
- {
- rs.updateInt( "id", 2 );
- rs.updateString( "name", "dave" );
- rs.updateRow();
- }
-
-
- fail("should not get here, update should fail");
- }
- catch (SQLException ex)
- {
- }
-
- rs = st.executeQuery("select oid,* from updateable");
- assertTrue(rs.first());
- rs.updateInt( "id", 3 );
- rs.updateString( "name", "dave3");
- rs.updateRow();
- assertEquals(3, rs.getInt("id"));
- assertEquals("dave3", rs.getString("name"));
-
- rs.moveToInsertRow();
- rs.updateInt( "id", 4 );
- rs.updateString( "name", "dave4" );
-
- rs.insertRow();
- rs.updateInt("id", 5 );
- rs.updateString( "name", "dave5" );
- rs.insertRow();
-
- rs.moveToCurrentRow();
- assertEquals(3, rs.getInt("id"));
- assertEquals("dave3", rs.getString("name"));
-
- assertTrue( rs.next() );
- assertEquals(4, rs.getInt("id"));
- assertEquals("dave4", rs.getString("name"));
-
- assertTrue( rs.next() );
- assertEquals(5, rs.getInt("id"));
- assertEquals("dave5", rs.getString("name"));
-
- rs.close();
- st.close();
- }
-
- public void testInsertRowIllegalMethods() throws Exception
- {
- Statement st = con.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE );
- ResultSet rs = st.executeQuery( "select * from updateable");
- assertNotNull(rs);
- rs.moveToInsertRow();
-
- try {
- rs.cancelRowUpdates();
- fail("expected an exception when calling cancelRowUpdates() on the insert row");
- } catch (SQLException e) {}
-
- try {
- rs.updateRow();
- fail("expected an exception when calling updateRow() on the insert row");
- } catch (SQLException e) {}
-
- try {
- rs.deleteRow();
- fail("expected an exception when calling deleteRow() on the insert row");
- } catch (SQLException e) {}
-
- try {
- rs.refreshRow();
- fail("expected an exception when calling refreshRow() on the insert row");
- } catch (SQLException e) {}
-
- rs.close();
- st.close();
- }
-
- public void testUpdateablePreparedStatement() throws Exception
- {
- // No args.
- PreparedStatement st = con.prepareStatement("select * from updateable",
- ResultSet.TYPE_SCROLL_INSENSITIVE,
- ResultSet.CONCUR_UPDATABLE);
- ResultSet rs = st.executeQuery();
- rs.moveToInsertRow();
- rs.close();
- st.close();
-
- // With args.
- st = con.prepareStatement("select * from updateable where id = ?",
- ResultSet.TYPE_SCROLL_INSENSITIVE,
- ResultSet.CONCUR_UPDATABLE);
- st.setInt(1, 1);
- rs = st.executeQuery();
- rs.moveToInsertRow();
- rs.close();
- st.close();
- }
-
- public void testUpdateSelectOnly() throws Exception
- {
- Statement st = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
- ResultSet.CONCUR_UPDATABLE);
-
- ResultSet rs = st.executeQuery( "select * from only second");
- assertTrue(rs.next());
- rs.updateInt(1, 2);
- rs.updateRow();
- }
-
- public void testUpdateReadOnlyResultSet() throws Exception
- {
- Statement st = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
- ResultSet.CONCUR_READ_ONLY);
- ResultSet rs = st.executeQuery( "select * from updateable");
- try {
- rs.moveToInsertRow();
- fail("expected an exception when calling moveToInsertRow() on a read-only resultset");
- } catch (SQLException e) {}
- }
-
- public void testBadColumnIndexes() throws Exception
- {
- Statement st = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
- ResultSet.CONCUR_UPDATABLE);
- ResultSet rs = st.executeQuery( "select * from updateable");
- rs.moveToInsertRow();
- try {
- rs.updateInt(0,1);
- fail("Should have thrown an exception on bad column index.");
- } catch (SQLException sqle) { }
- try {
- rs.updateString(1000,"hi");
- fail("Should have thrown an exception on bad column index.");
- } catch (SQLException sqle) { }
- try {
- rs.updateNull(1000);
- fail("Should have thrown an exception on bad column index.");
- } catch (SQLException sqle) { }
- }
-
- public void testArray() throws SQLException {
- Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
- stmt.executeUpdate("INSERT INTO updateable (id, intarr) VALUES (1, '{1,2,3}'::int4[])");
- ResultSet rs = stmt.executeQuery("SELECT id, intarr FROM updateable");
- assertTrue(rs.next());
- rs.updateObject(2, rs.getArray(2));
- rs.updateRow();
-
- Array arr = rs.getArray(2);
- assertEquals(Types.INTEGER, arr.getBaseType());
- Integer intarr[] = (Integer[])arr.getArray();
- assertEquals(3, intarr.length);
- assertEquals(1, intarr[0].intValue());
- assertEquals(2, intarr[1].intValue());
- assertEquals(3, intarr[2].intValue());
- rs.close();
-
- rs = stmt.executeQuery("SELECT id,intarr FROM updateable");
- assertTrue(rs.next());
- arr = rs.getArray(2);
- assertEquals(Types.INTEGER, arr.getBaseType());
- intarr = (Integer[])arr.getArray();
- assertEquals(3, intarr.length);
- assertEquals(1, intarr[0].intValue());
- assertEquals(2, intarr[1].intValue());
- assertEquals(3, intarr[2].intValue());
-
- rs.close();
- stmt.close();
- }
-}
diff --git a/org/postgresql/test/jdbc2/optional/BaseDataSourceTest.java b/org/postgresql/test/jdbc2/optional/BaseDataSourceTest.java
deleted file mode 100644
index 8871d4a..0000000
--- a/org/postgresql/test/jdbc2/optional/BaseDataSourceTest.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2.optional;
-
-import junit.framework.TestCase;
-import org.postgresql.test.TestUtil;
-import org.postgresql.test.util.MiniJndiContextFactory;
-import org.postgresql.ds.common.BaseDataSource;
-import org.postgresql.PGConnection;
-
-import java.sql.*;
-import java.util.*;
-import javax.naming.*;
-
-/**
- * Common tests for all the BaseDataSource implementations. This is
- * a small variety to make sure that a connection can be opened and
- * some basic queries run. The different BaseDataSource subclasses
- * have different subclasses of this which add additional custom
- * tests.
- *
- * @author Aaron Mulder (ammulder at chariotsolutions.com)
- */
-public abstract class BaseDataSourceTest extends TestCase
-{
- public static String DATA_SOURCE_JNDI = "BaseDataSource";
- protected Connection con;
- protected BaseDataSource bds;
-
- /**
- * Constructor required by JUnit
- */
- public BaseDataSourceTest(String name)
- {
- super(name);
- }
-
- /**
- * Creates a test table using a standard connection (not from a
- * DataSource).
- */
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
- TestUtil.createTable(con, "poolingtest", "id int4 not null primary key, name varchar(50)");
- Statement stmt = con.createStatement();
- stmt.executeUpdate("INSERT INTO poolingtest VALUES (1, 'Test Row 1')");
- stmt.executeUpdate("INSERT INTO poolingtest VALUES (2, 'Test Row 2')");
- TestUtil.closeDB(con);
- }
-
- /**
- * Removes the test table using a standard connection (not from
- * a DataSource)
- */
- protected void tearDown() throws Exception
- {
- TestUtil.closeDB(con);
- con = TestUtil.openDB();
- TestUtil.dropTable(con, "poolingtest");
- TestUtil.closeDB(con);
- }
-
- /**
- * Gets a connection from the current BaseDataSource
- */
- protected Connection getDataSourceConnection() throws SQLException
- {
- if (bds == null)
- {
- initializeDataSource();
- }
- return bds.getConnection();
- }
-
- /**
- * Creates an instance of the current BaseDataSource for
- * testing. Must be customized by each subclass.
- */
- protected abstract void initializeDataSource();
-
- public static void setupDataSource(BaseDataSource bds)
- {
- bds.setServerName(TestUtil.getServer());
- bds.setPortNumber(TestUtil.getPort());
- bds.setDatabaseName(TestUtil.getDatabase());
- bds.setUser(TestUtil.getUser());
- bds.setPassword(TestUtil.getPassword());
- bds.setPrepareThreshold(TestUtil.getPrepareThreshold());
- bds.setLogLevel(TestUtil.getLogLevel());
- bds.setProtocolVersion(TestUtil.getProtocolVersion());
- }
-
- /**
- * Test to make sure you can instantiate and configure the
- * appropriate DataSource
- */
- public void testCreateDataSource()
- {
- initializeDataSource();
- }
-
- /**
- * Test to make sure you can get a connection from the DataSource,
- * which in turn means the DataSource was able to open it.
- */
- public void testGetConnection()
- {
- try
- {
- con = getDataSourceConnection();
- con.close();
- }
- catch (SQLException e)
- {
- fail(e.getMessage());
- }
- }
-
- /**
- * A simple test to make sure you can execute SQL using the
- * Connection from the DataSource
- */
- public void testUseConnection()
- {
- try
- {
- con = getDataSourceConnection();
- Statement st = con.createStatement();
- ResultSet rs = st.executeQuery("SELECT COUNT(*) FROM poolingtest");
- if (rs.next())
- {
- int count = rs.getInt(1);
- if (rs.next())
- {
- fail("Should only have one row in SELECT COUNT result set");
- }
- if (count != 2)
- {
- fail("Count returned " + count + " expecting 2");
- }
- }
- else
- {
- fail("Should have one row in SELECT COUNT result set");
- }
- rs.close();
- st.close();
- con.close();
- }
- catch (SQLException e)
- {
- fail(e.getMessage());
- }
- }
-
- /**
- * A test to make sure you can execute DDL SQL using the
- * Connection from the DataSource.
- */
- public void testDdlOverConnection()
- {
- try
- {
- con = getDataSourceConnection();
- TestUtil.createTable(con, "poolingtest", "id int4 not null primary key, name varchar(50)");
- con.close();
- }
- catch (SQLException e)
- {
- fail(e.getMessage());
- }
- }
-
- /**
- * A test to make sure the connections are not being pooled by the
- * current DataSource. Obviously need to be overridden in the case
- * of a pooling Datasource.
- */
- public void testNotPooledConnection() throws SQLException
- {
- con = getDataSourceConnection();
- String name = con.toString();
- con.close();
- con = getDataSourceConnection();
- String name2 = con.toString();
- con.close();
- assertTrue(!name.equals(name2));
- }
-
- /**
- * Test to make sure that PGConnection methods can be called on the
- * pooled Connection.
- */
- public void testPGConnection()
- {
- try
- {
- con = getDataSourceConnection();
- ((PGConnection)con).getNotifications();
- con.close();
- }
- catch (Exception e)
- {
- fail("Unable to call PGConnection method on pooled connection due to " + e.getClass().getName() + " (" + e.getMessage() + ")");
- }
- }
-
- /**
- * Uses the mini-JNDI implementation for testing purposes
- */
- protected InitialContext getInitialContext()
- {
- Hashtable env = new Hashtable();
- env.put(Context.INITIAL_CONTEXT_FACTORY, MiniJndiContextFactory.class.getName());
- try
- {
- return new InitialContext(env);
- }
- catch (NamingException e)
- {
- fail("Unable to create InitialContext: " + e.getMessage());
- return null;
- }
- }
-
- /**
- * Eventually, we must test stuffing the DataSource in JNDI and
- * then getting it back out and make sure it's still usable. This
- * should ideally test both Serializable and Referenceable
- * mechanisms. Will probably be multiple tests when implemented.
- */
- public void testJndi()
- {
- initializeDataSource();
- BaseDataSource oldbds = bds;
- InitialContext ic = getInitialContext();
- try
- {
- ic.rebind(DATA_SOURCE_JNDI, bds);
- bds = (BaseDataSource)ic.lookup(DATA_SOURCE_JNDI);
- assertTrue("Got null looking up DataSource from JNDI!", bds != null);
- compareJndiDataSource(oldbds, bds);
- }
- catch (NamingException e)
- {
- fail(e.getMessage());
- }
- oldbds = bds;
- testUseConnection();
- assertTrue("Test should not have changed DataSource (" + bds + " != " + oldbds + ")!", bds == oldbds);
- }
-
- /**
- * Check whether a DS was dereferenced from JNDI or recreated.
- */
- protected void compareJndiDataSource(BaseDataSource oldbds, BaseDataSource bds) {
- assertTrue("DataSource was dereferenced, should have been serialized or recreated", bds != oldbds);
- }
-}
diff --git a/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java b/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java
deleted file mode 100644
index d9d28cd..0000000
--- a/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java
+++ /dev/null
@@ -1,551 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2.optional;
-
-import org.postgresql.jdbc2.optional.ConnectionPool;
-import org.postgresql.ds.PGConnectionPoolDataSource;
-import org.postgresql.test.TestUtil;
-import javax.sql.*;
-import java.sql.*;
-import java.util.*;
-import java.io.*;
-
-/**
- * Tests for the ConnectionPoolDataSource and PooledConnection
- * implementations. They are tested together because the only client
- * interface to the PooledConnection is through the CPDS.
- *
- * @author Aaron Mulder (ammulder at chariotsolutions.com)
- */
-public class ConnectionPoolTest extends BaseDataSourceTest
-{
- private ArrayList connections = new ArrayList();
-
- /**
- * Constructor required by JUnit
- */
- public ConnectionPoolTest(String name)
- {
- super(name);
- }
-
- /**
- * Creates and configures a ConnectionPool
- */
- protected void initializeDataSource()
- {
- if (bds == null)
- {
- bds = new ConnectionPool();
- setupDataSource(bds);
- }
- }
-
- protected void tearDown() throws Exception
- {
- for (Iterator i = connections.iterator(); i.hasNext(); ) {
- PooledConnection c = (PooledConnection) i.next();
- try {
- c.close();
- } catch (Exception ex) {
- // close throws nullptr or other evil things if the connection
- // is already closed
- }
- }
- }
-
- /**
- * Though the normal client interface is to grab a Connection, in
- * order to test the middleware/server interface, we need to deal
- * with PooledConnections. Some tests use each.
- */
- protected PooledConnection getPooledConnection() throws SQLException
- {
- initializeDataSource();
- // we need to recast to PGConnectionPool rather than
- // jdbc.optional.ConnectionPool because our ObjectFactory
- // returns only the top level class, not the specific
- // jdbc2/jdbc3 implementations.
- PooledConnection c = ((PGConnectionPoolDataSource)bds).getPooledConnection();
- connections.add(c);
- return c;
- }
-
- /**
- * Instead of just fetching a Connection from the ConnectionPool,
- * get a PooledConnection, add a listener to close it when the
- * Connection is closed, and then get the Connection. Without
- * the listener the PooledConnection (and thus the physical connection)
- * would never by closed. Probably not a disaster during testing, but
- * you never know.
- */
- protected Connection getDataSourceConnection() throws SQLException
- {
- initializeDataSource();
- final PooledConnection pc = getPooledConnection();
- // Since the pooled connection won't be reused in these basic tests, close it when the connection is closed
- pc.addConnectionEventListener(new ConnectionEventListener()
- {
- public void connectionClosed(ConnectionEvent event)
- {
- try
- {
- pc.close();
- }
- catch (SQLException e)
- {
- fail("Unable to close PooledConnection: " + e);
- }
- }
-
- public void connectionErrorOccurred(ConnectionEvent event)
- {
- }
- }
- );
- return pc.getConnection();
- }
-
- /**
- * Makes sure that if you get a connection from a PooledConnection,
- * close it, and then get another one, you're really using the same
- * physical connection. Depends on the implementation of toString
- * for the connection handle.
- */
- public void testPoolReuse()
- {
- try
- {
- PooledConnection pc = getPooledConnection();
- con = pc.getConnection();
- String name = con.toString();
- con.close();
- con = pc.getConnection();
- String name2 = con.toString();
- con.close();
- pc.close();
- assertTrue("Physical connection doesn't appear to be reused across PooledConnection wrappers", name.equals(name2));
- }
- catch (SQLException e)
- {
- fail(e.getMessage());
- }
- }
-
- /**
- * Makes sure that when you request a connection from the
- * PooledConnection, and previous connection it might have given
- * out is closed. See JDBC 2.0 Optional Package spec section
- * 6.2.3
- */
- public void testPoolCloseOldWrapper()
- {
- try
- {
- PooledConnection pc = getPooledConnection();
- con = pc.getConnection();
- Connection con2 = pc.getConnection();
- try
- {
- con.createStatement();
- fail("Original connection wrapper should be closed when new connection wrapper is generated");
- }
- catch (SQLException e)
- {
- }
- con2.close();
- pc.close();
- }
- catch (SQLException e)
- {
- fail(e.getMessage());
- }
- }
-
- /**
- * Makes sure that if you get two connection wrappers from the same
- * PooledConnection, they are different, even though the represent
- * the same physical connection. See JDBC 2.0 Optional Pacakge spec
- * section 6.2.2
- */
- public void testPoolNewWrapper()
- {
- try
- {
- PooledConnection pc = getPooledConnection();
- con = pc.getConnection();
- Connection con2 = pc.getConnection();
- con2.close();
- pc.close();
- assertTrue("Two calls to PooledConnection.getConnection should not return the same connection wrapper", con != con2);
- }
- catch (SQLException e)
- {
- fail(e.getMessage());
- }
- }
-
- /**
- * Makes sure that exactly one close event is fired for each time a
- * connection handle is closed. Also checks that events are not
- * fired after a given handle has been closed once.
- */
- public void testCloseEvent()
- {
- try
- {
- PooledConnection pc = getPooledConnection();
- CountClose cc = new CountClose();
- pc.addConnectionEventListener(cc);
- con = pc.getConnection();
- assertTrue(cc.getCount() == 0);
- assertTrue(cc.getErrorCount() == 0);
- con.close();
- assertTrue(cc.getCount() == 1);
- assertTrue(cc.getErrorCount() == 0);
- con = pc.getConnection();
- assertTrue(cc.getCount() == 1);
- assertTrue(cc.getErrorCount() == 0);
- con.close();
- assertTrue(cc.getCount() == 2);
- assertTrue(cc.getErrorCount() == 0);
- // a double close shouldn't fire additional events
- con.close();
- assertTrue(cc.getCount() == 2);
- assertTrue(cc.getErrorCount() == 0);
- pc.close();
- }
- catch (SQLException e)
- {
- fail(e.getMessage());
- }
- }
-
- /**
- * Makes sure that close events are not fired after a listener has
- * been removed.
- */
- public void testNoCloseEvent()
- {
- try
- {
- PooledConnection pc = getPooledConnection();
- CountClose cc = new CountClose();
- pc.addConnectionEventListener(cc);
- con = pc.getConnection();
- assertTrue(cc.getCount() == 0);
- assertTrue(cc.getErrorCount() == 0);
- con.close();
- assertTrue(cc.getCount() == 1);
- assertTrue(cc.getErrorCount() == 0);
- pc.removeConnectionEventListener(cc);
- con = pc.getConnection();
- assertTrue(cc.getCount() == 1);
- assertTrue(cc.getErrorCount() == 0);
- con.close();
- assertTrue(cc.getCount() == 1);
- assertTrue(cc.getErrorCount() == 0);
- }
- catch (SQLException e)
- {
- fail(e.getMessage());
- }
- }
-
- /**
- * Makes sure that a listener can be removed while dispatching
- * events. Sometimes this causes a ConcurrentModificationException
- * or something.
- */
- public void testInlineCloseEvent()
- {
- try
- {
- PooledConnection pc = getPooledConnection();
- RemoveClose rc1 = new RemoveClose();
- RemoveClose rc2 = new RemoveClose();
- RemoveClose rc3 = new RemoveClose();
- pc.addConnectionEventListener(rc1);
- pc.addConnectionEventListener(rc2);
- pc.addConnectionEventListener(rc3);
- con = pc.getConnection();
- con.close();
- con = pc.getConnection();
- con.close();
- }
- catch (Exception e)
- {
- fail(e.getMessage());
- }
- }
-
- /**
- * Tests that a close event is not generated when a connection
- * handle is closed automatically due to a new connection handle
- * being opened for the same PooledConnection. See JDBC 2.0
- * Optional Package spec section 6.3
- */
- public void testAutomaticCloseEvent()
- {
- try
- {
- PooledConnection pc = getPooledConnection();
- CountClose cc = new CountClose();
- pc.addConnectionEventListener(cc);
- con = pc.getConnection();
- assertTrue(cc.getCount() == 0);
- assertTrue(cc.getErrorCount() == 0);
- con.close();
- assertTrue(cc.getCount() == 1);
- assertTrue(cc.getErrorCount() == 0);
- con = pc.getConnection();
- assertTrue(cc.getCount() == 1);
- assertTrue(cc.getErrorCount() == 0);
- // Open a 2nd connection, causing the first to be closed. No even should be generated.
- Connection con2 = pc.getConnection();
- assertTrue("Connection handle was not closed when new handle was opened", con.isClosed());
- assertTrue(cc.getCount() == 1);
- assertTrue(cc.getErrorCount() == 0);
- con2.close();
- assertTrue(cc.getCount() == 2);
- assertTrue(cc.getErrorCount() == 0);
- pc.close();
- }
- catch (SQLException e)
- {
- fail(e.getMessage());
- }
- }
-
- /**
- * Makes sure the isClosed method on a connection wrapper does what
- * you'd expect. Checks the usual case, as well as automatic
- * closure when a new handle is opened on the same physical connection.
- */
- public void testIsClosed()
- {
- try
- {
- PooledConnection pc = getPooledConnection();
- con = pc.getConnection();
- assertTrue(!con.isClosed());
- con.close();
- assertTrue(con.isClosed());
- con = pc.getConnection();
- Connection con2 = pc.getConnection();
- assertTrue(con.isClosed());
- assertTrue(!con2.isClosed());
- con2.close();
- assertTrue(con.isClosed());
- pc.close();
- }
- catch (SQLException e)
- {
- fail(e.getMessage());
- }
- }
-
- /**
- * Ensures that a statement generated by a proxied connection returns the
- * proxied connection from getConnection() [not the physical connection].
- */
- public void testStatementConnection() {
- try
- {
- PooledConnection pc = getPooledConnection();
- con = pc.getConnection();
- Statement s = con.createStatement();
- Connection conRetrieved = s.getConnection();
-
- assertTrue(con.getClass().equals(conRetrieved.getClass()));
- assertTrue(con.equals(conRetrieved));
- }
- catch (SQLException e)
- {
- fail(e.getMessage());
- }
- }
-
- /**
- * Ensures that the Statement proxy generated by the Connection handle
- * throws the correct kind of exception.
- */
- public void testStatementProxy() {
- Statement s = null;
- try
- {
- PooledConnection pc = getPooledConnection();
- con = pc.getConnection();
- s = con.createStatement();
- }
- catch (SQLException e)
- {
- fail(e.getMessage());
- }
- try
- {
- s.executeQuery("SELECT * FROM THIS_TABLE_SHOULD_NOT_EXIST");
- fail("An SQL exception was not thrown that should have been");
- }
- catch (SQLException e)
- {
- ; // This is the expected and correct path
- }
- catch (Exception e)
- {
- fail("bad exception; was expecting SQLException, not" +
- e.getClass().getName());
- }
- }
-
- /**
- * Ensures that a prepared statement generated by a proxied connection
- * returns the proxied connection from getConnection() [not the physical
- * connection].
- */
- public void testPreparedStatementConnection() {
- try
- {
- PooledConnection pc = getPooledConnection();
- con = pc.getConnection();
- PreparedStatement s = con.prepareStatement("select 'x'");
- Connection conRetrieved = s.getConnection();
-
- assertTrue(con.getClass().equals(conRetrieved.getClass()));
- assertTrue(con.equals(conRetrieved));
- }
- catch (SQLException e)
- {
- fail(e.getMessage());
- }
- }
-
- /**
- * Ensures that a callable statement generated by a proxied connection
- * returns the proxied connection from getConnection() [not the physical
- * connection].
- */
- public void testCallableStatementConnection() {
- try
- {
- PooledConnection pc = getPooledConnection();
- con = pc.getConnection();
- CallableStatement s = con.prepareCall("select 'x'");
- Connection conRetrieved = s.getConnection();
-
- assertTrue(con.getClass().equals(conRetrieved.getClass()));
- assertTrue(con.equals(conRetrieved));
- }
- catch (SQLException e)
- {
- fail(e.getMessage());
- }
- }
-
- /**
- * Ensure that a statement created from a pool can be used
- * like any other statement in regard to pg extensions.
- */
- public void testStatementsProxyPGStatement() {
- try
- {
- PooledConnection pc = getPooledConnection();
- con = pc.getConnection();
-
- Statement s = con.createStatement();
- boolean b = ((org.postgresql.PGStatement)s).isUseServerPrepare();
-
- PreparedStatement ps = con.prepareStatement("select 'x'");
- b = ((org.postgresql.PGStatement)ps).isUseServerPrepare();
-
- CallableStatement cs = con.prepareCall("select 'x'");
- b = ((org.postgresql.PGStatement)cs).isUseServerPrepare();
-
- }
- catch (SQLException e)
- {
- fail(e.getMessage());
- }
- }
-
- /**
- * Helper class to remove a listener during event dispatching.
- */
- private class RemoveClose implements ConnectionEventListener
- {
- public void connectionClosed(ConnectionEvent event)
- {
- ((PooledConnection)event.getSource()).removeConnectionEventListener(this);
- }
-
- public void connectionErrorOccurred(ConnectionEvent event)
- {
- ((PooledConnection)event.getSource()).removeConnectionEventListener(this);
- }
- }
-
- /**
- * Helper class that implements the event listener interface, and
- * counts the number of events it sees.
- */
- private class CountClose implements ConnectionEventListener
- {
- private int count = 0, errorCount = 0;
- public void connectionClosed(ConnectionEvent event)
- {
- count++;
- }
-
- public void connectionErrorOccurred(ConnectionEvent event)
- {
- errorCount++;
- }
-
- public int getCount()
- {
- return count;
- }
-
- public int getErrorCount()
- {
- return errorCount;
- }
-
- public void clear()
- {
- count = errorCount = 0;
- }
- }
-
- public void testSerializable() throws IOException, ClassNotFoundException
- {
- ConnectionPool pool = new ConnectionPool();
- pool.setDefaultAutoCommit(false);
- pool.setServerName("db.myhost.com");
- pool.setDatabaseName("mydb");
- pool.setUser("user");
- pool.setPassword("pass");
- pool.setPortNumber(1111);
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(pool);
-
- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- ObjectInputStream ois = new ObjectInputStream(bais);
- ConnectionPool pool2 = (ConnectionPool)ois.readObject();
-
- assertEquals(pool.isDefaultAutoCommit(), pool2.isDefaultAutoCommit());
- assertEquals(pool.getServerName(), pool2.getServerName());
- assertEquals(pool.getDatabaseName(), pool2.getDatabaseName());
- assertEquals(pool.getUser(), pool2.getUser());
- assertEquals(pool.getPassword(), pool2.getPassword());
- assertEquals(pool.getPortNumber(), pool2.getPortNumber());
- }
-
-}
diff --git a/org/postgresql/test/jdbc2/optional/OptionalTestSuite.java b/org/postgresql/test/jdbc2/optional/OptionalTestSuite.java
deleted file mode 100644
index f4a7cc3..0000000
--- a/org/postgresql/test/jdbc2/optional/OptionalTestSuite.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2.optional;
-
-import junit.framework.TestSuite;
-
-/**
- * Test suite for the JDBC 2.0 Optional Package implementation. This
- * includes the DataSource, ConnectionPoolDataSource, and
- * PooledConnection implementations.
- *
- * @author Aaron Mulder (ammulder at chariotsolutions.com)
- */
-public class OptionalTestSuite extends TestSuite
-{
- /**
- * Gets the test suite for the entire JDBC 2.0 Optional Package
- * implementation.
- */
- public static TestSuite suite() throws Exception
- {
- Class.forName("org.postgresql.Driver");
- TestSuite suite = new TestSuite();
- suite.addTestSuite(SimpleDataSourceTest.class);
- suite.addTestSuite(ConnectionPoolTest.class);
- suite.addTestSuite(PoolingDataSourceTest.class);
- return suite;
- }
-}
diff --git a/org/postgresql/test/jdbc2/optional/PoolingDataSourceTest.java b/org/postgresql/test/jdbc2/optional/PoolingDataSourceTest.java
deleted file mode 100644
index 0b0a8fa..0000000
--- a/org/postgresql/test/jdbc2/optional/PoolingDataSourceTest.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2.optional;
-
-import java.sql.*;
-import org.postgresql.test.TestUtil;
-import org.postgresql.jdbc2.optional.PoolingDataSource;
-import org.postgresql.ds.common.BaseDataSource;
-
-/**
- * Minimal tests for pooling DataSource. Needs many more.
- *
- * @author Aaron Mulder (ammulder at chariotsolutions.com)
- */
-public class PoolingDataSourceTest extends BaseDataSourceTest
-{
- private final static String DS_NAME = "JDBC 2 SE Test DataSource";
-
- /**
- * Constructor required by JUnit
- */
- public PoolingDataSourceTest(String name)
- {
- super(name);
- }
-
- protected void tearDown() throws Exception
- {
- if (bds instanceof PoolingDataSource)
- {
- ((PoolingDataSource) bds).close();
- }
- super.tearDown();
- }
-
- /**
- * Creates and configures a new SimpleDataSource.
- */
- protected void initializeDataSource()
- {
- if (bds == null)
- {
- bds = new PoolingDataSource();
- setupDataSource(bds);
- ((PoolingDataSource) bds).setDataSourceName(DS_NAME);
- ((PoolingDataSource) bds).setInitialConnections(2);
- ((PoolingDataSource) bds).setMaxConnections(10);
- }
- }
-
- /**
- * In this case, we *do* want it to be pooled.
- */
- public void testNotPooledConnection() throws SQLException
- {
- con = getDataSourceConnection();
- String name = con.toString();
- con.close();
- con = getDataSourceConnection();
- String name2 = con.toString();
- con.close();
- assertTrue("Pooled DS doesn't appear to be pooling connections!", name.equals(name2));
- }
-
- /**
- * In this case, the desired behavior is dereferencing.
- */
- protected void compareJndiDataSource(BaseDataSource oldbds, BaseDataSource bds)
- {
- assertTrue("DataSource was serialized or recreated, should have been dereferenced", bds == oldbds);
- }
-
- /**
- * Check that 2 DS instances can't use the same name.
- */
- public void testCantReuseName()
- {
- initializeDataSource();
- PoolingDataSource pds = new PoolingDataSource();
- try
- {
- pds.setDataSourceName(DS_NAME);
- fail("Should have denied 2nd DataSource with same name");
- }
- catch (IllegalArgumentException e)
- {
- }
- }
-
- /**
- * Closing a Connection twice is not an error.
- */
- public void testDoubleConnectionClose() throws SQLException
- {
- con = getDataSourceConnection();
- con.close();
- con.close();
- }
-
- /**
- * Closing a Statement twice is not an error.
- */
- public void testDoubleStatementClose() throws SQLException
- {
- con = getDataSourceConnection();
- Statement stmt = con.createStatement();
- stmt.close();
- stmt.close();
- con.close();
- }
-
- public void testConnectionObjectMethods() throws SQLException
- {
- con = getDataSourceConnection();
-
- Connection conRef = con;
- assertEquals(con, conRef);
-
- int hc1 = con.hashCode();
- con.close();
- int hc2 = con.hashCode();
-
- assertEquals(con, conRef);
- assertEquals(hc1, hc2);
- }
-
- public void testStatementObjectMethods() throws SQLException
- {
- con = getDataSourceConnection();
-
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT 1");
- Statement stmtRef = stmt;
-
- assertEquals(stmt, stmtRef);
- // Currently we aren't proxying ResultSet, so this doesn't
- // work, see Bug #1010542.
- // assertEquals(stmt, rs.getStatement());
-
- int hc1 = stmt.hashCode();
- stmt.close();
- int hc2 = stmt.hashCode();
-
- assertEquals(stmt, stmtRef);
- assertEquals(hc1, hc2);
- }
-
-}
diff --git a/org/postgresql/test/jdbc2/optional/SimpleDataSourceTest.java b/org/postgresql/test/jdbc2/optional/SimpleDataSourceTest.java
deleted file mode 100644
index e9d77a7..0000000
--- a/org/postgresql/test/jdbc2/optional/SimpleDataSourceTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc2.optional;
-
-import org.postgresql.test.TestUtil;
-import org.postgresql.jdbc2.optional.SimpleDataSource;
-
-/**
- * Performs the basic tests defined in the superclass. Just adds the
- * configuration logic.
- *
- * @author Aaron Mulder (ammulder at chariotsolutions.com)
- */
-public class SimpleDataSourceTest extends BaseDataSourceTest
-{
- /**
- * Constructor required by JUnit
- */
- public SimpleDataSourceTest(String name)
- {
- super(name);
- }
-
- /**
- * Creates and configures a new SimpleDataSource.
- */
- protected void initializeDataSource()
- {
- if (bds == null)
- {
- bds = new SimpleDataSource();
- setupDataSource(bds);
- }
- }
-}
diff --git a/org/postgresql/test/jdbc3/DatabaseMetaDataTest.java b/org/postgresql/test/jdbc3/DatabaseMetaDataTest.java
deleted file mode 100644
index 7bb201c..0000000
--- a/org/postgresql/test/jdbc3/DatabaseMetaDataTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2008-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc3;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-import java.sql.*;
-
-public class DatabaseMetaDataTest extends TestCase
-{
-
- private Connection _conn;
-
- public DatabaseMetaDataTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- _conn = TestUtil.openDB();
- if (TestUtil.haveMinimumServerVersion(_conn, "7.3")) {
- Statement stmt = _conn.createStatement();
- stmt.execute("CREATE DOMAIN mydom AS int");
- stmt.execute("CREATE TABLE domtab (a mydom)");
- }
- }
-
- protected void tearDown() throws Exception
- {
- if (TestUtil.haveMinimumServerVersion(_conn, "7.3")) {
- Statement stmt = _conn.createStatement();
- stmt.execute("DROP TABLE domtab");
- stmt.execute("DROP DOMAIN mydom");
- }
- TestUtil.closeDB(_conn);
- }
-
- public void testGetColumnsForDomain() throws Exception
- {
- if (!TestUtil.haveMinimumServerVersion(_conn, "7.3"))
- return;
-
- DatabaseMetaData dbmd = _conn.getMetaData();
-
- ResultSet rs = dbmd.getColumns("%","%","domtab", "%");
- assertTrue( rs.next() );
- assertEquals("a", rs.getString("COLUMN_NAME"));
- assertEquals(Types.DISTINCT, rs.getInt("DATA_TYPE"));
- assertEquals("mydom", rs.getString("TYPE_NAME"));
- assertEquals(Types.INTEGER, rs.getInt("SOURCE_DATA_TYPE"));
- assertTrue( !rs.next() );
- }
-
-}
diff --git a/org/postgresql/test/jdbc3/GeneratedKeysTest.java b/org/postgresql/test/jdbc3/GeneratedKeysTest.java
deleted file mode 100644
index c0eb094..0000000
--- a/org/postgresql/test/jdbc3/GeneratedKeysTest.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2008-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc3;
-
-import java.sql.*;
-
-import junit.framework.TestCase;
-
-import org.postgresql.test.TestUtil;
-
-public class GeneratedKeysTest extends TestCase {
-
- private Connection _conn;
-
- public GeneratedKeysTest(String name) throws Exception {
- super(name);
- }
-
- protected void setUp() throws Exception {
- _conn = TestUtil.openDB();
- Statement stmt = _conn.createStatement();
- stmt.execute("CREATE TEMP TABLE genkeys(a serial, b text, c int)");
- stmt.close();
- }
-
- protected void tearDown() throws SQLException {
- Statement stmt = _conn.createStatement();
- stmt.execute("DROP TABLE genkeys");
- stmt.close();
- TestUtil.closeDB(_conn);
- }
-
- public void testExecuteUpdateAllColumns() throws SQLException
- {
- Statement stmt = _conn.createStatement();
- int count = stmt.executeUpdate("INSERT INTO genkeys VALUES (1, 'a', 2)", Statement.RETURN_GENERATED_KEYS);
- assertEquals(1, count);
- ResultSet rs = stmt.getGeneratedKeys();
- assertTrue(rs.next());
- assertEquals(1, rs.getInt(1));
- assertEquals("a", rs.getString(2));
- assertEquals(2, rs.getInt(3));
- assertEquals(1, rs.getInt("a"));
- assertEquals("a", rs.getString("b"));
- assertEquals(2, rs.getInt("c"));
- assertTrue(!rs.next());
- }
-
- public void testStatementUpdateCount() throws SQLException
- {
- Statement stmt = _conn.createStatement();
- stmt.executeUpdate("INSERT INTO genkeys VALUES (1, 'a', 2)", Statement.RETURN_GENERATED_KEYS);
- assertEquals(1, stmt.getUpdateCount());
- assertNull(stmt.getResultSet());
- assertTrue(!stmt.getMoreResults());
- }
-
- public void testCloseStatementClosesRS() throws SQLException
- {
- Statement stmt = _conn.createStatement();
- stmt.executeUpdate("INSERT INTO genkeys VALUES (1, 'a', 2)", Statement.RETURN_GENERATED_KEYS);
- ResultSet rs = stmt.getGeneratedKeys();
- stmt.close();
- try {
- rs.next();
- fail("Can't operate on a closed result set.");
- } catch (SQLException sqle) {}
- }
-
- public void testReturningWithTrailingSemicolon() throws SQLException
- {
- Statement stmt = _conn.createStatement();
- stmt.executeUpdate("INSERT INTO genkeys VALUES (1, 'a', 2); ", Statement.RETURN_GENERATED_KEYS);
- ResultSet rs = stmt.getGeneratedKeys();
- assertTrue(rs.next());
- assertEquals("a", rs.getString(2));
- assertTrue(!rs.next());
- }
-
- public void testEmptyRSWithoutReturning() throws SQLException
- {
- Statement stmt = _conn.createStatement();
- int count = stmt.executeUpdate("INSERT INTO genkeys VALUES (1, 'a', 2); ", Statement.NO_GENERATED_KEYS);
- assertEquals(1, count);
- ResultSet rs = stmt.getGeneratedKeys();
- assertTrue(!rs.next());
- }
-
- public void testColumnsByName() throws SQLException
- {
- Statement stmt = _conn.createStatement();
- int count = stmt.executeUpdate("INSERT INTO genkeys VALUES (1, 'a', 2); ", new String[]{"c","a"});
- assertEquals(1, count);
- ResultSet rs = stmt.getGeneratedKeys();
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- assertEquals(1, rs.getInt(2));
- assertEquals(1, rs.getInt("a"));
- assertEquals(2, rs.getInt("c"));
- assertTrue(!rs.next());
- }
-
- public void testMultipleRows() throws SQLException
- {
- Statement stmt = _conn.createStatement();
- int count = stmt.executeUpdate("INSERT INTO genkeys VALUES (1, 'a', 2), (3, 'b', 4); ", new String[]{"c"});
- assertEquals(2, count);
- ResultSet rs = stmt.getGeneratedKeys();
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- assertTrue(rs.next());
- assertEquals(4, rs.getInt(1));
- assertTrue(!rs.next());
- }
-
- public void testSerialWorks() throws SQLException
- {
- Statement stmt = _conn.createStatement();
- int count = stmt.executeUpdate("INSERT INTO genkeys (b,c) VALUES ('a', 2), ('b', 4); ", new String[]{"a"});
- assertEquals(2, count);
- ResultSet rs = stmt.getGeneratedKeys();
- assertTrue(rs.next());
- assertEquals(1, rs.getInt(1));
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- assertTrue(!rs.next());
- }
-
- public void testUpdate() throws SQLException
- {
- Statement stmt = _conn.createStatement();
- stmt.executeUpdate("INSERT INTO genkeys VALUES (1, 'a', 2)");
- stmt.executeUpdate("INSERT INTO genkeys VALUES (2, 'b', 4)");
- stmt.executeUpdate("UPDATE genkeys SET c=3 WHERE a = 1", new String[]{"c", "b"});
- ResultSet rs = stmt.getGeneratedKeys();
- assertTrue(rs.next());
- assertEquals(3, rs.getInt(1));
- assertEquals("a", rs.getString(2));
- assertTrue(!rs.next());
- }
-
- public void testDelete() throws SQLException
- {
- Statement stmt = _conn.createStatement();
- stmt.executeUpdate("INSERT INTO genkeys VALUES (1, 'a', 2)");
- stmt.executeUpdate("INSERT INTO genkeys VALUES (2, 'b', 4)");
- stmt.executeUpdate("DELETE FROM genkeys WHERE a = 1", new String[]{"c", "b"});
- ResultSet rs = stmt.getGeneratedKeys();
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- assertEquals("a", rs.getString(2));
- assertTrue(!rs.next());
- }
-
- public void testPSUpdate() throws SQLException
- {
- Statement stmt = _conn.createStatement();
- stmt.executeUpdate("INSERT INTO genkeys VALUES (1, 'a', 2)");
- stmt.executeUpdate("INSERT INTO genkeys VALUES (2, 'b', 4)");
- stmt.close();
-
- PreparedStatement ps = _conn.prepareStatement("UPDATE genkeys SET c=? WHERE a = ?", new String[]{"c", "b"});
- ps.setInt(1,3);
- ps.setInt(2,1);
- assertEquals(1, ps.executeUpdate());
- ResultSet rs = ps.getGeneratedKeys();
- assertTrue(rs.next());
- assertEquals(3, rs.getInt(1));
- assertEquals("a", rs.getString(2));
- assertTrue(!rs.next());
- }
-
- public void testPSDelete() throws SQLException
- {
- Statement stmt = _conn.createStatement();
- stmt.executeUpdate("INSERT INTO genkeys VALUES (1, 'a', 2)");
- stmt.executeUpdate("INSERT INTO genkeys VALUES (2, 'b', 4)");
- stmt.close();
-
- PreparedStatement ps = _conn.prepareStatement("DELETE FROM genkeys WHERE a = ?", new String[]{"c", "b"});
-
- ps.setInt(1,1);
- assertEquals(1, ps.executeUpdate());
- ResultSet rs = ps.getGeneratedKeys();
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- assertEquals("a", rs.getString(2));
- assertTrue(!rs.next());
-
- ps.setInt(1,2);
- assertEquals(1, ps.executeUpdate());
- rs = ps.getGeneratedKeys();
- assertTrue(rs.next());
- assertEquals(4, rs.getInt(1));
- assertEquals("b", rs.getString(2));
- assertTrue(!rs.next());
- }
-
- public void testGeneratedKeysCleared() throws SQLException {
- Statement stmt = _conn.createStatement();
- stmt.executeUpdate("INSERT INTO genkeys VALUES (1, 'a', 2); ", Statement.RETURN_GENERATED_KEYS);
- ResultSet rs = stmt.getGeneratedKeys();
- assertTrue(rs.next());
- stmt.executeUpdate("INSERT INTO genkeys VALUES (2, 'b', 3)");
- rs = stmt.getGeneratedKeys();
- assertTrue(!rs.next());
- }
-
- public void testBatchGeneratedKeys() throws SQLException {
- PreparedStatement ps = _conn.prepareStatement("INSERT INTO genkeys(c) VALUES (?)", Statement.RETURN_GENERATED_KEYS);
- ps.setInt(1,4);
- ps.addBatch();
- ps.setInt(1,7);
- ps.addBatch();
- ps.executeBatch();
- ResultSet rs = ps.getGeneratedKeys();
- assertTrue(rs.next());
- assertEquals(1, rs.getInt("a"));
- assertTrue(rs.next());
- assertEquals(2, rs.getInt("a"));
- assertTrue(!rs.next());
- }
-
-}
-
diff --git a/org/postgresql/test/jdbc3/Jdbc3BlobTest.java b/org/postgresql/test/jdbc3/Jdbc3BlobTest.java
deleted file mode 100644
index 20a5850..0000000
--- a/org/postgresql/test/jdbc3/Jdbc3BlobTest.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2005-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc3;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.sql.Blob;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-import org.postgresql.test.TestUtil;
-
-/**
- * @author Michael Barker <mailto:mike at middlesoft.co.uk>
- *
- */
-public class Jdbc3BlobTest extends TestCase
-{
- Connection _conn;
- private final static String TABLE = "blobtest";
- private final static String INSERT = "INSERT INTO " + TABLE + " VALUES (1, lo_creat(-1))";
- private final static String SELECT = "SELECT ID, DATA FROM " + TABLE + " WHERE ID = 1";
-
- public Jdbc3BlobTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- _conn = TestUtil.openDB();
- TestUtil.createTable(_conn, TABLE, "ID INT PRIMARY KEY, DATA OID");
- _conn.setAutoCommit(false);
- }
-
- protected void tearDown() throws SQLException
- {
- _conn.setAutoCommit(true);
- TestUtil.dropTable(_conn, TABLE);
- TestUtil.closeDB(_conn);
- }
-
- /**
- * Test the writing and reading of a single byte.
- *
- * @throws SQLException
- */
- public void test1Byte() throws SQLException
- {
- byte[] data = { (byte) 'a' };
- readWrite(data);
- }
-
- /**
- * Test the writing and reading of a few bytes.
- * @throws SQLException
- */
- public void testManyBytes() throws SQLException
- {
- byte[] data = "aaaaaaaaaa".getBytes();
- readWrite(data);
- }
-
- /**
- * Test writing a single byte with an offset.
- *
- * @throws SQLException
- */
- public void test1ByteOffset() throws SQLException
- {
- byte[] data = { (byte) 'a' };
- readWrite(10, data);
- }
-
- /**
- * Test the writing and reading of a few bytes with an offset.
- *
- * @throws SQLException
- */
- public void testManyBytesOffset() throws SQLException
- {
- byte[] data = "aaaaaaaaaa".getBytes();
- readWrite(10, data);
- }
-
- /**
- * Tests all of the byte values from 0 - 255.
- *
- * @throws SQLException
- */
- public void testAllBytes() throws SQLException
- {
- byte[] data = new byte[256];
- for (int i = 0; i < data.length; i++)
- {
- data[i] = (byte) i;
- }
- readWrite(data);
- }
-
- public void testTruncate() throws SQLException
- {
- if (!TestUtil.haveMinimumServerVersion(_conn, "8.3"))
- return;
-
- byte data[] = new byte[100];
- for (byte i=0; i<data.length; i++) {
- data[i] = i;
- }
- readWrite(data);
-
- PreparedStatement ps = _conn.prepareStatement(SELECT);
- ResultSet rs = ps.executeQuery();
-
- assertTrue(rs.next());
- Blob blob = rs.getBlob("DATA");
-
- assertEquals(100, blob.length());
-
- blob.truncate(50);
- assertEquals(50, blob.length());
-
- blob.truncate(150);
- assertEquals(150, blob.length());
-
- data = blob.getBytes(1, 200);
- assertEquals(150, data.length);
- for (byte i=0; i<50; i++) {
- assertEquals(i, data[i]);
- }
-
- for (int i=50; i<150; i++) {
- assertEquals(0, data[i]);
- }
- }
-
- /**
- *
- * @param data
- * @throws SQLException
- */
- public void readWrite(byte[] data) throws SQLException
- {
- readWrite(1, data);
- }
-
- /**
- *
- * @param offset
- * @param data
- * @throws SQLException
- */
- public void readWrite(int offset, byte[] data) throws SQLException
- {
-
- PreparedStatement ps = _conn.prepareStatement(INSERT);
- ps.executeUpdate();
- ps.close();
-
- ps = _conn.prepareStatement(SELECT);
- ResultSet rs = ps.executeQuery();
-
- assertTrue(rs.next());
- Blob b = rs.getBlob("DATA");
- b.setBytes(offset, data);
-
- rs.close();
- ps.close();
-
- ps = _conn.prepareStatement(SELECT);
- rs = ps.executeQuery();
-
- assertTrue(rs.next());
- b = rs.getBlob("DATA");
- byte[] rspData = b.getBytes(offset, data.length);
- assertTrue("Request should be the same as the response", Arrays.equals(data, rspData));
-
- rs.close();
- ps.close();
- }
-
-
- /**
- * Test the writing and reading of a single byte.
- *
- * @throws SQLException
- * @throws IOException
- */
- public void test1ByteStream() throws SQLException, IOException
- {
- byte[] data = { (byte) 'a' };
- readWriteStream(data);
- }
-
- /**
- * Test the writing and reading of a few bytes.
- * @throws SQLException
- * @throws IOException
- */
- public void testManyBytesStream() throws SQLException, IOException
- {
- byte[] data = "aaaaaaaaaa".getBytes();
- readWriteStream(data);
- }
-
- /**
- * Test writing a single byte with an offset.
- *
- * @throws SQLException
- * @throws IOException
- */
- public void test1ByteOffsetStream() throws SQLException, IOException
- {
- byte[] data = { (byte) 'a' };
- readWriteStream(10, data);
- }
-
- /**
- * Test the writing and reading of a few bytes with an offset.
- *
- * @throws SQLException
- * @throws IOException
- */
- public void testManyBytesOffsetStream() throws SQLException, IOException
- {
- byte[] data = "aaaaaaaaaa".getBytes();
- readWriteStream(10, data);
- }
-
- /**
- * Tests all of the byte values from 0 - 255.
- *
- * @throws SQLException
- * @throws IOException
- */
- public void testAllBytesStream() throws SQLException, IOException
- {
- byte[] data = new byte[256];
- for (int i = 0; i < data.length; i++)
- {
- data[i] = (byte) i;
- }
- readWriteStream(data);
- }
-
- public void readWriteStream(byte[] data) throws SQLException, IOException
- {
- readWriteStream(1, data);
- }
-
-
- /**
- * Reads then writes data to the blob via a stream.
- *
- * @param offset
- * @param data
- * @throws SQLException
- * @throws IOException
- */
- public void readWriteStream(int offset, byte[] data) throws SQLException, IOException
- {
-
- PreparedStatement ps = _conn.prepareStatement(INSERT);
- ps.executeUpdate();
- ps.close();
-
- ps = _conn.prepareStatement(SELECT);
- ResultSet rs = ps.executeQuery();
-
- assertTrue(rs.next());
- Blob b = rs.getBlob("DATA");
- OutputStream out = b.setBinaryStream(offset);
- out.write(data);
- out.flush();
- out.close();
-
- rs.close();
- ps.close();
-
- ps = _conn.prepareStatement(SELECT);
- rs = ps.executeQuery();
-
- assertTrue(rs.next());
- b = rs.getBlob("DATA");
- InputStream in = b.getBinaryStream();
- byte[] rspData = new byte[data.length];
- in.skip(offset-1);
- in.read(rspData);
- in.close();
-
- assertTrue("Request should be the same as the response", Arrays.equals(data, rspData));
-
- rs.close();
- ps.close();
- }
-
- public void testPattern() throws SQLException
- {
- byte[] data = "abcdefghijklmnopqrstuvwxyx0123456789".getBytes();
- byte[] pattern = "def".getBytes();
-
- PreparedStatement ps = _conn.prepareStatement(INSERT);
- ps.executeUpdate();
- ps.close();
-
- ps = _conn.prepareStatement(SELECT);
- ResultSet rs = ps.executeQuery();
-
- assertTrue(rs.next());
- Blob b = rs.getBlob("DATA");
- b.setBytes(1, data);
-
- rs.close();
- ps.close();
-
- ps = _conn.prepareStatement(SELECT);
- rs = ps.executeQuery();
-
- assertTrue(rs.next());
- b = rs.getBlob("DATA");
- long position = b.position(pattern, 1);
- byte[] rspData = b.getBytes(position, pattern.length);
- assertTrue("Request should be the same as the response", Arrays.equals(pattern, rspData));
-
- rs.close();
- ps.close();
-
- }
-}
diff --git a/org/postgresql/test/jdbc3/Jdbc3CallableStatementTest.java b/org/postgresql/test/jdbc3/Jdbc3CallableStatementTest.java
deleted file mode 100644
index f34f956..0000000
--- a/org/postgresql/test/jdbc3/Jdbc3CallableStatementTest.java
+++ /dev/null
@@ -1,1116 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2005-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc3;
-
-import java.math.BigDecimal;
-import java.sql.CallableStatement;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.Types;
-
-import org.postgresql.test.TestUtil;
-import org.postgresql.util.PSQLState;
-
-import junit.framework.TestCase;
-
-/**
- * @author davec
- *
- */
-public class Jdbc3CallableStatementTest extends TestCase
-{
-
- Connection con;
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception
- {
- con = TestUtil.openDB();
- Statement stmt = con.createStatement ();
- stmt.execute("create temp table numeric_tab (MAX_VAL NUMERIC(30,15), MIN_VAL NUMERIC(30,15), NULL_VAL NUMERIC(30,15) NULL)");
- stmt.execute("insert into numeric_tab values ( 999999999999999,0.000000000000001, null)");
- stmt.execute("CREATE OR REPLACE FUNCTION myiofunc(a INOUT int, b OUT int) AS 'BEGIN b := a; a := 1; END;' LANGUAGE plpgsql");
- stmt.execute("CREATE OR REPLACE FUNCTION myif(a INOUT int, b IN int) AS 'BEGIN a := b; END;' LANGUAGE plpgsql");
-
- stmt.execute("create or replace function "
- + "Numeric_Proc( OUT IMAX NUMERIC(30,15), OUT IMIN NUMERIC(30,15), OUT INUL NUMERIC(30,15)) as "
- + "'begin "
- + "select max_val into imax from numeric_tab;"
- + "select min_val into imin from numeric_tab;"
- + "select null_val into inul from numeric_tab;"
-
- + " end;' "
- + "language plpgsql;");
-
- stmt.execute( "CREATE OR REPLACE FUNCTION test_somein_someout("
- + "pa IN int4,"
- + "pb OUT varchar,"
- + "pc OUT int8)"
- + " AS "
-
- + "'begin "
- + "pb := ''out'';"
- + "pc := pa + 1;"
- + "end;'"
-
- + "LANGUAGE plpgsql VOLATILE;"
-
- );
- stmt.execute("CREATE OR REPLACE FUNCTION test_allinout("
- + "pa INOUT int4,"
- + "pb INOUT varchar,"
- + "pc INOUT int8)"
- + " AS "
- + "'begin "
- + "pa := pa + 1;"
- + "pb := ''foo out'';"
- + "pc := pa + 1;"
- + "end;'"
- + "LANGUAGE plpgsql VOLATILE;"
- );
-
-
- }
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception
- {
- Statement stmt = con.createStatement();
- stmt.execute("drop function Numeric_Proc(out decimal, out decimal, out decimal)");
- stmt.execute("drop function test_somein_someout(int4)");
- stmt.execute("drop function test_allinout( inout int4, inout varchar, inout int8)");
- stmt.execute("drop function myiofunc(a INOUT int, b OUT int) ");
- stmt.execute("drop function myif(a INOUT int, b IN int)");
- stmt.close();
- TestUtil.closeDB(con);
- }
-
- public void testSomeInOut() throws Throwable
- {
- CallableStatement call = con.prepareCall( "{ call test_somein_someout(?,?,?) }" ) ;
-
- call.registerOutParameter(2,Types.VARCHAR);
- call.registerOutParameter(3,Types.BIGINT);
- call.setInt(1,20);
- call.execute();
-
- }
- public void testNotEnoughParameters() throws Throwable
- {
-
- CallableStatement cs = con.prepareCall("{call myiofunc(?,?)}");
- cs.setInt(1,2);
- cs.registerOutParameter(2,Types.INTEGER);
- try
- {
- cs.execute();
- fail("Should throw an exception ");
- }
- catch( SQLException ex)
- {
- assertTrue(ex.getSQLState().equalsIgnoreCase(PSQLState.SYNTAX_ERROR.getState()));
- }
-
- }
- public void testTooManyParameters() throws Throwable
- {
-
- CallableStatement cs = con.prepareCall("{call myif(?,?)}");
- try
- {
- cs.setInt(1,1);
- cs.setInt(2,2);
- cs.registerOutParameter(1,Types.INTEGER);
- cs.registerOutParameter(2,Types.INTEGER);
- cs.execute();
- fail("should throw an exception");
- }
- catch( SQLException ex )
- {
- assertTrue(ex.getSQLState().equalsIgnoreCase(PSQLState.SYNTAX_ERROR.getState()));
- }
-
- }
- public void testAllInOut() throws Throwable
- {
-
- CallableStatement call = con.prepareCall( "{ call test_allinout(?,?,?) }" ) ;
-
- call.registerOutParameter(1,Types.INTEGER);
- call.registerOutParameter(2,Types.VARCHAR);
- call.registerOutParameter(3,Types.BIGINT);
- call.setInt(1,20);
- call.setString(2,"hi");
- call.setInt(3,123);
- call.execute();
- call.getInt(1);
- call.getString(2);
- call.getLong(3);
-
- }
-
- public void testNumeric() throws Throwable
- {
-
- CallableStatement call = con.prepareCall( "{ call Numeric_Proc(?,?,?) }" ) ;
-
- call.registerOutParameter(1,Types.NUMERIC,15);
- call.registerOutParameter(2,Types.NUMERIC,15);
- call.registerOutParameter(3,Types.NUMERIC,15);
-
- call.executeUpdate();
- java.math.BigDecimal ret = call.getBigDecimal(1);
- assertTrue ("correct return from getNumeric () should be 999999999999999.000000000000000 but returned " + ret.toString(),
- ret.equals (new java.math.BigDecimal("999999999999999.000000000000000")));
-
- ret=call.getBigDecimal(2);
- assertTrue ("correct return from getNumeric ()",
- ret.equals (new java.math.BigDecimal("0.000000000000001")));
- try
- {
- ret = call.getBigDecimal(3);
- }catch(NullPointerException ex)
- {
- assertTrue("This should be null",call.wasNull());
- }
-
-
-
- }
- public void testGetObjectDecimal() throws Throwable
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("create temp table decimal_tab ( max_val numeric(30,15), min_val numeric(30,15), nul_val numeric(30,15) )");
- stmt.execute("insert into decimal_tab values (999999999999999.000000000000000,0.000000000000001,null)");
-
- boolean ret = stmt.execute("create or replace function "
- + "decimal_proc( OUT pmax numeric, OUT pmin numeric, OUT nval numeric) as "
- + "'begin "
- + "select max_val into pmax from decimal_tab;"
- + "select min_val into pmin from decimal_tab;"
- + "select nul_val into nval from decimal_tab;"
-
- + " end;' "
- + "language plpgsql;");
- }
- catch (Exception ex)
- {
- fail ( ex.getMessage());
- throw ex;
- }
- try
- {
- CallableStatement cstmt = con.prepareCall("{ call decimal_proc(?,?,?) }");
- cstmt.registerOutParameter(1, Types.DECIMAL);
- cstmt.registerOutParameter(2, Types.DECIMAL );
- cstmt.registerOutParameter(3, Types.DECIMAL );
- cstmt.executeUpdate();
- BigDecimal val = (BigDecimal)cstmt.getObject(1);
- assertTrue( val.compareTo(new BigDecimal("999999999999999.000000000000000")) == 0 );
- val = ( BigDecimal )cstmt.getObject(2);
- assertTrue( val.compareTo( new BigDecimal( "0.000000000000001")) == 0);
- val = ( BigDecimal )cstmt.getObject(3);
- assertTrue( val == null );
- }
- catch ( Exception ex )
- {
- fail(ex.getMessage());
- }
- finally
- {
- try
- {
- Statement dstmt = con.createStatement();
- dstmt.execute("drop function decimal_proc()");
- }
- catch (Exception ex){}
- }
- }
-
- public void testVarcharBool() throws Throwable
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("create temp table vartab( max_val text, min_val text)");
- stmt.execute("insert into vartab values ('a','b')");
- boolean ret = stmt.execute("create or replace function "
- + "updatevarchar( in imax text, in imin text) returns int as "
- + "'begin "
- + "update vartab set max_val = imax;"
- + "update vartab set min_val = imin;"
- + "return 0;"
- + " end;' "
- + "language plpgsql;");
- stmt.close();
- }
- catch (Exception ex)
- {
- fail ( ex.getMessage());
- throw ex;
- }
- try
- {
- String str = Boolean.TRUE.toString();
- CallableStatement cstmt = con.prepareCall("{ call updatevarchar(?,?) }");
- cstmt.setObject(1,Boolean.TRUE, Types.VARCHAR);
- cstmt.setObject(2,Boolean.FALSE, Types.VARCHAR);
-
- cstmt.executeUpdate();
- cstmt.close();
- ResultSet rs = con.createStatement().executeQuery("select * from vartab");
- assertTrue(rs.next());
- assertTrue( rs.getString(1).equals(Boolean.TRUE.toString()) );
-
- assertTrue( rs.getString(2).equals(Boolean.FALSE.toString()) );
- rs.close();
- }
- catch ( Exception ex )
- {
- fail(ex.getMessage());
- }
- finally
- {
- try
- {
- Statement dstmt = con.createStatement();
- dstmt.execute("drop function updatevarchar(text,text)");
- }
- catch (Exception ex){}
- }
- }
- public void testInOut() throws Throwable
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute(createBitTab);
- stmt.execute(insertBitTab);
- boolean ret = stmt.execute("create or replace function "
- + "insert_bit( inout IMAX boolean, inout IMIN boolean, inout INUL boolean) as "
- + "'begin "
- + "insert into bit_tab values( imax, imin, inul);"
- + "select max_val into imax from bit_tab;"
- + "select min_val into imin from bit_tab;"
- + "select null_val into inul from bit_tab;"
- + " end;' "
- + "language plpgsql;");
- }
- catch (Exception ex)
- {
- fail ( ex.getMessage());
- throw ex;
- }
- try
- {
- CallableStatement cstmt = con.prepareCall("{ call insert_bit(?,?,?) }");
- cstmt.setObject(1,"true", Types.BIT);
- cstmt.setObject(2,"false", Types.BIT);
- cstmt.setNull(3,Types.BIT);
- cstmt.registerOutParameter(1, Types.BIT);
- cstmt.registerOutParameter(2, Types.BIT);
- cstmt.registerOutParameter(3, Types.BIT);
- cstmt.executeUpdate();
-
- assertTrue( cstmt.getBoolean(1) == true );
- assertTrue( cstmt.getBoolean(2) == false );
- cstmt.getBoolean(3);
- assertTrue(cstmt.wasNull());
- }
-
- finally
- {
- try
- {
- Statement dstmt = con.createStatement();
- dstmt.execute("drop function insert_bit(boolean, boolean, boolean)");
- }
- catch (Exception ex){}
- }
- }
- private final String createBitTab = "create temp table bit_tab ( max_val boolean, min_val boolean, null_val boolean )";
- private final String insertBitTab = "insert into bit_tab values (true,false,null)";
-
- public void testSetObjectBit() throws Throwable
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute(createBitTab);
- stmt.execute(insertBitTab);
- boolean ret = stmt.execute("create or replace function "
- + "update_bit( in IMAX boolean, in IMIN boolean, in INUL boolean) returns int as "
- + "'begin "
- + "update bit_tab set max_val = imax;"
- + "update bit_tab set min_val = imin;"
- + "update bit_tab set min_val = inul;"
- + " return 0;"
- + " end;' "
- + "language plpgsql;");
- }
- catch (Exception ex)
- {
- fail ( ex.getMessage());
- throw ex;
- }
- try
- {
- CallableStatement cstmt = con.prepareCall("{ call update_bit(?,?,?) }");
- cstmt.setObject(1,"true", Types.BIT);
- cstmt.setObject(2,"false", Types.BIT);
- cstmt.setNull(3,Types.BIT);
- cstmt.executeUpdate();
- cstmt.close();
- ResultSet rs = con.createStatement().executeQuery("select * from bit_tab");
-
- assertTrue( rs.next() );
- assertTrue( rs.getBoolean(1) == true );
- assertTrue( rs.getBoolean(2) == false );
- rs.getBoolean(3);
- assertTrue( rs.wasNull() );
- }
- catch ( Exception ex )
- {
- fail(ex.getMessage());
- }
- finally
- {
- try
- {
- Statement dstmt = con.createStatement();
- dstmt.execute("drop function update_bit(boolean, boolean, boolean)");
- }
- catch (Exception ex){}
- }
- }
- public void testGetObjectLongVarchar() throws Throwable
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("create temp table longvarchar_tab ( t text, null_val text )");
- stmt.execute("insert into longvarchar_tab values ('testdata',null)");
- boolean ret = stmt.execute("create or replace function "
- + "longvarchar_proc( OUT pcn text, OUT nval text) as "
- + "'begin "
- + "select t into pcn from longvarchar_tab;"
- + "select null_val into nval from longvarchar_tab;"
-
- + " end;' "
- + "language plpgsql;");
-
- ret = stmt.execute("create or replace function "
- + "lvarchar_in_name( IN pcn text) returns int as "
- + "'begin "
- + "update longvarchar_tab set t=pcn;"
- + "return 0;"
- + " end;' "
- + "language plpgsql;");
- }
- catch (Exception ex)
- {
- fail ( ex.getMessage());
- throw ex;
- }
- try
- {
- CallableStatement cstmt = con.prepareCall("{ call longvarchar_proc(?,?) }");
- cstmt.registerOutParameter(1, Types.LONGVARCHAR);
- cstmt.registerOutParameter(2, Types.LONGVARCHAR );
- cstmt.executeUpdate();
- String val = (String)cstmt.getObject(1);
- assertTrue( val.equals("testdata") );
- val = ( String )cstmt.getObject(2);
- assertTrue( val == null );
- cstmt.close();
- cstmt = con.prepareCall("{ call lvarchar_in_name(?) }");
- String maxFloat = "3.4E38";
- cstmt.setObject( 1, new Float(maxFloat), Types.LONGVARCHAR);
- cstmt.executeUpdate();
- cstmt.close();
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("select * from longvarchar_tab");
- assertTrue(rs.next());
- String rval = (String)rs.getObject(1);
- assertEquals( rval.trim(), maxFloat.trim());
- }
- catch ( Exception ex )
- {
- fail(ex.getMessage());
- }
- finally
- {
- try
- {
- Statement dstmt = con.createStatement();
- dstmt.execute("drop function longvarchar_proc()");
- dstmt.execute("drop function lvarchar_in_name(text)");
- }
- catch (Exception ex){}
- }
- }
- public void testGetBytes01() throws Throwable
- {
- byte [] testdata = "TestData".getBytes();
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("create temp table varbinary_tab ( vbinary bytea, null_val bytea )");
- boolean ret = stmt.execute("create or replace function "
- + "varbinary_proc( OUT pcn bytea, OUT nval bytea) as "
- + "'begin "
- + "select vbinary into pcn from varbinary_tab;"
- + "select null_val into nval from varbinary_tab;"
-
- + " end;' "
- + "language plpgsql;");
- stmt.close();
- PreparedStatement pstmt = con.prepareStatement("insert into varbinary_tab values (?,?)");
- pstmt.setBytes( 1, testdata);
- pstmt.setBytes( 2, null );
-
- pstmt.executeUpdate();
- pstmt.close();
- }
- catch (Exception ex)
- {
- fail ( ex.getMessage());
- throw ex;
- }
- try
- {
- CallableStatement cstmt = con.prepareCall("{ call varbinary_proc(?,?) }");
- cstmt.registerOutParameter(1, Types.VARBINARY);
- cstmt.registerOutParameter(2, Types.VARBINARY );
- cstmt.executeUpdate();
- byte [] retval = cstmt.getBytes(1);
- for( int i = 0; i < testdata.length; i++)
- {
- assertTrue( testdata[i] == retval[i] );
- }
-
- retval = cstmt.getBytes(2);
- assertTrue( retval == null );
- }
- catch ( Exception ex )
- {
- fail(ex.getMessage());
- }
- finally
- {
- try
- {
- Statement dstmt = con.createStatement();
- dstmt.execute("drop function varbinary_proc()");
- }
- catch (Exception ex){}
- }
- }
- private final String createDecimalTab = "create temp table decimal_tab ( max_val float, min_val float, null_val float )";
- private final String insertDecimalTab = "insert into decimal_tab values (1.0E125,1.0E-130,null)";
- private final String createFloatProc = "create or replace function "
- + "float_proc( OUT IMAX float, OUT IMIN float, OUT INUL float) as "
- + "'begin "
- + "select max_val into imax from decimal_tab;"
- + "select min_val into imin from decimal_tab;"
- + "select null_val into inul from decimal_tab;"
- + " end;' "
- + "language plpgsql;";
-
- private final String createUpdateFloat = "create or replace function "
- + "updatefloat_proc ( IN maxparm float, IN minparm float ) returns int as "
- + "'begin "
- + "update decimal_tab set max_val=maxparm;"
- + "update decimal_tab set min_val=minparm;"
- + "return 0;"
- + " end;' "
- + "language plpgsql;";
-
- private final String createRealTab = "create temp table real_tab ( max_val float(25), min_val float(25), null_val float(25) )";
- private final String insertRealTab = "insert into real_tab values (1.0E37,1.0E-37, null)";
-
- private final String dropFloatProc = "drop function float_proc()";
- private final String createUpdateReal = "create or replace function "
- + "update_real_proc ( IN maxparm float(25), IN minparm float(25) ) returns int as "
- + "'begin "
- + "update real_tab set max_val=maxparm;"
- + "update real_tab set min_val=minparm;"
- + "return 0;"
- + " end;' "
- + "language plpgsql;";
- private final String dropUpdateReal = "drop function update_real_proc(float, float)";
- private final double [] doubleValues = {1.0E125, 1.0E-130};
- private final float [] realValues = {(float)1.0E37,(float)1.0E-37};
- private final int []intValues = {2147483647,-2147483648};
-
- public void testUpdateReal() throws Throwable
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute(createRealTab);
- boolean ret = stmt.execute(createUpdateReal);
-
- stmt.execute(insertRealTab);
- stmt.close();
-
-
- }
- catch (Exception ex)
- {
- fail ( ex.getMessage());
- throw ex;
- }
- try
- {
- CallableStatement cstmt = con.prepareCall("{ call update_real_proc(?,?) }");
- BigDecimal val = new BigDecimal( intValues[0] );
- float x = val.floatValue();
- cstmt.setObject( 1, val, Types.REAL );
- val = new BigDecimal( intValues[1]);
- cstmt.setObject( 2, val, Types.REAL );
- cstmt.executeUpdate();
- cstmt.close();
- ResultSet rs = con.createStatement().executeQuery("select * from real_tab");
- assertTrue ( rs.next() );
- Float oVal = new Float( intValues[0]);
- Float rVal = new Float(rs.getObject(1).toString());
- assertTrue ( oVal.equals(rVal) );
- oVal = new Float( intValues[1] );
- rVal = new Float(rs.getObject(2).toString());
- assertTrue ( oVal.equals(rVal) );
- rs.close();
- }
- catch ( Exception ex )
- {
- fail(ex.getMessage());
- }
- finally
- {
- try
- {
- Statement dstmt = con.createStatement();
- dstmt.execute(dropUpdateReal);
- dstmt.close();
- }
- catch (Exception ex){}
- }
- }
- public void testUpdateDecimal() throws Throwable
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute(createDecimalTab);
- boolean ret = stmt.execute(createUpdateFloat);
- stmt.close();
- PreparedStatement pstmt = con.prepareStatement("insert into decimal_tab values (?,?)");
- // note these are reversed on purpose
- pstmt.setDouble(1, doubleValues[1]);
- pstmt.setDouble(2, doubleValues[0]);
-
- pstmt.executeUpdate();
- pstmt.close();
- }
- catch (Exception ex)
- {
- fail ( ex.getMessage());
- throw ex;
- }
- try
- {
- CallableStatement cstmt = con.prepareCall("{ call updatefloat_proc(?,?) }");
- cstmt.setDouble(1, doubleValues[0]);
- cstmt.setDouble(2, doubleValues[1]);
- cstmt.executeUpdate();
- cstmt.close();
- ResultSet rs = con.createStatement().executeQuery("select * from decimal_tab");
- assertTrue ( rs.next() );
- assertTrue ( rs.getDouble(1) == doubleValues[0]);
- assertTrue ( rs.getDouble(2) == doubleValues[1]);
- rs.close();
- }
- catch ( Exception ex )
- {
- fail(ex.getMessage());
- }
- finally
- {
- try
- {
- Statement dstmt = con.createStatement();
- dstmt.execute("drop function updatefloat_proc(float, float)");
- }
- catch (Exception ex){}
- }
- }
- public void testGetBytes02() throws Throwable
- {
- byte [] testdata = "TestData".getBytes();
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("create temp table longvarbinary_tab ( vbinary bytea, null_val bytea )");
- boolean ret = stmt.execute("create or replace function "
- + "longvarbinary_proc( OUT pcn bytea, OUT nval bytea) as "
- + "'begin "
- + "select vbinary into pcn from longvarbinary_tab;"
- + "select null_val into nval from longvarbinary_tab;"
-
- + " end;' "
- + "language plpgsql;");
- stmt.close();
- PreparedStatement pstmt = con.prepareStatement("insert into longvarbinary_tab values (?,?)");
- pstmt.setBytes( 1, testdata);
- pstmt.setBytes( 2, null );
-
- pstmt.executeUpdate();
- pstmt.close();
- }
- catch (Exception ex)
- {
- fail ( ex.getMessage());
- throw ex;
- }
- try
- {
- CallableStatement cstmt = con.prepareCall("{ call longvarbinary_proc(?,?) }");
- cstmt.registerOutParameter(1, Types.LONGVARBINARY);
- cstmt.registerOutParameter(2, Types.LONGVARBINARY );
- cstmt.executeUpdate();
- byte [] retval = cstmt.getBytes(1);
- for( int i = 0; i < testdata.length; i++)
- {
- assertTrue( testdata[i] == retval[i] );
- }
-
- retval = cstmt.getBytes(2);
- assertTrue( retval == null );
- }
- catch ( Exception ex )
- {
- fail(ex.getMessage());
- }
- finally
- {
- try
- {
- Statement dstmt = con.createStatement();
- dstmt.execute("drop function longvarbinary_proc()");
- }
- catch (Exception ex){}
- }
- }
-
-
- public void testGetObjectFloat() throws Throwable
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute( createDecimalTab );
- stmt.execute( insertDecimalTab );
- boolean ret = stmt.execute(createFloatProc);
- }
- catch (Exception ex)
- {
- fail ( ex.getMessage());
- throw ex;
- }
- try
- {
- CallableStatement cstmt = con.prepareCall("{ call float_proc(?,?,?) }");
- cstmt.registerOutParameter(1,java.sql.Types.FLOAT);
- cstmt.registerOutParameter(2,java.sql.Types.FLOAT);
- cstmt.registerOutParameter(3,java.sql.Types.FLOAT);
- cstmt.executeUpdate();
- Double val = (Double)cstmt.getObject(1);
- assertTrue( val.doubleValue() == doubleValues[0] );
-
- val = (Double)cstmt.getObject(2);
- assertTrue( val.doubleValue() == doubleValues[1]);
-
- val = (Double)cstmt.getObject(3);
- assertTrue( cstmt.wasNull() );
- }
- catch ( Exception ex )
- {
- fail(ex.getMessage());
- }
- finally
- {
- try
- {
- Statement dstmt = con.createStatement();
- dstmt.execute(dropFloatProc);
- }
- catch (Exception ex){}
- }
- }
-
- public void testGetDouble01() throws Throwable
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("create temp table d_tab ( max_val float, min_val float, null_val float )");
- stmt.execute("insert into d_tab values (1.0E125,1.0E-130,null)");
- boolean ret = stmt.execute("create or replace function "
- + "double_proc( OUT IMAX float, OUT IMIN float, OUT INUL float) as "
- + "'begin "
- + "select max_val into imax from d_tab;"
- + "select min_val into imin from d_tab;"
- + "select null_val into inul from d_tab;"
-
- + " end;' "
- + "language plpgsql;");
- }
- catch (Exception ex)
- {
- fail ( ex.getMessage());
- throw ex;
- }
- try
- {
- CallableStatement cstmt = con.prepareCall("{ call double_proc(?,?,?) }");
- cstmt.registerOutParameter(1,java.sql.Types.DOUBLE);
- cstmt.registerOutParameter(2,java.sql.Types.DOUBLE);
- cstmt.registerOutParameter(3,java.sql.Types.DOUBLE);
- cstmt.executeUpdate();
- assertTrue( cstmt.getDouble(1) == 1.0E125 );
- assertTrue( cstmt.getDouble(2) == 1.0E-130);
- cstmt.getDouble(3);
- assertTrue( cstmt.wasNull() );
- }
- catch ( Exception ex )
- {
- fail(ex.getMessage());
- }
- finally
- {
- try
- {
- Statement dstmt = con.createStatement();
- dstmt.execute("drop function double_proc()");
- }
- catch (Exception ex){}
- }
- }
- public void testGetDoubleAsReal() throws Throwable
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("create temp table d_tab ( max_val float, min_val float, null_val float )");
- stmt.execute("insert into d_tab values (3.4E38,1.4E-45,null)");
- boolean ret = stmt.execute("create or replace function "
- + "double_proc( OUT IMAX float, OUT IMIN float, OUT INUL float) as "
- + "'begin "
- + "select max_val into imax from d_tab;"
- + "select min_val into imin from d_tab;"
- + "select null_val into inul from d_tab;"
-
- + " end;' "
- + "language plpgsql;");
- }
- catch (Exception ex)
- {
- fail ( ex.getMessage());
- throw ex;
- }
- try
- {
- CallableStatement cstmt = con.prepareCall("{ call double_proc(?,?,?) }");
- cstmt.registerOutParameter(1,java.sql.Types.REAL);
- cstmt.registerOutParameter(2,java.sql.Types.REAL);
- cstmt.registerOutParameter(3,java.sql.Types.REAL);
- cstmt.executeUpdate();
- assertTrue( cstmt.getFloat(1) == 3.4E38f);
- assertTrue( cstmt.getFloat(2) == 1.4E-45f);
- cstmt.getFloat(3);
- assertTrue( cstmt.wasNull() );
- }
- catch ( Exception ex )
- {
- fail(ex.getMessage());
- }
- finally
- {
- try
- {
- Statement dstmt = con.createStatement();
- dstmt.execute("drop function double_proc()");
- }
- catch (Exception ex){}
- }
- }
- public void testGetShort01() throws Throwable
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("create temp table short_tab ( max_val int2, min_val int2, null_val int2 )");
- stmt.execute("insert into short_tab values (32767,-32768,null)");
- boolean ret = stmt.execute("create or replace function "
- + "short_proc( OUT IMAX int2, OUT IMIN int2, OUT INUL int2) as "
- + "'begin "
- + "select max_val into imax from short_tab;"
- + "select min_val into imin from short_tab;"
- + "select null_val into inul from short_tab;"
-
- + " end;' "
- + "language plpgsql;");
- }
- catch (Exception ex)
- {
- fail ( ex.getMessage());
- throw ex;
- }
- try
- {
- CallableStatement cstmt = con.prepareCall("{ call short_proc(?,?,?) }");
- cstmt.registerOutParameter(1,java.sql.Types.SMALLINT);
- cstmt.registerOutParameter(2,java.sql.Types.SMALLINT);
- cstmt.registerOutParameter(3,java.sql.Types.SMALLINT);
- cstmt.executeUpdate();
- assertTrue ( cstmt.getShort(1) == 32767);
- assertTrue ( cstmt.getShort(2) == -32768);
- cstmt.getShort(3);
- assertTrue( cstmt.wasNull() );
- }
- catch ( Exception ex )
- {
- fail(ex.getMessage());
- }
- finally
- {
- try
- {
- Statement dstmt = con.createStatement();
- dstmt.execute("drop function short_proc()");
- }
- catch (Exception ex){}
- }
- }
- public void testGetInt01() throws Throwable
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("create temp table i_tab ( max_val int, min_val int, null_val int )");
- stmt.execute("insert into i_tab values (2147483647,-2147483648,null)");
- boolean ret = stmt.execute("create or replace function "
- + "int_proc( OUT IMAX int, OUT IMIN int, OUT INUL int) as "
- + "'begin "
- + "select max_val into imax from i_tab;"
- + "select min_val into imin from i_tab;"
- + "select null_val into inul from i_tab;"
-
- + " end;' "
- + "language plpgsql;");
- }
- catch (Exception ex)
- {
- fail ( ex.getMessage());
- throw ex;
- }
- try
- {
- CallableStatement cstmt = con.prepareCall("{ call int_proc(?,?,?) }");
- cstmt.registerOutParameter(1,java.sql.Types.INTEGER);
- cstmt.registerOutParameter(2,java.sql.Types.INTEGER);
- cstmt.registerOutParameter(3,java.sql.Types.INTEGER);
- cstmt.executeUpdate();
- assertTrue( cstmt.getInt(1) == 2147483647);
- assertTrue( cstmt.getInt(2) == -2147483648);
- cstmt.getInt(3);
- assertTrue( cstmt.wasNull() );
- }
- catch ( Exception ex )
- {
- fail(ex.getMessage());
- }
- finally
- {
- try
- {
- Statement dstmt = con.createStatement();
- dstmt.execute("drop function int_proc()");
- }
- catch (Exception ex){}
- }
- }
- public void testGetLong01() throws Throwable
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("create temp table l_tab ( max_val int8, min_val int8, null_val int8 )");
- stmt.execute("insert into l_tab values (9223372036854775807,-9223372036854775808,null)");
- boolean ret = stmt.execute("create or replace function "
- + "bigint_proc( OUT IMAX int8, OUT IMIN int8, OUT INUL int8) as "
- + "'begin "
- + "select max_val into imax from l_tab;"
- + "select min_val into imin from l_tab;"
- + "select null_val into inul from l_tab;"
-
- + " end;' "
- + "language plpgsql;");
- }
- catch (Exception ex)
- {
- fail ( ex.getMessage());
- throw ex;
- }
- try
- {
- CallableStatement cstmt = con.prepareCall("{ call bigint_proc(?,?,?) }");
- cstmt.registerOutParameter(1,java.sql.Types.BIGINT);
- cstmt.registerOutParameter(2,java.sql.Types.BIGINT);
- cstmt.registerOutParameter(3,java.sql.Types.BIGINT);
- cstmt.executeUpdate();
- assertTrue(cstmt.getLong( 1 ) == 9223372036854775807l );
- assertTrue( cstmt.getLong(2) == -9223372036854775808l );
- cstmt.getLong(3);
- assertTrue( cstmt.wasNull() );
- }
- catch ( Exception ex )
- {
- fail(ex.getMessage());
- }
- finally
- {
- try
- {
- Statement dstmt = con.createStatement();
- dstmt.execute("drop function bigint_proc()");
- }
- catch (Exception ex){}
- }
- }
-
- public void testGetBoolean01() throws Throwable
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute(createBitTab);
- stmt.execute(insertBitTab);
- boolean ret = stmt.execute("create or replace function "
- + "bit_proc( OUT IMAX boolean, OUT IMIN boolean, OUT INUL boolean) as "
- + "'begin "
- + "select max_val into imax from bit_tab;"
- + "select min_val into imin from bit_tab;"
- + "select null_val into inul from bit_tab;"
-
- + " end;' "
- + "language plpgsql;");
- }
- catch (Exception ex)
- {
- fail ( ex.getMessage());
- throw ex;
- }
- try
- {
- CallableStatement cstmt = con.prepareCall("{ call bit_proc(?,?,?) }");
- cstmt.registerOutParameter(1,java.sql.Types.BIT);
- cstmt.registerOutParameter(2,java.sql.Types.BIT);
- cstmt.registerOutParameter(3,java.sql.Types.BIT);
- cstmt.executeUpdate();
- assertTrue(cstmt.getBoolean( 1 ) );
- assertTrue( cstmt.getBoolean(2) == false );
- cstmt.getBoolean(3);
- assertTrue( cstmt.wasNull() );
- }
- catch ( Exception ex )
- {
- fail(ex.getMessage());
- }
- finally
- {
- try
- {
- Statement dstmt = con.createStatement();
- dstmt.execute("drop function bit_proc()");
- }
- catch (Exception ex){}
- }
- }
- public void testGetByte01() throws Throwable
- {
- try
- {
- Statement stmt = con.createStatement();
- stmt.execute("create temp table byte_tab ( max_val int2, min_val int2, null_val int2 )");
- stmt.execute("insert into byte_tab values (127,-128,null)");
- boolean ret = stmt.execute("create or replace function "
- + "byte_proc( OUT IMAX int2, OUT IMIN int2, OUT INUL int2) as "
- + "'begin "
- + "select max_val into imax from byte_tab;"
- + "select min_val into imin from byte_tab;"
- + "select null_val into inul from byte_tab;"
-
- + " end;' "
- + "language plpgsql;");
- }
- catch (Exception ex)
- {
- fail ( ex.getMessage());
- throw ex;
- }
- try
- {
- CallableStatement cstmt = con.prepareCall("{ call byte_proc(?,?,?) }");
- cstmt.registerOutParameter(1,java.sql.Types.TINYINT);
- cstmt.registerOutParameter(2,java.sql.Types.TINYINT);
- cstmt.registerOutParameter(3,java.sql.Types.TINYINT);
- cstmt.executeUpdate();
- assertTrue(cstmt.getByte( 1 ) == 127 );
- assertTrue( cstmt.getByte(2) == -128 );
- cstmt.getByte(3);
- assertTrue( cstmt.wasNull() );
- }
- catch ( Exception ex )
- {
- fail(ex.getMessage());
- }
- finally
- {
- try
- {
- Statement dstmt = con.createStatement();
- dstmt.execute("drop function byte_proc()");
- }
- catch (Exception ex){}
- }
- }
-
- public void testMultipleOutExecutions() throws SQLException
- {
- CallableStatement cs = con.prepareCall("{call myiofunc(?, ?)}");
- for (int i=0; i<10; i++) {
- cs.registerOutParameter(1, Types.INTEGER);
- cs.registerOutParameter(2, Types.INTEGER);
- cs.setInt(1, i);
- cs.execute();
- assertEquals(1, cs.getInt(1));
- assertEquals(i, cs.getInt(2));
- cs.clearParameters();
- }
- }
-
-}
diff --git a/org/postgresql/test/jdbc3/Jdbc3SavepointTest.java b/org/postgresql/test/jdbc3/Jdbc3SavepointTest.java
deleted file mode 100644
index 9c32e27..0000000
--- a/org/postgresql/test/jdbc3/Jdbc3SavepointTest.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc3;
-
-import java.sql.*;
-import junit.framework.TestCase;
-import org.postgresql.test.TestUtil;
-
-public class Jdbc3SavepointTest extends TestCase {
-
- private Connection _conn;
-
- public Jdbc3SavepointTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- _conn = TestUtil.openDB();
- TestUtil.createTable(_conn, "savepointtable", "id int primary key");
- _conn.setAutoCommit(false);
- }
-
- protected void tearDown() throws SQLException {
- _conn.setAutoCommit(true);
- TestUtil.dropTable(_conn, "savepointtable");
- TestUtil.closeDB(_conn);
- }
-
- private boolean hasSavepoints() throws SQLException {
- return TestUtil.haveMinimumServerVersion(_conn, "8.0");
- }
-
- private void addRow(int id) throws SQLException {
- PreparedStatement pstmt = _conn.prepareStatement("INSERT INTO savepointtable VALUES (?)");
- pstmt.setInt(1, id);
- pstmt.executeUpdate();
- pstmt.close();
- }
-
- private int countRows() throws SQLException {
- Statement stmt = _conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT COUNT(*) FROM savepointtable");
- rs.next();
- int count = rs.getInt(1);
- rs.close();
- return count;
- }
-
- public void testAutoCommitFails() throws SQLException {
- if (!hasSavepoints())
- return ;
-
- _conn.setAutoCommit(true);
-
- try
- {
- _conn.setSavepoint();
- fail("Can't create a savepoint with autocommit.");
- }
- catch (SQLException sqle)
- {
- }
-
- try
- {
- _conn.setSavepoint("spname");
- fail("Can't create a savepoint with autocommit.");
- }
- catch (SQLException sqle)
- {
- }
- }
-
- public void testCantMixSavepointTypes() throws SQLException {
- if (!hasSavepoints())
- return ;
-
- Savepoint namedSavepoint = _conn.setSavepoint("named");
- Savepoint unNamedSavepoint = _conn.setSavepoint();
-
- try
- {
- namedSavepoint.getSavepointId();
- fail("Can't get id from named savepoint.");
- }
- catch (SQLException sqle)
- {
- }
-
- try
- {
- unNamedSavepoint.getSavepointName();
- fail("Can't get name from unnamed savepoint.");
- }
- catch (SQLException sqle)
- {
- }
-
- }
-
- public void testRollingBackToSavepoints() throws SQLException {
- if (!hasSavepoints())
- return ;
-
- Savepoint empty = _conn.setSavepoint();
- addRow(1);
- Savepoint onerow = _conn.setSavepoint("onerow");
- addRow(2);
-
- assertEquals(2, countRows());
- _conn.rollback(onerow);
- assertEquals(1, countRows());
- _conn.rollback(empty);
- assertEquals(0, countRows());
- }
-
- public void testGlobalRollbackWorks() throws SQLException {
- if (!hasSavepoints())
- return ;
-
- _conn.setSavepoint();
- addRow(1);
- _conn.setSavepoint("onerow");
- addRow(2);
-
- assertEquals(2, countRows());
- _conn.rollback();
- assertEquals(0, countRows());
- }
-
- public void testContinueAfterError() throws SQLException {
- if (!hasSavepoints())
- return ;
-
- addRow(1);
- Savepoint savepoint = _conn.setSavepoint();
- try
- {
- addRow(1);
- fail("Should have thrown duplicate key exception");
- }
- catch (SQLException sqle)
- {
- _conn.rollback(savepoint);
- }
-
- assertEquals(1, countRows());
- addRow(2);
- assertEquals(2, countRows());
- }
-
- public void testReleaseSavepoint() throws SQLException {
- if (!hasSavepoints())
- return ;
-
- Savepoint savepoint = _conn.setSavepoint("mysavepoint");
- _conn.releaseSavepoint(savepoint);
- try
- {
- savepoint.getSavepointName();
- fail("Can't use savepoint after release.");
- }
- catch (SQLException sqle)
- {
- }
-
- savepoint = _conn.setSavepoint();
- _conn.releaseSavepoint(savepoint);
- try
- {
- savepoint.getSavepointId();
- fail("Can't use savepoint after release.");
- }
- catch (SQLException sqle)
- {
- }
- }
-
- public void testComplicatedSavepointName() throws SQLException {
- if (!hasSavepoints())
- return ;
-
- Savepoint savepoint = _conn.setSavepoint("name with spaces + \"quotes\"");
- _conn.rollback(savepoint);
- _conn.releaseSavepoint(savepoint);
- }
-
- public void testRollingBackToInvalidSavepointFails() throws SQLException {
- if (!hasSavepoints())
- return ;
-
- Savepoint sp1 = _conn.setSavepoint();
- Savepoint sp2 = _conn.setSavepoint();
-
- _conn.rollback(sp1);
- try
- {
- _conn.rollback(sp2);
- fail("Can't rollback to a savepoint that's invalid.");
- }
- catch (SQLException sqle)
- {
- }
- }
-
- public void testRollbackMultipleTimes() throws SQLException {
- if (!hasSavepoints())
- return ;
-
- addRow(1);
- Savepoint savepoint = _conn.setSavepoint();
-
- addRow(2);
- _conn.rollback(savepoint);
- assertEquals(1, countRows());
-
- _conn.rollback(savepoint);
- assertEquals(1, countRows());
-
- addRow(2);
- _conn.rollback(savepoint);
- assertEquals(1, countRows());
-
- _conn.releaseSavepoint(savepoint);
- assertEquals(1, countRows());
- }
-
-}
diff --git a/org/postgresql/test/jdbc3/Jdbc3TestSuite.java b/org/postgresql/test/jdbc3/Jdbc3TestSuite.java
deleted file mode 100644
index 6d22d41..0000000
--- a/org/postgresql/test/jdbc3/Jdbc3TestSuite.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc3;
-
-import org.postgresql.test.TestUtil;
-
-import junit.framework.TestSuite;
-
-/*
- * Executes all known tests for JDBC3
- */
-public class Jdbc3TestSuite extends TestSuite
-{
-
- /*
- * The main entry point for JUnit
- */
- public static TestSuite suite() throws Exception
- {
- Class.forName("org.postgresql.Driver");
- TestSuite suite = new TestSuite();
- try
- {
- java.sql.Connection con = TestUtil.openDB();
-
- if ( TestUtil.haveMinimumServerVersion( con, "8.1") && TestUtil.isProtocolVersion(con, 3))
- {
- suite.addTestSuite(Jdbc3CallableStatementTest.class);
- }
- if ( TestUtil.haveMinimumServerVersion( con, "8.2") )
- {
- suite.addTestSuite(GeneratedKeysTest.class);
- }
- con.close();
- }
- catch (Exception ex )
- {
- ex.printStackTrace();
- }
-
- suite.addTestSuite(Jdbc3SavepointTest.class);
- suite.addTestSuite(TypesTest.class);
- suite.addTestSuite(ResultSetTest.class);
- suite.addTestSuite(ParameterMetaDataTest.class);
- suite.addTestSuite(Jdbc3BlobTest.class);
- suite.addTestSuite(DatabaseMetaDataTest.class);
- suite.addTestSuite(SendRecvBufferSizeTest.class);
- return suite;
- }
-}
diff --git a/org/postgresql/test/jdbc3/ParameterMetaDataTest.java b/org/postgresql/test/jdbc3/ParameterMetaDataTest.java
deleted file mode 100644
index 4991957..0000000
--- a/org/postgresql/test/jdbc3/ParameterMetaDataTest.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2005-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc3;
-
-import java.sql.*;
-import junit.framework.TestCase;
-import org.postgresql.test.TestUtil;
-
-public class ParameterMetaDataTest extends TestCase {
-
- private Connection _conn;
-
- public ParameterMetaDataTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- _conn = TestUtil.openDB();
- TestUtil.createTable(_conn, "parametertest", "a int4, b float8, c text, d point, e timestamp with time zone");
- }
-
- protected void tearDown() throws SQLException {
- TestUtil.dropTable(_conn, "parametertest");
- TestUtil.closeDB(_conn);
- }
-
- public void testParameterMD() throws SQLException {
- if (!TestUtil.isProtocolVersion(_conn, 3))
- return;
-
- PreparedStatement pstmt = _conn.prepareStatement("SELECT a FROM parametertest WHERE b = ? AND c = ? AND d >^ ? ");
- ParameterMetaData pmd = pstmt.getParameterMetaData();
-
- assertEquals(3, pmd.getParameterCount());
- assertEquals(Types.DOUBLE, pmd.getParameterType(1));
- assertEquals("float8", pmd.getParameterTypeName(1));
- assertEquals("java.lang.Double", pmd.getParameterClassName(1));
- assertEquals(Types.VARCHAR, pmd.getParameterType(2));
- assertEquals("text", pmd.getParameterTypeName(2));
- assertEquals("java.lang.String", pmd.getParameterClassName(2));
- assertEquals(Types.OTHER, pmd.getParameterType(3));
- assertEquals("point", pmd.getParameterTypeName(3));
- assertEquals("org.postgresql.geometric.PGpoint", pmd.getParameterClassName(3));
-
- pstmt.close();
- }
-
- public void testFailsOnBadIndex() throws SQLException {
- if (!TestUtil.isProtocolVersion(_conn, 3))
- return;
-
- PreparedStatement pstmt = _conn.prepareStatement("SELECT a FROM parametertest WHERE b = ? AND c = ?");
- ParameterMetaData pmd = pstmt.getParameterMetaData();
- try {
- pmd.getParameterType(0);
- fail("Can't get parameter for index < 1.");
- } catch (SQLException sqle) { }
- try {
- pmd.getParameterType(3);
- fail("Can't get parameter for index 3 with only two parameters.");
- } catch (SQLException sqle) { }
- }
-
- // Make sure we work when mashing two queries into a single statement.
- public void testMultiStatement() throws SQLException {
- if (!TestUtil.isProtocolVersion(_conn, 3))
- return;
-
- PreparedStatement pstmt = _conn.prepareStatement("SELECT a FROM parametertest WHERE b = ? AND c = ? ; SELECT b FROM parametertest WHERE a = ?");
- ParameterMetaData pmd = pstmt.getParameterMetaData();
-
- assertEquals(3, pmd.getParameterCount());
- assertEquals(Types.DOUBLE, pmd.getParameterType(1));
- assertEquals("float8", pmd.getParameterTypeName(1));
- assertEquals(Types.VARCHAR, pmd.getParameterType(2));
- assertEquals("text", pmd.getParameterTypeName(2));
- assertEquals(Types.INTEGER, pmd.getParameterType(3));
- assertEquals("int4", pmd.getParameterTypeName(3));
-
- pstmt.close();
-
- }
-
- // Here we test that we can legally change the resolved type
- // from text to varchar with the complicating factor that there
- // is also an unknown parameter.
- //
- public void testTypeChangeWithUnknown() throws SQLException {
- if (!TestUtil.isProtocolVersion(_conn, 3))
- return;
-
- PreparedStatement pstmt = _conn.prepareStatement("SELECT a FROM parametertest WHERE c = ? AND e = ?");
- ParameterMetaData pmd = pstmt.getParameterMetaData();
-
- pstmt.setString(1, "Hi");
- pstmt.setTimestamp(2, new Timestamp(0L));
-
- ResultSet rs = pstmt.executeQuery();
- rs.close();
- }
-
-}
diff --git a/org/postgresql/test/jdbc3/ResultSetTest.java b/org/postgresql/test/jdbc3/ResultSetTest.java
deleted file mode 100644
index 45699c4..0000000
--- a/org/postgresql/test/jdbc3/ResultSetTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc3;
-
-import java.sql.*;
-import junit.framework.TestCase;
-import org.postgresql.test.TestUtil;
-
-public class ResultSetTest extends TestCase {
-
- private Connection _conn;
-
- public ResultSetTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- _conn = TestUtil.openDB();
- Statement stmt = _conn.createStatement();
- stmt.execute("CREATE TEMP TABLE hold(a int)");
- stmt.execute("INSERT INTO hold VALUES (1)");
- stmt.execute("INSERT INTO hold VALUES (2)");
- stmt.close();
- }
-
- protected void tearDown() throws SQLException {
- Statement stmt = _conn.createStatement();
- stmt.execute("DROP TABLE hold");
- stmt.close();
- TestUtil.closeDB(_conn);
- }
-
- public void testHoldableResultSet() throws SQLException {
- Statement stmt = _conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
-
- _conn.setAutoCommit(false);
- stmt.setFetchSize(1);
-
- ResultSet rs = stmt.executeQuery("SELECT a FROM hold ORDER BY a");
-
- assertTrue(rs.next());
- assertEquals(1, rs.getInt(1));
-
- _conn.commit();
-
- assertTrue(rs.next());
- assertEquals(2, rs.getInt(1));
- assertTrue(!rs.next());
-
- rs.close();
- stmt.close();
- }
-
-}
diff --git a/org/postgresql/test/jdbc3/SendRecvBufferSizeTest.java b/org/postgresql/test/jdbc3/SendRecvBufferSizeTest.java
deleted file mode 100644
index 80d49ac..0000000
--- a/org/postgresql/test/jdbc3/SendRecvBufferSizeTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc3;
-
-import java.sql.*;
-import junit.framework.TestCase;
-
-import org.postgresql.jdbc2.AbstractJdbc2Connection;
-import org.postgresql.test.TestUtil;
-
-public class SendRecvBufferSizeTest extends TestCase {
-
- private Connection _conn;
-
- public SendRecvBufferSizeTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- System.setProperty("sendBufferSize", "1024");
- System.setProperty("receiveBufferSize","1024");
-
- _conn = TestUtil.openDB();
- Statement stmt = _conn.createStatement();
- stmt.execute("CREATE TEMP TABLE hold(a int)");
- stmt.execute("INSERT INTO hold VALUES (1)");
- stmt.execute("INSERT INTO hold VALUES (2)");
- stmt.close();
- }
-
- protected void tearDown() throws SQLException {
- Statement stmt = _conn.createStatement();
- stmt.execute("DROP TABLE hold");
- stmt.close();
- TestUtil.closeDB(_conn);
- }
-
-
- // dummy test
- public void testSelect() throws SQLException {
- Statement stmt = _conn.createStatement();
- stmt.execute("select * from hold");
- stmt.close();
- }
-
-}
\ No newline at end of file
diff --git a/org/postgresql/test/jdbc3/TypesTest.java b/org/postgresql/test/jdbc3/TypesTest.java
deleted file mode 100644
index 17a0987..0000000
--- a/org/postgresql/test/jdbc3/TypesTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc3;
-
-import java.sql.*;
-import junit.framework.TestCase;
-import org.postgresql.test.TestUtil;
-
-public class TypesTest extends TestCase {
-
- private Connection _conn;
-
- public TypesTest(String name) {
- super(name);
- try
- {
- Class.forName("org.postgresql.Driver");
- }
- catch (Exception ex )
- {
-
- }
- }
-
- protected void setUp() throws Exception {
- _conn = TestUtil.openDB();
- Statement stmt = _conn.createStatement();
- stmt.execute("CREATE OR REPLACE FUNCTION return_bool(boolean) RETURNS boolean AS 'BEGIN RETURN $1; END;' LANGUAGE plpgsql");
- stmt.close();
- }
-
- protected void tearDown() throws SQLException {
- Statement stmt = _conn.createStatement();
- stmt.execute("DROP FUNCTION return_bool(boolean)");
- stmt.close();
- TestUtil.closeDB(_conn);
- }
-
- public void testPreparedBoolean() throws SQLException {
- PreparedStatement pstmt = _conn.prepareStatement("SELECT ?,?,?,?");
- pstmt.setNull(1, Types.BOOLEAN);
- pstmt.setObject(2, null, Types.BOOLEAN);
- pstmt.setBoolean(3, true);
- pstmt.setObject(4, Boolean.FALSE);
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertTrue(!rs.getBoolean(1));
- assertTrue(rs.wasNull());
- assertNull(rs.getObject(2));
- assertTrue(rs.getBoolean(3));
- // Only the V3 protocol return will be strongly typed.
- // The V2 path will return a String because it doesn't know
- // any better.
- if (TestUtil.isProtocolVersion(_conn, 3))
- {
- assertTrue(!((Boolean)rs.getObject(4)).booleanValue());
- }
- }
-
- public void testPreparedByte() throws SQLException {
- PreparedStatement pstmt = _conn.prepareStatement("SELECT ?,?");
- pstmt.setByte(1, (byte)1);
- pstmt.setObject(2, new Byte((byte)2));
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- assertEquals((byte)1, rs.getByte(1));
- assertFalse(rs.wasNull());
- assertEquals((byte)2, rs.getByte(2));
- assertFalse(rs.wasNull());
- rs.close();
- pstmt.close();
- }
-
- public void testCallableBoolean() throws SQLException {
- CallableStatement cs = _conn.prepareCall("{? = call return_bool(?)}");
- cs.registerOutParameter(1, Types.BOOLEAN);
- cs.setBoolean(2, true);
- cs.execute();
- assertEquals(true, cs.getBoolean(1));
- cs.close();
- }
- public void testUnknownType() throws SQLException {
- Statement stmt = _conn.createStatement();
-
- ResultSet rs = stmt.executeQuery("select 'foo1' as icon1, 'foo2' as icon2 ");
- assertTrue(rs.next());
- assertTrue("failed returned [" + rs.getString("icon1")+"]",rs.getString("icon1").equalsIgnoreCase("foo1"));
- assertTrue("failed returned [" + rs.getString("icon2")+"]",rs.getString("icon2").equalsIgnoreCase("foo2"));
- }
-
-}
diff --git a/org/postgresql/test/jdbc4/ArrayTest.java b/org/postgresql/test/jdbc4/ArrayTest.java
deleted file mode 100644
index ae23d5c..0000000
--- a/org/postgresql/test/jdbc4/ArrayTest.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2007-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc4;
-
-import java.sql.*;
-import junit.framework.TestCase;
-import org.postgresql.test.TestUtil;
-import org.postgresql.geometric.PGbox;
-
-public class ArrayTest extends TestCase {
-
- private Connection _conn;
-
- public ArrayTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- _conn = TestUtil.openDB();
- TestUtil.createTable(_conn, "arrtest", "intarr int[], decarr decimal(2,1)[], strarr text[]");
- }
-
- protected void tearDown() throws SQLException {
- TestUtil.dropTable(_conn, "arrtest");
- TestUtil.closeDB(_conn);
- }
-
- public void testCreateArrayOfInt() throws SQLException {
- PreparedStatement pstmt = _conn.prepareStatement("SELECT ?::int[]");
- Integer in[] = new Integer[3];
- in[0] = 0;
- in[1] = -1;
- in[2] = 2;
- pstmt.setArray(1, _conn.createArrayOf("int4", in));
-
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- Array arr = rs.getArray(1);
- Integer out[] = (Integer [])arr.getArray();
-
- assertEquals(3, out.length);
- assertEquals(0, out[0].intValue());
- assertEquals(-1, out[1].intValue());
- assertEquals(2, out[2].intValue());
- }
-
- public void testCreateArrayOfMultiString() throws SQLException {
- PreparedStatement pstmt = _conn.prepareStatement("SELECT ?::text[]");
- String in[][] = new String[2][2];
- in[0][0] = "a";
- in[0][1] = "";
- in[1][0] = "\\";
- in[1][1] = "\"\\'z";
- pstmt.setArray(1, _conn.createArrayOf("text", in));
-
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- Array arr = rs.getArray(1);
- String out[][] = (String [][])arr.getArray();
-
- assertEquals(2, out.length);
- assertEquals(2, out[0].length);
- assertEquals("a", out[0][0]);
- assertEquals("", out[0][1]);
- assertEquals("\\", out[1][0]);
- assertEquals("\"\\'z", out[1][1]);
- }
-
- public void testCreateArrayWithNonStandardDelimiter() throws SQLException {
- PGbox in[] = new PGbox[2];
- in[0] = new PGbox(1, 2, 3, 4);
- in[1] = new PGbox(5, 6, 7, 8);
-
- PreparedStatement pstmt = _conn.prepareStatement("SELECT ?::box[]");
- pstmt.setArray(1, _conn.createArrayOf("box", in));
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- Array arr = rs.getArray(1);
- ResultSet arrRs = arr.getResultSet();
- assertTrue(arrRs.next());
- assertEquals(in[0], arrRs.getObject(2));
- assertTrue(arrRs.next());
- assertEquals(in[1], arrRs.getObject(2));
- assertFalse(arrRs.next());
- }
-
-
- public void testCreateArrayOfNull() throws SQLException {
- if (!TestUtil.haveMinimumServerVersion(_conn, "8.2"))
- return;
-
- String sql = "SELECT ?";
- // We must provide the type information for V2 protocol
- if (TestUtil.isProtocolVersion(_conn, 2)) {
- sql = "SELECT ?::int8[]";
- }
-
- PreparedStatement pstmt = _conn.prepareStatement(sql);
- String in[] = new String[2];
- in[0] = null;
- in[1] = null;
- pstmt.setArray(1, _conn.createArrayOf("int8", in));
-
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- Array arr = rs.getArray(1);
- Long out[] = (Long [])arr.getArray();
-
- assertEquals(2, out.length);
- assertNull(out[0]);
- assertNull(out[1]);
- }
-
- public void testCreateEmptyArrayOfIntViaAlias() throws SQLException {
- PreparedStatement pstmt = _conn.prepareStatement("SELECT ?::int[]");
- Integer in[] = new Integer[0];
- pstmt.setArray(1, _conn.createArrayOf("integer", in));
-
- ResultSet rs = pstmt.executeQuery();
- assertTrue(rs.next());
- Array arr = rs.getArray(1);
- Integer out[] = (Integer [])arr.getArray();
-
- assertEquals(0, out.length);
-
- ResultSet arrRs = arr.getResultSet();
- assertFalse(arrRs.next());
- }
-
- public void testCreateArrayWithoutServer() throws SQLException {
- String in[][] = new String[2][2];
- in[0][0] = "a";
- in[0][1] = "";
- in[1][0] = "\\";
- in[1][1] = "\"\\'z";
-
- Array arr = _conn.createArrayOf("varchar", in);
- String out[][] = (String [][])arr.getArray();
-
- assertEquals(2, out.length);
- assertEquals(2, out[0].length);
- assertEquals("a", out[0][0]);
- assertEquals("", out[0][1]);
- assertEquals("\\", out[1][0]);
- assertEquals("\"\\'z", out[1][1]);
- }
-
- public void testCreatePrimitiveArray() throws SQLException {
- double in[][] = new double[2][2];
- in[0][0] = 3.5;
- in[0][1] = -4.5;
- in[1][0] = 10.0/3;
- in[1][1] = 77;
-
- Array arr = _conn.createArrayOf("float8", in);
- Double out[][] = (Double [][])arr.getArray();
-
- assertEquals(2, out.length);
- assertEquals(2, out[0].length);
- assertEquals(3.5, out[0][0], 0.00001);
- assertEquals(-4.5, out[0][1], 0.00001);
- assertEquals(10.0/3, out[1][0], 0.00001);
- assertEquals(77, out[1][1], 0.00001);
- }
-
- public void testSetObjectFromJavaArray() throws SQLException {
- String[] strArray = new String[]{"a","b","c"};
-
- PreparedStatement pstmt = _conn.prepareStatement("INSERT INTO arrtest(strarr) VALUES (?)");
-
- // Incorrect, but commonly attempted by many ORMs:
- try {
- pstmt.setObject(1, strArray, Types.ARRAY);
- pstmt.executeUpdate();
- fail("setObject() with a Java array parameter and Types.ARRAY shouldn't succeed");
- } catch (org.postgresql.util.PSQLException ex) {
- // Expected failure.
- }
-
- // Also incorrect, but commonly attempted by many ORMs:
- try {
- pstmt.setObject(1, strArray);
- pstmt.executeUpdate();
- fail("setObject() with a Java array parameter and no Types argument shouldn't succeed");
- } catch (org.postgresql.util.PSQLException ex) {
- // Expected failure.
- }
-
- // Correct way, though the use of "text" as a type is non-portable.
- // Only supported for JDK 1.6 and JDBC4
- Array sqlArray = _conn.createArrayOf("text", strArray);
- pstmt.setArray(1, sqlArray);
- pstmt.executeUpdate();
-
- pstmt.close();
- }
-}
diff --git a/org/postgresql/test/jdbc4/ConnectionTest.java b/org/postgresql/test/jdbc4/ConnectionTest.java
deleted file mode 100644
index c9c697f..0000000
--- a/org/postgresql/test/jdbc4/ConnectionTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2010-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc4;
-
-import java.sql.*;
-import java.util.Properties;
-import junit.framework.TestCase;
-import org.postgresql.test.TestUtil;
-
-public class ConnectionTest extends TestCase {
-
- private Connection _conn;
-
- public ConnectionTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- _conn = TestUtil.openDB();
- }
-
- protected void tearDown() throws SQLException {
- TestUtil.closeDB(_conn);
- }
-
- private String getAppName() throws SQLException {
- Statement stmt = _conn.createStatement();
- ResultSet rs = stmt.executeQuery("SHOW application_name");
- rs.next();
- String appName = rs.getString(1);
- rs.close();
- stmt.close();
- return appName;
- }
-
- public void testSetAppName() throws SQLException
- {
- if (!TestUtil.haveMinimumServerVersion(_conn, "9.0"))
- return;
-
- _conn.setClientInfo("ApplicationName", "my app");
- assertEquals("my app", getAppName());
- assertEquals("my app", _conn.getClientInfo("ApplicationName"));
- assertEquals("my app", _conn.getClientInfo().getProperty("ApplicationName"));
- }
-
- public void testSetAppNameProps() throws SQLException
- {
- if (!TestUtil.haveMinimumServerVersion(_conn, "9.0"))
- return;
-
- Properties props = new Properties();
- props.put("ApplicationName", "my app");
- _conn.setClientInfo(props);
- assertEquals("my app", getAppName());
- assertEquals("my app", _conn.getClientInfo("ApplicationName"));
- assertEquals("my app", _conn.getClientInfo().getProperty("ApplicationName"));
- }
-
-}
diff --git a/org/postgresql/test/jdbc4/DatabaseMetaDataTest.java b/org/postgresql/test/jdbc4/DatabaseMetaDataTest.java
deleted file mode 100644
index ab26ee1..0000000
--- a/org/postgresql/test/jdbc4/DatabaseMetaDataTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2007-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc4;
-
-import org.postgresql.test.TestUtil;
-import junit.framework.TestCase;
-import java.sql.*;
-
-public class DatabaseMetaDataTest extends TestCase
-{
-
- private Connection _conn;
-
- public DatabaseMetaDataTest(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- _conn = TestUtil.openDB();
- TestUtil.dropSequence(_conn, "sercoltest_a_seq");
- TestUtil.createTable(_conn, "sercoltest", "a serial, b int");
- }
-
- protected void tearDown() throws Exception
- {
- TestUtil.dropSequence(_conn, "sercoltest_a_seq");
- TestUtil.dropTable(_conn, "sercoltest");
- TestUtil.closeDB( _conn );
- }
-
- public void testGetClientInfoProperties() throws Exception
- {
- DatabaseMetaData dbmd = _conn.getMetaData();
-
- ResultSet rs = dbmd.getClientInfoProperties();
- if (!TestUtil.haveMinimumServerVersion(_conn, "9.0")) {
- assertTrue( !rs.next() );
- return;
- }
-
- assertTrue(rs.next());
- assertEquals("ApplicationName", rs.getString("NAME"));
- }
-
- public void testGetColumnsForAutoIncrement() throws Exception
- {
- DatabaseMetaData dbmd = _conn.getMetaData();
-
- ResultSet rs = dbmd.getColumns("%","%","sercoltest", "%");
- assertTrue( rs.next() );
- assertEquals("a", rs.getString("COLUMN_NAME"));
- assertEquals("YES", rs.getString("IS_AUTOINCREMENT"));
-
- assertTrue( rs.next() );
- assertEquals("b", rs.getString("COLUMN_NAME"));
- assertEquals("NO", rs.getString("IS_AUTOINCREMENT"));
-
- assertTrue( !rs.next() );
- }
-
- public void testGetSchemas() throws SQLException
- {
- DatabaseMetaData dbmd = _conn.getMetaData();
-
- ResultSet rs = dbmd.getSchemas("", "publ%");
-
- if (!TestUtil.haveMinimumServerVersion(_conn, "7.3")) {
- assertTrue(!rs.next());
- return;
- }
-
- assertTrue(rs.next());
- assertEquals("public", rs.getString("TABLE_SCHEM"));
- assertNull(rs.getString("TABLE_CATALOG"));
- assertTrue(!rs.next());
- }
-}
diff --git a/org/postgresql/test/jdbc4/Jdbc4TestSuite.java b/org/postgresql/test/jdbc4/Jdbc4TestSuite.java
deleted file mode 100644
index b54d970..0000000
--- a/org/postgresql/test/jdbc4/Jdbc4TestSuite.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2007-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc4;
-
-import junit.framework.TestSuite;
-
-import java.sql.*;
-import org.postgresql.test.TestUtil;
-
-/*
- * Executes all known tests for JDBC4
- */
-public class Jdbc4TestSuite extends TestSuite
-{
-
- /*
- * The main entry point for JUnit
- */
- public static TestSuite suite() throws Exception
- {
- Class.forName("org.postgresql.Driver");
- TestSuite suite = new TestSuite();
-
- suite.addTestSuite(LOBTest.class);
- suite.addTestSuite(DatabaseMetaDataTest.class);
- suite.addTestSuite(ArrayTest.class);
- suite.addTestSuite(ConnectionTest.class);
-
- Connection connection = TestUtil.openDB();
- try
- {
- if (TestUtil.haveMinimumServerVersion(connection, "8.3"))
- {
- suite.addTestSuite(UUIDTest.class);
- if (isXmlEnabled(connection)) {
- suite.addTestSuite(XmlTest.class);
- }
- }
- }
- finally
- {
- connection.close();
- }
-
- return suite;
- }
-
- /**
- * Not all servers will have been complied --with-libxml.
- */
- private static boolean isXmlEnabled(Connection conn) {
- try {
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT '<a>b</a>'::xml");
- rs.close();
- stmt.close();
- return true;
- } catch (SQLException sqle) {
- return false;
- }
- }
-
-}
-
diff --git a/org/postgresql/test/jdbc4/LOBTest.java b/org/postgresql/test/jdbc4/LOBTest.java
deleted file mode 100644
index ea8c765..0000000
--- a/org/postgresql/test/jdbc4/LOBTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2007-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc4;
-
-import java.sql.*;
-import junit.framework.TestCase;
-import org.postgresql.test.TestUtil;
-
-public class LOBTest extends TestCase {
-
- private Connection _conn;
-
- public LOBTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- _conn = TestUtil.openDB();
- Statement stmt = _conn.createStatement();
- stmt.execute("CREATE TEMP TABLE lotest(lo oid)");
- stmt.execute("INSERT INTO lotest VALUES(lo_creat(-1))");
- stmt.close();
- }
-
- protected void tearDown() throws SQLException {
- Statement stmt = _conn.createStatement();
- stmt.execute("DROP TABLE lotest");
- stmt.close();
- TestUtil.closeDB(_conn);
- }
-
- public void testFree() throws SQLException {
- _conn.setAutoCommit(false);
- Statement stmt = _conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT lo FROM lotest");
- assertTrue(rs.next());
-
- Blob blob = rs.getBlob(1);
- blob.free();
- try {
- blob.length();
- fail("Should have thrown an Exception because it was freed.");
- } catch (SQLException sqle) {
- }
- }
-
-}
diff --git a/org/postgresql/test/jdbc4/UUIDTest.java b/org/postgresql/test/jdbc4/UUIDTest.java
deleted file mode 100644
index 55eeae1..0000000
--- a/org/postgresql/test/jdbc4/UUIDTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2008-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc4;
-
-import java.sql.*;
-import java.util.UUID;
-
-import junit.framework.TestCase;
-
-import org.postgresql.test.TestUtil;
-
-public class UUIDTest extends TestCase {
-
- private Connection _conn;
-
- public UUIDTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- _conn = TestUtil.openDB();
- Statement stmt = _conn.createStatement();
- stmt.execute("CREATE TEMP TABLE uuidtest(id uuid)");
- stmt.close();
- }
-
- protected void tearDown() throws SQLException {
- Statement stmt = _conn.createStatement();
- stmt.execute("DROP TABLE uuidtest");
- stmt.close();
- TestUtil.closeDB(_conn);
- }
-
- public void testUUID() throws SQLException {
- UUID uuid = UUID.randomUUID();
- PreparedStatement ps = _conn.prepareStatement("INSERT INTO uuidtest VALUES (?)");
- ps.setObject(1, uuid, Types.OTHER);
- ps.executeUpdate();
- ps.close();
-
- Statement stmt = _conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT id FROM uuidtest");
- assertTrue(rs.next());
-
- UUID uuid2 = (UUID)rs.getObject(1);
- assertEquals(uuid, rs.getObject(1));
- assertEquals(uuid.toString(), rs.getString(1));
-
- rs.close();
- stmt.close();
- }
-
-}
-
diff --git a/org/postgresql/test/jdbc4/XmlTest.java b/org/postgresql/test/jdbc4/XmlTest.java
deleted file mode 100644
index d9b0e22..0000000
--- a/org/postgresql/test/jdbc4/XmlTest.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2008-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.jdbc4;
-
-import java.sql.*;
-
-import junit.framework.TestCase;
-
-import org.postgresql.test.TestUtil;
-
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.io.Reader;
-import java.io.InputStream;
-import java.io.IOException;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stax.StAXSource;
-import org.w3c.dom.Node;
-
-import javax.xml.transform.Transformer;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerException;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stax.StAXResult;
-
-
-public class XmlTest extends TestCase {
-
- private Connection _conn;
- private final Transformer _xslTransformer;
- private final Transformer _identityTransformer;
- private final static String _xsl = "<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"><xsl:output method=\"text\" indent=\"no\" /><xsl:template match=\"/a\"><xsl:for-each select=\"/a/b\">B<xsl:value-of select=\".\" /></xsl:for-each></xsl:template></xsl:stylesheet>";
- private final static String _xmlDocument = "<a><b>1</b><b>2</b></a>";
- private final static String _xmlFragment = "<a>f</a><b>g</b>";
-
-
-
- public XmlTest(String name) throws Exception {
- super(name);
- TransformerFactory factory = TransformerFactory.newInstance();
- _xslTransformer = factory.newTransformer(new StreamSource(new StringReader(_xsl)));
- _xslTransformer.setErrorListener(new Ignorer());
- _identityTransformer = factory.newTransformer();
- }
-
- protected void setUp() throws Exception {
- _conn = TestUtil.openDB();
- Statement stmt = _conn.createStatement();
- stmt.execute("CREATE TEMP TABLE xmltest(id int primary key, val xml)");
- stmt.execute("INSERT INTO xmltest VALUES (1, '" + _xmlDocument + "')");
- stmt.execute("INSERT INTO xmltest VALUES (2, '" + _xmlFragment + "')");
- stmt.close();
- }
-
- protected void tearDown() throws SQLException {
- Statement stmt = _conn.createStatement();
- stmt.execute("DROP TABLE xmltest");
- stmt.close();
- TestUtil.closeDB(_conn);
- }
-
- private ResultSet getRS() throws SQLException {
- Statement stmt = _conn.createStatement();
- return stmt.executeQuery("SELECT val FROM xmltest");
- }
-
- public void testUpdateRS() throws SQLException {
- Statement stmt = _conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
- ResultSet rs = stmt.executeQuery("SELECT id, val FROM xmltest");
- assertTrue(rs.next());
- SQLXML xml = rs.getSQLXML(2);
- rs.updateSQLXML(2, xml);
- rs.updateRow();
- }
-
- public void testDOMParse() throws SQLException {
- ResultSet rs = getRS();
-
- assertTrue(rs.next());
- SQLXML xml = rs.getSQLXML(1);
- DOMSource source = xml.getSource(DOMSource.class);
- Node doc = source.getNode();
- Node root = doc.getFirstChild();
- assertEquals("a", root.getNodeName());
- Node first = root.getFirstChild();
- assertEquals("b", first.getNodeName());
- assertEquals("1", first.getTextContent());
- Node last = root.getLastChild();
- assertEquals("b", last.getNodeName());
- assertEquals("2", last.getTextContent());
-
- assertTrue(rs.next());
- try {
- xml = rs.getSQLXML(1);
- source = xml.getSource(DOMSource.class);
- fail("Can't retrieve a fragment.");
- } catch (SQLException sqle) {
- }
- }
-
- private void transform(Source source) throws Exception {
- StringWriter writer = new StringWriter();
- StreamResult result = new StreamResult(writer);
- _xslTransformer.transform(source, result);
- assertEquals("B1B2", writer.toString());
- }
-
- private <T extends Source> void testRead(Class<T> sourceClass) throws Exception
- {
- ResultSet rs = getRS();
-
- assertTrue(rs.next());
- SQLXML xml = rs.getSQLXML(1);
- Source source = xml.getSource(sourceClass);
- transform(source);
-
- assertTrue(rs.next());
- xml = rs.getSQLXML(1);
- try {
- source = xml.getSource(sourceClass);
- transform(source);
- fail("Can't transform a fragment.");
- } catch (Exception sqle) { }
- }
-
- public void testDOMRead() throws Exception
- {
- testRead(DOMSource.class);
- }
-
- public void testSAXRead() throws Exception
- {
- testRead(SAXSource.class);
- }
-
- public void testStAXRead() throws Exception
- {
- testRead(StAXSource.class);
- }
-
- public void testStreamRead() throws Exception
- {
- testRead(StreamSource.class);
- }
-
- private <T extends Result> void testWrite(Class<T> resultClass) throws Exception
- {
- Statement stmt = _conn.createStatement();
- stmt.execute("DELETE FROM xmltest");
- stmt.close();
-
- PreparedStatement ps = _conn.prepareStatement("INSERT INTO xmltest VALUES (?,?)");
- SQLXML xml = _conn.createSQLXML();
- Result result = xml.setResult(resultClass);
-
- Source source = new StreamSource(new StringReader(_xmlDocument));
- _identityTransformer.transform(source, result);
-
- ps.setInt(1, 1);
- ps.setSQLXML(2, xml);
- ps.executeUpdate();
- ps.close();
-
- ResultSet rs = getRS();
- assertTrue(rs.next());
-
- // DOMResults tack on the additional <?xml ...?> header.
- //
- String header = "";
- if (DOMResult.class.equals(resultClass)) {
- header = "<?xml version=\"1.0\" standalone=\"no\"?>";
- }
-
- assertEquals(header + _xmlDocument, rs.getString(1));
- xml = rs.getSQLXML(1);
- assertEquals(header + _xmlDocument, xml.getString());
-
- assertTrue(!rs.next());
- }
-
- public void testDomWrite() throws Exception
- {
- testWrite(DOMResult.class);
- }
-
- public void testStAXWrite() throws Exception
- {
- testWrite(StAXResult.class);
- }
-
- public void testStreamWrite() throws Exception
- {
- testWrite(StreamResult.class);
- }
-
- public void testSAXWrite() throws Exception
- {
- testWrite(SAXResult.class);
- }
-
- public void testFree() throws SQLException
- {
- ResultSet rs = getRS();
- assertTrue(rs.next());
- SQLXML xml = rs.getSQLXML(1);
- xml.free();
- xml.free();
- try {
- xml.getString();
- fail("Not freed.");
- } catch (SQLException sqle) { }
- }
-
- public void testGetObject() throws SQLException
- {
- ResultSet rs = getRS();
- assertTrue(rs.next());
- SQLXML xml = (SQLXML)rs.getObject(1);
- }
-
- public void testSetNull() throws SQLException
- {
- Statement stmt = _conn.createStatement();
- stmt.execute("DELETE FROM xmltest");
- stmt.close();
-
- PreparedStatement ps = _conn.prepareStatement("INSERT INTO xmltest VALUES (?,?)");
- ps.setInt(1, 1);
- ps.setNull(2, Types.SQLXML);
- ps.executeUpdate();
- ps.setInt(1, 2);
- ps.setObject(2, null, Types.SQLXML);
- ps.executeUpdate();
- SQLXML xml = _conn.createSQLXML();
- xml.setString(null);
- ps.setInt(1, 3);
- ps.setObject(2, xml);
- ps.executeUpdate();
- ps.close();
-
- ResultSet rs = getRS();
- assertTrue(rs.next());
- assertNull(rs.getObject(1));
- assertTrue(rs.next());
- assertNull(rs.getSQLXML(1));
- assertTrue(rs.next());
- assertNull(rs.getSQLXML("val"));
- assertTrue(!rs.next());
- }
-
- public void testEmpty() throws SQLException, IOException {
- SQLXML xml = _conn.createSQLXML();
-
- try {
- xml.getString();
- fail("Cannot retrieve data from an uninitialized object.");
- } catch (SQLException sqle) { }
-
- try {
- xml.getSource(null);
- fail("Cannot retrieve data from an uninitialized object.");
- } catch (SQLException sqle) { }
- }
-
- public void testDoubleSet() throws SQLException
- {
- SQLXML xml = _conn.createSQLXML();
-
- xml.setString("");
-
- try {
- xml.setString("");
- fail("Can't set a value after its been initialized.");
- } catch (SQLException sqle) { }
-
- ResultSet rs = getRS();
- assertTrue(rs.next());
- xml = rs.getSQLXML(1);
- try {
- xml.setString("");
- fail("Can't set a value after its been initialized.");
- } catch (SQLException sqle) { }
- }
-
- // Don't print warning and errors to System.err, it just
- // clutters the display.
- static class Ignorer implements ErrorListener {
- public void error(TransformerException t) { }
- public void fatalError(TransformerException t) { }
- public void warning(TransformerException t) { }
- }
-
-}
-
diff --git a/org/postgresql/test/ssl/SslTest.java b/org/postgresql/test/ssl/SslTest.java
deleted file mode 100644
index 07df2f9..0000000
--- a/org/postgresql/test/ssl/SslTest.java
+++ /dev/null
@@ -1,347 +0,0 @@
-package org.postgresql.test.ssl;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.Map;
-import java.util.Properties;
-import java.util.TreeMap;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.postgresql.test.TestUtil;
-
-public class SslTest extends TestCase {
-
- /**
- * Tries to connect to the database.
- * @param connstr Connection string for the database
- * @param expected Expected values. the first element is a String holding the expected message of PSQLException
- * or null, if no exception is expected, the second indicates weather ssl is to be used (Boolean)
- * @throws SQLException
- */
- protected void driver(String connstr, Object[] expected) throws SQLException
- {
- Connection conn = null;
- String exmsg = (String)expected[0];
- try
- {
- conn = DriverManager.getConnection(connstr, TestUtil.getUser(), TestUtil.getPassword());
- if (exmsg!=null)
- {
- fail("Exception did not occur: "+exmsg);
- }
- //
- ResultSet rs = conn.createStatement().executeQuery("select ssl_is_used()");
- assertTrue(rs.next());
- assertEquals("ssl_is_used: ",((Boolean)expected[1]).booleanValue(), rs.getBoolean(1));
- conn.close();
- }
- catch (SQLException ex) {
- if (conn!=null) { conn.close(); }
- if (exmsg==null)
- { //no exception is excepted
- fail("Exception thrown: "+ex.getMessage());
- } else {
- assertTrue("expected: "+exmsg+" actual: "+ex.getMessage(), ex.getMessage().matches(exmsg));
- return;
- }
- }
- }
-
- protected String certdir;
- protected String connstr;
- protected String sslmode;
- protected int protocol;
- protected boolean goodclient;
- protected boolean goodserver;
- protected String prefix;
- protected Object[] expected;
-
- private String makeConnStr(String sslmode, boolean goodclient, boolean goodserver, int protocol)
- {
- return connstr+"&protocolVersion="+protocol+"&sslmode="+sslmode+
- "&sslcert="+certdir+"/"+prefix+(goodclient?"goodclient.crt":"badclient.crt")+
- "&sslkey="+certdir+"/"+prefix+(goodclient?"goodclient.pk8":"badclient.pk8")+
- "&sslrootcert="+certdir+"/"+prefix+(goodserver?"goodroot.crt":"badroot.crt")+
- "&loglevel="+TestUtil.getLogLevel();
- }
-
- public SslTest(String name, String certdir, String connstr, String sslmode, int protocol, boolean goodclient, boolean goodserver, String prefix, Object[] expected)
- {
- super(name);
- this.certdir = certdir;
- this.connstr = connstr;
- this.sslmode = sslmode;
- this.protocol = protocol;
- this.goodclient = goodclient;
- this.goodserver = goodserver;
- this.prefix = prefix;
- this.expected = expected;
- }
-
- static TestSuite getSuite(Properties prop, String param)
- {
- String certdir = prop.getProperty("certdir");
- String sconnstr = prop.getProperty(param);
- String sprefix = prop.getProperty(param + "prefix");
- String[] csslmode = {"disable","allow","prefer","require","verify-ca","verify-full"};
-
- TestSuite suite = new TestSuite();
- Map expected = (Map)expectedmap.get(param);
- if (expected == null) {;expected = defaultexpected;}
- int j=0;
- for (int i=0; i<csslmode.length; i++)
- {
- suite.addTest(new SslTest(param + "-"+csslmode[i]+"GG2",certdir,sconnstr,csslmode[i],2,true, true,sprefix,(Object[])expected.get(csslmode[i]+"GG")));
- suite.addTest(new SslTest(param + "-"+csslmode[i]+"GG3",certdir,sconnstr,csslmode[i],3,true, true,sprefix,(Object[])expected.get(csslmode[i]+"GG")));
- suite.addTest(new SslTest(param + "-"+csslmode[i]+"GB2",certdir,sconnstr,csslmode[i],2,true,false,sprefix,(Object[])expected.get(csslmode[i]+"GB")));
- suite.addTest(new SslTest(param + "-"+csslmode[i]+"GB3",certdir,sconnstr,csslmode[i],3,true,false,sprefix,(Object[])expected.get(csslmode[i]+"GB")));
- suite.addTest(new SslTest(param + "-"+csslmode[i]+"BG2",certdir,sconnstr,csslmode[i],2,false,true,sprefix,(Object[])expected.get(csslmode[i]+"BG")));
- suite.addTest(new SslTest(param + "-"+csslmode[i]+"BG3",certdir,sconnstr,csslmode[i],3,false,true,sprefix,(Object[])expected.get(csslmode[i]+"BG")));
- }
- return suite;
- }
-
- protected void runTest() throws Throwable {
- driver(makeConnStr(sslmode, goodclient, goodserver, protocol), expected);
- }
-
- static Map expectedmap;
- static TreeMap defaultexpected;
-
- //For some strange reason, the v2 driver begins these error messages by "Connection rejected: " but the v3 does not.
- //Also, for v2 there are two spaces after FATAL:, and the message ends with "\n.".
- static String PG_HBA_ON = "(Connection rejected: )?FATAL: ?no pg_hba.conf entry for host .*, user .*, database .*, SSL on(?s-d:.*)";
- static String PG_HBA_OFF = "(Connection rejected: )?FATAL: ?no pg_hba.conf entry for host .*, user .*, database .*, SSL off(?s-d:.*)";
- static String FAILED = "The connection attempt failed.";
- static String BROKEN = "SSL error: (Broken pipe|Received fatal alert: unknown_ca|Connection reset)";
- static String SSLMODE = "Invalid sslmode value: (allow|prefer)";
- //static String UNKNOWN = "SSL error: Broken pipe";
- //static String UNKNOWN = "SSL error: Received fatal alert: unknown_ca";
- static String ANY = ".*";
- static String VALIDATOR = "SSL error: sun.security.validator.ValidatorException: PKIX path (building|validation) failed:.*";
- static String HOSTNAME = "The hostname .* could not be verified.";
- static
- {
- defaultexpected = new TreeMap();
- defaultexpected.put("disableGG", new Object[]{null,Boolean.FALSE});
- defaultexpected.put("disableGB", new Object[]{null,Boolean.FALSE});
- defaultexpected.put("disableBG", new Object[]{null,Boolean.FALSE});
- defaultexpected.put("allowGG", new Object[]{SSLMODE,Boolean.TRUE});
- defaultexpected.put("allowGB", new Object[]{SSLMODE,Boolean.TRUE});
- defaultexpected.put("allowBG", new Object[]{SSLMODE,Boolean.TRUE});
- defaultexpected.put("preferGG", new Object[]{SSLMODE,Boolean.TRUE});
- defaultexpected.put("preferGB", new Object[]{SSLMODE,Boolean.TRUE});
- defaultexpected.put("preferBG", new Object[]{SSLMODE,Boolean.TRUE});
- defaultexpected.put("requireGG", new Object[]{null,Boolean.TRUE});
- defaultexpected.put("requireGB", new Object[]{null,Boolean.TRUE});
- defaultexpected.put("requireBG", new Object[]{null,Boolean.TRUE});
- defaultexpected.put("verify-caGG", new Object[]{null,Boolean.TRUE});
- defaultexpected.put("verify-caGB", new Object[]{ANY,Boolean.TRUE});
- defaultexpected.put("verify-caBG", new Object[]{null,Boolean.TRUE});
- defaultexpected.put("verify-fullGG", new Object[]{null,Boolean.TRUE});
- defaultexpected.put("verify-fullGB", new Object[]{ANY,Boolean.TRUE});
- defaultexpected.put("verify-fullBG", new Object[]{null,Boolean.TRUE});
-
- expectedmap = new TreeMap();
- TreeMap work;
-
- work=(TreeMap)defaultexpected.clone();
- work.put("disableGG", new Object[]{null,Boolean.FALSE});
- work.put("disableGB", new Object[]{null,Boolean.FALSE});
- work.put("disableBG", new Object[]{null,Boolean.FALSE});
- work.put("allowGG", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("allowGB", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("allowBG", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("preferGG", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("preferGB", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("preferBG", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("requireGG", new Object[]{ANY,Boolean.TRUE});
- work.put("requireGB", new Object[]{ANY,Boolean.TRUE});
- work.put("requireBG", new Object[]{ANY,Boolean.TRUE});
- work.put("verify-caGG", new Object[]{ANY,Boolean.TRUE});
- work.put("verify-caGB", new Object[]{ANY,Boolean.TRUE});
- work.put("verify-caBG", new Object[]{ANY,Boolean.TRUE});
- work.put("verify-fullGG", new Object[]{ANY,Boolean.TRUE});
- work.put("verify-fullGB", new Object[]{ANY,Boolean.TRUE});
- work.put("verify-fullBG", new Object[]{ANY,Boolean.TRUE});
- expectedmap.put("ssloff8",work);
- work=(TreeMap)work.clone();
- expectedmap.put("ssloff9",work);
-
- work=(TreeMap)defaultexpected.clone();
- work.put("disableGG", new Object[]{null,Boolean.FALSE});
- work.put("disableGB", new Object[]{null,Boolean.FALSE});
- work.put("disableBG", new Object[]{null,Boolean.FALSE});
- work.put("allowGG", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("allowGB", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("allowBG", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("preferGG", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("preferGB", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("preferBG", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("requireGG", new Object[]{PG_HBA_ON,Boolean.TRUE});
- work.put("requireGB", new Object[]{PG_HBA_ON,Boolean.TRUE});
- work.put("requireBG", new Object[]{BROKEN,Boolean.TRUE});
- work.put("verify-caGG", new Object[]{PG_HBA_ON,Boolean.TRUE});
- work.put("verify-caGB", new Object[]{VALIDATOR,Boolean.TRUE});
- work.put("verify-caBG", new Object[]{BROKEN,Boolean.TRUE});
- work.put("verify-fullGG", new Object[]{PG_HBA_ON,Boolean.TRUE});
- work.put("verify-fullGB", new Object[]{VALIDATOR,Boolean.TRUE});
- work.put("verify-fullBG", new Object[]{BROKEN,Boolean.TRUE});
- expectedmap.put("sslhostnossl8",work);
- work=(TreeMap)work.clone();
- expectedmap.put("sslhostnossl9",work);
-
- work=(TreeMap)defaultexpected.clone();
- work.put("disableGG", new Object[]{null,Boolean.FALSE});
- work.put("disableGB", new Object[]{null,Boolean.FALSE});
- work.put("disableBG", new Object[]{null,Boolean.FALSE});
- work.put("allowGG", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("allowGB", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("allowBG", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("preferGG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("preferGB", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("preferBG", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("requireGG", new Object[]{null,Boolean.TRUE});
- work.put("requireGB", new Object[]{null,Boolean.TRUE});
- work.put("requireBG", new Object[]{BROKEN,Boolean.TRUE});
- work.put("verify-caGG", new Object[]{null,Boolean.TRUE});
- work.put("verify-caGB", new Object[]{VALIDATOR,Boolean.TRUE});
- work.put("verify-caBG", new Object[]{BROKEN,Boolean.TRUE});
- work.put("verify-fullGG", new Object[]{null,Boolean.TRUE});
- work.put("verify-fullGB", new Object[]{VALIDATOR,Boolean.TRUE});
- work.put("verify-fullBG", new Object[]{BROKEN,Boolean.TRUE});
- expectedmap.put("sslhostgh8",work);
- work=(TreeMap)work.clone();
- expectedmap.put("sslhostgh9",work);
-
- work=(TreeMap)work.clone();
- work.put("disableGG", new Object[]{PG_HBA_OFF,Boolean.FALSE});
- work.put("disableGB", new Object[]{PG_HBA_OFF,Boolean.FALSE});
- work.put("disableBG", new Object[]{PG_HBA_OFF,Boolean.FALSE});
- work.put("allowGG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("allowGB", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("allowBG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("preferBG", new Object[]{SSLMODE,Boolean.FALSE});
- expectedmap.put("sslhostsslgh8",work);
- work=(TreeMap)work.clone();
- expectedmap.put("sslhostsslgh9",work);
-
- work=(TreeMap)defaultexpected.clone();
- work.put("disableGG", new Object[]{null,Boolean.FALSE});
- work.put("disableGB", new Object[]{null,Boolean.FALSE});
- work.put("disableBG", new Object[]{null,Boolean.FALSE});
- work.put("allowGG", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("allowGB", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("allowBG", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("preferGG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("preferGB", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("preferBG", new Object[]{SSLMODE,Boolean.FALSE});
- work.put("requireGG", new Object[]{null,Boolean.TRUE});
- work.put("requireGB", new Object[]{null,Boolean.TRUE});
- work.put("requireBG", new Object[]{BROKEN,Boolean.TRUE});
- work.put("verify-caGG", new Object[]{null,Boolean.TRUE});
- work.put("verify-caGB", new Object[]{VALIDATOR,Boolean.TRUE});
- work.put("verify-caBG", new Object[]{BROKEN,Boolean.TRUE});
- work.put("verify-fullGG", new Object[]{HOSTNAME,Boolean.TRUE});
- work.put("verify-fullGB", new Object[]{VALIDATOR,Boolean.TRUE});
- work.put("verify-fullBG", new Object[]{BROKEN,Boolean.TRUE});
- expectedmap.put("sslhostbh8",work);
- work=(TreeMap)work.clone();
- expectedmap.put("sslhostbh9",work);
-
- work=(TreeMap)work.clone();
- work.put("disableGG", new Object[]{PG_HBA_OFF,Boolean.FALSE});
- work.put("disableGB", new Object[]{PG_HBA_OFF,Boolean.FALSE});
- work.put("disableBG", new Object[]{PG_HBA_OFF,Boolean.FALSE});
- work.put("allowGG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("allowGB", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("allowBG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("preferBG", new Object[]{SSLMODE,Boolean.FALSE});
- expectedmap.put("sslhostsslbh8",work);
- work=(TreeMap)work.clone();
- expectedmap.put("sslhostsslbh9",work);
-
- work=(TreeMap)defaultexpected.clone();
- work.put("disableGG", new Object[]{PG_HBA_OFF,Boolean.FALSE});
- work.put("disableGB", new Object[]{PG_HBA_OFF,Boolean.FALSE});
- work.put("disableBG", new Object[]{PG_HBA_OFF,Boolean.FALSE});
- work.put("allowGG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("allowGB", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("allowBG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("preferGG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("preferGB", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("preferBG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("requireGG", new Object[]{null,Boolean.TRUE});
- work.put("requireGB", new Object[]{null,Boolean.TRUE});
- work.put("requireBG", new Object[]{BROKEN,Boolean.TRUE});
- work.put("verify-caGG", new Object[]{null,Boolean.TRUE});
- work.put("verify-caGB", new Object[]{VALIDATOR,Boolean.TRUE});
- work.put("verify-caBG", new Object[]{BROKEN,Boolean.TRUE});
- work.put("verify-fullGG", new Object[]{null,Boolean.TRUE});
- work.put("verify-fullGB", new Object[]{VALIDATOR,Boolean.TRUE});
- work.put("verify-fullBG", new Object[]{BROKEN,Boolean.TRUE});
- expectedmap.put("sslhostsslcertgh8",work);
- work=(TreeMap)work.clone();
- expectedmap.put("sslhostsslcertgh9",work);
-
- work=(TreeMap)defaultexpected.clone();
- work.put("disableGG", new Object[]{PG_HBA_OFF,Boolean.FALSE});
- work.put("disableGB", new Object[]{PG_HBA_OFF,Boolean.FALSE});
- work.put("disableBG", new Object[]{PG_HBA_OFF,Boolean.FALSE});
- work.put("allowGG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("allowGB", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("allowBG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("preferGG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("preferGB", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("preferBG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("requireGG", new Object[]{null,Boolean.TRUE});
- work.put("requireGB", new Object[]{null,Boolean.TRUE});
- work.put("requireBG", new Object[]{BROKEN,Boolean.TRUE});
- work.put("verify-caGG", new Object[]{null,Boolean.TRUE});
- work.put("verify-caGB", new Object[]{VALIDATOR,Boolean.TRUE});
- work.put("verify-caBG", new Object[]{BROKEN,Boolean.TRUE});
- work.put("verify-fullGG", new Object[]{HOSTNAME,Boolean.TRUE});
- work.put("verify-fullGB", new Object[]{VALIDATOR,Boolean.TRUE});
- work.put("verify-fullBG", new Object[]{BROKEN,Boolean.TRUE});
- expectedmap.put("sslhostsslcertbh8",work);
- work=(TreeMap)work.clone();
- expectedmap.put("sslhostsslcertbh9",work);
-
- work=(TreeMap)defaultexpected.clone();
- work.put("disableGG", new Object[]{PG_HBA_OFF,Boolean.FALSE});
- work.put("disableGB", new Object[]{PG_HBA_OFF,Boolean.FALSE});
- work.put("disableBG", new Object[]{PG_HBA_OFF,Boolean.FALSE});
- work.put("allowGG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("allowGB", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("allowBG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("preferGG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("preferGB", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("preferBG", new Object[]{SSLMODE,Boolean.TRUE});
- work.put("requireGG", new Object[]{null,Boolean.TRUE});
- work.put("requireGB", new Object[]{null,Boolean.TRUE});
- work.put("requireBG", new Object[]{BROKEN,Boolean.TRUE});
- work.put("verify-caGG", new Object[]{null,Boolean.TRUE});
- work.put("verify-caGB", new Object[]{VALIDATOR,Boolean.TRUE});
- work.put("verify-caBG", new Object[]{BROKEN,Boolean.TRUE});
- work.put("verify-fullGG", new Object[]{null,Boolean.TRUE});
- work.put("verify-fullGB", new Object[]{VALIDATOR,Boolean.TRUE});
- work.put("verify-fullBG", new Object[]{BROKEN,Boolean.TRUE});
- expectedmap.put("sslcertgh8",work);
- work=(TreeMap)work.clone();
- expectedmap.put("sslcertgh9",work);
-
- work=(TreeMap)work.clone();
- work.put("verify-fullGG", new Object[]{HOSTNAME,Boolean.TRUE});
- expectedmap.put("sslcertbh8",work);
- work=(TreeMap)work.clone();
- expectedmap.put("sslcertbh9",work);
-
- }
-
-
-
-}
diff --git a/org/postgresql/test/ssl/SslTestSuite.java b/org/postgresql/test/ssl/SslTestSuite.java
deleted file mode 100644
index dc595e9..0000000
--- a/org/postgresql/test/ssl/SslTestSuite.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.postgresql.test.ssl;
-
-import java.io.FileInputStream;
-import java.util.Properties;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestResult;
-import junit.framework.TestSuite;
-
-import org.postgresql.test.TestUtil;
-
-public class SslTestSuite extends TestSuite {
-
- private static void add(TestSuite suite, String param)
- {
- if (prop.getProperty(param,"").equals(""))
- {
- System.out.println("Skipping "+param+".");
- } else {
- suite.addTest(SslTest.getSuite(prop,param));
- }
- }
-
- static Properties prop;
- /*
- * The main entry point for JUnit
- */
- public static TestSuite suite() throws Exception
- {
- TestSuite suite = new TestSuite();
- prop = new Properties();
- prop.load(new FileInputStream(System.getProperty("ssltest.properties")));
- add(suite,"ssloff8");
- add(suite,"sslhostnossl8");
- add(suite,"ssloff9");
- add(suite,"sslhostnossl9");
-
- String[] hostmode = {"sslhost","sslhostssl","sslhostsslcert","sslcert"};
- String[] certmode = {"gh","bh"};
-
- for (int i=0; i<hostmode.length; i++)
- {
- for (int j=0; j<certmode.length; j++)
- {
- add(suite,hostmode[i]+certmode[j]+"8");
- add(suite,hostmode[i]+certmode[j]+"9");
- }
- }
-
- TestUtil.initDriver();
-
- return suite;
- }
-}
diff --git a/org/postgresql/test/util/BrokenInputStream.java b/org/postgresql/test/util/BrokenInputStream.java
deleted file mode 100644
index 424222c..0000000
--- a/org/postgresql/test/util/BrokenInputStream.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.util;
-
-import java.io.InputStream;
-import java.io.IOException;
-
-public class BrokenInputStream extends InputStream {
-
- private InputStream _is;
- private long _numRead;
- private long _breakOn;
-
- public BrokenInputStream(InputStream is, long breakOn) {
- _is = is;
- _breakOn = breakOn;
- _numRead = 0;
- }
-
- public int read() throws IOException {
- if (_breakOn > _numRead++)
- {
- throw new IOException("I was told to break on " + _breakOn);
- }
-
- return _is.read();
- }
-}
diff --git a/org/postgresql/test/util/MiniJndiContext.java b/org/postgresql/test/util/MiniJndiContext.java
deleted file mode 100644
index a0f1c20..0000000
--- a/org/postgresql/test/util/MiniJndiContext.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.util;
-
-import java.util.*;
-import java.rmi.MarshalledObject;
-import java.io.Serializable;
-import javax.naming.*;
-import javax.naming.spi.ObjectFactory;
-
-/**
- * The Context for a trivial JNDI implementation. This is not meant to
- * be very useful, beyond testing JNDI features of the connection
- * pools. It is not a complete JNDI implementations.
- *
- * @author Aaron Mulder (ammulder at chariotsolutions.com)
- */
-public class MiniJndiContext implements Context
-{
- private Map map = new HashMap();
-
- public MiniJndiContext()
- {
- }
-
- public Object lookup(Name name) throws NamingException
- {
- return lookup(name.get(0));
- }
-
- public Object lookup(String name) throws NamingException
- {
- Object o = map.get(name);
- if (o == null)
- {
- return null;
- }
- if (o instanceof Reference)
- {
- Reference ref = (Reference) o;
- try
- {
- Class factoryClass = Class.forName(ref.getFactoryClassName());
- ObjectFactory fac = (ObjectFactory) factoryClass.newInstance();
- Object result = fac.getObjectInstance(ref, null, this, null);
- return result;
- }
- catch (Exception e)
- {
- throw new NamingException("Unable to dereference to object: " + e);
- }
- }
- else if (o instanceof MarshalledObject)
- {
- try
- {
- Object result = ((MarshalledObject) o).get();
- return result;
- }
- catch (java.io.IOException e)
- {
- throw new NamingException("Unable to deserialize object: " + e);
- }
- catch (ClassNotFoundException e)
- {
- throw new NamingException("Unable to deserialize object: " + e);
- }
- }
- else
- {
- throw new NamingException("JNDI Object is neither Referenceable nor Serializable");
- }
- }
-
- public void bind(Name name, Object obj) throws NamingException
- {
- rebind(name.get(0), obj);
- }
-
- public void bind(String name, Object obj) throws NamingException
- {
- rebind(name, obj);
- }
-
- public void rebind(Name name, Object obj) throws NamingException
- {
- rebind(name.get(0), obj);
- }
-
- public void rebind(String name, Object obj) throws NamingException
- {
- if (obj instanceof Referenceable)
- {
- Reference ref = ((Referenceable) obj).getReference();
- map.put(name, ref);
- }
- else if (obj instanceof Serializable)
- {
- try
- {
- MarshalledObject mo = new MarshalledObject(obj);
- map.put(name, mo);
- }
- catch (java.io.IOException e)
- {
- throw new NamingException("Unable to serialize object to JNDI: " + e);
- }
- }
- else
- {
- throw new NamingException("Object to store in JNDI is neither Referenceable nor Serializable");
- }
- }
-
- public void unbind(Name name) throws NamingException
- {
- unbind(name.get(0));
- }
-
- public void unbind(String name) throws NamingException
- {
- map.remove(name);
- }
-
- public void rename(Name oldName, Name newName) throws NamingException
- {
- rename(oldName.get(0), newName.get(0));
- }
-
- public void rename(String oldName, String newName) throws NamingException
- {
- map.put(newName, map.remove(oldName));
- }
-
- public NamingEnumeration list(Name name) throws NamingException
- {
- return null;
- }
-
- public NamingEnumeration list(String name) throws NamingException
- {
- return null;
- }
-
- public NamingEnumeration listBindings(Name name) throws NamingException
- {
- return null;
- }
-
- public NamingEnumeration listBindings(String name) throws NamingException
- {
- return null;
- }
-
- public void destroySubcontext(Name name) throws NamingException
- {
- }
-
- public void destroySubcontext(String name) throws NamingException
- {
- }
-
- public Context createSubcontext(Name name) throws NamingException
- {
- return null;
- }
-
- public Context createSubcontext(String name) throws NamingException
- {
- return null;
- }
-
- public Object lookupLink(Name name) throws NamingException
- {
- return null;
- }
-
- public Object lookupLink(String name) throws NamingException
- {
- return null;
- }
-
- public NameParser getNameParser(Name name) throws NamingException
- {
- return null;
- }
-
- public NameParser getNameParser(String name) throws NamingException
- {
- return null;
- }
-
- public Name composeName(Name name, Name prefix) throws NamingException
- {
- return null;
- }
-
- public String composeName(String name, String prefix)
- throws NamingException
- {
- return null;
- }
-
- public Object addToEnvironment(String propName, Object propVal)
- throws NamingException
- {
- return null;
- }
-
- public Object removeFromEnvironment(String propName)
- throws NamingException
- {
- return null;
- }
-
- public Hashtable getEnvironment() throws NamingException
- {
- return null;
- }
-
- public void close() throws NamingException
- {
- }
-
- public String getNameInNamespace() throws NamingException
- {
- return null;
- }
-}
diff --git a/org/postgresql/test/util/MiniJndiContextFactory.java b/org/postgresql/test/util/MiniJndiContextFactory.java
deleted file mode 100644
index 53596f4..0000000
--- a/org/postgresql/test/util/MiniJndiContextFactory.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.util;
-
-import java.util.*;
-import javax.naming.*;
-import javax.naming.spi.InitialContextFactory;
-
-/**
- * The ICF for a trivial JNDI implementation. This is not meant to
- * be very useful, beyond testing JNDI features of the connection
- * pools.
- *
- * @author Aaron Mulder (ammulder at chariotsolutions.com)
- */
-public class MiniJndiContextFactory implements InitialContextFactory
-{
- public Context getInitialContext(Hashtable environment)
- throws NamingException
- {
- return new MiniJndiContext();
- }
-}
diff --git a/org/postgresql/test/xa/XADataSourceTest.java b/org/postgresql/test/xa/XADataSourceTest.java
deleted file mode 100644
index 086f925..0000000
--- a/org/postgresql/test/xa/XADataSourceTest.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2009-2011, PostgreSQL Global Development Group
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.xa;
-
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.Arrays;
-import java.util.Random;
-
-import javax.sql.XAConnection;
-import javax.sql.XADataSource;
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-
-
-import org.postgresql.test.TestUtil;
-import org.postgresql.test.jdbc2.optional.BaseDataSourceTest;
-import org.postgresql.xa.PGXADataSource;
-
-import junit.framework.TestCase;
-
-public class XADataSourceTest extends TestCase {
-
- private XADataSource _ds;
-
- private Connection _conn;
-
- private XAConnection xaconn;
- private XAResource xaRes;
- private Connection conn;
-
- public XADataSourceTest(String name) {
- super(name);
-
- _ds = new PGXADataSource();
- BaseDataSourceTest.setupDataSource((PGXADataSource)_ds);
- }
-
- protected void setUp() throws Exception {
- _conn = TestUtil.openDB();
-
- TestUtil.createTable(_conn, "testxa1", "foo int");
-
- clearAllPrepared();
-
- xaconn = _ds.getXAConnection();
- xaRes = xaconn.getXAResource();
- conn = xaconn.getConnection();
- }
-
- protected void tearDown() throws SQLException {
- xaconn.close();
- clearAllPrepared();
-
- TestUtil.dropTable(_conn, "testxa1");
- TestUtil.closeDB(_conn);
-
- }
-
- private void clearAllPrepared() throws SQLException
- {
- Statement st = _conn.createStatement();
- try
- {
- ResultSet rs = st.executeQuery("SELECT gid FROM pg_prepared_xacts");
-
- Statement st2 = _conn.createStatement();
- while (rs.next())
- {
- st2.executeUpdate("ROLLBACK PREPARED '" + rs.getString(1) + "'");
- }
- st2.close();
- }
- finally
- {
- st.close();
- }
- }
-
- static class CustomXid implements Xid {
- private static Random rand = new Random(System.currentTimeMillis());
- byte[] gtrid = new byte[Xid.MAXGTRIDSIZE];
- byte[] bqual = new byte[Xid.MAXBQUALSIZE];
-
- CustomXid(int i)
- {
- rand.nextBytes(gtrid);
- gtrid[0] = (byte)i;
- gtrid[1] = (byte)i;
- gtrid[2] = (byte)i;
- gtrid[3] = (byte)i;
- gtrid[4] = (byte)i;
- bqual[0] = 4;
- bqual[1] = 5;
- bqual[2] = 6;
- }
-
- public int getFormatId() {
- return 0;
- }
-
-
- public byte[] getGlobalTransactionId() {
- return gtrid;
- }
-
- public byte[] getBranchQualifier() {
- return bqual;
- }
- public boolean equals(Object o) {
- Xid other = (Xid)o;
- if (other.getFormatId() != this.getFormatId())
- return false;
- if (!Arrays.equals(other.getBranchQualifier(), this.getBranchQualifier()))
- return false;
- if (!Arrays.equals(other.getGlobalTransactionId(), this.getGlobalTransactionId()))
- return false;
-
- return true;
- }
- }
-
- public void testOnePhase() throws Exception {
- Xid xid = new CustomXid(1);
- xaRes.start(xid, XAResource.TMNOFLAGS);
- conn.createStatement().executeQuery("SELECT * FROM testxa1");
- xaRes.end(xid, XAResource.TMSUCCESS);
- xaRes.commit(xid, true);
- }
-
- public void testTwoPhaseCommit() throws Exception {
- Xid xid = new CustomXid(1);
- xaRes.start(xid, XAResource.TMNOFLAGS);
- conn.createStatement().executeQuery("SELECT * FROM testxa1");
- xaRes.end(xid, XAResource.TMSUCCESS);
- xaRes.prepare(xid);
- xaRes.commit(xid, false);
- }
-
- public void testCloseBeforeCommit() throws Exception {
- Xid xid = new CustomXid(5);
- xaRes.start(xid, XAResource.TMNOFLAGS);
- assertEquals(1, conn.createStatement().executeUpdate("INSERT INTO testxa1 VALUES (1)"));
- conn.close();
- xaRes.end(xid, XAResource.TMSUCCESS);
- xaRes.commit(xid, true);
-
- ResultSet rs = _conn.createStatement().executeQuery("SELECT foo FROM testxa1");
- assertTrue(rs.next());
- assertEquals(1, rs.getInt(1));
- }
-
- public void testRecover() throws Exception {
- Xid xid = new CustomXid(12345);
- xaRes.start(xid, XAResource.TMNOFLAGS);
- conn.createStatement().executeQuery("SELECT * FROM testxa1");
- xaRes.end(xid, XAResource.TMSUCCESS);
- xaRes.prepare(xid);
-
- {
- Xid[] recoveredXidArray = xaRes.recover(XAResource.TMSTARTRSCAN);
-
- boolean recoveredXid = false;
-
- for (int i = 0; i < recoveredXidArray.length; i++)
- {
- if (xid.equals(recoveredXidArray[i]))
- {
- recoveredXid = true;
- break;
- }
- }
-
- assertTrue("Did not recover prepared xid", recoveredXid);
- assertEquals(0, xaRes.recover(XAResource.TMNOFLAGS).length);
- }
-
- xaRes.rollback(xid);
-
- {
- Xid[] recoveredXidArray = xaRes.recover(XAResource.TMSTARTRSCAN);
-
- boolean recoveredXid = false;
-
- for (int c = 0; c < recoveredXidArray.length; c++)
- {
- if (xaRes.equals(recoveredXidArray[c]))
- {
- recoveredXid = true;
- break;
- }
- }
-
- assertFalse("Recovered rolled back xid", recoveredXid);
- }
- }
-
- public void testRollback() throws XAException {
- Xid xid = new CustomXid(3);
-
- xaRes.start(xid, XAResource.TMNOFLAGS);
- xaRes.end(xid, XAResource.TMSUCCESS);
- xaRes.prepare(xid);
- xaRes.rollback(xid);
- }
-
- public void testRollbackWithoutPrepare() throws XAException {
- Xid xid = new CustomXid(4);
-
- xaRes.start(xid, XAResource.TMNOFLAGS);
- xaRes.end(xid, XAResource.TMSUCCESS);
- xaRes.rollback(xid);
- }
-
- public void testAutoCommit() throws Exception {
- Xid xid = new CustomXid(6);
-
- // When not in an XA transaction, autocommit should be true
- // per normal JDBC rules.
- assertTrue(conn.getAutoCommit());
-
- // When in an XA transaction, autocommit should be false
- xaRes.start(xid, XAResource.TMNOFLAGS);
- assertFalse(conn.getAutoCommit());
- xaRes.end(xid, XAResource.TMSUCCESS);
- assertFalse(conn.getAutoCommit());
- xaRes.commit(xid, true);
- assertTrue(conn.getAutoCommit());
-
- xaRes.start(xid, XAResource.TMNOFLAGS);
- xaRes.end(xid, XAResource.TMSUCCESS);
- xaRes.prepare(xid);
- assertTrue(conn.getAutoCommit());
- xaRes.commit(xid, false);
- assertTrue(conn.getAutoCommit());
-
- // Check that autocommit is reset to true after a 1-phase rollback
- xaRes.start(xid, XAResource.TMNOFLAGS);
- xaRes.end(xid, XAResource.TMSUCCESS);
- xaRes.rollback(xid);
- assertTrue(conn.getAutoCommit());
-
- // Check that autocommit is reset to true after a 2-phase rollback
- xaRes.start(xid, XAResource.TMNOFLAGS);
- xaRes.end(xid, XAResource.TMSUCCESS);
- xaRes.prepare(xid);
- xaRes.rollback(xid);
- assertTrue(conn.getAutoCommit());
-
- // Check that autoCommit is set correctly after a getConnection-call
- conn = xaconn.getConnection();
- assertTrue(conn.getAutoCommit());
-
- xaRes.start(xid, XAResource.TMNOFLAGS);
-
- conn.createStatement().executeQuery("SELECT * FROM testxa1");
-
- java.sql.Timestamp ts1 = getTransactionTimestamp(conn);
-
- conn.close();
- conn = xaconn.getConnection();
- assertFalse(conn.getAutoCommit());
-
- java.sql.Timestamp ts2 = getTransactionTimestamp(conn);
-
- /* Check that we're still in the same transaction.
- * close+getConnection() should not rollback the XA-transaction
- * implicitly.
- */
- assertEquals(ts1, ts2);
-
- xaRes.end(xid, XAResource.TMSUCCESS);
- xaRes.prepare(xid);
- xaRes.rollback(xid);
- assertTrue(conn.getAutoCommit());
- }
-
- /**
- * Get the time the current transaction was started from the server.
- *
- * This can be used to check that transaction doesn't get committed/
- * rolled back inadvertently, by calling this once before and after the
- * suspected piece of code, and check that they match. It's a bit iffy,
- * conceivably you might get the same timestamp anyway if the
- * suspected piece of code runs fast enough, and/or the server clock
- * is very coarse grained. But it'll do for testing purposes.
- */
- private static java.sql.Timestamp getTransactionTimestamp(Connection conn) throws SQLException
- {
- ResultSet rs = conn.createStatement().executeQuery("SELECT now()");
- rs.next();
- return rs.getTimestamp(1);
- }
-
- public void testEndThenJoin() throws XAException {
- Xid xid = new CustomXid(5);
-
- xaRes.start(xid, XAResource.TMNOFLAGS);
- xaRes.end(xid, XAResource.TMSUCCESS);
- xaRes.start(xid, XAResource.TMJOIN);
- xaRes.end(xid, XAResource.TMSUCCESS);
- xaRes.commit(xid, true);
- }
-
- public void testRestoreOfAutoCommit() throws Exception {
- conn.setAutoCommit(false);
-
- Xid xid = new CustomXid(14);
- xaRes.start(xid, XAResource.TMNOFLAGS);
- xaRes.end(xid, XAResource.TMSUCCESS);
- xaRes.commit(xid, true);
-
- assertTrue(!conn.getAutoCommit());
- }
-
-
- /* We don't support transaction interleaving.
- public void testInterleaving1() throws Exception {
- Xid xid1 = new CustomXid(1);
- Xid xid2 = new CustomXid(2);
-
- xaRes.start(xid1, XAResource.TMNOFLAGS);
- conn.createStatement().executeUpdate("UPDATE testxa1 SET foo = 'ccc'");
- xaRes.end(xid1, XAResource.TMSUCCESS);
-
- xaRes.start(xid2, XAResource.TMNOFLAGS);
- conn.createStatement().executeUpdate("UPDATE testxa2 SET foo = 'bbb'");
-
- xaRes.commit(xid1, true);
-
- xaRes.end(xid2, XAResource.TMSUCCESS);
-
- xaRes.commit(xid2, true);
-
- }
- public void testInterleaving2() throws Exception {
- Xid xid1 = new CustomXid(1);
- Xid xid2 = new CustomXid(2);
- Xid xid3 = new CustomXid(3);
-
- xaRes.start(xid1, XAResource.TMNOFLAGS);
- conn.createStatement().executeUpdate("UPDATE testxa1 SET foo = 'aa'");
- xaRes.end(xid1, XAResource.TMSUCCESS);
-
- xaRes.start(xid2, XAResource.TMNOFLAGS);
- conn.createStatement().executeUpdate("UPDATE testxa2 SET foo = 'bb'");
- xaRes.end(xid2, XAResource.TMSUCCESS);
-
- xaRes.start(xid3, XAResource.TMNOFLAGS);
- conn.createStatement().executeUpdate("UPDATE testxa3 SET foo = 'cc'");
- xaRes.end(xid3, XAResource.TMSUCCESS);
-
- xaRes.commit(xid1, true);
- xaRes.commit(xid2, true);
- xaRes.commit(xid3, true);
- }
- */
-}
diff --git a/org/postgresql/test/xa/XATestSuite.java b/org/postgresql/test/xa/XATestSuite.java
deleted file mode 100644
index b27c3b1..0000000
--- a/org/postgresql/test/xa/XATestSuite.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2009-2011, PostgreSQL Global Development Group
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.test.xa;
-
-import java.sql.Connection;
-import java.sql.Statement;
-import java.sql.ResultSet;
-
-import junit.framework.TestSuite;
-
-import org.postgresql.test.TestUtil;
-
-public class XATestSuite extends TestSuite {
- public static TestSuite suite() throws Exception {
- Class.forName("org.postgresql.Driver");
- TestSuite suite = new TestSuite();
- Connection connection = TestUtil.openDB();
-
- try
- {
- if (TestUtil.haveMinimumServerVersion(connection, "8.1"))
- {
- Statement stmt = connection.createStatement();
- ResultSet rs = stmt.executeQuery("SHOW max_prepared_transactions");
- rs.next();
- int mpt = rs.getInt(1);
- if (mpt > 0) {
- suite.addTestSuite(XADataSourceTest.class);
- } else {
- System.out.println("Skipping XA tests because max_prepared_transactions = 0.");
- }
- rs.close();
- stmt.close();
- }
- }
- finally
- {
- connection.close();
- }
- return suite;
- }
-}
diff --git a/org/postgresql/translation/bg.po b/org/postgresql/translation/bg.po
deleted file mode 100755
index 0bf84c7..0000000
--- a/org/postgresql/translation/bg.po
+++ /dev/null
@@ -1,1519 +0,0 @@
-# Bulgarian language translation for the PostgreSQL JDBC driver
-# This file is distributed under the same license as the package.
-# First author: Viktor Usunov <usun0v at mail.bg>, 2009.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: JDBC Driver for PostgreSQL 8.x\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-10-31 13:37+0000\n"
-"PO-Revision-Date: 2009-12-28 00:01+0100\n"
-"Last-Translator: <usun0v at mail.bg>\n"
-"Language-Team: <bg at li.org>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Poedit-Language: Bulgarian\n"
-"X-Poedit-Country: BULGARIA\n"
-
-#: org/postgresql/Driver.java.in:235
-msgid "Error loading default settings from driverconfig.properties"
-msgstr ""
-"Грешка при зареждане на настройките по подразбиране от файла driverconfig."
-"properties"
-
-#: org/postgresql/Driver.java.in:282
-msgid ""
-"Your security policy has prevented the connection from being attempted. You "
-"probably need to grant the connect java.net.SocketPermission to the database "
-"server host and port that you wish to connect to."
-msgstr ""
-"Връзката не бе осъществена, поради вашите настройки за сигурност. Може би "
-"трябва да предоставите java.net.SocketPermission права на сървъра и порта с "
-"базата данни, към който искате да се свържете."
-
-#: org/postgresql/Driver.java.in:287 org/postgresql/Driver.java.in:351
-msgid ""
-"Something unusual has occurred to cause the driver to fail. Please report "
-"this exception."
-msgstr ""
-"Възникна неочаквана грешка с драйвъра. Моля докадвайте това изключение. "
-
-#: org/postgresql/Driver.java.in:359
-msgid "Connection attempt timed out."
-msgstr "Времето за осъществяване на връзката изтече (таймаут)."
-
-#: org/postgresql/Driver.java.in:372
-msgid "Interrupted while attempting to connect."
-msgstr "Опита за осъществяване на връзка бе своевременно прекъснат. "
-
-#: org/postgresql/Driver.java.in:714
-#, java-format
-msgid "Method {0} is not yet implemented."
-msgstr "Методът {0} все още не е функционален."
-
-#: org/postgresql/copy/CopyManager.java:56
-#, java-format
-msgid "Requested CopyIn but got {0}"
-msgstr "Зададено CopyIn но получено {0}"
-
-#: org/postgresql/copy/CopyManager.java:67
-#, java-format
-msgid "Requested CopyOut but got {0}"
-msgstr "Зададено CopyOut но получено {0}"
-
-#: org/postgresql/copy/PGCopyInputStream.java:51
-#, java-format
-msgid "Copying from database failed: {0}"
-msgstr "Копирането от базата данни бе неуспешно: {0}"
-
-#: org/postgresql/copy/PGCopyInputStream.java:67
-#: org/postgresql/copy/PGCopyOutputStream.java:90
-msgid "This copy stream is closed."
-msgstr "Потока за копиране на данните е затворен."
-
-#: org/postgresql/copy/PGCopyInputStream.java:108
-msgid "Read from copy failed."
-msgstr "Четене от копието неуспешно."
-
-#: org/postgresql/copy/PGCopyOutputStream.java:68
-#, java-format
-msgid "Cannot write to copy a byte of value {0}"
-msgstr "Няма пишещи права, за да копира байтова стойност {0}"
-
-#: org/postgresql/core/ConnectionFactory.java:69
-#, java-format
-msgid "A connection could not be made using the requested protocol {0}."
-msgstr "Не може да осъществи връзка, ползвайки искания протокол {0}."
-
-#: org/postgresql/core/Oid.java:113
-#, java-format
-msgid "oid type {0} not known and not a number"
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:490
-#, java-format
-msgid "Premature end of input stream, expected {0} bytes, but only read {1}."
-msgstr ""
-"Преждевременен край на входящ поток на данни, очаквани {0} байта, но "
-"прочетени само {1}."
-
-#: org/postgresql/core/PGStream.java:530
-#, java-format
-msgid "Expected an EOF from server, got: {0}"
-msgstr "Очакван край на файла от сървъра, но получено: {0}"
-
-#: org/postgresql/core/SetupQueryRunner.java:86
-msgid "An unexpected result was returned by a query."
-msgstr "Заявката върна неочакван резултат."
-
-#: org/postgresql/core/UTF8Encoding.java:28
-#, java-format
-msgid ""
-"Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}"
-msgstr ""
-"Невалидна UTF-8 последователност: байта {0} от байтова последователност {1} "
-"не е 10xxxxxx: {2}"
-
-#: org/postgresql/core/UTF8Encoding.java:61
-#, java-format
-msgid "Illegal UTF-8 sequence: {0} bytes used to encode a {1} byte value: {2}"
-msgstr ""
-"Невалидна UTF-8 последователност: {0} байта използвани за кодирането на {1} "
-"байтова стойност: {2}"
-
-#: org/postgresql/core/UTF8Encoding.java:98
-#: org/postgresql/core/UTF8Encoding.java:125
-#, java-format
-msgid "Illegal UTF-8 sequence: initial byte is {0}: {1}"
-msgstr "Невалидна UTF-8 последователност: първоначален байт е {0}: {1}"
-
-#: org/postgresql/core/UTF8Encoding.java:130
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is out of range: {0}"
-msgstr ""
-"Невалидна UTF-8 последователност: крайната стойност е извън стойностните "
-"граници: {0}"
-
-#: org/postgresql/core/UTF8Encoding.java:145
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is a surrogate value: {0}"
-msgstr ""
-"Невалидна UTF-8 последователност: крайната стойност е заместителна стойност: "
-"{0}"
-
-#: org/postgresql/core/Utils.java:95 org/postgresql/core/Utils.java:112
-msgid "Zero bytes may not occur in string parameters."
-msgstr "Не може да има нула байта в низ параметрите."
-
-#: org/postgresql/core/Utils.java:145
-msgid "Zero bytes may not occur in identifiers."
-msgstr "Не може да има нула байта в идентификаторите."
-
-#: org/postgresql/core/types/PGBigDecimal.java:63
-#: org/postgresql/core/types/PGBoolean.java:62
-#: org/postgresql/core/types/PGByte.java:63
-#: org/postgresql/core/types/PGDouble.java:64
-#: org/postgresql/core/types/PGFloat.java:64
-#: org/postgresql/core/types/PGInteger.java:61
-#: org/postgresql/core/types/PGLong.java:62
-#: org/postgresql/core/types/PGNumber.java:62
-#: org/postgresql/core/types/PGShort.java:58
-#: org/postgresql/core/types/PGString.java:73
-#, java-format
-msgid "Cannot convert an instance of {0} to type {1}"
-msgstr "Не може да преобразува инстанцията на {0} във вида {1}"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:66
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:74
-#, fuzzy, java-format
-msgid "Invalid sslmode value: {0}"
-msgstr "Невалидна дължина {0} на потока данни."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:134
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:207
-msgid ""
-"Connection refused. Check that the hostname and port are correct and that "
-"the postmaster is accepting TCP/IP connections."
-msgstr ""
-"Връзката отказана. Проверете дали името на хоста и порта са верни и дали "
-"postmaster приема ТСР / IP връзки."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:153
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:225
-msgid "The connection attempt failed."
-msgstr "Опита за връзка бе неуспешен."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:175
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:246
-#, fuzzy
-msgid "The connection url is invalid."
-msgstr "Опита за връзка бе неуспешен."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:198
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:210
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:295
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:307
-msgid "The server does not support SSL."
-msgstr "Сървърът не поддържа SSL."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:223
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:320
-msgid "An error occurred while setting up the SSL connection."
-msgstr "Възникна грешка при осъществяване на SSL връзката."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:272
-#, java-format
-msgid "Connection rejected: {0}."
-msgstr "Връзката отказана: {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:290
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:312
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:332
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:419
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:444
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:471
-msgid ""
-"The server requested password-based authentication, but no password was "
-"provided."
-msgstr "Сървърът изисква идентифициране с парола, но парола не бе въведена."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:356
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:504
-#, java-format
-msgid ""
-"The authentication type {0} is not supported. Check that you have configured "
-"the pg_hba.conf file to include the client''s IP address or subnet, and that "
-"it is using an authentication scheme supported by the driver."
-msgstr ""
-"Тип на удостоверяване {0} не се поддържа. Проверете дали сте конфигурирали "
-"pg_hba.conf файла, да включва IP адреса на клиента или подмрежата, и че се "
-"използва схема за удостоверяване, поддържана от драйвъра."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:362
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:400
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:510
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:553
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:599
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:609
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:618
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:626
-#: org/postgresql/gss/MakeGSS.java:158
-msgid "Protocol error. Session setup failed."
-msgstr "Грешка в протокола. Неуспешна настройка на сесията."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:390
-#, java-format
-msgid "Backend start-up failed: {0}."
-msgstr "Неуспешен опит за стартиране на backend: {0}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:55
-#: org/postgresql/core/v2/FastpathParameterList.java:77
-#: org/postgresql/core/v2/FastpathParameterList.java:84
-#: org/postgresql/core/v2/SimpleParameterList.java:57
-#: org/postgresql/core/v2/SimpleParameterList.java:76
-#: org/postgresql/core/v2/SimpleParameterList.java:83
-#: org/postgresql/core/v2/SimpleParameterList.java:90
-#: org/postgresql/core/v3/CompositeParameterList.java:35
-#: org/postgresql/core/v3/SimpleParameterList.java:49
-#: org/postgresql/core/v3/SimpleParameterList.java:56
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2845
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java:419
-#, java-format
-msgid "The column index is out of range: {0}, number of columns: {1}."
-msgstr "Индексът на колоната е извън стойностен обхват: {0}, брой колони: {1}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:142
-#: org/postgresql/core/v2/SimpleParameterList.java:155
-#: org/postgresql/core/v3/SimpleParameterList.java:216
-#, java-format
-msgid "No value specified for parameter {0}."
-msgstr "Няма стойност, определена за параметър {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:72
-#: org/postgresql/core/v2/QueryExecutorImpl.java:337
-#: org/postgresql/core/v3/QueryExecutorImpl.java:443
-#: org/postgresql/core/v3/QueryExecutorImpl.java:507
-#, java-format
-msgid "Expected command status BEGIN, got {0}."
-msgstr "Очаквана команда BEGIN, получена {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:78
-#: org/postgresql/core/v3/QueryExecutorImpl.java:513
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1828
-#, java-format
-msgid "Unexpected command status: {0}."
-msgstr "Неочакван статус на команда: {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:118
-#: org/postgresql/core/v2/QueryExecutorImpl.java:129
-#: org/postgresql/core/v2/QueryExecutorImpl.java:174
-#: org/postgresql/core/v2/QueryExecutorImpl.java:369
-#: org/postgresql/core/v3/QueryExecutorImpl.java:281
-#: org/postgresql/core/v3/QueryExecutorImpl.java:411
-#: org/postgresql/core/v3/QueryExecutorImpl.java:485
-#: org/postgresql/core/v3/QueryExecutorImpl.java:551
-#: org/postgresql/core/v3/QueryExecutorImpl.java:631
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2094
-#, fuzzy
-msgid "An I/O error occured while sending to the backend."
-msgstr "Входно/изходна грешка при изпращане към backend."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:170
-#: org/postgresql/core/v2/QueryExecutorImpl.java:225
-#: org/postgresql/core/v2/QueryExecutorImpl.java:236
-#: org/postgresql/core/v3/QueryExecutorImpl.java:627
-#: org/postgresql/core/v3/QueryExecutorImpl.java:685
-#, java-format
-msgid "Unknown Response Type {0}."
-msgstr "Неизвестен тип на отговор {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:430
-#: org/postgresql/core/v2/QueryExecutorImpl.java:475
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1857
-msgid "Ran out of memory retrieving query results."
-msgstr "Недостатъчна памет при представяна на резултатите от заявката."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:597
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2199
-#, java-format
-msgid "Unable to interpret the update count in command completion tag: {0}."
-msgstr ""
-"Не може да осъществи актуализация на брояча при командно допълнение: {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:610
-msgid "Copy not implemented for protocol version 2"
-msgstr "Копирането не е възможно при версия 2 на протокола"
-
-#: org/postgresql/core/v3/CopyOperationImpl.java:56
-msgid "CommandComplete expected COPY but got: "
-msgstr "Очаквано командно допълнение COPY но получено: "
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:66
-msgid "Tried to obtain lock while already holding it"
-msgstr "Опит за получаване на заключване/резервация докато вече е получено"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:78
-msgid "Tried to break lock on database connection"
-msgstr ""
-"Опит за премахване на заключването/резервацията при връзка към базата данни"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:93
-msgid "Interrupted while waiting to obtain lock on database connection"
-msgstr ""
-"Прекъсване при чакане да получи заключване/резервация при връзка към базата "
-"данни"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:275
-msgid "Unable to bind parameter values for statement."
-msgstr "Не може да подготви параметрите на командата."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:726
-msgid "Database connection failed when starting copy"
-msgstr "Неосъществена връзка към базата данни при започване на копирането"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:757
-msgid "Tried to cancel an inactive copy operation"
-msgstr "Опит за прекъсване на неактивно копиране"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:794
-msgid "Database connection failed when canceling copy operation"
-msgstr "Неосъществена връзка към базата данни при прекъсване на копирането"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:799
-msgid "Missing expected error response to copy cancel request"
-msgstr "Липсва очакван отговор при грешка да прекъсне копирането"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:801
-#, java-format
-msgid "Got {0} error responses to single copy cancel request"
-msgstr ""
-"Получени {0} отговори за грешка при единствено искане да се прекъсне "
-"копирането"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:814
-msgid "Tried to end inactive copy"
-msgstr "Опит за прекъсване на неактивно копиране"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:827
-msgid "Database connection failed when ending copy"
-msgstr "Неосъществена връзка към базата данни при завършване на копирането"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:842
-#: org/postgresql/core/v3/QueryExecutorImpl.java:860
-msgid "Tried to write to an inactive copy operation"
-msgstr "Опит за писане при неактивна операция за копиране"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:854
-#: org/postgresql/core/v3/QueryExecutorImpl.java:866
-msgid "Database connection failed when writing to copy"
-msgstr "Неосъществена връзка към базата данни при опит за копиране"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:878
-msgid "Tried to read from inactive copy"
-msgstr "Опит за четене при неактивно копиране"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:883
-msgid "Database connection failed when reading from copy"
-msgstr "Неосъществена връзка към базата данни при четене от копие"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:951
-#, java-format
-msgid "Received CommandComplete ''{0}'' without an active copy operation"
-msgstr "Получено командно допълнение ''{0}'' без активна команда за копиране"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:975
-#, java-format
-msgid "Got CopyInResponse from server during an active {0}"
-msgstr "Получен CopyInResponse отговор от сървъра при активно {0}"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:988
-#, java-format
-msgid "Got CopyOutResponse from server during an active {0}"
-msgstr "Получен CopyOutResponse отговор от сървъра при активно {0}"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1003
-msgid "Got CopyData without an active copy operation"
-msgstr "Получено CopyData без наличие на активна операция за копиране"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1005
-#, java-format
-msgid "Unexpected copydata from server for {0}"
-msgstr "Неочаквано CopyData от сървъра за {0}"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1056
-#, java-format
-msgid "Unexpected packet type during copy: {0}"
-msgstr "Неочакван тип пакет при копиране: {0}"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1310
-#, java-format
-msgid ""
-"Bind message length {0} too long. This can be caused by very large or "
-"incorrect length specifications on InputStream parameters."
-msgstr ""
-"Прекалено голяма дължина {0} на съобщението. Това може да е причинено от "
-"прекалено голяма или неправилно зададена дължина на InputStream параметри."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1925
-#, fuzzy, java-format
-msgid ""
-"The server''s client_encoding parameter was changed to {0}. The JDBC driver "
-"requires client_encoding to be UTF8 for correct operation."
-msgstr ""
-"Параметърът client_encoding при сървъра бе променен на {0}. JDBC драйвъра "
-"изисква client_encoding да бъде UNICODE за да функционира правилно."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1932
-#, java-format
-msgid ""
-"The server''s DateStyle parameter was changed to {0}. The JDBC driver "
-"requires DateStyle to begin with ISO for correct operation."
-msgstr ""
-"Параметърът DateStyle при сървъра бе променен на {0}. JDBC драйвъра изисква "
-"DateStyle започва с ISO за да функционира правилно."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1945
-#, java-format
-msgid ""
-"The server''s standard_conforming_strings parameter was reported as {0}. The "
-"JDBC driver expected on or off."
-msgstr ""
-"Параметърът standard_conforming_strings при сървъра бе докладван като {0}. "
-"JDBC драйвъра очаква този параметър да бъде on или off."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2015
-msgid "The driver currently does not support COPY operations."
-msgstr "За момента драйвъра не поддържа COPY команди."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:112
-msgid "This PooledConnection has already been closed."
-msgstr "Тази PooledConnection връзка бе вече прекъсната."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid ""
-"Connection has been closed automatically because a new connection was opened "
-"for the same PooledConnection or the PooledConnection has been closed."
-msgstr ""
-"Връзката бе автоматично прекъсната, защото нова връзка за същата беше "
-"осъществена или PooledConnection връзката е вече прекъсната."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid "Connection has been closed."
-msgstr "Връзката бе прекъсната."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:442
-msgid "Statement has been closed."
-msgstr "Командата е завършена."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:291
-msgid "Failed to setup DataSource."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:414
-msgid "DataSource has been closed."
-msgstr "Източникът на данни е прекъснат."
-
-#: org/postgresql/fastpath/Fastpath.java:81
-#: org/postgresql/fastpath/Fastpath.java:128
-#, java-format
-msgid "Fastpath call {0} - No result was returned and we expected an integer."
-msgstr "Извикване на {0} - няма резултати и а бе очаквано цяло число."
-
-#: org/postgresql/fastpath/Fastpath.java:237
-#, java-format
-msgid "The fastpath function {0} is unknown."
-msgstr "Функцията {0} е неизвестна."
-
-#: org/postgresql/geometric/PGbox.java:83
-#: org/postgresql/geometric/PGcircle.java:82
-#: org/postgresql/geometric/PGcircle.java:91
-#: org/postgresql/geometric/PGline.java:80
-#: org/postgresql/geometric/PGlseg.java:77
-#: org/postgresql/geometric/PGpoint.java:85
-#, java-format
-msgid "Conversion to type {0} failed: {1}."
-msgstr "Неуспешно преобразуване към тип {0}: {1}."
-
-#: org/postgresql/geometric/PGpath.java:81
-#, java-format
-msgid "Cannot tell if path is open or closed: {0}."
-msgstr "Не може да определи дали адреса е отворен или затворен: {0}."
-
-#: org/postgresql/gss/MakeGSS.java:47 org/postgresql/gss/MakeGSS.java:55
-#: org/postgresql/gss/MakeGSS.java:168
-msgid "GSS Authentication failed"
-msgstr "GSS удостоверяването бе неуспешно"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:153
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:790
-#, java-format
-msgid "The array index is out of range: {0}"
-msgstr "Индексът на масив е извън обхвата: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:168
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:807
-#, java-format
-msgid "The array index is out of range: {0}, number of elements: {1}."
-msgstr "Индексът на масив е извън обхвата: {0}, брой елементи: {1}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:196
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1982
-#: org/postgresql/util/HStoreConverter.java:34
-#: org/postgresql/util/HStoreConverter.java:61
-msgid ""
-"Invalid character data was found. This is most likely caused by stored data "
-"containing characters that are invalid for the character set the database "
-"was created in. The most common example of this is storing 8bit data in a "
-"SQL_ASCII database."
-msgstr ""
-"Бяха намерени невалидни данни. Това най-вероятно се дължи на съхранявани "
-"данни, съдържащи символи, които са невалидни за набора от знаци при "
-"създаване на базата данни. Чест пример за това е съхраняване на 8bit данни в "
-"SQL_ASCII бази данни."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:73
-msgid ""
-"Truncation of large objects is only implemented in 8.3 and later servers."
-msgstr "Скъсяване на големи обекти LOB е осъществено само във версии след 8.3."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:77
-msgid "Cannot truncate LOB to a negative length."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:81
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:235
-#, java-format
-msgid "PostgreSQL LOBs can only index to: {0}"
-msgstr "PostgreSQL индексира големи обекти LOB само до: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:231
-msgid "LOB positioning offsets start at 1."
-msgstr "Позиционалният офсет при големи обекти LOB започва от 1."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:246
-msgid "free() was called on this LOB previously"
-msgstr "Функцията free() бе вече извикана за този голям обект LOB"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:225
-#, java-format
-msgid "Unsupported value for stringtype parameter: {0}"
-msgstr "Непозволена стойност за StringType параметър: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:245
-msgid "unknownLength parameter value must be an integer"
-msgstr "Стойността на параметъра unknownLength трябва да бъде цяло число"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:353
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:284
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:303
-#: org/postgresql/jdbc2/TypeInfoCache.java:201
-#: org/postgresql/jdbc2/TypeInfoCache.java:249
-#: org/postgresql/jdbc2/TypeInfoCache.java:287
-#: org/postgresql/jdbc2/TypeInfoCache.java:344
-#: org/postgresql/jdbc2/TypeInfoCache.java:348
-#: org/postgresql/jdbc2/TypeInfoCache.java:384
-#: org/postgresql/jdbc2/TypeInfoCache.java:388
-msgid "No results were returned by the query."
-msgstr "Няма намерени резултати за заявката."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:367
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:336
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:368
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2702
-msgid "A result was returned when none was expected."
-msgstr "Бе получен резултат, когато такъв не бе очакван."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:519
-msgid "Custom type maps are not supported."
-msgstr "Специфични типови съответствия не се поддържат."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:567
-#, java-format
-msgid "Failed to create object for: {0}."
-msgstr "Неуспешно създаване на обект за: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:629
-#, java-format
-msgid "Unable to load the class {0} responsible for the datatype {1}"
-msgstr "Невъзможно е зареждането на клас {0}, отговарящ за типа данни {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:725
-msgid ""
-"Cannot change transaction read-only property in the middle of a transaction."
-msgstr ""
-"Не може да променяте правата на транзакцията по време на нейното извършване."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:813
-msgid "Cannot commit when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:822
-#, fuzzy
-msgid "This connection has been closed."
-msgstr "Връзката бе прекъсната."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:842
-msgid "Cannot rollback when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:929
-msgid ""
-"Cannot change transaction isolation level in the middle of a transaction."
-msgstr ""
-"Не може да променяте изолационното ниво на транзакцията по време на нейното "
-"извършване."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:934
-#, java-format
-msgid "Transaction isolation level {0} not supported."
-msgstr "Изолационно ниво на транзакциите {0} не се поддържа."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1001
-msgid "Finalizing a Connection that was never closed:"
-msgstr "Приключване на връзка, която не бе прекъсната:"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1103
-msgid "Unable to translate data into the desired encoding."
-msgstr "Невъзможно преобразуване на данни в желаното кодиране."
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:63
-msgid ""
-"Unable to determine a value for MaxIndexKeys due to missing system catalog "
-"data."
-msgstr ""
-"Невъзможно е да се определи стойността за MaxIndexKeys поради липса на "
-"системния каталог с данни."
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:86
-msgid "Unable to find name datatype in the system catalogs."
-msgstr "Не може да се намери името на типа данни в системните каталози."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:235
-msgid ""
-"Operation requires a scrollable ResultSet, but this ResultSet is "
-"FORWARD_ONLY."
-msgstr ""
-"Операцията изисква резултатите да са scrollable, но този ResultSet е "
-"FORWARD_ONLY."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:416
-msgid "Unexpected error while decoding character data from a large object."
-msgstr "Неочаквана грешка при декодиране на символите от голям обект LOB."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:462
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:491
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:525
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3129
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3174
-#, fuzzy, java-format
-msgid "Cannot convert the column of type {0} to requested type {1}."
-msgstr "Не може да преобразува инстанцията на {0} във вида {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:744
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:768
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1892
-msgid "Can''t use relative move methods while on the insert row."
-msgstr ""
-"Не може да се използват относителни методи за движение, когато се намираме "
-"при редицата на въвеждане."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:788
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2956
-#, java-format
-msgid "Invalid fetch direction constant: {0}."
-msgstr "Невалидна константа за fetch посоката: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:802
-msgid "Cannot call cancelRowUpdates() when on the insert row."
-msgstr ""
-"Не може да се изпълни cancelRowUpdates() метода, когато се намираме при "
-"редицата на въвеждане."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:822
-msgid "Cannot call deleteRow() when on the insert row."
-msgstr ""
-"Не може да се изпълни deleteRow() метода, когато се намираме при редицата на "
-"въвеждане."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:828
-msgid ""
-"Currently positioned before the start of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"В момента се намираме в началото на ResultSet. Тук не може да се изпълни "
-"deleteRow() метода."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:833
-msgid ""
-"Currently positioned after the end of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"В момента се намираме преди края на ResultSet. Тук не може да се изпълни "
-"deleteRow() метода."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:838
-msgid "There are no rows in this ResultSet."
-msgstr "В този ResultSet няма редове."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:885
-msgid "Not on the insert row."
-msgstr "Не сме в редицата на въвеждане."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:889
-msgid "You must specify at least one column value to insert a row."
-msgstr "Трябва да посочите поне една стойност за колона, за да вмъкнете ред."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1074
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1805
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2494
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2524
-#, java-format
-msgid "The JVM claims not to support the encoding: {0}"
-msgstr "JVM не поддържа тази кодова таблица за момента: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1078
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1121
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1534
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1663
-msgid "Provided InputStream failed."
-msgstr "Зададения InputStream поток е неуспешен."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1191
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3137
-msgid "Provided Reader failed."
-msgstr "Грешка с ползвания четец."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1259
-msgid "Can''t refresh the insert row."
-msgstr "Не може да обнови въведения ред."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1327
-msgid "Cannot call updateRow() when on the insert row."
-msgstr ""
-"Не може да се изпълни updateRow() метода, когато се намираме при редицата на "
-"въвеждане."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1333
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3190
-msgid ""
-"Cannot update the ResultSet because it is either before the start or after "
-"the end of the results."
-msgstr ""
-"Не може да се обнови ResultSet, когато се намираме преди началото или след "
-"края на резултатите."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1582
-msgid "ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."
-msgstr ""
-"ResultSets с concurrency CONCUR_READ_ONLY не могат да бъдат актуализирани."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1650
-#, java-format
-msgid "No primary key found for table {0}."
-msgstr "Няма първичен ключ за таблица {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1876
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2965
-msgid "Fetch size must be a value greater to or equal to 0."
-msgstr "Размера за fetch size трябва да бъде по-голям или равен на 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2044
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2051
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2098
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2106
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2926
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2934
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2964
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2971
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2991
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3002
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3020
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3038
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3179
-#: org/postgresql/jdbc2/TimestampUtils.java:258
-#, java-format
-msgid "Bad value for type {0} : {1}"
-msgstr "Невалидна стойност за тип {0} : {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2727
-#, java-format
-msgid "The column name {0} was not found in this ResultSet."
-msgstr "Името на колоната {0} не бе намерено в този ResultSet."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2827
-msgid ""
-"ResultSet is not updateable. The query that generated this result set must "
-"select only one table, and must select all primary keys from that table. See "
-"the JDBC 2.1 API Specification, section 5.6 for more details."
-msgstr ""
-"ResultSet не може да се обновява. Заявката генерираща този резултат трябва "
-"да селектира само една таблица, както и всички първични ключове в нея. За "
-"повече информация, вижте раздел 5.6 на JDBC 2.1 API Specification."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2839
-msgid "This ResultSet is closed."
-msgstr "Операциите по този ResultSet са били прекратени."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2860
-msgid "ResultSet not positioned properly, perhaps you need to call next."
-msgstr ""
-"ResultSet не е референциран правилно. Вероятно трябва да придвижите курсора "
-"посредством next."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:259
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:323
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:392
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2655
-msgid ""
-"Can''t use query methods that take a query string on a PreparedStatement."
-msgstr ""
-"Не може да се употребяват методи за заявка, които ползват низове на "
-"PreparedStatement."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:287
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:306
-msgid "Multiple ResultSets were returned by the query."
-msgstr "Заявката върна няколко ResultSets."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:425
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:429
-msgid "A CallableStatement was executed with nothing returned."
-msgstr "CallableStatement функция бе обработена, но няма резултати."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:437
-msgid "A CallableStatement was executed with an invalid number of parameters"
-msgstr ""
-"CallableStatement функция бе обработена, но с непозволен брой параметри."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:468
-#, java-format
-msgid ""
-"A CallableStatement function was executed and the out parameter {0} was of "
-"type {1} however type {2} was registered."
-msgstr ""
-"CallableStatement функция бе обработена и изходния параметър {0} бе от тип "
-"{1}, обаче тип {2} бе използван."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:674
-msgid "Maximum number of rows must be a value grater than or equal to 0."
-msgstr ""
-"Максималният брой редове трябва да бъде стойност по-голяма или равна на 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:717
-msgid "Query timeout must be a value greater than or equals to 0."
-msgstr ""
-"Времето за изпълнение на заявката трябва да бъде стойност по-голяма или "
-"равна на 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:809
-msgid "The maximum field size must be a value greater than or equal to 0."
-msgstr ""
-"Максималният размер на полето трябва да бъде стойност по-голяма или равна на "
-"0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1226
-msgid "Unknown Types value."
-msgstr "Стойност от неизвестен тип."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1499
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1624
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3108
-#, java-format
-msgid "Invalid stream length {0}."
-msgstr "Невалидна дължина {0} на потока данни."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1530
-#, java-format
-msgid "The JVM claims not to support the {0} encoding."
-msgstr "JVM не поддържа за момента {0} кодовата таблица."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1705
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3030
-#, java-format
-msgid "Unknown type {0}."
-msgstr "Неизвестен тип {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1720
-msgid "No hstore extension installed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1845
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1851
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1857
-#, java-format
-msgid "Cannot cast an instance of {0} to type {1}"
-msgstr "Не може да преобразува инстанция на {0} към тип {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1869
-#, java-format
-msgid "Unsupported Types value: {0}"
-msgstr "Неподдържана стойност за тип: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1927
-#, java-format
-msgid ""
-"Can''t infer the SQL type to use for an instance of {0}. Use setObject() "
-"with an explicit Types value to specify the type to use."
-msgstr ""
-"Не може да се определи SQL тип, който да се използва за инстанцията на {0}. "
-"Ползвайте метода setObject() с точни стойности, за да определите типа."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1975
-msgid ""
-"This statement does not declare an OUT parameter. Use '{' ?= call ... '}' "
-"to declare one."
-msgstr ""
-"Тази заявка не декларира изходен параметър. Ползвайте '{' ?= call ... '}' за "
-"да декларирате такъв."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2025
-msgid "wasNull cannot be call before fetching a result."
-msgstr "wasNull не може да бьде изпълнен, преди наличието на резултата."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2521
-#, java-format
-msgid "Malformed function or procedure escape syntax at offset {0}."
-msgstr "Непозволен синтаксис на функция или процедура при офсет {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2571
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2585
-#, java-format
-msgid ""
-"Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was "
-"made."
-msgstr ""
-"Отчетен параметър от тип {0}, но обработено като get{1} (sqltype={2}). "
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2604
-msgid ""
-"A CallableStatement was declared, but no call to registerOutParameter(1, "
-"<some type>) was made."
-msgstr ""
-"CallableStatement функция бе декларирана, но обработена като "
-"registerOutParameter(1, <some type>) "
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2608
-msgid "No function outputs were registered."
-msgstr "Резултати от функцията не бяха регистрирани."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2611
-msgid ""
-"Results cannot be retrieved from a CallableStatement before it is executed."
-msgstr ""
-"Резултати от CallableStatement функция не могат да бъдат получени, преди тя "
-"да бъде обработена."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2644
-msgid "This statement has been closed."
-msgstr "Командата е извършена."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2724
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2794
-msgid "Too many update results were returned."
-msgstr "Твърде много резултати бяха получени при актуализацията."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2753
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2823
-#, java-format
-msgid ""
-"Batch entry {0} {1} was aborted. Call getNextException to see the cause."
-msgstr ""
-"Партида {0} {1} беше прекратена. Изпълнете функция getNextException за да "
-"видите причината."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3078
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3167
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3207
-msgid "Unexpected error writing large object to database."
-msgstr "Неочаквана грешка при записване на голям обект LOB в базата данни."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:145
-#: org/postgresql/jdbc2/EscapedFunctions.java:157
-#: org/postgresql/jdbc2/EscapedFunctions.java:169
-#: org/postgresql/jdbc2/EscapedFunctions.java:206
-#: org/postgresql/jdbc2/EscapedFunctions.java:243
-#: org/postgresql/jdbc2/EscapedFunctions.java:267
-#: org/postgresql/jdbc2/EscapedFunctions.java:292
-#: org/postgresql/jdbc2/EscapedFunctions.java:316
-#: org/postgresql/jdbc2/EscapedFunctions.java:328
-#: org/postgresql/jdbc2/EscapedFunctions.java:352
-#: org/postgresql/jdbc2/EscapedFunctions.java:380
-#: org/postgresql/jdbc2/EscapedFunctions.java:389
-#: org/postgresql/jdbc2/EscapedFunctions.java:399
-#: org/postgresql/jdbc2/EscapedFunctions.java:408
-#: org/postgresql/jdbc2/EscapedFunctions.java:417
-#: org/postgresql/jdbc2/EscapedFunctions.java:426
-#: org/postgresql/jdbc2/EscapedFunctions.java:435
-#: org/postgresql/jdbc2/EscapedFunctions.java:444
-#: org/postgresql/jdbc2/EscapedFunctions.java:453
-#: org/postgresql/jdbc2/EscapedFunctions.java:462
-#: org/postgresql/jdbc2/EscapedFunctions.java:471
-#: org/postgresql/jdbc2/EscapedFunctions.java:480
-#, java-format
-msgid "{0} function takes one and only one argument."
-msgstr "Функцията {0} може да приеме само един единствен аргумент."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:181
-#: org/postgresql/jdbc2/EscapedFunctions.java:193
-#: org/postgresql/jdbc2/EscapedFunctions.java:255
-#: org/postgresql/jdbc2/EscapedFunctions.java:304
-#: org/postgresql/jdbc2/EscapedFunctions.java:582
-#, java-format
-msgid "{0} function takes two and only two arguments."
-msgstr "Функцията {0} може да приеме два и само два аргумента."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:230
-#, java-format
-msgid "{0} function takes four and only four argument."
-msgstr "Функцията {0} може да приеме четири и само четири аргумента."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:282
-#: org/postgresql/jdbc2/EscapedFunctions.java:342
-#, java-format
-msgid "{0} function takes two or three arguments."
-msgstr "Функцията {0} може да приеме два или три аргумента."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:362
-#: org/postgresql/jdbc2/EscapedFunctions.java:371
-#: org/postgresql/jdbc2/EscapedFunctions.java:573
-#: org/postgresql/jdbc2/EscapedFunctions.java:591
-#, java-format
-msgid "{0} function doesn''t take any argument."
-msgstr "Функцията {0} не може да приема аргументи."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:489
-#: org/postgresql/jdbc2/EscapedFunctions.java:531
-#, java-format
-msgid "{0} function takes three and only three arguments."
-msgstr "Функцията {0} може да приеме три и само три аргумента."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:501
-#: org/postgresql/jdbc2/EscapedFunctions.java:521
-#: org/postgresql/jdbc2/EscapedFunctions.java:523
-#: org/postgresql/jdbc2/EscapedFunctions.java:543
-#: org/postgresql/jdbc2/EscapedFunctions.java:564
-#: org/postgresql/jdbc2/EscapedFunctions.java:566
-#, java-format
-msgid "Interval {0} not yet implemented"
-msgstr "Интервалът {0} не е валиден все още."
-
-#: org/postgresql/jdbc2/TimestampUtils.java:360
-msgid ""
-"Infinite value found for timestamp/date. This cannot be represented as time."
-msgstr ""
-"Безкрайна стойност за време или дата. Не може да бъде представена като "
-"времева стойност."
-
-#: org/postgresql/jdbc2/TimestampUtils.java:648
-#: org/postgresql/jdbc2/TimestampUtils.java:680
-#: org/postgresql/jdbc2/TimestampUtils.java:727
-#, fuzzy, java-format
-msgid "Unsupported binary encoding of {0}."
-msgstr "Неподдържана стойност за тип: {0}"
-
-#: org/postgresql/jdbc2/TypeInfoCache.java:161
-#, java-format
-msgid "The class {0} does not implement org.postgresql.util.PGobject."
-msgstr "Клас {0} не изпълнява org.postgresql.util.PGobject."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:60
-#, java-format
-msgid "Unknown ResultSet holdability setting: {0}."
-msgstr "Неизвестна ResultSet holdability настройка: {0}."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:98
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:130
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:165
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:187
-msgid "Server versions prior to 8.0 do not support savepoints."
-msgstr "Сървър версии преди 8.0 не поддържат savepoints."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:100
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:132
-msgid "Cannot establish a savepoint in auto-commit mode."
-msgstr "Не може да се установи savepoint в auto-commit модус."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:419
-msgid "Returning autogenerated keys is not supported."
-msgstr "Автоматично генерирани ключове не се поддържат."
-
-#: org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java:81
-#, java-format
-msgid "The parameter index is out of range: {0}, number of parameters: {1}."
-msgstr "Параметърният индекс е извън обхват: {0}, брой параметри: {1}."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:151
-msgid ""
-"Returning autogenerated keys is only supported for 8.2 and later servers."
-msgstr ""
-"Автоматично генерирани ключове се поддържат за версии на сървъра след 8.2."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:199
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:317
-msgid "Returning autogenerated keys by column index is not supported."
-msgstr ""
-"Автоматично генерирани ключове спрямо индекс на колона не се поддържат."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:38
-#: org/postgresql/jdbc3/PSQLSavepoint.java:50
-#: org/postgresql/jdbc3/PSQLSavepoint.java:66
-msgid "Cannot reference a savepoint after it has been released."
-msgstr "Не може да референцира savepoint, след като е била освободена."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:42
-msgid "Cannot retrieve the id of a named savepoint."
-msgstr "Не може да определи ID на спомената savepoint."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:54
-msgid "Cannot retrieve the name of an unnamed savepoint."
-msgstr "Не може да определи името на неупомената savepoint."
-
-#: org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java:37
-msgid "Invalid UUID data."
-msgstr "Невалидни UUID данни."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:83
-#, java-format
-msgid "Unable to find server array type for provided name {0}."
-msgstr "Не може да се намери типа на сървърен масив за зададеното име {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:121
-#, fuzzy, java-format
-msgid "Invalid timeout ({0}<0)."
-msgstr "Невалидна дължина {0} на потока данни."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:134
-msgid "Validating connection."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:157
-#, fuzzy, java-format
-msgid "Failed to set ClientInfo property: {0}"
-msgstr "Неуспешно създаване на обект за: {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:166
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:188
-msgid "ClientInfo property not supported."
-msgstr "Информацията за ClientInfo не се поддържа."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Statement.java:127
-msgid "Object is too large to send over the protocol."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:147
-msgid "Unable to decode xml data."
-msgstr "Не може да декодира XML данните."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:150
-#, java-format
-msgid "Unknown XML Source class: {0}"
-msgstr "Неизвестен XML входящ клас: {0}"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:195
-msgid "Unable to create SAXResult for SQLXML."
-msgstr "Не може да се създаде SAXResult за SQLXML."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:209
-msgid "Unable to create StAXResult for SQLXML"
-msgstr "Не може да се създаде StAXResult за SQLXML."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:213
-#, java-format
-msgid "Unknown XML Result class: {0}"
-msgstr "Неизвестен XML изходящ клас: {0}"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:226
-msgid "This SQLXML object has already been freed."
-msgstr "Този SQLXML обект вече е освободен."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:233
-msgid ""
-"This SQLXML object has not been initialized, so you cannot retrieve data "
-"from it."
-msgstr ""
-"Този SQLXML обект не е инициализиран, така че не могат да се извличат данни "
-"от него."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:244
-#, java-format
-msgid "Failed to convert binary xml data to encoding: {0}."
-msgstr ""
-"Неуспешно преобразуване на двоични XML данни за кодиране съгласно: {0}."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:269
-msgid "Unable to convert DOMResult SQLXML data to a string."
-msgstr "Не може да преобразува DOMResult SQLXML данни в низ."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:282
-msgid ""
-"This SQLXML object has already been initialized, so you cannot manipulate it "
-"further."
-msgstr "Този SQLXML обект вече е инициализиран и не може да бъде променен."
-
-#: org/postgresql/largeobject/LargeObjectManager.java:138
-msgid "Failed to initialize LargeObject API"
-msgstr "Не може да инициализира LargeObject API"
-
-#: org/postgresql/largeobject/LargeObjectManager.java:257
-#: org/postgresql/largeobject/LargeObjectManager.java:298
-msgid "Large Objects may not be used in auto-commit mode."
-msgstr "Големи обекти LOB не могат да се използват в auto-commit модус."
-
-#: org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java:58
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:110
-#, java-format
-msgid "The SSLSocketFactory class provided {0} could not be instantiated."
-msgstr "Класът SSLSocketFactory връща {0} и не може да бъде инстанцииран."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:125
-#, java-format
-msgid "SSL error: {0}"
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:138
-#, fuzzy, java-format
-msgid "The HostnameVerifier class provided {0} could not be instantiated."
-msgstr "Класът SSLSocketFactory връща {0} и не може да бъде инстанцииран."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:142
-#, java-format
-msgid "The hostname {0} could not be verified by hostnameverifier {1}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:149
-#, fuzzy, java-format
-msgid "The hostname {0} could not be verified."
-msgstr "Класът SSLSocketFactory връща {0} и не може да бъде инстанцииран."
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:121
-msgid ""
-"Could not find a java cryptographic algorithm: X.509 CertificateFactory not "
-"available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:132
-#, java-format
-msgid "Could not open SSL certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:137
-#, java-format
-msgid "Loading the SSL certificate {0} into a KeyManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:194
-msgid "Enter SSL password: "
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:202
-msgid "Could not read password for SSL key file, console is not available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:204
-#, java-format
-msgid "Could not read password for SSL key file by callbackhandler {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:223
-#, java-format
-msgid "Could not decrypt SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:231
-#, java-format
-msgid "Could not read SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:235
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:173
-#, java-format
-msgid "Could not find a java cryptographic algorithm: {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:99
-#, fuzzy, java-format
-msgid "The password callback class provided {0} could not be instantiated."
-msgstr "Класът SSLSocketFactory връща {0} и не може да бъде инстанцииран."
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:133
-#, java-format
-msgid "Could not open SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:150
-#, java-format
-msgid "Could not read SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:153
-#, java-format
-msgid "Loading the SSL root certificate {0} into a TrustManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:166
-msgid "Could not initialize SSL context."
-msgstr ""
-
-#: org/postgresql/util/PGInterval.java:164
-msgid "Conversion of interval failed"
-msgstr "Неуспешно преобразуване на интервал"
-
-#: org/postgresql/util/PGmoney.java:73
-msgid "Conversion of money failed."
-msgstr "Неуспешно валутно преобразуване."
-
-#: org/postgresql/util/ServerErrorMessage.java:155
-#, java-format
-msgid "Detail: {0}"
-msgstr "Подробност: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:159
-#, java-format
-msgid "Hint: {0}"
-msgstr "Забележка: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:162
-#, java-format
-msgid "Position: {0}"
-msgstr "Позиция: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:165
-#, java-format
-msgid "Where: {0}"
-msgstr "Където: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:171
-#, java-format
-msgid "Internal Query: {0}"
-msgstr "Вътрешна заявка: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:174
-#, java-format
-msgid "Internal Position: {0}"
-msgstr "Вътрешна позиция: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:180
-#, java-format
-msgid "Location: File: {0}, Routine: {1}, Line: {2}"
-msgstr "Местоположение: Файл: {0}, Функция: {1}, Ред: {2}"
-
-#: org/postgresql/util/ServerErrorMessage.java:183
-#, java-format
-msgid "Server SQLState: {0}"
-msgstr "SQL статус на сървъра: {0}"
-
-#: org/postgresql/xa/PGXAConnection.java:148
-msgid ""
-"Transaction control methods setAutoCommit(true), commit, rollback and "
-"setSavePoint not allowed while an XA transaction is active."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:186
-#: org/postgresql/xa/PGXAConnection.java:245
-msgid "Invalid flags"
-msgstr "Невалидни флагове"
-
-#: org/postgresql/xa/PGXAConnection.java:189
-#: org/postgresql/xa/PGXAConnection.java:248
-#: org/postgresql/xa/PGXAConnection.java:425
-msgid "xid must not be null"
-msgstr "xid не може да бъде null"
-
-#: org/postgresql/xa/PGXAConnection.java:192
-msgid "Connection is busy with another transaction"
-msgstr "Връзката е заета с друга транзакция"
-
-#: org/postgresql/xa/PGXAConnection.java:198
-#: org/postgresql/xa/PGXAConnection.java:255
-msgid "suspend/resume not implemented"
-msgstr "спиране / започване не се поддържа за момента"
-
-#: org/postgresql/xa/PGXAConnection.java:204
-#: org/postgresql/xa/PGXAConnection.java:207
-#: org/postgresql/xa/PGXAConnection.java:209
-msgid "Transaction interleaving not implemented"
-msgstr "Транзакция в транзакция не се поддържа за момента"
-
-#: org/postgresql/xa/PGXAConnection.java:218
-msgid "Error disabling autocommit"
-msgstr "Грешка при изключване на autocommit"
-
-#: org/postgresql/xa/PGXAConnection.java:251
-msgid "tried to call end without corresponding start call"
-msgstr "опита да извика end без съответстващо извикване на start"
-
-#: org/postgresql/xa/PGXAConnection.java:282
-msgid ""
-"Not implemented: Prepare must be issued using the same connection that "
-"started the transaction"
-msgstr ""
-"Невъзможна комбинация: Prepare трябва да бъде издадено чрез използване на "
-"същата връзка, при която е започната транзакцията"
-
-#: org/postgresql/xa/PGXAConnection.java:286
-msgid "Prepare called before end"
-msgstr "Prepare извикано преди края"
-
-#: org/postgresql/xa/PGXAConnection.java:292
-msgid "Server versions prior to 8.1 do not support two-phase commit."
-msgstr "Сървър версии преди 8.1 не поддържат дву-фазов commit."
-
-#: org/postgresql/xa/PGXAConnection.java:313
-msgid "Error preparing transaction"
-msgstr "Грешка при подготвяне на транзакция"
-
-#: org/postgresql/xa/PGXAConnection.java:328
-msgid "Invalid flag"
-msgstr "Невалиден флаг"
-
-#: org/postgresql/xa/PGXAConnection.java:368
-msgid "Error during recover"
-msgstr "Грешка при възстановяване"
-
-#: org/postgresql/xa/PGXAConnection.java:416
-msgid "Error rolling back prepared transaction"
-msgstr "Грешка при възстановяване на състоянието преди подготвена транзакция"
-
-#: org/postgresql/xa/PGXAConnection.java:451
-msgid ""
-"Not implemented: one-phase commit must be issued using the same connection "
-"that was used to start it"
-msgstr ""
-"Невъзможна комбинация: едно-фазов commit трябва да бъде издаден чрез "
-"използване на същата връзка, при която е започнал"
-
-#: org/postgresql/xa/PGXAConnection.java:455
-msgid "commit called before end"
-msgstr "commit извикан преди end"
-
-#: org/postgresql/xa/PGXAConnection.java:466
-msgid "Error during one-phase commit"
-msgstr "Грешка при едно-фазов commit"
-
-#: org/postgresql/xa/PGXAConnection.java:487
-msgid ""
-"Not implemented: 2nd phase commit must be issued using an idle connection"
-msgstr ""
-"Невъзможна комбинация: втората фаза на commit задължително трябва да бъде "
-"издадена при свободна връзка"
-
-#: org/postgresql/xa/PGXAConnection.java:507
-#, fuzzy
-msgid "Error committing prepared transaction"
-msgstr "Грешка при възстановяване на състоянието преди подготвена транзакция"
-
-#: org/postgresql/xa/PGXAConnection.java:522
-msgid "Heuristic commit/rollback not supported"
-msgstr "Евристичен commit или rollback не се поддържа"
-
-#~ msgid "Query returning autogenerated keys didn't return anything."
-#~ msgstr ""
-#~ "Заявката за автоматично генериране на ключове не предостави резултат."
-
-#~ msgid "The driver does not support SSL."
-#~ msgstr "Драйвъра не поддържа SSL."
-
-#~ msgid "Multi-dimensional arrays are currently not supported."
-#~ msgstr "Многомерни низове не се поддържат за момента."
-
-#~ msgid "Exception: {0}"
-#~ msgstr "Изключение: {0}"
-
-#~ msgid "Stack Trace:"
-#~ msgstr "Stack Trace:"
-
-#~ msgid "End of Stack Trace"
-#~ msgstr "Край на stack trace"
-
-#~ msgid "Exception generating stacktrace for: {0} encountered: {1}"
-#~ msgstr "Stacktrace изключение при генериране на: {0} възникнали: {1}"
-
-#~ msgid "rand function only takes zero or one argument(the seed)."
-#~ msgstr ""
-#~ "функцията за рандомизиране не приема аргументи или приема само един "
-#~ "аргумент (seed)."
-
-#~ msgid "suspend/resume and join not implemented"
-#~ msgstr "спиране / продължаване или съединяване не се поддържа за момента"
diff --git a/org/postgresql/translation/cs.po b/org/postgresql/translation/cs.po
deleted file mode 100644
index 0422d28..0000000
--- a/org/postgresql/translation/cs.po
+++ /dev/null
@@ -1,1440 +0,0 @@
-# Just Czech translation ;o)
-# Copyright (C) 2005
-# This file is distributed under the same license as the PACKAGE package.
-# Petr Dittrich <bodyn at medoro.org>, 2005
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PostgreSQL JDBC Driver 8.0\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-10-31 13:37+0000\n"
-"PO-Revision-Date: 2005-08-21 20:00+0200\n"
-"Last-Translator: Petr Dittrich <bodyn at medoro.org>\n"
-"Language-Team: \n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ISO-8859-2\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: org/postgresql/Driver.java.in:235
-msgid "Error loading default settings from driverconfig.properties"
-msgstr "Chyba na��t�n� standardn�ho nastaven� z driverconfig.properties"
-
-#: org/postgresql/Driver.java.in:282
-msgid ""
-"Your security policy has prevented the connection from being attempted. You "
-"probably need to grant the connect java.net.SocketPermission to the database "
-"server host and port that you wish to connect to."
-msgstr ""
-
-#: org/postgresql/Driver.java.in:287 org/postgresql/Driver.java.in:351
-msgid ""
-"Something unusual has occurred to cause the driver to fail. Please report "
-"this exception."
-msgstr ""
-"N�co neobvykl�ho p�inutilo ovlada� selhat. Pros�m nahlaste tuto vyj�mku."
-
-#: org/postgresql/Driver.java.in:359
-#, fuzzy
-msgid "Connection attempt timed out."
-msgstr "Pokus o p�ipojen� selhal."
-
-#: org/postgresql/Driver.java.in:372
-#, fuzzy
-msgid "Interrupted while attempting to connect."
-msgstr "Nastala chyba p�i nastaven� SSL spojen�."
-
-#: org/postgresql/Driver.java.in:714
-#, java-format
-msgid "Method {0} is not yet implemented."
-msgstr "Metoda {0} nen� implementov�na."
-
-#: org/postgresql/copy/CopyManager.java:56
-#, java-format
-msgid "Requested CopyIn but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/CopyManager.java:67
-#, java-format
-msgid "Requested CopyOut but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:51
-#, java-format
-msgid "Copying from database failed: {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:67
-#: org/postgresql/copy/PGCopyOutputStream.java:90
-#, fuzzy
-msgid "This copy stream is closed."
-msgstr "Tento ResultSet je uzav�en�."
-
-#: org/postgresql/copy/PGCopyInputStream.java:108
-msgid "Read from copy failed."
-msgstr ""
-
-#: org/postgresql/copy/PGCopyOutputStream.java:68
-#, java-format
-msgid "Cannot write to copy a byte of value {0}"
-msgstr ""
-
-#: org/postgresql/core/ConnectionFactory.java:69
-#, java-format
-msgid "A connection could not be made using the requested protocol {0}."
-msgstr "Spojen� nelze vytvo�it s pou�it�m ��dan�ho protokolu {0}."
-
-#: org/postgresql/core/Oid.java:113
-#, java-format
-msgid "oid type {0} not known and not a number"
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:490
-#, java-format
-msgid "Premature end of input stream, expected {0} bytes, but only read {1}."
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:530
-#, java-format
-msgid "Expected an EOF from server, got: {0}"
-msgstr ""
-
-#: org/postgresql/core/SetupQueryRunner.java:86
-msgid "An unexpected result was returned by a query."
-msgstr "Obdr�en neo�ek�van� v�sledek dotazu."
-
-#: org/postgresql/core/UTF8Encoding.java:28
-#, java-format
-msgid ""
-"Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:61
-#, java-format
-msgid "Illegal UTF-8 sequence: {0} bytes used to encode a {1} byte value: {2}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:98
-#: org/postgresql/core/UTF8Encoding.java:125
-#, java-format
-msgid "Illegal UTF-8 sequence: initial byte is {0}: {1}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:130
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is out of range: {0}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:145
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is a surrogate value: {0}"
-msgstr ""
-
-#: org/postgresql/core/Utils.java:95 org/postgresql/core/Utils.java:112
-msgid "Zero bytes may not occur in string parameters."
-msgstr ""
-
-#: org/postgresql/core/Utils.java:145
-msgid "Zero bytes may not occur in identifiers."
-msgstr ""
-
-#: org/postgresql/core/types/PGBigDecimal.java:63
-#: org/postgresql/core/types/PGBoolean.java:62
-#: org/postgresql/core/types/PGByte.java:63
-#: org/postgresql/core/types/PGDouble.java:64
-#: org/postgresql/core/types/PGFloat.java:64
-#: org/postgresql/core/types/PGInteger.java:61
-#: org/postgresql/core/types/PGLong.java:62
-#: org/postgresql/core/types/PGNumber.java:62
-#: org/postgresql/core/types/PGShort.java:58
-#: org/postgresql/core/types/PGString.java:73
-#, fuzzy, java-format
-msgid "Cannot convert an instance of {0} to type {1}"
-msgstr "Nemohu p�etypovat instanci {0} na typ {1}"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:66
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:74
-#, fuzzy, java-format
-msgid "Invalid sslmode value: {0}"
-msgstr "Vadn� d�lka proudu {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:134
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:207
-msgid ""
-"Connection refused. Check that the hostname and port are correct and that "
-"the postmaster is accepting TCP/IP connections."
-msgstr ""
-"Spojen� odm�tnuto. Zkontrolujte zda je jm�no hosta a port spr�vn� a zda "
-"postmaster p�ij�m� TCP/IP spojen�."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:153
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:225
-msgid "The connection attempt failed."
-msgstr "Pokus o p�ipojen� selhal."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:175
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:246
-#, fuzzy
-msgid "The connection url is invalid."
-msgstr "Pokus o p�ipojen� selhal."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:198
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:210
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:295
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:307
-msgid "The server does not support SSL."
-msgstr "Server nepodporuje SSL."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:223
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:320
-msgid "An error occurred while setting up the SSL connection."
-msgstr "Nastala chyba p�i nastaven� SSL spojen�."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:272
-#, java-format
-msgid "Connection rejected: {0}."
-msgstr "Spojen� odm�tnuto: {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:290
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:312
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:332
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:419
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:444
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:471
-msgid ""
-"The server requested password-based authentication, but no password was "
-"provided."
-msgstr "Server vy�aduje ov��en� heslem, ale ��dn� nebylo posl�no."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:356
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:504
-#, java-format
-msgid ""
-"The authentication type {0} is not supported. Check that you have configured "
-"the pg_hba.conf file to include the client''s IP address or subnet, and that "
-"it is using an authentication scheme supported by the driver."
-msgstr ""
-"Ov��en� typu {0} nen� podporov�no. Zkontrolujte zda konfigura�n� soubor "
-"pg_hba.conf obsahuje klientskou IP adresu �i pods� a zda je pou�it� "
-"ov��enovac� sch�ma podporov�no ovlada�em."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:362
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:400
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:510
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:553
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:599
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:609
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:618
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:626
-#: org/postgresql/gss/MakeGSS.java:158
-msgid "Protocol error. Session setup failed."
-msgstr "Chyba protokolu. Nastaven� relace selhalo."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:390
-#, java-format
-msgid "Backend start-up failed: {0}."
-msgstr "Selhal start backendu: {0}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:55
-#: org/postgresql/core/v2/FastpathParameterList.java:77
-#: org/postgresql/core/v2/FastpathParameterList.java:84
-#: org/postgresql/core/v2/SimpleParameterList.java:57
-#: org/postgresql/core/v2/SimpleParameterList.java:76
-#: org/postgresql/core/v2/SimpleParameterList.java:83
-#: org/postgresql/core/v2/SimpleParameterList.java:90
-#: org/postgresql/core/v3/CompositeParameterList.java:35
-#: org/postgresql/core/v3/SimpleParameterList.java:49
-#: org/postgresql/core/v3/SimpleParameterList.java:56
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2845
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java:419
-#, java-format
-msgid "The column index is out of range: {0}, number of columns: {1}."
-msgstr "Index sloupece je mimo rozsah: {0}, po�et sloupc�: {1}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:142
-#: org/postgresql/core/v2/SimpleParameterList.java:155
-#: org/postgresql/core/v3/SimpleParameterList.java:216
-#, java-format
-msgid "No value specified for parameter {0}."
-msgstr "Nespecifikov�na hodnota parametru {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:72
-#: org/postgresql/core/v2/QueryExecutorImpl.java:337
-#: org/postgresql/core/v3/QueryExecutorImpl.java:443
-#: org/postgresql/core/v3/QueryExecutorImpl.java:507
-#, java-format
-msgid "Expected command status BEGIN, got {0}."
-msgstr "O�ek�v�n p��kaz BEGIN, obdr�en {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:78
-#: org/postgresql/core/v3/QueryExecutorImpl.java:513
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1828
-#, java-format
-msgid "Unexpected command status: {0}."
-msgstr "Neo�ek�van� stav p��kazu: {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:118
-#: org/postgresql/core/v2/QueryExecutorImpl.java:129
-#: org/postgresql/core/v2/QueryExecutorImpl.java:174
-#: org/postgresql/core/v2/QueryExecutorImpl.java:369
-#: org/postgresql/core/v3/QueryExecutorImpl.java:281
-#: org/postgresql/core/v3/QueryExecutorImpl.java:411
-#: org/postgresql/core/v3/QueryExecutorImpl.java:485
-#: org/postgresql/core/v3/QueryExecutorImpl.java:551
-#: org/postgresql/core/v3/QueryExecutorImpl.java:631
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2094
-#, fuzzy
-msgid "An I/O error occured while sending to the backend."
-msgstr "Vystupn�/v�stupn� chyba p�i odes�l�n� k backend."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:170
-#: org/postgresql/core/v2/QueryExecutorImpl.java:225
-#: org/postgresql/core/v2/QueryExecutorImpl.java:236
-#: org/postgresql/core/v3/QueryExecutorImpl.java:627
-#: org/postgresql/core/v3/QueryExecutorImpl.java:685
-#, java-format
-msgid "Unknown Response Type {0}."
-msgstr "Nezn�m� typ odpov�di {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:430
-#: org/postgresql/core/v2/QueryExecutorImpl.java:475
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1857
-msgid "Ran out of memory retrieving query results."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:597
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2199
-#, java-format
-msgid "Unable to interpret the update count in command completion tag: {0}."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:610
-msgid "Copy not implemented for protocol version 2"
-msgstr ""
-
-#: org/postgresql/core/v3/CopyOperationImpl.java:56
-msgid "CommandComplete expected COPY but got: "
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:66
-msgid "Tried to obtain lock while already holding it"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:78
-msgid "Tried to break lock on database connection"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:93
-#, fuzzy
-msgid "Interrupted while waiting to obtain lock on database connection"
-msgstr "Nastala chyba p�i nastaven� SSL spojen�."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:275
-msgid "Unable to bind parameter values for statement."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:726
-msgid "Database connection failed when starting copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:757
-msgid "Tried to cancel an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:794
-msgid "Database connection failed when canceling copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:799
-msgid "Missing expected error response to copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:801
-#, java-format
-msgid "Got {0} error responses to single copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:814
-msgid "Tried to end inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:827
-msgid "Database connection failed when ending copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:842
-#: org/postgresql/core/v3/QueryExecutorImpl.java:860
-msgid "Tried to write to an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:854
-#: org/postgresql/core/v3/QueryExecutorImpl.java:866
-msgid "Database connection failed when writing to copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:878
-msgid "Tried to read from inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:883
-msgid "Database connection failed when reading from copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:951
-#, java-format
-msgid "Received CommandComplete ''{0}'' without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:975
-#, java-format
-msgid "Got CopyInResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:988
-#, java-format
-msgid "Got CopyOutResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1003
-msgid "Got CopyData without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1005
-#, fuzzy, java-format
-msgid "Unexpected copydata from server for {0}"
-msgstr "Neo�ek�van� stav p��kazu: {0}."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1056
-#, java-format
-msgid "Unexpected packet type during copy: {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1310
-#, java-format
-msgid ""
-"Bind message length {0} too long. This can be caused by very large or "
-"incorrect length specifications on InputStream parameters."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1925
-#, java-format
-msgid ""
-"The server''s client_encoding parameter was changed to {0}. The JDBC driver "
-"requires client_encoding to be UTF8 for correct operation."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1932
-#, java-format
-msgid ""
-"The server''s DateStyle parameter was changed to {0}. The JDBC driver "
-"requires DateStyle to begin with ISO for correct operation."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1945
-#, java-format
-msgid ""
-"The server''s standard_conforming_strings parameter was reported as {0}. The "
-"JDBC driver expected on or off."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2015
-msgid "The driver currently does not support COPY operations."
-msgstr "Ovlada� nyn� nepodporuje p��kaz COPY."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:112
-msgid "This PooledConnection has already been closed."
-msgstr "Tento PooledConnection byl uzav�en."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid ""
-"Connection has been closed automatically because a new connection was opened "
-"for the same PooledConnection or the PooledConnection has been closed."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid "Connection has been closed."
-msgstr "Spojeni bylo uzav�eno."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:442
-msgid "Statement has been closed."
-msgstr "Statement byl uzav�en."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:291
-msgid "Failed to setup DataSource."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:414
-msgid "DataSource has been closed."
-msgstr "DataSource byl uzav�en."
-
-#: org/postgresql/fastpath/Fastpath.java:81
-#: org/postgresql/fastpath/Fastpath.java:128
-#, java-format
-msgid "Fastpath call {0} - No result was returned and we expected an integer."
-msgstr ""
-
-#: org/postgresql/fastpath/Fastpath.java:237
-#, java-format
-msgid "The fastpath function {0} is unknown."
-msgstr ""
-
-#: org/postgresql/geometric/PGbox.java:83
-#: org/postgresql/geometric/PGcircle.java:82
-#: org/postgresql/geometric/PGcircle.java:91
-#: org/postgresql/geometric/PGline.java:80
-#: org/postgresql/geometric/PGlseg.java:77
-#: org/postgresql/geometric/PGpoint.java:85
-#, java-format
-msgid "Conversion to type {0} failed: {1}."
-msgstr ""
-
-#: org/postgresql/geometric/PGpath.java:81
-#, java-format
-msgid "Cannot tell if path is open or closed: {0}."
-msgstr ""
-
-#: org/postgresql/gss/MakeGSS.java:47 org/postgresql/gss/MakeGSS.java:55
-#: org/postgresql/gss/MakeGSS.java:168
-msgid "GSS Authentication failed"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:153
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:790
-#, java-format
-msgid "The array index is out of range: {0}"
-msgstr "Index pole mimo rozsah: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:168
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:807
-#, java-format
-msgid "The array index is out of range: {0}, number of elements: {1}."
-msgstr "Index pole mimo rozsah: {0}, po�et prvk�: {1}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:196
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1982
-#: org/postgresql/util/HStoreConverter.java:34
-#: org/postgresql/util/HStoreConverter.java:61
-msgid ""
-"Invalid character data was found. This is most likely caused by stored data "
-"containing characters that are invalid for the character set the database "
-"was created in. The most common example of this is storing 8bit data in a "
-"SQL_ASCII database."
-msgstr ""
-"Nalezena vada ve znakov�ch datech. Toto m��e b�t zp�sobeno ulo�en�mi daty "
-"obsahuj�c�mi znaky, kter� jsou z�vadn� pro znakovou sadu nastavenou p�i "
-"zakl�d�n� datab�ze. Nejzn�mej�� p��klad je ukl�d�n� 8bitov�ch dat vSQL_ASCII "
-"datab�zi."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:73
-msgid ""
-"Truncation of large objects is only implemented in 8.3 and later servers."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:77
-msgid "Cannot truncate LOB to a negative length."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:81
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:235
-#, java-format
-msgid "PostgreSQL LOBs can only index to: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:231
-msgid "LOB positioning offsets start at 1."
-msgstr "Za��tek pozicov�n� LOB za��na na 1."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:246
-msgid "free() was called on this LOB previously"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:225
-#, fuzzy, java-format
-msgid "Unsupported value for stringtype parameter: {0}"
-msgstr "Nepodporovan� hodnota typu: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:245
-msgid "unknownLength parameter value must be an integer"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:353
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:284
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:303
-#: org/postgresql/jdbc2/TypeInfoCache.java:201
-#: org/postgresql/jdbc2/TypeInfoCache.java:249
-#: org/postgresql/jdbc2/TypeInfoCache.java:287
-#: org/postgresql/jdbc2/TypeInfoCache.java:344
-#: org/postgresql/jdbc2/TypeInfoCache.java:348
-#: org/postgresql/jdbc2/TypeInfoCache.java:384
-#: org/postgresql/jdbc2/TypeInfoCache.java:388
-msgid "No results were returned by the query."
-msgstr "Neobdr�en ��dn� v�sledek dotazu."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:367
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:336
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:368
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2702
-msgid "A result was returned when none was expected."
-msgstr "Obdr�en v�sledek, ikdy� ��dn� nebyl o�ek�v�n."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:519
-msgid "Custom type maps are not supported."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:567
-#, java-format
-msgid "Failed to create object for: {0}."
-msgstr "Selhalo vytvo�en� objektu: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:629
-#, java-format
-msgid "Unable to load the class {0} responsible for the datatype {1}"
-msgstr "Nemohu na��st t��du {0} odpov�dnou za typ {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:725
-msgid ""
-"Cannot change transaction read-only property in the middle of a transaction."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:813
-msgid "Cannot commit when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:822
-#, fuzzy
-msgid "This connection has been closed."
-msgstr "Spojeni bylo uzav�eno."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:842
-msgid "Cannot rollback when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:929
-msgid ""
-"Cannot change transaction isolation level in the middle of a transaction."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:934
-#, java-format
-msgid "Transaction isolation level {0} not supported."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1001
-#, fuzzy
-msgid "Finalizing a Connection that was never closed:"
-msgstr "Spojeni bylo uzav�eno."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1103
-msgid "Unable to translate data into the desired encoding."
-msgstr "Nemohu p�elo�it data do po�adovan�ho k�dov�n�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:63
-#, fuzzy
-msgid ""
-"Unable to determine a value for MaxIndexKeys due to missing system catalog "
-"data."
-msgstr "Nemohu naj�t oid a oidvector typu v syst�mov�m katalogu."
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:86
-msgid "Unable to find name datatype in the system catalogs."
-msgstr "Nemohu naj�t n�zev typu v syst�mov�m katalogu."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:235
-msgid ""
-"Operation requires a scrollable ResultSet, but this ResultSet is "
-"FORWARD_ONLY."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:416
-msgid "Unexpected error while decoding character data from a large object."
-msgstr "Neo�ek�van� chyba b�ham dek�dov�n� znaku z velk�ho objektu."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:462
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:491
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:525
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3129
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3174
-#, fuzzy, java-format
-msgid "Cannot convert the column of type {0} to requested type {1}."
-msgstr "Nemohu p�etypovat instanci {0} na typ {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:744
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:768
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1892
-msgid "Can''t use relative move methods while on the insert row."
-msgstr "Nem��ete pou��vat relativn� p�esuny p�i vkl�d�n� ��dku."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:788
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2956
-#, java-format
-msgid "Invalid fetch direction constant: {0}."
-msgstr "�patn� sm�r �ten�: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:802
-msgid "Cannot call cancelRowUpdates() when on the insert row."
-msgstr "Nem��ete volat cancelRowUpdates() p�i vkl�d�n� ��dku."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:822
-msgid "Cannot call deleteRow() when on the insert row."
-msgstr "Nem��ete volat deleteRow() p�i vkl�d�n� ��dku."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:828
-msgid ""
-"Currently positioned before the start of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:833
-msgid ""
-"Currently positioned after the end of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"Pr�v� jste za pozic� konce ResultSetu. Zde nem��ete volat deleteRow().s"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:838
-msgid "There are no rows in this ResultSet."
-msgstr "��dn� ��dek v ResultSet."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:885
-msgid "Not on the insert row."
-msgstr "Ne na vkl�dan�m ��dku."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:889
-msgid "You must specify at least one column value to insert a row."
-msgstr "Mus�te vyplnit alespo� jeden sloupec pro vlo�en� ��dku."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1074
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1805
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2494
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2524
-#, java-format
-msgid "The JVM claims not to support the encoding: {0}"
-msgstr "JVM tvrd�, �e nepodporuje kodov�n�: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1078
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1121
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1534
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1663
-msgid "Provided InputStream failed."
-msgstr "Selhal poskytnut� InputStream."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1191
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3137
-msgid "Provided Reader failed."
-msgstr "Selhal poskytnut� Reader."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1259
-msgid "Can''t refresh the insert row."
-msgstr "Nemohu obnovit vkl�dan� ��dek."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1327
-msgid "Cannot call updateRow() when on the insert row."
-msgstr "Nemohu volat updateRow() na vlk�dan�m ��dku."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1333
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3190
-msgid ""
-"Cannot update the ResultSet because it is either before the start or after "
-"the end of the results."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1582
-msgid "ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."
-msgstr "ResultSets se soub�nost� CONCUR_READ_ONLY nem��e b�t aktualizov�no"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1650
-#, java-format
-msgid "No primary key found for table {0}."
-msgstr "Nenalezen prim�rn� kl�� pro tabulku {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1876
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2965
-msgid "Fetch size must be a value greater to or equal to 0."
-msgstr "Nabran� velikost mus� b�t nez�porn�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2044
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2051
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2098
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2106
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2926
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2934
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2964
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2971
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2991
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3002
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3020
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3038
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3179
-#: org/postgresql/jdbc2/TimestampUtils.java:258
-#, java-format
-msgid "Bad value for type {0} : {1}"
-msgstr "�patn� hodnota pro typ {0} : {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2727
-#, java-format
-msgid "The column name {0} was not found in this ResultSet."
-msgstr "Sloupec pojmenovan� {0} nebyl nalezen v ResultSet."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2827
-msgid ""
-"ResultSet is not updateable. The query that generated this result set must "
-"select only one table, and must select all primary keys from that table. See "
-"the JDBC 2.1 API Specification, section 5.6 for more details."
-msgstr ""
-"ResultSet nen� aktualizavateln�. Dotaz mus� vyb�rat pouze z jedn� tabulky a "
-"mus� obsahovat v�echny prim�rn� kl��e tabulky. Koukni do JDBC 2.1 API "
-"Specifikace, sekce 5.6 pro v�ce podrobnost�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2839
-msgid "This ResultSet is closed."
-msgstr "Tento ResultSet je uzav�en�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2860
-msgid "ResultSet not positioned properly, perhaps you need to call next."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:259
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:323
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:392
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2655
-msgid ""
-"Can''t use query methods that take a query string on a PreparedStatement."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:287
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:306
-msgid "Multiple ResultSets were returned by the query."
-msgstr "V�cen�sobn� ResultSet byl vr�cen dotazem."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:425
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:429
-msgid "A CallableStatement was executed with nothing returned."
-msgstr "CallableStatement byl spu�t�n, le� nic nebylo vr�ceno."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:437
-#, fuzzy
-msgid "A CallableStatement was executed with an invalid number of parameters"
-msgstr "CallableStatement byl spu�t�n, le� nic nebylo vr�ceno."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:468
-#, java-format
-msgid ""
-"A CallableStatement function was executed and the out parameter {0} was of "
-"type {1} however type {2} was registered."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:674
-msgid "Maximum number of rows must be a value grater than or equal to 0."
-msgstr "Maxim�ln� po�et ��dek mus� b�t nez�porn� ��slo."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:717
-msgid "Query timeout must be a value greater than or equals to 0."
-msgstr "�asov� limit dotazu mus� b�t nez�porn� ��slo."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:809
-msgid "The maximum field size must be a value greater than or equal to 0."
-msgstr "Maxim�ln� velikost pole mus� b�t nez�porn� ��slo."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1226
-msgid "Unknown Types value."
-msgstr "Nezn�m� hodnota typu."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1499
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1624
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3108
-#, java-format
-msgid "Invalid stream length {0}."
-msgstr "Vadn� d�lka proudu {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1530
-#, java-format
-msgid "The JVM claims not to support the {0} encoding."
-msgstr "JVM tvrd�, �e nepodporuje kodov�n� {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1705
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3030
-#, java-format
-msgid "Unknown type {0}."
-msgstr "Nezn�m� typ {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1720
-msgid "No hstore extension installed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1845
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1851
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1857
-#, java-format
-msgid "Cannot cast an instance of {0} to type {1}"
-msgstr "Nemohu p�etypovat instanci {0} na typ {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1869
-#, java-format
-msgid "Unsupported Types value: {0}"
-msgstr "Nepodporovan� hodnota typu: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1927
-#, java-format
-msgid ""
-"Can''t infer the SQL type to use for an instance of {0}. Use setObject() "
-"with an explicit Types value to specify the type to use."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1975
-msgid ""
-"This statement does not declare an OUT parameter. Use '{' ?= call ... '}' "
-"to declare one."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2025
-msgid "wasNull cannot be call before fetching a result."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2521
-#, java-format
-msgid "Malformed function or procedure escape syntax at offset {0}."
-msgstr "Po�kozen� funkce nebo opu�t�n� procedury na pozici {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2571
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2585
-#, java-format
-msgid ""
-"Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was "
-"made."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2604
-msgid ""
-"A CallableStatement was declared, but no call to registerOutParameter(1, "
-"<some type>) was made."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2608
-msgid "No function outputs were registered."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2611
-msgid ""
-"Results cannot be retrieved from a CallableStatement before it is executed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2644
-msgid "This statement has been closed."
-msgstr "P��kaz byl uzav�en."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2724
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2794
-msgid "Too many update results were returned."
-msgstr "Bylo vr�ceno p��li� mnoho v�sledk� aktualizac�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2753
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2823
-#, java-format
-msgid ""
-"Batch entry {0} {1} was aborted. Call getNextException to see the cause."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3078
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3167
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3207
-msgid "Unexpected error writing large object to database."
-msgstr "Neo�ek�van� chyba p�i zapisov�n� velk�ho objektu do datab�ze."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:145
-#: org/postgresql/jdbc2/EscapedFunctions.java:157
-#: org/postgresql/jdbc2/EscapedFunctions.java:169
-#: org/postgresql/jdbc2/EscapedFunctions.java:206
-#: org/postgresql/jdbc2/EscapedFunctions.java:243
-#: org/postgresql/jdbc2/EscapedFunctions.java:267
-#: org/postgresql/jdbc2/EscapedFunctions.java:292
-#: org/postgresql/jdbc2/EscapedFunctions.java:316
-#: org/postgresql/jdbc2/EscapedFunctions.java:328
-#: org/postgresql/jdbc2/EscapedFunctions.java:352
-#: org/postgresql/jdbc2/EscapedFunctions.java:380
-#: org/postgresql/jdbc2/EscapedFunctions.java:389
-#: org/postgresql/jdbc2/EscapedFunctions.java:399
-#: org/postgresql/jdbc2/EscapedFunctions.java:408
-#: org/postgresql/jdbc2/EscapedFunctions.java:417
-#: org/postgresql/jdbc2/EscapedFunctions.java:426
-#: org/postgresql/jdbc2/EscapedFunctions.java:435
-#: org/postgresql/jdbc2/EscapedFunctions.java:444
-#: org/postgresql/jdbc2/EscapedFunctions.java:453
-#: org/postgresql/jdbc2/EscapedFunctions.java:462
-#: org/postgresql/jdbc2/EscapedFunctions.java:471
-#: org/postgresql/jdbc2/EscapedFunctions.java:480
-#, java-format
-msgid "{0} function takes one and only one argument."
-msgstr "Funkce {0} bere jeden argument."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:181
-#: org/postgresql/jdbc2/EscapedFunctions.java:193
-#: org/postgresql/jdbc2/EscapedFunctions.java:255
-#: org/postgresql/jdbc2/EscapedFunctions.java:304
-#: org/postgresql/jdbc2/EscapedFunctions.java:582
-#, java-format
-msgid "{0} function takes two and only two arguments."
-msgstr "Funkce {0} bere pr�v� dva argumenty."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:230
-#, java-format
-msgid "{0} function takes four and only four argument."
-msgstr "Funkce {0} bere p�esn� �ty�i argumenty."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:282
-#: org/postgresql/jdbc2/EscapedFunctions.java:342
-#, java-format
-msgid "{0} function takes two or three arguments."
-msgstr "Funkce {0} bere dva nebo t�i argumenty."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:362
-#: org/postgresql/jdbc2/EscapedFunctions.java:371
-#: org/postgresql/jdbc2/EscapedFunctions.java:573
-#: org/postgresql/jdbc2/EscapedFunctions.java:591
-#, java-format
-msgid "{0} function doesn''t take any argument."
-msgstr "Funkce {0} nebere ��dn� argument."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:489
-#: org/postgresql/jdbc2/EscapedFunctions.java:531
-#, fuzzy, java-format
-msgid "{0} function takes three and only three arguments."
-msgstr "Funkce {0} bere pr�v� dva argumenty."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:501
-#: org/postgresql/jdbc2/EscapedFunctions.java:521
-#: org/postgresql/jdbc2/EscapedFunctions.java:523
-#: org/postgresql/jdbc2/EscapedFunctions.java:543
-#: org/postgresql/jdbc2/EscapedFunctions.java:564
-#: org/postgresql/jdbc2/EscapedFunctions.java:566
-#, fuzzy, java-format
-msgid "Interval {0} not yet implemented"
-msgstr "Metoda {0} nen� implementov�na."
-
-#: org/postgresql/jdbc2/TimestampUtils.java:360
-msgid ""
-"Infinite value found for timestamp/date. This cannot be represented as time."
-msgstr "Nekone�n� hodnota pro timestamp/date. Toto nem��e reprezentovat �as."
-
-#: org/postgresql/jdbc2/TimestampUtils.java:648
-#: org/postgresql/jdbc2/TimestampUtils.java:680
-#: org/postgresql/jdbc2/TimestampUtils.java:727
-#, fuzzy, java-format
-msgid "Unsupported binary encoding of {0}."
-msgstr "Nepodporovan� hodnota typu: {0}"
-
-#: org/postgresql/jdbc2/TypeInfoCache.java:161
-#, java-format
-msgid "The class {0} does not implement org.postgresql.util.PGobject."
-msgstr "T��da {0} nepodporuje org.postgresql.util.PGobject."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:60
-#, java-format
-msgid "Unknown ResultSet holdability setting: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:98
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:130
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:165
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:187
-msgid "Server versions prior to 8.0 do not support savepoints."
-msgstr "Verze serveru ni��� ne� 8.0 nepodporuj� savepoints."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:100
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:132
-msgid "Cannot establish a savepoint in auto-commit mode."
-msgstr "Nemohu vytvo�it savepoint v auto-commit modu."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:419
-msgid "Returning autogenerated keys is not supported."
-msgstr "Vr�cen� automaticky generovan�ch kl��� nen� podporov�no."
-
-#: org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java:81
-#, java-format
-msgid "The parameter index is out of range: {0}, number of parameters: {1}."
-msgstr "Index parametru mimo rozsah: {0}, po�et parametr� {1}."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:151
-#, fuzzy
-msgid ""
-"Returning autogenerated keys is only supported for 8.2 and later servers."
-msgstr "Vr�cen� automaticky generovan�ch kl��� nen� podporov�no."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:199
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:317
-#, fuzzy
-msgid "Returning autogenerated keys by column index is not supported."
-msgstr "Vr�cen� automaticky generovan�ch kl��� nen� podporov�no."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:38
-#: org/postgresql/jdbc3/PSQLSavepoint.java:50
-#: org/postgresql/jdbc3/PSQLSavepoint.java:66
-msgid "Cannot reference a savepoint after it has been released."
-msgstr "Nemohu z�skat odkaz na savepoint, kdy� byl uvoln�n."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:42
-msgid "Cannot retrieve the id of a named savepoint."
-msgstr "Nemohu z�skat id nepojmenovan�ho savepointu."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:54
-msgid "Cannot retrieve the name of an unnamed savepoint."
-msgstr "Nemohu z�skat n�zev nepojmenovan�ho savepointu."
-
-#: org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java:37
-msgid "Invalid UUID data."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:83
-#, java-format
-msgid "Unable to find server array type for provided name {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:121
-#, fuzzy, java-format
-msgid "Invalid timeout ({0}<0)."
-msgstr "Vadn� d�lka proudu {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:134
-msgid "Validating connection."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:157
-#, fuzzy, java-format
-msgid "Failed to set ClientInfo property: {0}"
-msgstr "Selhalo vytvo�en� objektu: {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:166
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:188
-#, fuzzy
-msgid "ClientInfo property not supported."
-msgstr "Vr�cen� automaticky generovan�ch kl��� nen� podporov�no."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Statement.java:127
-msgid "Object is too large to send over the protocol."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:147
-msgid "Unable to decode xml data."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:150
-#, java-format
-msgid "Unknown XML Source class: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:195
-#, fuzzy
-msgid "Unable to create SAXResult for SQLXML."
-msgstr "Selhalo vytvo�en� objektu: {0}."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:209
-msgid "Unable to create StAXResult for SQLXML"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:213
-#, java-format
-msgid "Unknown XML Result class: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:226
-#, fuzzy
-msgid "This SQLXML object has already been freed."
-msgstr "Tento PooledConnection byl uzav�en."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:233
-msgid ""
-"This SQLXML object has not been initialized, so you cannot retrieve data "
-"from it."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:244
-#, java-format
-msgid "Failed to convert binary xml data to encoding: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:269
-msgid "Unable to convert DOMResult SQLXML data to a string."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:282
-msgid ""
-"This SQLXML object has already been initialized, so you cannot manipulate it "
-"further."
-msgstr ""
-
-#: org/postgresql/largeobject/LargeObjectManager.java:138
-msgid "Failed to initialize LargeObject API"
-msgstr "Selhala inicializace LargeObject API"
-
-#: org/postgresql/largeobject/LargeObjectManager.java:257
-#: org/postgresql/largeobject/LargeObjectManager.java:298
-msgid "Large Objects may not be used in auto-commit mode."
-msgstr "Velk� objecky nemohou b�t pou�ity v auto-commit modu."
-
-#: org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java:58
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:110
-#, java-format
-msgid "The SSLSocketFactory class provided {0} could not be instantiated."
-msgstr "T��da SSLSocketFactory poskytla {0} co� nem��e b�t instancionizov�no."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:125
-#, java-format
-msgid "SSL error: {0}"
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:138
-#, fuzzy, java-format
-msgid "The HostnameVerifier class provided {0} could not be instantiated."
-msgstr "T��da SSLSocketFactory poskytla {0} co� nem��e b�t instancionizov�no."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:142
-#, java-format
-msgid "The hostname {0} could not be verified by hostnameverifier {1}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:149
-#, fuzzy, java-format
-msgid "The hostname {0} could not be verified."
-msgstr "T��da SSLSocketFactory poskytla {0} co� nem��e b�t instancionizov�no."
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:121
-msgid ""
-"Could not find a java cryptographic algorithm: X.509 CertificateFactory not "
-"available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:132
-#, java-format
-msgid "Could not open SSL certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:137
-#, java-format
-msgid "Loading the SSL certificate {0} into a KeyManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:194
-msgid "Enter SSL password: "
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:202
-msgid "Could not read password for SSL key file, console is not available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:204
-#, java-format
-msgid "Could not read password for SSL key file by callbackhandler {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:223
-#, java-format
-msgid "Could not decrypt SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:231
-#, java-format
-msgid "Could not read SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:235
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:173
-#, java-format
-msgid "Could not find a java cryptographic algorithm: {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:99
-#, fuzzy, java-format
-msgid "The password callback class provided {0} could not be instantiated."
-msgstr "T��da SSLSocketFactory poskytla {0} co� nem��e b�t instancionizov�no."
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:133
-#, java-format
-msgid "Could not open SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:150
-#, java-format
-msgid "Could not read SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:153
-#, java-format
-msgid "Loading the SSL root certificate {0} into a TrustManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:166
-msgid "Could not initialize SSL context."
-msgstr ""
-
-#: org/postgresql/util/PGInterval.java:164
-#, fuzzy
-msgid "Conversion of interval failed"
-msgstr "P�evod pen�z selhal."
-
-#: org/postgresql/util/PGmoney.java:73
-msgid "Conversion of money failed."
-msgstr "P�evod pen�z selhal."
-
-#: org/postgresql/util/ServerErrorMessage.java:155
-#, java-format
-msgid "Detail: {0}"
-msgstr "Detail: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:159
-#, java-format
-msgid "Hint: {0}"
-msgstr "Rada: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:162
-#, java-format
-msgid "Position: {0}"
-msgstr "Pozice: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:165
-#, java-format
-msgid "Where: {0}"
-msgstr "Kde: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:171
-#, java-format
-msgid "Internal Query: {0}"
-msgstr ""
-
-#: org/postgresql/util/ServerErrorMessage.java:174
-#, fuzzy, java-format
-msgid "Internal Position: {0}"
-msgstr "Pozice: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:180
-#, java-format
-msgid "Location: File: {0}, Routine: {1}, Line: {2}"
-msgstr "Poloha: Soubor: {0}, Rutina: {1}, ��dek: {2}"
-
-#: org/postgresql/util/ServerErrorMessage.java:183
-#, java-format
-msgid "Server SQLState: {0}"
-msgstr "Server SQLState: {0}"
-
-#: org/postgresql/xa/PGXAConnection.java:148
-msgid ""
-"Transaction control methods setAutoCommit(true), commit, rollback and "
-"setSavePoint not allowed while an XA transaction is active."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:186
-#: org/postgresql/xa/PGXAConnection.java:245
-msgid "Invalid flags"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:189
-#: org/postgresql/xa/PGXAConnection.java:248
-#: org/postgresql/xa/PGXAConnection.java:425
-msgid "xid must not be null"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:192
-msgid "Connection is busy with another transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:198
-#: org/postgresql/xa/PGXAConnection.java:255
-msgid "suspend/resume not implemented"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:204
-#: org/postgresql/xa/PGXAConnection.java:207
-#: org/postgresql/xa/PGXAConnection.java:209
-msgid "Transaction interleaving not implemented"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:218
-msgid "Error disabling autocommit"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:251
-msgid "tried to call end without corresponding start call"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:282
-msgid ""
-"Not implemented: Prepare must be issued using the same connection that "
-"started the transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:286
-msgid "Prepare called before end"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:292
-#, fuzzy
-msgid "Server versions prior to 8.1 do not support two-phase commit."
-msgstr "Verze serveru ni��� ne� 8.0 nepodporuj� savepoints."
-
-#: org/postgresql/xa/PGXAConnection.java:313
-msgid "Error preparing transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:328
-msgid "Invalid flag"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:368
-msgid "Error during recover"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:416
-msgid "Error rolling back prepared transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:451
-msgid ""
-"Not implemented: one-phase commit must be issued using the same connection "
-"that was used to start it"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:455
-msgid "commit called before end"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:466
-msgid "Error during one-phase commit"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:487
-msgid ""
-"Not implemented: 2nd phase commit must be issued using an idle connection"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:507
-msgid "Error committing prepared transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:522
-msgid "Heuristic commit/rollback not supported"
-msgstr ""
-
-#~ msgid "The driver does not support SSL."
-#~ msgstr "Ovlada� nepodporuje SSL."
-
-#~ msgid "Multi-dimensional arrays are currently not supported."
-#~ msgstr "V�ce-rozm�rn� pole nejsou nyn� podporov�ny."
-
-#~ msgid "rand function only takes zero or one argument(the seed)."
-#~ msgstr "Funkce rand bere ��dn� nebo jen jeden argument(seed)."
-
-#~ msgid "Exception: {0}"
-#~ msgstr "Vyj�mka: {0}"
-
-#~ msgid "Stack Trace:"
-#~ msgstr "V�pis z�sobn�ku:"
-
-#~ msgid "End of Stack Trace"
-#~ msgstr "Konec v�pisu z�sobn�ku"
-
-#~ msgid "Exception generating stacktrace for: {0} encountered: {1}"
-#~ msgstr "Vyj�mka tvo��c� v�pis z�sobn�ku pro: {0} encountered: {1}"
-
-#~ msgid ""
-#~ "PostgreSQL only supports a single OUT function return value at index 1."
-#~ msgstr ""
-#~ "PostgreSQL podporuje pouze funkce s jednou navratovou hodnotou na indexu "
-#~ "1."
diff --git a/org/postgresql/translation/de.po b/org/postgresql/translation/de.po
deleted file mode 100644
index c43bb98..0000000
--- a/org/postgresql/translation/de.po
+++ /dev/null
@@ -1,1627 +0,0 @@
-# translation of head-de.po to Deutsch
-# German message translation for the PostgreSQL JDBC driver
-# This file is distributed under the same license as the package.
-#
-# Andre Bialojahn <ab.spamnews at freenet.de>, 2005, 2006, 2008.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: head-de\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-10-31 13:37+0000\n"
-"PO-Revision-Date: 2008-09-12 14:22+0200\n"
-"Last-Translator: Andre Bialojahn <ab.spamnews at freenet.de>\n"
-"Language-Team: Deutsch\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ISO-8859-1\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: KBabel 1.0.2\n"
-"X-Poedit-Language: German\n"
-"X-Poedit-Country: GERMANY\n"
-
-#: org/postgresql/Driver.java.in:235
-msgid "Error loading default settings from driverconfig.properties"
-msgstr "Fehler beim Laden der Voreinstellungen aus driverconfig.properties"
-
-#: org/postgresql/Driver.java.in:282
-msgid ""
-"Your security policy has prevented the connection from being attempted. You "
-"probably need to grant the connect java.net.SocketPermission to the database "
-"server host and port that you wish to connect to."
-msgstr ""
-"Ihre Sicherheitsrichtlinie hat den Versuch des Verbindungsaufbaus "
-"verhindert. Sie m�ssen wahrscheinlich der Verbindung zum Datenbankrechner "
-"java.net.SocketPermission gew�hren, um den Rechner auf dem gew�hlten Port zu "
-"erreichen."
-
-#: org/postgresql/Driver.java.in:287 org/postgresql/Driver.java.in:351
-msgid ""
-"Something unusual has occurred to cause the driver to fail. Please report "
-"this exception."
-msgstr ""
-"Etwas Ungew�hnliches ist passiert, das den Treiber fehlschlagen lie�. Bitte "
-"teilen Sie diesen Fehler mit."
-
-#: org/postgresql/Driver.java.in:359
-msgid "Connection attempt timed out."
-msgstr "Keine Verbindung innerhalb des Zeitintervalls m�glich."
-
-#: org/postgresql/Driver.java.in:372
-msgid "Interrupted while attempting to connect."
-msgstr "Beim Verbindungsversuch trat eine Unterbrechung auf."
-
-#: org/postgresql/Driver.java.in:714
-#, java-format
-msgid "Method {0} is not yet implemented."
-msgstr "Die Methode {0} ist noch nicht implementiert."
-
-#: org/postgresql/copy/CopyManager.java:56
-#, java-format
-msgid "Requested CopyIn but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/CopyManager.java:67
-#, java-format
-msgid "Requested CopyOut but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:51
-#, fuzzy, java-format
-msgid "Copying from database failed: {0}"
-msgstr "Konnte �{0}� nicht in Typ �box� umwandeln"
-
-#: org/postgresql/copy/PGCopyInputStream.java:67
-#: org/postgresql/copy/PGCopyOutputStream.java:90
-#, fuzzy
-msgid "This copy stream is closed."
-msgstr "Dieses ResultSet ist geschlossen."
-
-#: org/postgresql/copy/PGCopyInputStream.java:108
-msgid "Read from copy failed."
-msgstr ""
-
-#: org/postgresql/copy/PGCopyOutputStream.java:68
-#, java-format
-msgid "Cannot write to copy a byte of value {0}"
-msgstr ""
-
-#: org/postgresql/core/ConnectionFactory.java:69
-#, java-format
-msgid "A connection could not be made using the requested protocol {0}."
-msgstr ""
-"Es konnte keine Verbindung unter Verwendung des Protokolls {0} hergestellt "
-"werden."
-
-#: org/postgresql/core/Oid.java:113
-#, java-format
-msgid "oid type {0} not known and not a number"
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:490
-#, java-format
-msgid "Premature end of input stream, expected {0} bytes, but only read {1}."
-msgstr ""
-"Vorzeitiges Ende des Eingabedatenstroms. Es wurden {0} Bytes erwartet, "
-"jedoch nur {1} gelesen."
-
-#: org/postgresql/core/PGStream.java:530
-#, java-format
-msgid "Expected an EOF from server, got: {0}"
-msgstr "Vom Server wurde ein EOF erwartet, jedoch {0} gelesen."
-
-#: org/postgresql/core/SetupQueryRunner.java:86
-msgid "An unexpected result was returned by a query."
-msgstr "Eine Abfrage lieferte ein unerwartetes Resultat."
-
-#: org/postgresql/core/UTF8Encoding.java:28
-#, java-format
-msgid ""
-"Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}"
-msgstr ""
-"Ung�ltige UTF-8-Sequenz: Byte {0} der {1} Bytesequenz ist nicht 10xxxxxx: {2}"
-
-#: org/postgresql/core/UTF8Encoding.java:61
-#, java-format
-msgid "Illegal UTF-8 sequence: {0} bytes used to encode a {1} byte value: {2}"
-msgstr ""
-"Ung�ltige UTF-8-Sequenz: {0} Bytes wurden verwendet um einen {1} Bytewert zu "
-"kodieren: {2}"
-
-#: org/postgresql/core/UTF8Encoding.java:98
-#: org/postgresql/core/UTF8Encoding.java:125
-#, java-format
-msgid "Illegal UTF-8 sequence: initial byte is {0}: {1}"
-msgstr "Ung�ltige UTF-8-Sequenz: das erste Byte ist {0}: {1}"
-
-#: org/postgresql/core/UTF8Encoding.java:130
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is out of range: {0}"
-msgstr ""
-"Ung�ltige UTF-8-Sequenz: Der letzte Wert ist au�erhalb des zul�ssigen "
-"Bereichs: {0}"
-
-#: org/postgresql/core/UTF8Encoding.java:145
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is a surrogate value: {0}"
-msgstr "Ung�ltige UTF-8-Sequenz: der letzte Wert ist ein Ersatzwert: {0}"
-
-#: org/postgresql/core/Utils.java:95 org/postgresql/core/Utils.java:112
-msgid "Zero bytes may not occur in string parameters."
-msgstr "Stringparameter d�rfen keine Nullbytes enthalten."
-
-#: org/postgresql/core/Utils.java:145
-msgid "Zero bytes may not occur in identifiers."
-msgstr "Nullbytes d�rfen in Bezeichnern nicht vorkommen."
-
-#: org/postgresql/core/types/PGBigDecimal.java:63
-#: org/postgresql/core/types/PGBoolean.java:62
-#: org/postgresql/core/types/PGByte.java:63
-#: org/postgresql/core/types/PGDouble.java:64
-#: org/postgresql/core/types/PGFloat.java:64
-#: org/postgresql/core/types/PGInteger.java:61
-#: org/postgresql/core/types/PGLong.java:62
-#: org/postgresql/core/types/PGNumber.java:62
-#: org/postgresql/core/types/PGShort.java:58
-#: org/postgresql/core/types/PGString.java:73
-#, java-format
-msgid "Cannot convert an instance of {0} to type {1}"
-msgstr "Die Typwandlung f�r eine Instanz von {0} nach {1} ist nicht m�glich."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:66
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:74
-#, fuzzy, java-format
-msgid "Invalid sslmode value: {0}"
-msgstr "Ung�ltige L�nge des Datenstroms: {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:134
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:207
-msgid ""
-"Connection refused. Check that the hostname and port are correct and that "
-"the postmaster is accepting TCP/IP connections."
-msgstr ""
-"Verbindung verweigert. �berpr�fen Sie die Korrektheit von Hostnamen und der "
-"Portnummer und dass der Datenbankserver TCP/IP-Verbindungen annimmt."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:153
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:225
-msgid "The connection attempt failed."
-msgstr "Der Verbindungsversuch schlug fehl."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:175
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:246
-#, fuzzy
-msgid "The connection url is invalid."
-msgstr "Der Verbindungsversuch schlug fehl."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:198
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:210
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:295
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:307
-msgid "The server does not support SSL."
-msgstr "Der Server unterst�tzt SSL nicht."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:223
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:320
-msgid "An error occurred while setting up the SSL connection."
-msgstr "Beim Aufbau der SSL-Verbindung trat ein Fehler auf."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:272
-#, java-format
-msgid "Connection rejected: {0}."
-msgstr "Verbindung abgewiesen: {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:290
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:312
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:332
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:419
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:444
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:471
-msgid ""
-"The server requested password-based authentication, but no password was "
-"provided."
-msgstr ""
-"Der Server verlangt passwortbasierte Authentifizierung, jedoch wurde kein "
-"Passwort angegeben."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:356
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:504
-#, java-format
-msgid ""
-"The authentication type {0} is not supported. Check that you have configured "
-"the pg_hba.conf file to include the client''s IP address or subnet, and that "
-"it is using an authentication scheme supported by the driver."
-msgstr ""
-"Der Authentifizierungstyp {0} wird nicht unterst�tzt. Stellen Sie sicher, "
-"dass die Datei ''pg_hba.conf'' die IP-Adresse oder das Subnetz des Clients "
-"enth�lt und dass der Client ein Authentifizierungsschema nutzt, das vom "
-"Treiber unterst�tzt wird."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:362
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:400
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:510
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:553
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:599
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:609
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:618
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:626
-#: org/postgresql/gss/MakeGSS.java:158
-msgid "Protocol error. Session setup failed."
-msgstr "Protokollfehler. Die Sitzung konnte nicht gestartet werden."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:390
-#, java-format
-msgid "Backend start-up failed: {0}."
-msgstr "Das Backend konnte nicht gestartet werden: {0}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:55
-#: org/postgresql/core/v2/FastpathParameterList.java:77
-#: org/postgresql/core/v2/FastpathParameterList.java:84
-#: org/postgresql/core/v2/SimpleParameterList.java:57
-#: org/postgresql/core/v2/SimpleParameterList.java:76
-#: org/postgresql/core/v2/SimpleParameterList.java:83
-#: org/postgresql/core/v2/SimpleParameterList.java:90
-#: org/postgresql/core/v3/CompositeParameterList.java:35
-#: org/postgresql/core/v3/SimpleParameterList.java:49
-#: org/postgresql/core/v3/SimpleParameterList.java:56
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2845
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java:419
-#, java-format
-msgid "The column index is out of range: {0}, number of columns: {1}."
-msgstr ""
-"Der Spaltenindex {0} ist au�erhalb des g�ltigen Bereichs. Anzahl Spalten: "
-"{1}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:142
-#: org/postgresql/core/v2/SimpleParameterList.java:155
-#: org/postgresql/core/v3/SimpleParameterList.java:216
-#, java-format
-msgid "No value specified for parameter {0}."
-msgstr "F�r den Parameter {0} wurde kein Wert angegeben."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:72
-#: org/postgresql/core/v2/QueryExecutorImpl.java:337
-#: org/postgresql/core/v3/QueryExecutorImpl.java:443
-#: org/postgresql/core/v3/QueryExecutorImpl.java:507
-#, java-format
-msgid "Expected command status BEGIN, got {0}."
-msgstr "Statt des erwarteten Befehlsstatus BEGIN, wurde {0} empfangen."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:78
-#: org/postgresql/core/v3/QueryExecutorImpl.java:513
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1828
-#, java-format
-msgid "Unexpected command status: {0}."
-msgstr "Unerwarteter Befehlsstatus: {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:118
-#: org/postgresql/core/v2/QueryExecutorImpl.java:129
-#: org/postgresql/core/v2/QueryExecutorImpl.java:174
-#: org/postgresql/core/v2/QueryExecutorImpl.java:369
-#: org/postgresql/core/v3/QueryExecutorImpl.java:281
-#: org/postgresql/core/v3/QueryExecutorImpl.java:411
-#: org/postgresql/core/v3/QueryExecutorImpl.java:485
-#: org/postgresql/core/v3/QueryExecutorImpl.java:551
-#: org/postgresql/core/v3/QueryExecutorImpl.java:631
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2094
-#, fuzzy
-msgid "An I/O error occured while sending to the backend."
-msgstr "Eingabe/Ausgabe-Fehler {0} beim Senden an das Backend."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:170
-#: org/postgresql/core/v2/QueryExecutorImpl.java:225
-#: org/postgresql/core/v2/QueryExecutorImpl.java:236
-#: org/postgresql/core/v3/QueryExecutorImpl.java:627
-#: org/postgresql/core/v3/QueryExecutorImpl.java:685
-#, java-format
-msgid "Unknown Response Type {0}."
-msgstr "Die Antwort weist einen unbekannten Typ auf: {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:430
-#: org/postgresql/core/v2/QueryExecutorImpl.java:475
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1857
-msgid "Ran out of memory retrieving query results."
-msgstr "Nicht gen�gend Speicher beim Abholen der Abfrageergebnisse."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:597
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2199
-#, java-format
-msgid "Unable to interpret the update count in command completion tag: {0}."
-msgstr ""
-"Der Updatecount aus der Kommandovervollst�ndigungsmarkierung(?) {0} konnte "
-"nicht interpretiert werden."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:610
-msgid "Copy not implemented for protocol version 2"
-msgstr ""
-
-#: org/postgresql/core/v3/CopyOperationImpl.java:56
-msgid "CommandComplete expected COPY but got: "
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:66
-msgid "Tried to obtain lock while already holding it"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:78
-msgid "Tried to break lock on database connection"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:93
-#, fuzzy
-msgid "Interrupted while waiting to obtain lock on database connection"
-msgstr "Beim Verbindungsversuch trat eine Unterbrechung auf."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:275
-msgid "Unable to bind parameter values for statement."
-msgstr "Der Anweisung konnten keine Parameterwerte zugewiesen werden."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:726
-msgid "Database connection failed when starting copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:757
-msgid "Tried to cancel an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:794
-msgid "Database connection failed when canceling copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:799
-msgid "Missing expected error response to copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:801
-#, java-format
-msgid "Got {0} error responses to single copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:814
-msgid "Tried to end inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:827
-msgid "Database connection failed when ending copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:842
-#: org/postgresql/core/v3/QueryExecutorImpl.java:860
-msgid "Tried to write to an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:854
-#: org/postgresql/core/v3/QueryExecutorImpl.java:866
-msgid "Database connection failed when writing to copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:878
-msgid "Tried to read from inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:883
-msgid "Database connection failed when reading from copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:951
-#, java-format
-msgid "Received CommandComplete ''{0}'' without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:975
-#, java-format
-msgid "Got CopyInResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:988
-#, java-format
-msgid "Got CopyOutResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1003
-msgid "Got CopyData without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1005
-#, fuzzy, java-format
-msgid "Unexpected copydata from server for {0}"
-msgstr "Vom Server wurde ein EOF erwartet, jedoch {0} gelesen."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1056
-#, java-format
-msgid "Unexpected packet type during copy: {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1310
-#, java-format
-msgid ""
-"Bind message length {0} too long. This can be caused by very large or "
-"incorrect length specifications on InputStream parameters."
-msgstr ""
-"Die Nachrichtenl�nge {0} ist zu gro�. Das kann von sehr gro�en oder "
-"inkorrekten L�ngenangaben eines InputStream-Parameters herr�hren."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1925
-#, fuzzy, java-format
-msgid ""
-"The server''s client_encoding parameter was changed to {0}. The JDBC driver "
-"requires client_encoding to be UTF8 for correct operation."
-msgstr ""
-"Der Parameter ''client_encoding'' wurde auf dem Server auf {0} ver�ndert. "
-"Der JDBC-Treiber setzt f�r korrektes Funktionieren die Einstellung UNICODE "
-"voraus."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1932
-#, java-format
-msgid ""
-"The server''s DateStyle parameter was changed to {0}. The JDBC driver "
-"requires DateStyle to begin with ISO for correct operation."
-msgstr ""
-"Der Parameter ''Date Style'' wurde auf dem Server auf {0} ver�ndert. Der "
-"JDBC-Treiber setzt f�r korrekte Funktion voraus, dass ''Date Style'' mit "
-"''ISO'' beginnt."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1945
-#, java-format
-msgid ""
-"The server''s standard_conforming_strings parameter was reported as {0}. The "
-"JDBC driver expected on or off."
-msgstr ""
-"Der standard_conforming_strings Parameter des Servers steht auf {0}. Der "
-"JDBC-Treiber erwartete on oder off."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2015
-msgid "The driver currently does not support COPY operations."
-msgstr "Der Treiber unterst�tzt derzeit keine COPY-Operationen."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:112
-msgid "This PooledConnection has already been closed."
-msgstr "Diese PooledConnection ist bereits geschlossen worden."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid ""
-"Connection has been closed automatically because a new connection was opened "
-"for the same PooledConnection or the PooledConnection has been closed."
-msgstr ""
-"Die Verbindung wurde automatisch geschlossen, da entweder eine neue "
-"Verbindung f�r die gleiche PooledConnection ge�ffnet wurde, oder die "
-"PooledConnection geschlossen worden ist.."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid "Connection has been closed."
-msgstr "Die Verbindung wurde geschlossen."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:442
-msgid "Statement has been closed."
-msgstr "Die Anweisung wurde geschlossen."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:291
-msgid "Failed to setup DataSource."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:414
-msgid "DataSource has been closed."
-msgstr "Die Datenquelle wurde geschlossen."
-
-#: org/postgresql/fastpath/Fastpath.java:81
-#: org/postgresql/fastpath/Fastpath.java:128
-#, java-format
-msgid "Fastpath call {0} - No result was returned and we expected an integer."
-msgstr ""
-"Der Fastpath-Aufruf {0} gab kein Ergebnis zur�ck, jedoch wurde ein Integer "
-"erwartet."
-
-#: org/postgresql/fastpath/Fastpath.java:237
-#, java-format
-msgid "The fastpath function {0} is unknown."
-msgstr "Die Fastpath-Funktion {0} ist unbekannt."
-
-#: org/postgresql/geometric/PGbox.java:83
-#: org/postgresql/geometric/PGcircle.java:82
-#: org/postgresql/geometric/PGcircle.java:91
-#: org/postgresql/geometric/PGline.java:80
-#: org/postgresql/geometric/PGlseg.java:77
-#: org/postgresql/geometric/PGpoint.java:85
-#, java-format
-msgid "Conversion to type {0} failed: {1}."
-msgstr "Die Umwandlung in den Typ {0} schlug fehl: {1}."
-
-#: org/postgresql/geometric/PGpath.java:81
-#, java-format
-msgid "Cannot tell if path is open or closed: {0}."
-msgstr ""
-"Es konnte nicht ermittelt werden, ob der Pfad offen oder geschlossen ist: "
-"{0}."
-
-#: org/postgresql/gss/MakeGSS.java:47 org/postgresql/gss/MakeGSS.java:55
-#: org/postgresql/gss/MakeGSS.java:168
-msgid "GSS Authentication failed"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:153
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:790
-#, java-format
-msgid "The array index is out of range: {0}"
-msgstr "Der Arrayindex ist au�erhalb des g�ltigen Bereichs: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:168
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:807
-#, java-format
-msgid "The array index is out of range: {0}, number of elements: {1}."
-msgstr ""
-"Der Arrayindex {0} ist au�erhalb des g�ltigen Bereichs. Vorhandene Elemente: "
-"{1}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:196
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1982
-#: org/postgresql/util/HStoreConverter.java:34
-#: org/postgresql/util/HStoreConverter.java:61
-msgid ""
-"Invalid character data was found. This is most likely caused by stored data "
-"containing characters that are invalid for the character set the database "
-"was created in. The most common example of this is storing 8bit data in a "
-"SQL_ASCII database."
-msgstr ""
-"Ung�ltige Zeichendaten. Das ist h�chstwahrscheinlich von in der Datenbank "
-"gespeicherten Zeichen hervorgerufen, die in einer anderen Kodierung "
-"vorliegen, als die, in der die Datenbank erstellt wurde. Das h�ufigste "
-"Beispiel daf�r ist es, 8Bit-Daten in SQL_ASCII-Datenbanken abzulegen."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:73
-msgid ""
-"Truncation of large objects is only implemented in 8.3 and later servers."
-msgstr ""
-"Das Abschneiden gro�er Objekte ist nur in Versionen nach 8.3 implementiert."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:77
-msgid "Cannot truncate LOB to a negative length."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:81
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:235
-#, java-format
-msgid "PostgreSQL LOBs can only index to: {0}"
-msgstr "LOBs in PostgreSQL k�nnen nur auf {0} verweisen."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:231
-msgid "LOB positioning offsets start at 1."
-msgstr "Positionsoffsets f�r LOBs beginnen bei 1."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:246
-msgid "free() was called on this LOB previously"
-msgstr "free() wurde bereits f�r dieses LOB aufgerufen."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:225
-#, java-format
-msgid "Unsupported value for stringtype parameter: {0}"
-msgstr "Nichtunterst�tzter Wert f�r den Stringparameter: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:245
-msgid "unknownLength parameter value must be an integer"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:353
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:284
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:303
-#: org/postgresql/jdbc2/TypeInfoCache.java:201
-#: org/postgresql/jdbc2/TypeInfoCache.java:249
-#: org/postgresql/jdbc2/TypeInfoCache.java:287
-#: org/postgresql/jdbc2/TypeInfoCache.java:344
-#: org/postgresql/jdbc2/TypeInfoCache.java:348
-#: org/postgresql/jdbc2/TypeInfoCache.java:384
-#: org/postgresql/jdbc2/TypeInfoCache.java:388
-msgid "No results were returned by the query."
-msgstr "Die Abfrage lieferte kein Ergebnis."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:367
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:336
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:368
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2702
-msgid "A result was returned when none was expected."
-msgstr "Die Anweisung lieferte ein Ergebnis obwohl keines erwartet wurde."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:519
-#, fuzzy
-msgid "Custom type maps are not supported."
-msgstr "Selbstdefinierte Typabbildungen werden nicht unterst�tzt."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:567
-#, java-format
-msgid "Failed to create object for: {0}."
-msgstr "Erstellung des Objektes schlug fehl f�r: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:629
-#, java-format
-msgid "Unable to load the class {0} responsible for the datatype {1}"
-msgstr ""
-"Die f�r den Datentyp {1} verantwortliche Klasse {0} konnte nicht geladen "
-"werden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:725
-msgid ""
-"Cannot change transaction read-only property in the middle of a transaction."
-msgstr ""
-"Die Nur-Lesen-Eigenschaft einer Transaktion kann nicht w�hrend der "
-"Transaktion ver�ndert werden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:813
-msgid "Cannot commit when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:822
-#, fuzzy
-msgid "This connection has been closed."
-msgstr "Die Verbindung wurde geschlossen."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:842
-msgid "Cannot rollback when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:929
-msgid ""
-"Cannot change transaction isolation level in the middle of a transaction."
-msgstr ""
-"Die Transaktions-Trennungsstufe kann nicht w�hrend einer Transaktion "
-"ver�ndert werden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:934
-#, java-format
-msgid "Transaction isolation level {0} not supported."
-msgstr "Die Transaktions-Trennungsstufe {0} ist nicht unterst�tzt."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1001
-msgid "Finalizing a Connection that was never closed:"
-msgstr "Eine Connection wurde finalisiert, die nie geschlossen wurde:"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1103
-msgid "Unable to translate data into the desired encoding."
-msgstr "Die Daten konnten nicht in die gew�nschte Kodierung gewandelt werden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:63
-msgid ""
-"Unable to determine a value for MaxIndexKeys due to missing system catalog "
-"data."
-msgstr ""
-"Es konnte kein Wert f�r MaxIndexKeys gefunden werden, da die "
-"Systemkatalogdaten fehlen."
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:86
-msgid "Unable to find name datatype in the system catalogs."
-msgstr ""
-"In den Systemkatalogen konnte der Namensdatentyp nicht gefunden werden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:235
-msgid ""
-"Operation requires a scrollable ResultSet, but this ResultSet is "
-"FORWARD_ONLY."
-msgstr ""
-"Die Operation erfordert ein scrollbares ResultSet, dieses jedoch ist "
-"FORWARD_ONLY."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:416
-msgid "Unexpected error while decoding character data from a large object."
-msgstr ""
-"Ein unerwarteter Fehler trat beim Dekodieren von Zeichen aus einem "
-"LargeObject (LOB) auf."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:462
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:491
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:525
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3129
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3174
-#, fuzzy, java-format
-msgid "Cannot convert the column of type {0} to requested type {1}."
-msgstr "Die Typwandlung f�r eine Instanz von {0} nach {1} ist nicht m�glich."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:744
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:768
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1892
-msgid "Can''t use relative move methods while on the insert row."
-msgstr ""
-"Relative Bewegungen k�nnen in der Einf�gezeile nicht durchgef�hrt werden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:788
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2956
-#, java-format
-msgid "Invalid fetch direction constant: {0}."
-msgstr "Unzul�ssige Richtungskonstante bei fetch: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:802
-msgid "Cannot call cancelRowUpdates() when on the insert row."
-msgstr ""
-"''cancelRowUpdates()'' kann in der Einf�gezeile nicht aufgerufen werden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:822
-msgid "Cannot call deleteRow() when on the insert row."
-msgstr "''deleteRow()'' kann in der Einf�gezeile nicht aufgerufen werden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:828
-msgid ""
-"Currently positioned before the start of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"Die augenblickliche Position ist vor dem Beginn des ResultSets. Dort kann "
-"''deleteRow()'' nicht aufgerufen werden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:833
-msgid ""
-"Currently positioned after the end of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"Die augenblickliche Position ist hinter dem Ende des ResultSets. Dort kann "
-"''deleteRow()'' nicht aufgerufen werden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:838
-msgid "There are no rows in this ResultSet."
-msgstr "Es gibt keine Zeilen in diesem ResultSet."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:885
-msgid "Not on the insert row."
-msgstr "Nicht in der Einf�gezeile."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:889
-msgid "You must specify at least one column value to insert a row."
-msgstr ""
-"Sie m�ssen mindestens einen Spaltenwert angeben, um eine Zeile einzuf�gen."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1074
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1805
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2494
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2524
-#, java-format
-msgid "The JVM claims not to support the encoding: {0}"
-msgstr "Die JVM behauptet, die Zeichenkodierung {0} nicht zu unterst�tzen."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1078
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1121
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1534
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1663
-msgid "Provided InputStream failed."
-msgstr "Der bereitgestellte InputStream scheiterte."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1191
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3137
-msgid "Provided Reader failed."
-msgstr "Der bereitgestellte Reader scheiterte."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1259
-msgid "Can''t refresh the insert row."
-msgstr "Die Einf�gezeile kann nicht aufgefrischt werden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1327
-msgid "Cannot call updateRow() when on the insert row."
-msgstr "''updateRow()'' kann in der Einf�gezeile nicht aufgerufen werden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1333
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3190
-msgid ""
-"Cannot update the ResultSet because it is either before the start or after "
-"the end of the results."
-msgstr ""
-"Das ResultSet kann nicht aktualisiert werden, da es entweder vor oder nach "
-"dem Ende der Ergebnisse ist."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1582
-msgid "ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."
-msgstr ""
-"ResultSets, deren Zugriffsart CONCUR_READ_ONLY ist, k�nnen nicht "
-"aktualisiert werden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1650
-#, java-format
-msgid "No primary key found for table {0}."
-msgstr "F�r die Tabelle {0} konnte kein Prim�rschl�ssel gefunden werden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1876
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2965
-msgid "Fetch size must be a value greater to or equal to 0."
-msgstr "Die Fetch-Gr��e muss ein Wert gr��er oder gleich Null sein."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2044
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2051
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2098
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2106
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2926
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2934
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2964
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2971
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2991
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3002
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3020
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3038
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3179
-#: org/postgresql/jdbc2/TimestampUtils.java:258
-#, java-format
-msgid "Bad value for type {0} : {1}"
-msgstr "Unzul�ssiger Wert f�r den Typ {0} : {1}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2727
-#, java-format
-msgid "The column name {0} was not found in this ResultSet."
-msgstr "Der Spaltenname {0} wurde in diesem ResultSet nicht gefunden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2827
-msgid ""
-"ResultSet is not updateable. The query that generated this result set must "
-"select only one table, and must select all primary keys from that table. See "
-"the JDBC 2.1 API Specification, section 5.6 for more details."
-msgstr ""
-"Das ResultSet kann nicht aktualisiert werden. Die Abfrage, die es erzeugte, "
-"darf nur eine Tabelle und muss darin alle Prim�rschl�ssel ausw�hlen. Siehe "
-"JDBC 2.1 API-Spezifikation, Abschnitt 5.6 f�r mehr Details."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2839
-msgid "This ResultSet is closed."
-msgstr "Dieses ResultSet ist geschlossen."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2860
-msgid "ResultSet not positioned properly, perhaps you need to call next."
-msgstr ""
-"Das ResultSet ist nicht richtig positioniert. Eventuell muss ''next'' "
-"aufgerufen werden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:259
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:323
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:392
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2655
-#, fuzzy
-msgid ""
-"Can''t use query methods that take a query string on a PreparedStatement."
-msgstr ""
-"Abfragemethoden, die einen Abfragestring annehmen, k�nnen nicht auf ein "
-"PreparedStatement angewandt werden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:287
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:306
-msgid "Multiple ResultSets were returned by the query."
-msgstr "Die Abfrage ergab mehrere ResultSets."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:425
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:429
-msgid "A CallableStatement was executed with nothing returned."
-msgstr "Ein CallableStatement wurde ausgef�hrt ohne etwas zur�ckzugeben."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:437
-msgid "A CallableStatement was executed with an invalid number of parameters"
-msgstr ""
-"Ein CallableStatement wurde mit einer falschen Anzahl Parameter ausgef�hrt."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:468
-#, java-format
-msgid ""
-"A CallableStatement function was executed and the out parameter {0} was of "
-"type {1} however type {2} was registered."
-msgstr ""
-"Eine CallableStatement-Funktion wurde ausgef�hrt und der R�ckgabewert {0} "
-"war vom Typ {1}. Jedoch wurde der Typ {2} daf�r registriert."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:674
-msgid "Maximum number of rows must be a value grater than or equal to 0."
-msgstr "Die maximale Zeilenzahl muss ein Wert gr��er oder gleich Null sein."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:717
-msgid "Query timeout must be a value greater than or equals to 0."
-msgstr "Das Abfragetimeout muss ein Wert gr��er oder gleich Null sein."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:809
-msgid "The maximum field size must be a value greater than or equal to 0."
-msgstr "Die maximale Feldgr��e muss ein Wert gr��er oder gleich Null sein."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1226
-msgid "Unknown Types value."
-msgstr "Unbekannter Typ."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1499
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1624
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3108
-#, java-format
-msgid "Invalid stream length {0}."
-msgstr "Ung�ltige L�nge des Datenstroms: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1530
-#, java-format
-msgid "The JVM claims not to support the {0} encoding."
-msgstr "Die JVM behauptet, die Zeichenkodierung {0} nicht zu unterst�tzen."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1705
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3030
-#, java-format
-msgid "Unknown type {0}."
-msgstr "Unbekannter Typ {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1720
-msgid "No hstore extension installed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1845
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1851
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1857
-#, java-format
-msgid "Cannot cast an instance of {0} to type {1}"
-msgstr "Die Typwandlung f�r eine Instanz von {0} nach {1} ist nicht m�glich."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1869
-#, java-format
-msgid "Unsupported Types value: {0}"
-msgstr "Unbekannter Typ: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1927
-#, java-format
-msgid ""
-"Can''t infer the SQL type to use for an instance of {0}. Use setObject() "
-"with an explicit Types value to specify the type to use."
-msgstr ""
-"Der in SQL f�r eine Instanz von {0} zu verwendende Datentyp kann nicht "
-"abgeleitet werden. Benutzen Sie ''setObject()'' mit einem expliziten Typ, um "
-"ihn festzulegen."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1975
-msgid ""
-"This statement does not declare an OUT parameter. Use '{' ?= call ... '}' "
-"to declare one."
-msgstr ""
-"Diese Anweisung deklariert keinen OUT-Parameter. Benutzen Sie '{' ?= "
-"call ... '}' um das zu tun."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2025
-msgid "wasNull cannot be call before fetching a result."
-msgstr ""
-"wasNull kann nicht aufgerufen werden, bevor ein Ergebnis abgefragt wurde."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2521
-#, java-format
-msgid "Malformed function or procedure escape syntax at offset {0}."
-msgstr ""
-"Unzul�ssige Syntax f�r ein Funktions- oder Prozedur-Escape an Offset {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2571
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2585
-#, java-format
-msgid ""
-"Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was "
-"made."
-msgstr ""
-"Ein Parameter des Typs {0} wurde registriert, jedoch erfolgte ein Aufruf get"
-"{1} (sqltype={2})."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2604
-msgid ""
-"A CallableStatement was declared, but no call to registerOutParameter(1, "
-"<some type>) was made."
-msgstr ""
-"Ein CallableStatement wurde deklariert, aber kein Aufruf von "
-"''registerOutParameter(1, <some type>)'' erfolgte."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2608
-#, fuzzy
-msgid "No function outputs were registered."
-msgstr "Es wurden keine Funktionsausgaben registriert."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2611
-msgid ""
-"Results cannot be retrieved from a CallableStatement before it is executed."
-msgstr ""
-"Ergebnisse k�nnen nicht von einem CallableStatement abgerufen werden, bevor "
-"es ausgef�hrt wurde."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2644
-msgid "This statement has been closed."
-msgstr "Die Anweisung wurde geschlossen."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2724
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2794
-msgid "Too many update results were returned."
-msgstr "Zu viele Updateergebnisse wurden zur�ckgegeben."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2753
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2823
-#, java-format
-msgid ""
-"Batch entry {0} {1} was aborted. Call getNextException to see the cause."
-msgstr ""
-"Batch-Eintrag {0} {1} wurde abgebrochen. Rufen Sie ''getNextException'' "
-"auf, um die Ursache zu erfahren."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3078
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3167
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3207
-msgid "Unexpected error writing large object to database."
-msgstr ""
-"Beim Schreiben eines LargeObjects (LOB) in die Datenbank trat ein "
-"unerwarteter Fehler auf."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:145
-#: org/postgresql/jdbc2/EscapedFunctions.java:157
-#: org/postgresql/jdbc2/EscapedFunctions.java:169
-#: org/postgresql/jdbc2/EscapedFunctions.java:206
-#: org/postgresql/jdbc2/EscapedFunctions.java:243
-#: org/postgresql/jdbc2/EscapedFunctions.java:267
-#: org/postgresql/jdbc2/EscapedFunctions.java:292
-#: org/postgresql/jdbc2/EscapedFunctions.java:316
-#: org/postgresql/jdbc2/EscapedFunctions.java:328
-#: org/postgresql/jdbc2/EscapedFunctions.java:352
-#: org/postgresql/jdbc2/EscapedFunctions.java:380
-#: org/postgresql/jdbc2/EscapedFunctions.java:389
-#: org/postgresql/jdbc2/EscapedFunctions.java:399
-#: org/postgresql/jdbc2/EscapedFunctions.java:408
-#: org/postgresql/jdbc2/EscapedFunctions.java:417
-#: org/postgresql/jdbc2/EscapedFunctions.java:426
-#: org/postgresql/jdbc2/EscapedFunctions.java:435
-#: org/postgresql/jdbc2/EscapedFunctions.java:444
-#: org/postgresql/jdbc2/EscapedFunctions.java:453
-#: org/postgresql/jdbc2/EscapedFunctions.java:462
-#: org/postgresql/jdbc2/EscapedFunctions.java:471
-#: org/postgresql/jdbc2/EscapedFunctions.java:480
-#, java-format
-msgid "{0} function takes one and only one argument."
-msgstr "Die {0}-Funktion erwartet nur genau ein Argument."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:181
-#: org/postgresql/jdbc2/EscapedFunctions.java:193
-#: org/postgresql/jdbc2/EscapedFunctions.java:255
-#: org/postgresql/jdbc2/EscapedFunctions.java:304
-#: org/postgresql/jdbc2/EscapedFunctions.java:582
-#, java-format
-msgid "{0} function takes two and only two arguments."
-msgstr "Die {0}-Funktion erwartet genau zwei Argumente."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:230
-#, java-format
-msgid "{0} function takes four and only four argument."
-msgstr "Die {0}-Funktion erwartet genau vier Argumente."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:282
-#: org/postgresql/jdbc2/EscapedFunctions.java:342
-#, java-format
-msgid "{0} function takes two or three arguments."
-msgstr "Die {0}-Funktion erwartet zwei oder drei Argumente."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:362
-#: org/postgresql/jdbc2/EscapedFunctions.java:371
-#: org/postgresql/jdbc2/EscapedFunctions.java:573
-#: org/postgresql/jdbc2/EscapedFunctions.java:591
-#, java-format
-msgid "{0} function doesn''t take any argument."
-msgstr "Die {0}-Funktion akzeptiert kein Argument."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:489
-#: org/postgresql/jdbc2/EscapedFunctions.java:531
-#, java-format
-msgid "{0} function takes three and only three arguments."
-msgstr "Die {0}-Funktion erwartet genau drei Argumente."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:501
-#: org/postgresql/jdbc2/EscapedFunctions.java:521
-#: org/postgresql/jdbc2/EscapedFunctions.java:523
-#: org/postgresql/jdbc2/EscapedFunctions.java:543
-#: org/postgresql/jdbc2/EscapedFunctions.java:564
-#: org/postgresql/jdbc2/EscapedFunctions.java:566
-#, java-format
-msgid "Interval {0} not yet implemented"
-msgstr "Intervall {0} ist noch nicht implementiert."
-
-#: org/postgresql/jdbc2/TimestampUtils.java:360
-msgid ""
-"Infinite value found for timestamp/date. This cannot be represented as time."
-msgstr ""
-"F�r den Zeitstempel oder das Datum wurde der Wert ''unendlich'' gefunden. "
-"Dies kann nicht als Zeit repr�sentiert werden."
-
-#: org/postgresql/jdbc2/TimestampUtils.java:648
-#: org/postgresql/jdbc2/TimestampUtils.java:680
-#: org/postgresql/jdbc2/TimestampUtils.java:727
-#, fuzzy, java-format
-msgid "Unsupported binary encoding of {0}."
-msgstr "Unbekannter Typ: {0}."
-
-#: org/postgresql/jdbc2/TypeInfoCache.java:161
-#, java-format
-msgid "The class {0} does not implement org.postgresql.util.PGobject."
-msgstr "Die Klasse {0} implementiert nicht ''org.postgresql.util.PGobject''."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:60
-#, java-format
-msgid "Unknown ResultSet holdability setting: {0}."
-msgstr "Unbekannte Einstellung f�r die Haltbarkeit des ResultSets: {0}."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:98
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:130
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:165
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:187
-msgid "Server versions prior to 8.0 do not support savepoints."
-msgstr "Der Server unterst�tzt keine Rettungspunkte vor Version 8.0."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:100
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:132
-msgid "Cannot establish a savepoint in auto-commit mode."
-msgstr "Ein Rettungspunkt kann im Modus ''auto-commit'' nicht erstellt werden."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:419
-msgid "Returning autogenerated keys is not supported."
-msgstr "Die R�ckgabe automatisch generierter Schl�ssel wird nicht unterst�tzt,"
-
-#: org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java:81
-#, java-format
-msgid "The parameter index is out of range: {0}, number of parameters: {1}."
-msgstr ""
-"Der Parameterindex {0} ist au�erhalb des g�ltigen Bereichs. Es gibt {1} "
-"Parameter."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:151
-#, fuzzy
-msgid ""
-"Returning autogenerated keys is only supported for 8.2 and later servers."
-msgstr "Die R�ckgabe automatisch generierter Schl�ssel wird nicht unterst�tzt,"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:199
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:317
-#, fuzzy
-msgid "Returning autogenerated keys by column index is not supported."
-msgstr "Die R�ckgabe automatisch generierter Schl�ssel wird nicht unterst�tzt,"
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:38
-#: org/postgresql/jdbc3/PSQLSavepoint.java:50
-#: org/postgresql/jdbc3/PSQLSavepoint.java:66
-msgid "Cannot reference a savepoint after it has been released."
-msgstr ""
-"Ein Rettungspunkt kann nicht angesprochen werden, nach dem er entfernt wurde."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:42
-msgid "Cannot retrieve the id of a named savepoint."
-msgstr "Die ID eines benamten Rettungspunktes kann nicht ermittelt werden."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:54
-msgid "Cannot retrieve the name of an unnamed savepoint."
-msgstr "Der Name eines namenlosen Rettungpunktes kann nicht ermittelt werden."
-
-#: org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java:37
-#, fuzzy
-msgid "Invalid UUID data."
-msgstr "Ung�ltiges Flag."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:83
-#, fuzzy, java-format
-msgid "Unable to find server array type for provided name {0}."
-msgstr ""
-"F�r den angegebenen Namen {0} konnte kein Serverarraytyp gefunden werden."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:121
-#, fuzzy, java-format
-msgid "Invalid timeout ({0}<0)."
-msgstr "Ung�ltige L�nge des Datenstroms: {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:134
-msgid "Validating connection."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:157
-#, fuzzy, java-format
-msgid "Failed to set ClientInfo property: {0}"
-msgstr "Erstellung des Objektes schlug fehl f�r: {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:166
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:188
-msgid "ClientInfo property not supported."
-msgstr "Die ClientInfo-Eigenschaft ist nicht unterst�tzt."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Statement.java:127
-msgid "Object is too large to send over the protocol."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:147
-msgid "Unable to decode xml data."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:150
-#, java-format
-msgid "Unknown XML Source class: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:195
-#, fuzzy
-msgid "Unable to create SAXResult for SQLXML."
-msgstr "Erstellung des Objektes schlug fehl f�r: {0}."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:209
-msgid "Unable to create StAXResult for SQLXML"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:213
-#, fuzzy, java-format
-msgid "Unknown XML Result class: {0}"
-msgstr "Unbekannte Einstellung f�r die Haltbarkeit des ResultSets: {0}."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:226
-#, fuzzy
-msgid "This SQLXML object has already been freed."
-msgstr "Diese PooledConnection ist bereits geschlossen worden."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:233
-msgid ""
-"This SQLXML object has not been initialized, so you cannot retrieve data "
-"from it."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:244
-#, java-format
-msgid "Failed to convert binary xml data to encoding: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:269
-msgid "Unable to convert DOMResult SQLXML data to a string."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:282
-msgid ""
-"This SQLXML object has already been initialized, so you cannot manipulate it "
-"further."
-msgstr ""
-
-#: org/postgresql/largeobject/LargeObjectManager.java:138
-msgid "Failed to initialize LargeObject API"
-msgstr "Die LargeObject-API konnte nicht initialisiert werden."
-
-#: org/postgresql/largeobject/LargeObjectManager.java:257
-#: org/postgresql/largeobject/LargeObjectManager.java:298
-msgid "Large Objects may not be used in auto-commit mode."
-msgstr ""
-"LargeObjects (LOB) d�rfen im Modus ''auto-commit'' nicht verwendet werden."
-
-#: org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java:58
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:110
-#, java-format
-msgid "The SSLSocketFactory class provided {0} could not be instantiated."
-msgstr ""
-"Die von {0} bereitgestellte SSLSocketFactory-Klasse konnte nicht "
-"instanziiert werden."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:125
-#, java-format
-msgid "SSL error: {0}"
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:138
-#, fuzzy, java-format
-msgid "The HostnameVerifier class provided {0} could not be instantiated."
-msgstr ""
-"Die von {0} bereitgestellte SSLSocketFactory-Klasse konnte nicht "
-"instanziiert werden."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:142
-#, java-format
-msgid "The hostname {0} could not be verified by hostnameverifier {1}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:149
-#, fuzzy, java-format
-msgid "The hostname {0} could not be verified."
-msgstr ""
-"Die von {0} bereitgestellte SSLSocketFactory-Klasse konnte nicht "
-"instanziiert werden."
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:121
-msgid ""
-"Could not find a java cryptographic algorithm: X.509 CertificateFactory not "
-"available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:132
-#, java-format
-msgid "Could not open SSL certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:137
-#, java-format
-msgid "Loading the SSL certificate {0} into a KeyManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:194
-msgid "Enter SSL password: "
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:202
-msgid "Could not read password for SSL key file, console is not available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:204
-#, java-format
-msgid "Could not read password for SSL key file by callbackhandler {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:223
-#, java-format
-msgid "Could not decrypt SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:231
-#, java-format
-msgid "Could not read SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:235
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:173
-#, java-format
-msgid "Could not find a java cryptographic algorithm: {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:99
-#, fuzzy, java-format
-msgid "The password callback class provided {0} could not be instantiated."
-msgstr ""
-"Die von {0} bereitgestellte SSLSocketFactory-Klasse konnte nicht "
-"instanziiert werden."
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:133
-#, java-format
-msgid "Could not open SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:150
-#, java-format
-msgid "Could not read SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:153
-#, java-format
-msgid "Loading the SSL root certificate {0} into a TrustManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:166
-msgid "Could not initialize SSL context."
-msgstr ""
-
-#: org/postgresql/util/PGInterval.java:164
-msgid "Conversion of interval failed"
-msgstr "Die Umwandlung eines Intervalls schlug fehl."
-
-#: org/postgresql/util/PGmoney.java:73
-msgid "Conversion of money failed."
-msgstr "Die Umwandlung eines W�hrungsbetrags schlug fehl."
-
-#: org/postgresql/util/ServerErrorMessage.java:155
-#, java-format
-msgid "Detail: {0}"
-msgstr "Detail: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:159
-#, java-format
-msgid "Hint: {0}"
-msgstr "Hinweis: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:162
-#, java-format
-msgid "Position: {0}"
-msgstr "Position: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:165
-#, java-format
-msgid "Where: {0}"
-msgstr "Wobei: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:171
-#, java-format
-msgid "Internal Query: {0}"
-msgstr "Interne Abfrage: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:174
-#, java-format
-msgid "Internal Position: {0}"
-msgstr "Interne Position: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:180
-#, java-format
-msgid "Location: File: {0}, Routine: {1}, Line: {2}"
-msgstr "Ort: Datei: {0}, Routine: {1}, Zeile: {2}."
-
-#: org/postgresql/util/ServerErrorMessage.java:183
-#, java-format
-msgid "Server SQLState: {0}"
-msgstr "Server SQLState: {0}"
-
-#: org/postgresql/xa/PGXAConnection.java:148
-msgid ""
-"Transaction control methods setAutoCommit(true), commit, rollback and "
-"setSavePoint not allowed while an XA transaction is active."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:186
-#: org/postgresql/xa/PGXAConnection.java:245
-msgid "Invalid flags"
-msgstr "Ung�ltige Flags"
-
-#: org/postgresql/xa/PGXAConnection.java:189
-#: org/postgresql/xa/PGXAConnection.java:248
-#: org/postgresql/xa/PGXAConnection.java:425
-msgid "xid must not be null"
-msgstr "Die xid darf nicht null sein."
-
-#: org/postgresql/xa/PGXAConnection.java:192
-msgid "Connection is busy with another transaction"
-msgstr "Die Verbindung ist derzeit mit einer anderen Transaktion besch�ftigt."
-
-#: org/postgresql/xa/PGXAConnection.java:198
-#: org/postgresql/xa/PGXAConnection.java:255
-msgid "suspend/resume not implemented"
-msgstr "Anhalten/Fortsetzen ist nicht implementiert."
-
-#: org/postgresql/xa/PGXAConnection.java:204
-#: org/postgresql/xa/PGXAConnection.java:207
-#: org/postgresql/xa/PGXAConnection.java:209
-msgid "Transaction interleaving not implemented"
-msgstr "Transaktionsinterleaving ist nicht implementiert."
-
-#: org/postgresql/xa/PGXAConnection.java:218
-msgid "Error disabling autocommit"
-msgstr "Fehler beim Abschalten von Autocommit."
-
-#: org/postgresql/xa/PGXAConnection.java:251
-msgid "tried to call end without corresponding start call"
-msgstr ""
-"Es wurde versucht, ohne dazugeh�rigen ''start''-Aufruf ''end'' aufzurufen."
-
-#: org/postgresql/xa/PGXAConnection.java:282
-msgid ""
-"Not implemented: Prepare must be issued using the same connection that "
-"started the transaction"
-msgstr ""
-"Nicht implementiert: ''Prepare'' muss �ber die selbe Verbindung abgesetzt "
-"werden, die die Transaktion startete."
-
-#: org/postgresql/xa/PGXAConnection.java:286
-msgid "Prepare called before end"
-msgstr "''Prepare'' wurde vor ''end'' aufgerufen."
-
-#: org/postgresql/xa/PGXAConnection.java:292
-msgid "Server versions prior to 8.1 do not support two-phase commit."
-msgstr "Der Server unterst�tzt keine zweiphasige Best�tigung vor Version 8.1."
-
-#: org/postgresql/xa/PGXAConnection.java:313
-msgid "Error preparing transaction"
-msgstr "Beim Vorbereiten der Transaktion trat ein Fehler auf."
-
-#: org/postgresql/xa/PGXAConnection.java:328
-msgid "Invalid flag"
-msgstr "Ung�ltiges Flag."
-
-#: org/postgresql/xa/PGXAConnection.java:368
-msgid "Error during recover"
-msgstr "Beim Wiederherstellen trat ein Fehler auf."
-
-#: org/postgresql/xa/PGXAConnection.java:416
-msgid "Error rolling back prepared transaction"
-msgstr "Fehler beim Rollback einer vorbereiteten Transaktion."
-
-#: org/postgresql/xa/PGXAConnection.java:451
-msgid ""
-"Not implemented: one-phase commit must be issued using the same connection "
-"that was used to start it"
-msgstr ""
-"Nicht implementiert: Die einphasige Best�tigung muss �ber die selbe "
-"Verbindung abgewickelt werden, die verwendet wurde, um sie zu beginnen."
-
-#: org/postgresql/xa/PGXAConnection.java:455
-msgid "commit called before end"
-msgstr "''Commit'' wurde vor ''end'' aufgerufen."
-
-#: org/postgresql/xa/PGXAConnection.java:466
-msgid "Error during one-phase commit"
-msgstr "Bei der einphasigen Best�tigung trat ein Fehler auf."
-
-#: org/postgresql/xa/PGXAConnection.java:487
-msgid ""
-"Not implemented: 2nd phase commit must be issued using an idle connection"
-msgstr ""
-"Nicht implementiert: Die zweite Best�tigungsphase muss �ber eine im Leerlauf "
-"befindliche Verbindung abgewickelt werden."
-
-#: org/postgresql/xa/PGXAConnection.java:507
-#, fuzzy
-msgid "Error committing prepared transaction"
-msgstr "Fehler beim Rollback einer vorbereiteten Transaktion."
-
-#: org/postgresql/xa/PGXAConnection.java:522
-msgid "Heuristic commit/rollback not supported"
-msgstr "Heuristisches Commit/Rollback wird nicht unterst�tzt."
-
-#~ msgid "The driver does not support SSL."
-#~ msgstr "Der Treiber unterst�tzt SSL nicht."
-
-#~ msgid "Exception: {0}"
-#~ msgstr "Exception: {0}."
-
-#~ msgid "Stack Trace:"
-#~ msgstr "Stack-Trace:"
-
-#~ msgid "End of Stack Trace"
-#~ msgstr "Ende des Stack-Traces."
-
-#~ msgid "Exception generating stacktrace for: {0} encountered: {1}"
-#~ msgstr ""
-#~ "Beim Erstellen eines Stack-Traces f�r {0} trat eine Exception auf: {1}"
-
-#~ msgid "Multi-dimensional arrays are currently not supported."
-#~ msgstr "Mehrdimensionale Arrays werden derzeit nicht unterst�tzt."
-
-#~ msgid "rand function only takes zero or one argument(the seed)."
-#~ msgstr ""
-#~ "Die Funktion ''rand'' erwartet kein oder genau ein Argument (den "
-#~ "''seed'')."
-
-#~ msgid "suspend/resume and join not implemented"
-#~ msgstr "Anhalten/Fortsetzen und Join sind nicht implementiert."
-
-#~ msgid ""
-#~ "setNull(i,Types.OTHER) is not supported; use setObject(i,nullobject,Types."
-#~ "OTHER) instead."
-#~ msgstr ""
-#~ "''setNull(i, Types.OTHER)'' wird nicht unterst�tzt; benutzen Sie "
-#~ "stattdessen ''setObject(i, nullobject, Types.OTHER)''."
-
-#~ msgid ""
-#~ "setObject(i,null) is not supported. Instead, use setNull(i,type) or "
-#~ "setObject(i,null,type)"
-#~ msgstr ""
-#~ "''setObejct(i, null)'' ist nicht unterst�tzt. Benutzen Sie ''setNull(i, "
-#~ "type)'' oder ''setObject(i, null, type)'' stattdessen."
-
-#~ msgid ""
-#~ "Cannot call setXXX(1, ..) on a CallableStatement. This is an output that "
-#~ "must be configured with registerOutParameter instead."
-#~ msgstr ""
-#~ "''setXXX(1, ..)'' kann auf einem CallableStatement nicht aufgerufen "
-#~ "werden. Diese Ausgabe muss stattdessen mit ''registerOutParameter'' "
-#~ "konfiguriert werden."
-
-#~ msgid ""
-#~ "PostgreSQL only supports a single OUT function return value at index 1."
-#~ msgstr ""
-#~ "PostgreSQL unterst�tzt auf dem Index 1 nur einen einzigen R�ckgabewert "
-#~ "f�r die OUT-Funktion."
-
-#, fuzzy
-#~ msgid "Conversion of circle failed: {0}."
-#~ msgstr "Konnte �{0}� nicht in Typ �circle� umwandeln"
-
-#, fuzzy
-#~ msgid "Conversion of line failed: {0}."
-#~ msgstr "Konnte �{0}� nicht in Typ �line� umwandeln"
-
-#, fuzzy
-#~ msgid "Conversion of point failed: {0}."
-#~ msgstr "Konnte �{0}� nicht in Typ �point� umwandeln"
-
-#, fuzzy
-#~ msgid "No results where returned by the query."
-#~ msgstr "Die Abfrage ergab kein Ergebnis."
-
-#, fuzzy
-#~ msgid "Bad byte: {0}"
-#~ msgstr "Ung�ltiges Format f�r Byte: {0}"
-
-#, fuzzy
-#~ msgid "Bad short: {0}"
-#~ msgstr "Ung�ltiges Format f�r Short: {0}"
-
-#, fuzzy
-#~ msgid "Bad int: {0}"
-#~ msgstr "Ung�ltiges Format f�r Long: {0}"
-
-#, fuzzy
-#~ msgid "Bad long: {0}"
-#~ msgstr "Ung�ltiges Format f�r Long: {0}"
-
-#, fuzzy
-#~ msgid "Bad BigDecimal: {0}"
-#~ msgstr "Ung�ltiges Format f�r BigDecimal: {0}"
-
-#, fuzzy
-#~ msgid "Bad float: {0}"
-#~ msgstr "Ung�ltiges Format f�r Float: {0}"
-
-#, fuzzy
-#~ msgid "Bad double: {0}"
-#~ msgstr "Ung�ltiges Format f�r Double: {0}"
-
-#, fuzzy
-#~ msgid "Bad date: {0}"
-#~ msgstr "Ung�ltiges Format f�r Byte: {0}"
diff --git a/org/postgresql/translation/es.po b/org/postgresql/translation/es.po
deleted file mode 100644
index c8a7aad..0000000
--- a/org/postgresql/translation/es.po
+++ /dev/null
@@ -1,1408 +0,0 @@
-# Spanish message translation for the PostgreSQL JDBC driver
-# This file is distributed under the same license as the package.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: JDBC PostgreSQL Driver\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-10-31 13:37+0000\n"
-"PO-Revision-Date: 2004-10-22 16:51-0300\n"
-"Last-Translator: Diego Gil <diego at adminsa.com>\n"
-"Language-Team: \n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Poedit-Language: Spanish\n"
-
-#: org/postgresql/Driver.java.in:235
-msgid "Error loading default settings from driverconfig.properties"
-msgstr ""
-
-#: org/postgresql/Driver.java.in:282
-msgid ""
-"Your security policy has prevented the connection from being attempted. You "
-"probably need to grant the connect java.net.SocketPermission to the database "
-"server host and port that you wish to connect to."
-msgstr ""
-
-#: org/postgresql/Driver.java.in:287 org/postgresql/Driver.java.in:351
-msgid ""
-"Something unusual has occurred to cause the driver to fail. Please report "
-"this exception."
-msgstr ""
-"Algo inusual ha ocurrido que provocó un fallo en el controlador. Por favor "
-"reporte esta excepción."
-
-#: org/postgresql/Driver.java.in:359
-#, fuzzy
-msgid "Connection attempt timed out."
-msgstr "El intento de conexión falló."
-
-#: org/postgresql/Driver.java.in:372
-#, fuzzy
-msgid "Interrupted while attempting to connect."
-msgstr "Ha ocorrido un error mientras se establecía la conexión SSL."
-
-#: org/postgresql/Driver.java.in:714
-#, fuzzy, java-format
-msgid "Method {0} is not yet implemented."
-msgstr "Este método aún no ha sido implementado."
-
-#: org/postgresql/copy/CopyManager.java:56
-#, java-format
-msgid "Requested CopyIn but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/CopyManager.java:67
-#, java-format
-msgid "Requested CopyOut but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:51
-#, java-format
-msgid "Copying from database failed: {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:67
-#: org/postgresql/copy/PGCopyOutputStream.java:90
-msgid "This copy stream is closed."
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:108
-msgid "Read from copy failed."
-msgstr ""
-
-#: org/postgresql/copy/PGCopyOutputStream.java:68
-#, java-format
-msgid "Cannot write to copy a byte of value {0}"
-msgstr ""
-
-#: org/postgresql/core/ConnectionFactory.java:69
-#, fuzzy, java-format
-msgid "A connection could not be made using the requested protocol {0}."
-msgstr "No se pudo hacer una conexión para el protocolo solicitado {0}."
-
-#: org/postgresql/core/Oid.java:113
-#, java-format
-msgid "oid type {0} not known and not a number"
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:490
-#, java-format
-msgid "Premature end of input stream, expected {0} bytes, but only read {1}."
-msgstr ""
-"Final prematuro del flujo de entrada, se esperaban {0} bytes, pero solo se "
-"leyeron {1}."
-
-#: org/postgresql/core/PGStream.java:530
-#, java-format
-msgid "Expected an EOF from server, got: {0}"
-msgstr ""
-
-#: org/postgresql/core/SetupQueryRunner.java:86
-msgid "An unexpected result was returned by a query."
-msgstr "Una consulta retornó un resultado inesperado."
-
-#: org/postgresql/core/UTF8Encoding.java:28
-#, java-format
-msgid ""
-"Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:61
-#, java-format
-msgid "Illegal UTF-8 sequence: {0} bytes used to encode a {1} byte value: {2}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:98
-#: org/postgresql/core/UTF8Encoding.java:125
-#, java-format
-msgid "Illegal UTF-8 sequence: initial byte is {0}: {1}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:130
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is out of range: {0}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:145
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is a surrogate value: {0}"
-msgstr ""
-
-#: org/postgresql/core/Utils.java:95 org/postgresql/core/Utils.java:112
-msgid "Zero bytes may not occur in string parameters."
-msgstr ""
-
-#: org/postgresql/core/Utils.java:145
-msgid "Zero bytes may not occur in identifiers."
-msgstr ""
-
-#: org/postgresql/core/types/PGBigDecimal.java:63
-#: org/postgresql/core/types/PGBoolean.java:62
-#: org/postgresql/core/types/PGByte.java:63
-#: org/postgresql/core/types/PGDouble.java:64
-#: org/postgresql/core/types/PGFloat.java:64
-#: org/postgresql/core/types/PGInteger.java:61
-#: org/postgresql/core/types/PGLong.java:62
-#: org/postgresql/core/types/PGNumber.java:62
-#: org/postgresql/core/types/PGShort.java:58
-#: org/postgresql/core/types/PGString.java:73
-#, java-format
-msgid "Cannot convert an instance of {0} to type {1}"
-msgstr ""
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:66
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:74
-#, java-format
-msgid "Invalid sslmode value: {0}"
-msgstr ""
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:134
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:207
-msgid ""
-"Connection refused. Check that the hostname and port are correct and that "
-"the postmaster is accepting TCP/IP connections."
-msgstr ""
-"Conexión rechazada. Verifique que el nombre del Host y el puerto sean "
-"correctos y que postmaster este aceptando conexiones TCP/IP."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:153
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:225
-msgid "The connection attempt failed."
-msgstr "El intento de conexión falló."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:175
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:246
-#, fuzzy
-msgid "The connection url is invalid."
-msgstr "El intento de conexión falló."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:198
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:210
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:295
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:307
-msgid "The server does not support SSL."
-msgstr "Este servidor no soporta SSL."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:223
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:320
-msgid "An error occurred while setting up the SSL connection."
-msgstr "Ha ocorrido un error mientras se establecía la conexión SSL."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:272
-#, java-format
-msgid "Connection rejected: {0}."
-msgstr "Conexión rechazada: {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:290
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:312
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:332
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:419
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:444
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:471
-msgid ""
-"The server requested password-based authentication, but no password was "
-"provided."
-msgstr ""
-"El servidor requiere autenticación basada en contraseña, pero no se ha "
-"provisto ninguna contraseña."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:356
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:504
-#, fuzzy, java-format
-msgid ""
-"The authentication type {0} is not supported. Check that you have configured "
-"the pg_hba.conf file to include the client''s IP address or subnet, and that "
-"it is using an authentication scheme supported by the driver."
-msgstr ""
-"El tipo de autenticación {0} no es soportada. Verifique que ha configurado "
-"el archivo pg_hba.conf para incluir las direcciones IP de los clientes o la "
-"subred, y que está usando un esquema de autenticación soportado por el "
-"driver."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:362
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:400
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:510
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:553
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:599
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:609
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:618
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:626
-#: org/postgresql/gss/MakeGSS.java:158
-msgid "Protocol error. Session setup failed."
-msgstr "Error de protocolo. Falló el inicio de la sesión."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:390
-#, java-format
-msgid "Backend start-up failed: {0}."
-msgstr "Falló el arranque del Backend: {0}. "
-
-#: org/postgresql/core/v2/FastpathParameterList.java:55
-#: org/postgresql/core/v2/FastpathParameterList.java:77
-#: org/postgresql/core/v2/FastpathParameterList.java:84
-#: org/postgresql/core/v2/SimpleParameterList.java:57
-#: org/postgresql/core/v2/SimpleParameterList.java:76
-#: org/postgresql/core/v2/SimpleParameterList.java:83
-#: org/postgresql/core/v2/SimpleParameterList.java:90
-#: org/postgresql/core/v3/CompositeParameterList.java:35
-#: org/postgresql/core/v3/SimpleParameterList.java:49
-#: org/postgresql/core/v3/SimpleParameterList.java:56
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2845
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java:419
-#, java-format
-msgid "The column index is out of range: {0}, number of columns: {1}."
-msgstr ""
-"El índice de la columna está fuera de rango: {0}, número de columnas: {1}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:142
-#: org/postgresql/core/v2/SimpleParameterList.java:155
-#: org/postgresql/core/v3/SimpleParameterList.java:216
-#, java-format
-msgid "No value specified for parameter {0}."
-msgstr "No se ha especificado un valor para el parámetro {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:72
-#: org/postgresql/core/v2/QueryExecutorImpl.java:337
-#: org/postgresql/core/v3/QueryExecutorImpl.java:443
-#: org/postgresql/core/v3/QueryExecutorImpl.java:507
-#, java-format
-msgid "Expected command status BEGIN, got {0}."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:78
-#: org/postgresql/core/v3/QueryExecutorImpl.java:513
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1828
-#, java-format
-msgid "Unexpected command status: {0}."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:118
-#: org/postgresql/core/v2/QueryExecutorImpl.java:129
-#: org/postgresql/core/v2/QueryExecutorImpl.java:174
-#: org/postgresql/core/v2/QueryExecutorImpl.java:369
-#: org/postgresql/core/v3/QueryExecutorImpl.java:281
-#: org/postgresql/core/v3/QueryExecutorImpl.java:411
-#: org/postgresql/core/v3/QueryExecutorImpl.java:485
-#: org/postgresql/core/v3/QueryExecutorImpl.java:551
-#: org/postgresql/core/v3/QueryExecutorImpl.java:631
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2094
-#, fuzzy
-msgid "An I/O error occured while sending to the backend."
-msgstr "Un error de E/S ha ocurrido mientras se enviaba al backend."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:170
-#: org/postgresql/core/v2/QueryExecutorImpl.java:225
-#: org/postgresql/core/v2/QueryExecutorImpl.java:236
-#: org/postgresql/core/v3/QueryExecutorImpl.java:627
-#: org/postgresql/core/v3/QueryExecutorImpl.java:685
-#, java-format
-msgid "Unknown Response Type {0}."
-msgstr "Tipo de respuesta desconocida {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:430
-#: org/postgresql/core/v2/QueryExecutorImpl.java:475
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1857
-msgid "Ran out of memory retrieving query results."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:597
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2199
-#, java-format
-msgid "Unable to interpret the update count in command completion tag: {0}."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:610
-msgid "Copy not implemented for protocol version 2"
-msgstr ""
-
-#: org/postgresql/core/v3/CopyOperationImpl.java:56
-msgid "CommandComplete expected COPY but got: "
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:66
-msgid "Tried to obtain lock while already holding it"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:78
-msgid "Tried to break lock on database connection"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:93
-msgid "Interrupted while waiting to obtain lock on database connection"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:275
-msgid "Unable to bind parameter values for statement."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:726
-msgid "Database connection failed when starting copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:757
-msgid "Tried to cancel an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:794
-msgid "Database connection failed when canceling copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:799
-msgid "Missing expected error response to copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:801
-#, java-format
-msgid "Got {0} error responses to single copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:814
-msgid "Tried to end inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:827
-msgid "Database connection failed when ending copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:842
-#: org/postgresql/core/v3/QueryExecutorImpl.java:860
-msgid "Tried to write to an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:854
-#: org/postgresql/core/v3/QueryExecutorImpl.java:866
-msgid "Database connection failed when writing to copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:878
-msgid "Tried to read from inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:883
-msgid "Database connection failed when reading from copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:951
-#, java-format
-msgid "Received CommandComplete ''{0}'' without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:975
-#, java-format
-msgid "Got CopyInResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:988
-#, java-format
-msgid "Got CopyOutResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1003
-msgid "Got CopyData without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1005
-#, java-format
-msgid "Unexpected copydata from server for {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1056
-#, java-format
-msgid "Unexpected packet type during copy: {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1310
-#, java-format
-msgid ""
-"Bind message length {0} too long. This can be caused by very large or "
-"incorrect length specifications on InputStream parameters."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1925
-#, java-format
-msgid ""
-"The server''s client_encoding parameter was changed to {0}. The JDBC driver "
-"requires client_encoding to be UTF8 for correct operation."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1932
-#, java-format
-msgid ""
-"The server''s DateStyle parameter was changed to {0}. The JDBC driver "
-"requires DateStyle to begin with ISO for correct operation."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1945
-#, java-format
-msgid ""
-"The server''s standard_conforming_strings parameter was reported as {0}. The "
-"JDBC driver expected on or off."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2015
-msgid "The driver currently does not support COPY operations."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:112
-msgid "This PooledConnection has already been closed."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid ""
-"Connection has been closed automatically because a new connection was opened "
-"for the same PooledConnection or the PooledConnection has been closed."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-#, fuzzy
-msgid "Connection has been closed."
-msgstr "Conexión rechazada: {0}."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:442
-msgid "Statement has been closed."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:291
-msgid "Failed to setup DataSource."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:414
-msgid "DataSource has been closed."
-msgstr ""
-
-#: org/postgresql/fastpath/Fastpath.java:81
-#: org/postgresql/fastpath/Fastpath.java:128
-#, java-format
-msgid "Fastpath call {0} - No result was returned and we expected an integer."
-msgstr ""
-
-#: org/postgresql/fastpath/Fastpath.java:237
-#, java-format
-msgid "The fastpath function {0} is unknown."
-msgstr ""
-
-#: org/postgresql/geometric/PGbox.java:83
-#: org/postgresql/geometric/PGcircle.java:82
-#: org/postgresql/geometric/PGcircle.java:91
-#: org/postgresql/geometric/PGline.java:80
-#: org/postgresql/geometric/PGlseg.java:77
-#: org/postgresql/geometric/PGpoint.java:85
-#, java-format
-msgid "Conversion to type {0} failed: {1}."
-msgstr ""
-
-#: org/postgresql/geometric/PGpath.java:81
-#, java-format
-msgid "Cannot tell if path is open or closed: {0}."
-msgstr ""
-
-#: org/postgresql/gss/MakeGSS.java:47 org/postgresql/gss/MakeGSS.java:55
-#: org/postgresql/gss/MakeGSS.java:168
-msgid "GSS Authentication failed"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:153
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:790
-#, java-format
-msgid "The array index is out of range: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:168
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:807
-#, java-format
-msgid "The array index is out of range: {0}, number of elements: {1}."
-msgstr ""
-"El índice del arreglo esta fuera de rango: {0}, número de elementos: {1}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:196
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1982
-#: org/postgresql/util/HStoreConverter.java:34
-#: org/postgresql/util/HStoreConverter.java:61
-msgid ""
-"Invalid character data was found. This is most likely caused by stored data "
-"containing characters that are invalid for the character set the database "
-"was created in. The most common example of this is storing 8bit data in a "
-"SQL_ASCII database."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:73
-msgid ""
-"Truncation of large objects is only implemented in 8.3 and later servers."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:77
-msgid "Cannot truncate LOB to a negative length."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:81
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:235
-#, java-format
-msgid "PostgreSQL LOBs can only index to: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:231
-msgid "LOB positioning offsets start at 1."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:246
-msgid "free() was called on this LOB previously"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:225
-#, java-format
-msgid "Unsupported value for stringtype parameter: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:245
-msgid "unknownLength parameter value must be an integer"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:353
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:284
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:303
-#: org/postgresql/jdbc2/TypeInfoCache.java:201
-#: org/postgresql/jdbc2/TypeInfoCache.java:249
-#: org/postgresql/jdbc2/TypeInfoCache.java:287
-#: org/postgresql/jdbc2/TypeInfoCache.java:344
-#: org/postgresql/jdbc2/TypeInfoCache.java:348
-#: org/postgresql/jdbc2/TypeInfoCache.java:384
-#: org/postgresql/jdbc2/TypeInfoCache.java:388
-msgid "No results were returned by the query."
-msgstr "La consulta no retornó ningún resultado."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:367
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:336
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:368
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2702
-msgid "A result was returned when none was expected."
-msgstr "Se retornó un resultado cuando no se esperaba ninguno."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:519
-msgid "Custom type maps are not supported."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:567
-#, java-format
-msgid "Failed to create object for: {0}."
-msgstr "Fallo al crear objeto: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:629
-#, java-format
-msgid "Unable to load the class {0} responsible for the datatype {1}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:725
-msgid ""
-"Cannot change transaction read-only property in the middle of a transaction."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:813
-msgid "Cannot commit when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:822
-#, fuzzy
-msgid "This connection has been closed."
-msgstr "El intento de conexión falló."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:842
-msgid "Cannot rollback when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:929
-msgid ""
-"Cannot change transaction isolation level in the middle of a transaction."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:934
-#, java-format
-msgid "Transaction isolation level {0} not supported."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1001
-msgid "Finalizing a Connection that was never closed:"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1103
-msgid "Unable to translate data into the desired encoding."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:63
-msgid ""
-"Unable to determine a value for MaxIndexKeys due to missing system catalog "
-"data."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:86
-msgid "Unable to find name datatype in the system catalogs."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:235
-msgid ""
-"Operation requires a scrollable ResultSet, but this ResultSet is "
-"FORWARD_ONLY."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:416
-msgid "Unexpected error while decoding character data from a large object."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:462
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:491
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:525
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3129
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3174
-#, java-format
-msgid "Cannot convert the column of type {0} to requested type {1}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:744
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:768
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1892
-msgid "Can''t use relative move methods while on the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:788
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2956
-#, java-format
-msgid "Invalid fetch direction constant: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:802
-msgid "Cannot call cancelRowUpdates() when on the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:822
-msgid "Cannot call deleteRow() when on the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:828
-msgid ""
-"Currently positioned before the start of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:833
-msgid ""
-"Currently positioned after the end of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:838
-msgid "There are no rows in this ResultSet."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:885
-msgid "Not on the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:889
-msgid "You must specify at least one column value to insert a row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1074
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1805
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2494
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2524
-#, java-format
-msgid "The JVM claims not to support the encoding: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1078
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1121
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1534
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1663
-msgid "Provided InputStream failed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1191
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3137
-msgid "Provided Reader failed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1259
-msgid "Can''t refresh the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1327
-msgid "Cannot call updateRow() when on the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1333
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3190
-msgid ""
-"Cannot update the ResultSet because it is either before the start or after "
-"the end of the results."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1582
-msgid "ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1650
-#, java-format
-msgid "No primary key found for table {0}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1876
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2965
-msgid "Fetch size must be a value greater to or equal to 0."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2044
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2051
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2098
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2106
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2926
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2934
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2964
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2971
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2991
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3002
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3020
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3038
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3179
-#: org/postgresql/jdbc2/TimestampUtils.java:258
-#, java-format
-msgid "Bad value for type {0} : {1}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2727
-#, java-format
-msgid "The column name {0} was not found in this ResultSet."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2827
-msgid ""
-"ResultSet is not updateable. The query that generated this result set must "
-"select only one table, and must select all primary keys from that table. See "
-"the JDBC 2.1 API Specification, section 5.6 for more details."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2839
-msgid "This ResultSet is closed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2860
-msgid "ResultSet not positioned properly, perhaps you need to call next."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:259
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:323
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:392
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2655
-msgid ""
-"Can''t use query methods that take a query string on a PreparedStatement."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:287
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:306
-msgid "Multiple ResultSets were returned by the query."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:425
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:429
-msgid "A CallableStatement was executed with nothing returned."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:437
-msgid "A CallableStatement was executed with an invalid number of parameters"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:468
-#, java-format
-msgid ""
-"A CallableStatement function was executed and the out parameter {0} was of "
-"type {1} however type {2} was registered."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:674
-msgid "Maximum number of rows must be a value grater than or equal to 0."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:717
-msgid "Query timeout must be a value greater than or equals to 0."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:809
-msgid "The maximum field size must be a value greater than or equal to 0."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1226
-msgid "Unknown Types value."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1499
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1624
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3108
-#, java-format
-msgid "Invalid stream length {0}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1530
-#, java-format
-msgid "The JVM claims not to support the {0} encoding."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1705
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3030
-#, java-format
-msgid "Unknown type {0}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1720
-msgid "No hstore extension installed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1845
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1851
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1857
-#, java-format
-msgid "Cannot cast an instance of {0} to type {1}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1869
-#, java-format
-msgid "Unsupported Types value: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1927
-#, java-format
-msgid ""
-"Can''t infer the SQL type to use for an instance of {0}. Use setObject() "
-"with an explicit Types value to specify the type to use."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1975
-msgid ""
-"This statement does not declare an OUT parameter. Use '{' ?= call ... '}' "
-"to declare one."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2025
-msgid "wasNull cannot be call before fetching a result."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2521
-#, java-format
-msgid "Malformed function or procedure escape syntax at offset {0}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2571
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2585
-#, java-format
-msgid ""
-"Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was "
-"made."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2604
-msgid ""
-"A CallableStatement was declared, but no call to registerOutParameter(1, "
-"<some type>) was made."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2608
-msgid "No function outputs were registered."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2611
-msgid ""
-"Results cannot be retrieved from a CallableStatement before it is executed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2644
-msgid "This statement has been closed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2724
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2794
-#, fuzzy
-msgid "Too many update results were returned."
-msgstr "La consulta no retornó ningún resultado."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2753
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2823
-#, java-format
-msgid ""
-"Batch entry {0} {1} was aborted. Call getNextException to see the cause."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3078
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3167
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3207
-msgid "Unexpected error writing large object to database."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:145
-#: org/postgresql/jdbc2/EscapedFunctions.java:157
-#: org/postgresql/jdbc2/EscapedFunctions.java:169
-#: org/postgresql/jdbc2/EscapedFunctions.java:206
-#: org/postgresql/jdbc2/EscapedFunctions.java:243
-#: org/postgresql/jdbc2/EscapedFunctions.java:267
-#: org/postgresql/jdbc2/EscapedFunctions.java:292
-#: org/postgresql/jdbc2/EscapedFunctions.java:316
-#: org/postgresql/jdbc2/EscapedFunctions.java:328
-#: org/postgresql/jdbc2/EscapedFunctions.java:352
-#: org/postgresql/jdbc2/EscapedFunctions.java:380
-#: org/postgresql/jdbc2/EscapedFunctions.java:389
-#: org/postgresql/jdbc2/EscapedFunctions.java:399
-#: org/postgresql/jdbc2/EscapedFunctions.java:408
-#: org/postgresql/jdbc2/EscapedFunctions.java:417
-#: org/postgresql/jdbc2/EscapedFunctions.java:426
-#: org/postgresql/jdbc2/EscapedFunctions.java:435
-#: org/postgresql/jdbc2/EscapedFunctions.java:444
-#: org/postgresql/jdbc2/EscapedFunctions.java:453
-#: org/postgresql/jdbc2/EscapedFunctions.java:462
-#: org/postgresql/jdbc2/EscapedFunctions.java:471
-#: org/postgresql/jdbc2/EscapedFunctions.java:480
-#, java-format
-msgid "{0} function takes one and only one argument."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:181
-#: org/postgresql/jdbc2/EscapedFunctions.java:193
-#: org/postgresql/jdbc2/EscapedFunctions.java:255
-#: org/postgresql/jdbc2/EscapedFunctions.java:304
-#: org/postgresql/jdbc2/EscapedFunctions.java:582
-#, java-format
-msgid "{0} function takes two and only two arguments."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:230
-#, java-format
-msgid "{0} function takes four and only four argument."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:282
-#: org/postgresql/jdbc2/EscapedFunctions.java:342
-#, java-format
-msgid "{0} function takes two or three arguments."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:362
-#: org/postgresql/jdbc2/EscapedFunctions.java:371
-#: org/postgresql/jdbc2/EscapedFunctions.java:573
-#: org/postgresql/jdbc2/EscapedFunctions.java:591
-#, java-format
-msgid "{0} function doesn''t take any argument."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:489
-#: org/postgresql/jdbc2/EscapedFunctions.java:531
-#, java-format
-msgid "{0} function takes three and only three arguments."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:501
-#: org/postgresql/jdbc2/EscapedFunctions.java:521
-#: org/postgresql/jdbc2/EscapedFunctions.java:523
-#: org/postgresql/jdbc2/EscapedFunctions.java:543
-#: org/postgresql/jdbc2/EscapedFunctions.java:564
-#: org/postgresql/jdbc2/EscapedFunctions.java:566
-#, fuzzy, java-format
-msgid "Interval {0} not yet implemented"
-msgstr "Este método aún no ha sido implementado."
-
-#: org/postgresql/jdbc2/TimestampUtils.java:360
-msgid ""
-"Infinite value found for timestamp/date. This cannot be represented as time."
-msgstr ""
-
-#: org/postgresql/jdbc2/TimestampUtils.java:648
-#: org/postgresql/jdbc2/TimestampUtils.java:680
-#: org/postgresql/jdbc2/TimestampUtils.java:727
-#, java-format
-msgid "Unsupported binary encoding of {0}."
-msgstr ""
-
-#: org/postgresql/jdbc2/TypeInfoCache.java:161
-#, java-format
-msgid "The class {0} does not implement org.postgresql.util.PGobject."
-msgstr "La clase {0} no implementa org.postgresql.util.PGobject."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:60
-#, java-format
-msgid "Unknown ResultSet holdability setting: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:98
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:130
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:165
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:187
-msgid "Server versions prior to 8.0 do not support savepoints."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:100
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:132
-msgid "Cannot establish a savepoint in auto-commit mode."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:419
-msgid "Returning autogenerated keys is not supported."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java:81
-#, fuzzy, java-format
-msgid "The parameter index is out of range: {0}, number of parameters: {1}."
-msgstr ""
-"El índice del arreglo esta fuera de rango: {0}, número de elementos: {1}."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:151
-msgid ""
-"Returning autogenerated keys is only supported for 8.2 and later servers."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:199
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:317
-msgid "Returning autogenerated keys by column index is not supported."
-msgstr ""
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:38
-#: org/postgresql/jdbc3/PSQLSavepoint.java:50
-#: org/postgresql/jdbc3/PSQLSavepoint.java:66
-msgid "Cannot reference a savepoint after it has been released."
-msgstr ""
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:42
-msgid "Cannot retrieve the id of a named savepoint."
-msgstr ""
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:54
-msgid "Cannot retrieve the name of an unnamed savepoint."
-msgstr ""
-
-#: org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java:37
-msgid "Invalid UUID data."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:83
-#, java-format
-msgid "Unable to find server array type for provided name {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:121
-#, java-format
-msgid "Invalid timeout ({0}<0)."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:134
-msgid "Validating connection."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:157
-#, fuzzy, java-format
-msgid "Failed to set ClientInfo property: {0}"
-msgstr "Fallo al crear objeto: {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:166
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:188
-msgid "ClientInfo property not supported."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Statement.java:127
-msgid "Object is too large to send over the protocol."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:147
-msgid "Unable to decode xml data."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:150
-#, java-format
-msgid "Unknown XML Source class: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:195
-#, fuzzy
-msgid "Unable to create SAXResult for SQLXML."
-msgstr "Fallo al crear objeto: {0}."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:209
-msgid "Unable to create StAXResult for SQLXML"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:213
-#, java-format
-msgid "Unknown XML Result class: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:226
-msgid "This SQLXML object has already been freed."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:233
-msgid ""
-"This SQLXML object has not been initialized, so you cannot retrieve data "
-"from it."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:244
-#, java-format
-msgid "Failed to convert binary xml data to encoding: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:269
-msgid "Unable to convert DOMResult SQLXML data to a string."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:282
-msgid ""
-"This SQLXML object has already been initialized, so you cannot manipulate it "
-"further."
-msgstr ""
-
-#: org/postgresql/largeobject/LargeObjectManager.java:138
-msgid "Failed to initialize LargeObject API"
-msgstr ""
-
-#: org/postgresql/largeobject/LargeObjectManager.java:257
-#: org/postgresql/largeobject/LargeObjectManager.java:298
-msgid "Large Objects may not be used in auto-commit mode."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java:58
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:110
-#, java-format
-msgid "The SSLSocketFactory class provided {0} could not be instantiated."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:125
-#, java-format
-msgid "SSL error: {0}"
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:138
-#, java-format
-msgid "The HostnameVerifier class provided {0} could not be instantiated."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:142
-#, java-format
-msgid "The hostname {0} could not be verified by hostnameverifier {1}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:149
-#, java-format
-msgid "The hostname {0} could not be verified."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:121
-msgid ""
-"Could not find a java cryptographic algorithm: X.509 CertificateFactory not "
-"available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:132
-#, java-format
-msgid "Could not open SSL certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:137
-#, java-format
-msgid "Loading the SSL certificate {0} into a KeyManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:194
-msgid "Enter SSL password: "
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:202
-msgid "Could not read password for SSL key file, console is not available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:204
-#, java-format
-msgid "Could not read password for SSL key file by callbackhandler {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:223
-#, java-format
-msgid "Could not decrypt SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:231
-#, java-format
-msgid "Could not read SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:235
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:173
-#, java-format
-msgid "Could not find a java cryptographic algorithm: {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:99
-#, java-format
-msgid "The password callback class provided {0} could not be instantiated."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:133
-#, java-format
-msgid "Could not open SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:150
-#, java-format
-msgid "Could not read SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:153
-#, java-format
-msgid "Loading the SSL root certificate {0} into a TrustManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:166
-msgid "Could not initialize SSL context."
-msgstr ""
-
-#: org/postgresql/util/PGInterval.java:164
-msgid "Conversion of interval failed"
-msgstr ""
-
-#: org/postgresql/util/PGmoney.java:73
-msgid "Conversion of money failed."
-msgstr ""
-
-#: org/postgresql/util/ServerErrorMessage.java:155
-#, java-format
-msgid "Detail: {0}"
-msgstr ""
-
-#: org/postgresql/util/ServerErrorMessage.java:159
-#, java-format
-msgid "Hint: {0}"
-msgstr ""
-
-#: org/postgresql/util/ServerErrorMessage.java:162
-#, java-format
-msgid "Position: {0}"
-msgstr ""
-
-#: org/postgresql/util/ServerErrorMessage.java:165
-#, java-format
-msgid "Where: {0}"
-msgstr ""
-
-#: org/postgresql/util/ServerErrorMessage.java:171
-#, java-format
-msgid "Internal Query: {0}"
-msgstr ""
-
-#: org/postgresql/util/ServerErrorMessage.java:174
-#, java-format
-msgid "Internal Position: {0}"
-msgstr ""
-
-#: org/postgresql/util/ServerErrorMessage.java:180
-#, java-format
-msgid "Location: File: {0}, Routine: {1}, Line: {2}"
-msgstr ""
-
-#: org/postgresql/util/ServerErrorMessage.java:183
-#, java-format
-msgid "Server SQLState: {0}"
-msgstr "SQLState del servidor: {0}."
-
-#: org/postgresql/xa/PGXAConnection.java:148
-msgid ""
-"Transaction control methods setAutoCommit(true), commit, rollback and "
-"setSavePoint not allowed while an XA transaction is active."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:186
-#: org/postgresql/xa/PGXAConnection.java:245
-msgid "Invalid flags"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:189
-#: org/postgresql/xa/PGXAConnection.java:248
-#: org/postgresql/xa/PGXAConnection.java:425
-msgid "xid must not be null"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:192
-msgid "Connection is busy with another transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:198
-#: org/postgresql/xa/PGXAConnection.java:255
-#, fuzzy
-msgid "suspend/resume not implemented"
-msgstr "Este método aún no ha sido implementado."
-
-#: org/postgresql/xa/PGXAConnection.java:204
-#: org/postgresql/xa/PGXAConnection.java:207
-#: org/postgresql/xa/PGXAConnection.java:209
-msgid "Transaction interleaving not implemented"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:218
-msgid "Error disabling autocommit"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:251
-msgid "tried to call end without corresponding start call"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:282
-msgid ""
-"Not implemented: Prepare must be issued using the same connection that "
-"started the transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:286
-msgid "Prepare called before end"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:292
-msgid "Server versions prior to 8.1 do not support two-phase commit."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:313
-msgid "Error preparing transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:328
-msgid "Invalid flag"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:368
-msgid "Error during recover"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:416
-msgid "Error rolling back prepared transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:451
-msgid ""
-"Not implemented: one-phase commit must be issued using the same connection "
-"that was used to start it"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:455
-msgid "commit called before end"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:466
-msgid "Error during one-phase commit"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:487
-msgid ""
-"Not implemented: 2nd phase commit must be issued using an idle connection"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:507
-msgid "Error committing prepared transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:522
-msgid "Heuristic commit/rollback not supported"
-msgstr ""
-
-#~ msgid "The driver does not support SSL."
-#~ msgstr "Este driver no soporta SSL."
diff --git a/org/postgresql/translation/fr.po b/org/postgresql/translation/fr.po
deleted file mode 100644
index f84caad..0000000
--- a/org/postgresql/translation/fr.po
+++ /dev/null
@@ -1,1528 +0,0 @@
-# translation of head-fr.po to
-# french message translation for the PostgreSQL JDBC driver
-# This file is distributed under the same license as the package.
-# Xavier Poinsard <xpoinsard at free.fr>, 2004, 2005.
-# Poinsard Xavier <xpoinsard at free.fr>, 2005.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: head-fr\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-10-31 13:37+0000\n"
-"PO-Revision-Date: 2007-07-27 12:27+0200\n"
-"Last-Translator: \n"
-"Language-Team: <en at li.org>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ISO-8859-1\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: KBabel 1.11.4\n"
-"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-
-#: org/postgresql/Driver.java.in:235
-msgid "Error loading default settings from driverconfig.properties"
-msgstr ""
-"Erreur de chargement des valeurs par d�faut depuis driverconfig.properties"
-
-#: org/postgresql/Driver.java.in:282
-msgid ""
-"Your security policy has prevented the connection from being attempted. You "
-"probably need to grant the connect java.net.SocketPermission to the database "
-"server host and port that you wish to connect to."
-msgstr ""
-
-#: org/postgresql/Driver.java.in:287 org/postgresql/Driver.java.in:351
-msgid ""
-"Something unusual has occurred to cause the driver to fail. Please report "
-"this exception."
-msgstr ""
-"Quelque chose d''inhabituel a provoqu� l''�chec du pilote. Veuillez faire un "
-"rapport sur cette erreur."
-
-#: org/postgresql/Driver.java.in:359
-msgid "Connection attempt timed out."
-msgstr "La tentative de connexion a �chou� dans le d�lai imparti."
-
-#: org/postgresql/Driver.java.in:372
-msgid "Interrupted while attempting to connect."
-msgstr "Interrompu pendant l''�tablissement de la connexion."
-
-#: org/postgresql/Driver.java.in:714
-#, java-format
-msgid "Method {0} is not yet implemented."
-msgstr "La fonction {0} n''est pas encore impl�ment�e."
-
-#: org/postgresql/copy/CopyManager.java:56
-#, java-format
-msgid "Requested CopyIn but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/CopyManager.java:67
-#, java-format
-msgid "Requested CopyOut but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:51
-#, java-format
-msgid "Copying from database failed: {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:67
-#: org/postgresql/copy/PGCopyOutputStream.java:90
-#, fuzzy
-msgid "This copy stream is closed."
-msgstr "Ce ResultSet est ferm�."
-
-#: org/postgresql/copy/PGCopyInputStream.java:108
-msgid "Read from copy failed."
-msgstr ""
-
-#: org/postgresql/copy/PGCopyOutputStream.java:68
-#, java-format
-msgid "Cannot write to copy a byte of value {0}"
-msgstr ""
-
-#: org/postgresql/core/ConnectionFactory.java:69
-#, java-format
-msgid "A connection could not be made using the requested protocol {0}."
-msgstr ""
-"Aucune connexion n''a pu �tre �tablie en utilisant le protocole demand� {0}. "
-
-#: org/postgresql/core/Oid.java:113
-#, java-format
-msgid "oid type {0} not known and not a number"
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:490
-#, java-format
-msgid "Premature end of input stream, expected {0} bytes, but only read {1}."
-msgstr ""
-"Fin pr�matur�e du flux en entr�e, {0} octets attendus, mais seulement {1} "
-"lus."
-
-#: org/postgresql/core/PGStream.java:530
-#, java-format
-msgid "Expected an EOF from server, got: {0}"
-msgstr "Attendait une fin de fichier du serveur, re�u: {0}"
-
-#: org/postgresql/core/SetupQueryRunner.java:86
-msgid "An unexpected result was returned by a query."
-msgstr "Un r�sultat inattendu a �t� retourn� par une requ�te."
-
-#: org/postgresql/core/UTF8Encoding.java:28
-#, java-format
-msgid ""
-"Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}"
-msgstr ""
-"S�quence UTF-8 ill�gale: l''octet {0} de la s�quence d''octet {1} n''est pas "
-"10xxxxxx: {2}"
-
-#: org/postgresql/core/UTF8Encoding.java:61
-#, java-format
-msgid "Illegal UTF-8 sequence: {0} bytes used to encode a {1} byte value: {2}"
-msgstr ""
-"S�quence UTF-8 ill�gale: {0} octets utilis� pour encoder une valeur � {1} "
-"octets: {2}"
-
-#: org/postgresql/core/UTF8Encoding.java:98
-#: org/postgresql/core/UTF8Encoding.java:125
-#, java-format
-msgid "Illegal UTF-8 sequence: initial byte is {0}: {1}"
-msgstr "S�quence UTF-8 ill�gale: le premier octet est {0}: {1}"
-
-#: org/postgresql/core/UTF8Encoding.java:130
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is out of range: {0}"
-msgstr ""
-"S�quence UTF-8 ill�gale: la valeur finale est en dehors des limites: {0}"
-
-#: org/postgresql/core/UTF8Encoding.java:145
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is a surrogate value: {0}"
-msgstr ""
-"S�quence UTF-8 ill�gale: la valeur finale est une valeur de remplacement: {0}"
-
-#: org/postgresql/core/Utils.java:95 org/postgresql/core/Utils.java:112
-msgid "Zero bytes may not occur in string parameters."
-msgstr ""
-"Z�ro octets ne devrait pas se produire dans les param�tres de type cha�ne de "
-"caract�res."
-
-#: org/postgresql/core/Utils.java:145
-msgid "Zero bytes may not occur in identifiers."
-msgstr "Des octects � 0 ne devraient pas appara�tre dans les identifiants."
-
-#: org/postgresql/core/types/PGBigDecimal.java:63
-#: org/postgresql/core/types/PGBoolean.java:62
-#: org/postgresql/core/types/PGByte.java:63
-#: org/postgresql/core/types/PGDouble.java:64
-#: org/postgresql/core/types/PGFloat.java:64
-#: org/postgresql/core/types/PGInteger.java:61
-#: org/postgresql/core/types/PGLong.java:62
-#: org/postgresql/core/types/PGNumber.java:62
-#: org/postgresql/core/types/PGShort.java:58
-#: org/postgresql/core/types/PGString.java:73
-#, java-format
-msgid "Cannot convert an instance of {0} to type {1}"
-msgstr "Impossible de convertir une instance de type {0} vers le type {1}"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:66
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:74
-#, fuzzy, java-format
-msgid "Invalid sslmode value: {0}"
-msgstr "Longueur de flux invalide {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:134
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:207
-msgid ""
-"Connection refused. Check that the hostname and port are correct and that "
-"the postmaster is accepting TCP/IP connections."
-msgstr ""
-"Connexion refus�e. V�rifiez que le nom de machine et le port sont corrects "
-"et que postmaster accepte les connexions TCP/IP."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:153
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:225
-msgid "The connection attempt failed."
-msgstr "La tentative de connexion a �chou�."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:175
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:246
-#, fuzzy
-msgid "The connection url is invalid."
-msgstr "La tentative de connexion a �chou�."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:198
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:210
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:295
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:307
-msgid "The server does not support SSL."
-msgstr "Le serveur ne supporte pas SSL."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:223
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:320
-msgid "An error occurred while setting up the SSL connection."
-msgstr ""
-"Une erreur s''est produite pendant l''�tablissement de la connexion SSL."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:272
-#, java-format
-msgid "Connection rejected: {0}."
-msgstr "Connexion rejet�e�: {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:290
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:312
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:332
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:419
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:444
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:471
-msgid ""
-"The server requested password-based authentication, but no password was "
-"provided."
-msgstr ""
-"Le serveur a demand� une authentification par mots de passe, mais aucun mot "
-"de passe n''a �t� fourni."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:356
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:504
-#, java-format
-msgid ""
-"The authentication type {0} is not supported. Check that you have configured "
-"the pg_hba.conf file to include the client''s IP address or subnet, and that "
-"it is using an authentication scheme supported by the driver."
-msgstr ""
-"Le type d''authentification {0} n''est pas support�. V�rifiez que vous avez "
-"configur� le fichier pg_hba.conf pour inclure l''adresse IP du client ou le "
-"sous-r�seau et qu''il utilise un sch�ma d''authentification support� par le "
-"pilote."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:362
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:400
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:510
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:553
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:599
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:609
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:618
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:626
-#: org/postgresql/gss/MakeGSS.java:158
-msgid "Protocol error. Session setup failed."
-msgstr "Erreur de protocole. Ouverture de la session en �chec."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:390
-#, java-format
-msgid "Backend start-up failed: {0}."
-msgstr "D�marrage du serveur en �chec�: {0}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:55
-#: org/postgresql/core/v2/FastpathParameterList.java:77
-#: org/postgresql/core/v2/FastpathParameterList.java:84
-#: org/postgresql/core/v2/SimpleParameterList.java:57
-#: org/postgresql/core/v2/SimpleParameterList.java:76
-#: org/postgresql/core/v2/SimpleParameterList.java:83
-#: org/postgresql/core/v2/SimpleParameterList.java:90
-#: org/postgresql/core/v3/CompositeParameterList.java:35
-#: org/postgresql/core/v3/SimpleParameterList.java:49
-#: org/postgresql/core/v3/SimpleParameterList.java:56
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2845
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java:419
-#, java-format
-msgid "The column index is out of range: {0}, number of columns: {1}."
-msgstr ""
-"L''indice de la colonne est hors limite�: {0}, nombre de colonnes�: {1}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:142
-#: org/postgresql/core/v2/SimpleParameterList.java:155
-#: org/postgresql/core/v3/SimpleParameterList.java:216
-#, java-format
-msgid "No value specified for parameter {0}."
-msgstr "Pas de valeur sp�cifi�e pour le param�tre {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:72
-#: org/postgresql/core/v2/QueryExecutorImpl.java:337
-#: org/postgresql/core/v3/QueryExecutorImpl.java:443
-#: org/postgresql/core/v3/QueryExecutorImpl.java:507
-#, java-format
-msgid "Expected command status BEGIN, got {0}."
-msgstr "Attendait le statut de commande BEGIN, obtenu {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:78
-#: org/postgresql/core/v3/QueryExecutorImpl.java:513
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1828
-#, java-format
-msgid "Unexpected command status: {0}."
-msgstr "Statut de commande inattendu�: {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:118
-#: org/postgresql/core/v2/QueryExecutorImpl.java:129
-#: org/postgresql/core/v2/QueryExecutorImpl.java:174
-#: org/postgresql/core/v2/QueryExecutorImpl.java:369
-#: org/postgresql/core/v3/QueryExecutorImpl.java:281
-#: org/postgresql/core/v3/QueryExecutorImpl.java:411
-#: org/postgresql/core/v3/QueryExecutorImpl.java:485
-#: org/postgresql/core/v3/QueryExecutorImpl.java:551
-#: org/postgresql/core/v3/QueryExecutorImpl.java:631
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2094
-#, fuzzy
-msgid "An I/O error occured while sending to the backend."
-msgstr "Une erreur d''entr�e/sortie a eu lieu lors d''envoi vers le serveur."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:170
-#: org/postgresql/core/v2/QueryExecutorImpl.java:225
-#: org/postgresql/core/v2/QueryExecutorImpl.java:236
-#: org/postgresql/core/v3/QueryExecutorImpl.java:627
-#: org/postgresql/core/v3/QueryExecutorImpl.java:685
-#, java-format
-msgid "Unknown Response Type {0}."
-msgstr "Type de r�ponse inconnu {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:430
-#: org/postgresql/core/v2/QueryExecutorImpl.java:475
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1857
-msgid "Ran out of memory retrieving query results."
-msgstr "Ai manqu� de m�moire en r�cup�rant les r�sultats de la requ�te."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:597
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2199
-#, java-format
-msgid "Unable to interpret the update count in command completion tag: {0}."
-msgstr ""
-"Incapable d''interpr�ter le nombre de mise � jour dans la balise de "
-"compl�tion de commande�: {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:610
-msgid "Copy not implemented for protocol version 2"
-msgstr ""
-
-#: org/postgresql/core/v3/CopyOperationImpl.java:56
-msgid "CommandComplete expected COPY but got: "
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:66
-msgid "Tried to obtain lock while already holding it"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:78
-msgid "Tried to break lock on database connection"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:93
-#, fuzzy
-msgid "Interrupted while waiting to obtain lock on database connection"
-msgstr "Interrompu pendant l''�tablissement de la connexion."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:275
-msgid "Unable to bind parameter values for statement."
-msgstr "Incapable de lier les valeurs des param�tres pour la commande."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:726
-msgid "Database connection failed when starting copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:757
-msgid "Tried to cancel an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:794
-msgid "Database connection failed when canceling copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:799
-msgid "Missing expected error response to copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:801
-#, java-format
-msgid "Got {0} error responses to single copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:814
-msgid "Tried to end inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:827
-msgid "Database connection failed when ending copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:842
-#: org/postgresql/core/v3/QueryExecutorImpl.java:860
-msgid "Tried to write to an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:854
-#: org/postgresql/core/v3/QueryExecutorImpl.java:866
-msgid "Database connection failed when writing to copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:878
-msgid "Tried to read from inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:883
-msgid "Database connection failed when reading from copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:951
-#, java-format
-msgid "Received CommandComplete ''{0}'' without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:975
-#, java-format
-msgid "Got CopyInResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:988
-#, java-format
-msgid "Got CopyOutResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1003
-msgid "Got CopyData without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1005
-#, fuzzy, java-format
-msgid "Unexpected copydata from server for {0}"
-msgstr "Attendait une fin de fichier du serveur, re�u: {0}"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1056
-#, java-format
-msgid "Unexpected packet type during copy: {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1310
-#, java-format
-msgid ""
-"Bind message length {0} too long. This can be caused by very large or "
-"incorrect length specifications on InputStream parameters."
-msgstr ""
-"La longueur du message de liaison {0} est trop grande. Cela peut �tre caus� "
-"par des sp�cification de longueur tr�s grandes ou incorrectes pour les "
-"param�tres de type InputStream."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1925
-#, fuzzy, java-format
-msgid ""
-"The server''s client_encoding parameter was changed to {0}. The JDBC driver "
-"requires client_encoding to be UTF8 for correct operation."
-msgstr ""
-"Le param�tre client_encoding du serveur a �t� chang� pour {0}. Le pilote "
-"JDBC n�cessite l''affectation de la valeur UNICODE � client_encoding pour un "
-"fonctionnement correct."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1932
-#, java-format
-msgid ""
-"The server''s DateStyle parameter was changed to {0}. The JDBC driver "
-"requires DateStyle to begin with ISO for correct operation."
-msgstr ""
-"Le param�tre DateStyle du serveur a �t� chang� pour {0}. Le pilote JDBC "
-"n�cessite que DateStyle commence par ISO pour un fonctionnement correct."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1945
-#, java-format
-msgid ""
-"The server''s standard_conforming_strings parameter was reported as {0}. The "
-"JDBC driver expected on or off."
-msgstr ""
-"Le param�tre serveur standard_conforming_strings a pour valeur {0}. Le "
-"driver JDBC attend on ou off."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2015
-msgid "The driver currently does not support COPY operations."
-msgstr "Le pilote ne supporte pas actuellement les op�rations COPY."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:112
-msgid "This PooledConnection has already been closed."
-msgstr "Cette PooledConnection a d�j� �t� ferm�e."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid ""
-"Connection has been closed automatically because a new connection was opened "
-"for the same PooledConnection or the PooledConnection has been closed."
-msgstr ""
-"La connexion a �t� ferm�e automatiquement car une nouvelle connexion a �t� "
-"ouverte pour la m�me PooledConnection ou la PooledConnection a �t� ferm�e."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid "Connection has been closed."
-msgstr "La connexion a �t� ferm�e."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:442
-msgid "Statement has been closed."
-msgstr "Statement a �t� ferm�."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:291
-msgid "Failed to setup DataSource."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:414
-msgid "DataSource has been closed."
-msgstr "DataSource a �t� ferm�e."
-
-#: org/postgresql/fastpath/Fastpath.java:81
-#: org/postgresql/fastpath/Fastpath.java:128
-#, java-format
-msgid "Fastpath call {0} - No result was returned and we expected an integer."
-msgstr ""
-"Appel Fastpath {0} - Aucun r�sultat n''a �t� retourn� et nous attendions un "
-"entier."
-
-#: org/postgresql/fastpath/Fastpath.java:237
-#, java-format
-msgid "The fastpath function {0} is unknown."
-msgstr "La fonction fastpath {0} est inconnue."
-
-#: org/postgresql/geometric/PGbox.java:83
-#: org/postgresql/geometric/PGcircle.java:82
-#: org/postgresql/geometric/PGcircle.java:91
-#: org/postgresql/geometric/PGline.java:80
-#: org/postgresql/geometric/PGlseg.java:77
-#: org/postgresql/geometric/PGpoint.java:85
-#, java-format
-msgid "Conversion to type {0} failed: {1}."
-msgstr "La conversion vers le type {0} a �chou�: {1}."
-
-#: org/postgresql/geometric/PGpath.java:81
-#, java-format
-msgid "Cannot tell if path is open or closed: {0}."
-msgstr "Impossible de dire si path est ferm� ou ouvert�: {0}."
-
-#: org/postgresql/gss/MakeGSS.java:47 org/postgresql/gss/MakeGSS.java:55
-#: org/postgresql/gss/MakeGSS.java:168
-msgid "GSS Authentication failed"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:153
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:790
-#, java-format
-msgid "The array index is out of range: {0}"
-msgstr "L''indice du tableau est hors limites�: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:168
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:807
-#, java-format
-msgid "The array index is out of range: {0}, number of elements: {1}."
-msgstr "L''indice du tableau est hors limites�: {0}, nombre d''�l�ments�: {1}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:196
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1982
-#: org/postgresql/util/HStoreConverter.java:34
-#: org/postgresql/util/HStoreConverter.java:61
-msgid ""
-"Invalid character data was found. This is most likely caused by stored data "
-"containing characters that are invalid for the character set the database "
-"was created in. The most common example of this is storing 8bit data in a "
-"SQL_ASCII database."
-msgstr ""
-"Des donn�es de caract�res invalides ont �t� trouv�es. C''est probablement "
-"caus� par le stockage de caract�res invalides pour le jeu de caract�res de "
-"cr�ation de la base. L''exemple le plus courant est le stockage de donn�es "
-"8bit dans une base SQL_ASCII."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:73
-msgid ""
-"Truncation of large objects is only implemented in 8.3 and later servers."
-msgstr ""
-"Le troncage des large objects n''est impl�ment� que dans les serveurs 8.3 et "
-"sup�rieurs."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:77
-msgid "Cannot truncate LOB to a negative length."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:81
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:235
-#, java-format
-msgid "PostgreSQL LOBs can only index to: {0}"
-msgstr "Les LOB PostgreSQL peuvent seulement s''indicer �: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:231
-msgid "LOB positioning offsets start at 1."
-msgstr "Les d�calages de position des LOB commencent � 1."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:246
-msgid "free() was called on this LOB previously"
-msgstr "free() a �t� appel�e auparavant sur ce LOB"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:225
-#, java-format
-msgid "Unsupported value for stringtype parameter: {0}"
-msgstr ""
-"Valeur non support�e pour les param�tre de type cha�ne de caract�res�: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:245
-msgid "unknownLength parameter value must be an integer"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:353
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:284
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:303
-#: org/postgresql/jdbc2/TypeInfoCache.java:201
-#: org/postgresql/jdbc2/TypeInfoCache.java:249
-#: org/postgresql/jdbc2/TypeInfoCache.java:287
-#: org/postgresql/jdbc2/TypeInfoCache.java:344
-#: org/postgresql/jdbc2/TypeInfoCache.java:348
-#: org/postgresql/jdbc2/TypeInfoCache.java:384
-#: org/postgresql/jdbc2/TypeInfoCache.java:388
-msgid "No results were returned by the query."
-msgstr "Aucun r�sultat retourn� par la requ�te."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:367
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:336
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:368
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2702
-msgid "A result was returned when none was expected."
-msgstr "Un r�sultat a �t� retourn� alors qu''aucun n''�tait attendu."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:519
-msgid "Custom type maps are not supported."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:567
-#, java-format
-msgid "Failed to create object for: {0}."
-msgstr "�chec � la cr�ation de l''objet pour�: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:629
-#, java-format
-msgid "Unable to load the class {0} responsible for the datatype {1}"
-msgstr "Incapable de charger la classe {0} responsable du type de donn�es {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:725
-msgid ""
-"Cannot change transaction read-only property in the middle of a transaction."
-msgstr ""
-"Impossible de changer la propri�t� read-only d''une transaction au milieu "
-"d''une transaction."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:813
-msgid "Cannot commit when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:822
-#, fuzzy
-msgid "This connection has been closed."
-msgstr "La connexion a �t� ferm�e."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:842
-msgid "Cannot rollback when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:929
-msgid ""
-"Cannot change transaction isolation level in the middle of a transaction."
-msgstr ""
-"Impossible de changer le niveau d''isolation des transactions au milieu "
-"d''une transaction."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:934
-#, java-format
-msgid "Transaction isolation level {0} not supported."
-msgstr "Le niveau d''isolation de transaction {0} n''est pas support�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1001
-msgid "Finalizing a Connection that was never closed:"
-msgstr "Destruction d''une connection qui n''a jamais �t� ferm�e:"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1103
-msgid "Unable to translate data into the desired encoding."
-msgstr "Impossible de traduire les donn�es dans l''encodage d�sir�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:63
-msgid ""
-"Unable to determine a value for MaxIndexKeys due to missing system catalog "
-"data."
-msgstr ""
-"Incapable de d�terminer la valeur de MaxIndexKeys en raison de donn�es "
-"manquante dans lecatalogue syst�me."
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:86
-msgid "Unable to find name datatype in the system catalogs."
-msgstr ""
-"Incapable de trouver le type de donn�e name dans les catalogues syst�mes."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:235
-msgid ""
-"Operation requires a scrollable ResultSet, but this ResultSet is "
-"FORWARD_ONLY."
-msgstr ""
-"L''op�ration n�cessite un scrollable ResultSet, mais ce ResultSet est "
-"FORWARD_ONLY."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:416
-msgid "Unexpected error while decoding character data from a large object."
-msgstr ""
-"Erreur inattendue pendant le d�codage des donn�es caract�res pour un large "
-"object."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:462
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:491
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:525
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3129
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3174
-#, fuzzy, java-format
-msgid "Cannot convert the column of type {0} to requested type {1}."
-msgstr "Impossible de convertir une instance de type {0} vers le type {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:744
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:768
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1892
-msgid "Can''t use relative move methods while on the insert row."
-msgstr ""
-"Impossible d''utiliser les fonctions de d�placement relatif pendant "
-"l''insertion d''une ligne."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:788
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2956
-#, java-format
-msgid "Invalid fetch direction constant: {0}."
-msgstr "Constante de direction pour la r�cup�ration invalide�: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:802
-msgid "Cannot call cancelRowUpdates() when on the insert row."
-msgstr ""
-"Impossible d''appeler cancelRowUpdates() pendant l''insertion d''une ligne."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:822
-msgid "Cannot call deleteRow() when on the insert row."
-msgstr "Impossible d''appeler deleteRow() pendant l''insertion d''une ligne."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:828
-msgid ""
-"Currently positioned before the start of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"Actuellement positionn� avant le d�but du ResultSet. Vous ne pouvez pas "
-"appeler deleteRow() ici."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:833
-msgid ""
-"Currently positioned after the end of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"Actuellement positionn� apr�s la fin du ResultSet. Vous ne pouvez pas "
-"appeler deleteRow() ici."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:838
-msgid "There are no rows in this ResultSet."
-msgstr "Il n''y pas pas de lignes dans ce ResultSet."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:885
-msgid "Not on the insert row."
-msgstr "Pas sur la ligne en insertion."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:889
-msgid "You must specify at least one column value to insert a row."
-msgstr ""
-"Vous devez sp�cifier au moins une valeur de colonne pour ins�rer une ligne."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1074
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1805
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2494
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2524
-#, java-format
-msgid "The JVM claims not to support the encoding: {0}"
-msgstr "La JVM pr�tend ne pas supporter l''encodage: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1078
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1121
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1534
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1663
-msgid "Provided InputStream failed."
-msgstr "L''InputStream fourni a �chou�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1191
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3137
-msgid "Provided Reader failed."
-msgstr "Le Reader fourni a �chou�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1259
-msgid "Can''t refresh the insert row."
-msgstr "Impossible de rafra�chir la ligne ins�r�e."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1327
-msgid "Cannot call updateRow() when on the insert row."
-msgstr ""
-"Impossible d''appeler updateRow() tant que l''on est sur la ligne ins�r�e."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1333
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3190
-msgid ""
-"Cannot update the ResultSet because it is either before the start or after "
-"the end of the results."
-msgstr ""
-"Impossible de mettre � jour le ResultSet car c''est soit avant le d�but ou "
-"apr�s la fin des r�sultats."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1582
-msgid "ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."
-msgstr ""
-"Les ResultSets avec la concurrence CONCUR_READ_ONLY ne peuvent �tre mis � "
-"jour."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1650
-#, java-format
-msgid "No primary key found for table {0}."
-msgstr "Pas de cl� primaire trouv�e pour la table {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1876
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2965
-msgid "Fetch size must be a value greater to or equal to 0."
-msgstr "Fetch size doit �tre une valeur sup�rieur ou �gal � 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2044
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2051
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2098
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2106
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2926
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2934
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2964
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2971
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2991
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3002
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3020
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3038
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3179
-#: org/postgresql/jdbc2/TimestampUtils.java:258
-#, java-format
-msgid "Bad value for type {0} : {1}"
-msgstr "Mauvaise valeur pour le type {0}�: {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2727
-#, java-format
-msgid "The column name {0} was not found in this ResultSet."
-msgstr "Le nom de colonne {0} n''a pas �t� trouv� dans ce ResultSet."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2827
-msgid ""
-"ResultSet is not updateable. The query that generated this result set must "
-"select only one table, and must select all primary keys from that table. See "
-"the JDBC 2.1 API Specification, section 5.6 for more details."
-msgstr ""
-"Le ResultSet n''est pas modifiable. La requ�te qui a g�n�r� ce r�sultat doit "
-"s�lectionner seulement une table, et doit s�lectionner toutes les cl�s "
-"primaires de cette table. Voir la sp�cification de l''API JDBC 2.1, section "
-"5.6 pour plus de d�tails."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2839
-msgid "This ResultSet is closed."
-msgstr "Ce ResultSet est ferm�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2860
-msgid "ResultSet not positioned properly, perhaps you need to call next."
-msgstr ""
-"Le ResultSet n''est pas positionn� correctement, vous devez peut-�tre "
-"appeler next()."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:259
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:323
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:392
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2655
-msgid ""
-"Can''t use query methods that take a query string on a PreparedStatement."
-msgstr ""
-"Impossible d''utiliser les fonctions de requ�te qui utilisent une cha�ne de "
-"caract�res sur un PreparedStatement."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:287
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:306
-msgid "Multiple ResultSets were returned by the query."
-msgstr "Plusieurs ResultSets ont �t� retourn�s par la requ�te."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:425
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:429
-msgid "A CallableStatement was executed with nothing returned."
-msgstr "Un CallableStatement a �t� ex�cut� mais n''a rien retourn�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:437
-#, fuzzy
-msgid "A CallableStatement was executed with an invalid number of parameters"
-msgstr ""
-"Un CallableStatement a �t� ex�cut� avec un nombre de param�tres incorrect"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:468
-#, java-format
-msgid ""
-"A CallableStatement function was executed and the out parameter {0} was of "
-"type {1} however type {2} was registered."
-msgstr ""
-"Une fonction CallableStatement a �t� ex�cut�e et le param�tre en sortie {0} "
-"�tait du type {1} alors que le type {2} �tait pr�vu."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:674
-msgid "Maximum number of rows must be a value grater than or equal to 0."
-msgstr ""
-"Le nombre maximum de lignes doit �tre une valeur sup�rieure ou �gale � 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:717
-msgid "Query timeout must be a value greater than or equals to 0."
-msgstr "Query timeout doit �tre une valeur sup�rieure ou �gale � 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:809
-msgid "The maximum field size must be a value greater than or equal to 0."
-msgstr ""
-"La taille maximum des champs doit �tre une valeur sup�rieure ou �gale � 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1226
-msgid "Unknown Types value."
-msgstr "Valeur de Types inconnue."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1499
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1624
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3108
-#, java-format
-msgid "Invalid stream length {0}."
-msgstr "Longueur de flux invalide {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1530
-#, java-format
-msgid "The JVM claims not to support the {0} encoding."
-msgstr "La JVM pr�tend ne pas supporter l''encodage {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1705
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3030
-#, java-format
-msgid "Unknown type {0}."
-msgstr "Type inconnu�: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1720
-msgid "No hstore extension installed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1845
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1851
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1857
-#, java-format
-msgid "Cannot cast an instance of {0} to type {1}"
-msgstr "Impossible de convertir une instance de {0} vers le type {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1869
-#, java-format
-msgid "Unsupported Types value: {0}"
-msgstr "Valeur de type non support�e�: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1927
-#, java-format
-msgid ""
-"Can''t infer the SQL type to use for an instance of {0}. Use setObject() "
-"with an explicit Types value to specify the type to use."
-msgstr ""
-"Impossible de d�duire le type SQL � utiliser pour une instance de {0}. "
-"Utilisez setObject() avec une valeur de type explicite pour sp�cifier le "
-"type � utiliser."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1975
-msgid ""
-"This statement does not declare an OUT parameter. Use '{' ?= call ... '}' "
-"to declare one."
-msgstr ""
-"Cette requ�te ne d�clare pas de param�tre OUT. Utilisez '{' ?= call ... '}' "
-"pour en d�clarer un."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2025
-msgid "wasNull cannot be call before fetching a result."
-msgstr "wasNull ne peut pas �tre appel� avant la r�cup�ration d''un r�sultat."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2521
-#, java-format
-msgid "Malformed function or procedure escape syntax at offset {0}."
-msgstr ""
-"Syntaxe de fonction ou d''�chappement de proc�dure malform�e � l''indice {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2571
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2585
-#, java-format
-msgid ""
-"Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was "
-"made."
-msgstr ""
-"Un param�tre de type {0} a �t� enregistr�, mais un appel � get{1} (sqltype="
-"{2}) a �t� fait."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2604
-msgid ""
-"A CallableStatement was declared, but no call to registerOutParameter(1, "
-"<some type>) was made."
-msgstr ""
-"Un CallableStatement a �t� d�clar�, mais aucun appel � registerOutParameter"
-"(1, <un type>) n''a �t� fait."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2608
-msgid "No function outputs were registered."
-msgstr "Aucune fonction outputs n''a �t� enregistr�e."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2611
-msgid ""
-"Results cannot be retrieved from a CallableStatement before it is executed."
-msgstr ""
-"Les r�sultats ne peuvent �tre r�cup�r�s � partir d''un CallableStatement "
-"avant qu''il ne soit ex�cut�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2644
-msgid "This statement has been closed."
-msgstr "Ce statement a �t� ferm�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2724
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2794
-msgid "Too many update results were returned."
-msgstr "Trop de r�sultats de mise � jour ont �t� retourn�s."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2753
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2823
-#, java-format
-msgid ""
-"Batch entry {0} {1} was aborted. Call getNextException to see the cause."
-msgstr ""
-"L''�l�ment du batch {0} {1} a �t� annul�. Appeler getNextException pour en "
-"conna�tre la cause."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3078
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3167
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3207
-msgid "Unexpected error writing large object to database."
-msgstr "Erreur inattendue pendant l''�criture de large object dans la base."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:145
-#: org/postgresql/jdbc2/EscapedFunctions.java:157
-#: org/postgresql/jdbc2/EscapedFunctions.java:169
-#: org/postgresql/jdbc2/EscapedFunctions.java:206
-#: org/postgresql/jdbc2/EscapedFunctions.java:243
-#: org/postgresql/jdbc2/EscapedFunctions.java:267
-#: org/postgresql/jdbc2/EscapedFunctions.java:292
-#: org/postgresql/jdbc2/EscapedFunctions.java:316
-#: org/postgresql/jdbc2/EscapedFunctions.java:328
-#: org/postgresql/jdbc2/EscapedFunctions.java:352
-#: org/postgresql/jdbc2/EscapedFunctions.java:380
-#: org/postgresql/jdbc2/EscapedFunctions.java:389
-#: org/postgresql/jdbc2/EscapedFunctions.java:399
-#: org/postgresql/jdbc2/EscapedFunctions.java:408
-#: org/postgresql/jdbc2/EscapedFunctions.java:417
-#: org/postgresql/jdbc2/EscapedFunctions.java:426
-#: org/postgresql/jdbc2/EscapedFunctions.java:435
-#: org/postgresql/jdbc2/EscapedFunctions.java:444
-#: org/postgresql/jdbc2/EscapedFunctions.java:453
-#: org/postgresql/jdbc2/EscapedFunctions.java:462
-#: org/postgresql/jdbc2/EscapedFunctions.java:471
-#: org/postgresql/jdbc2/EscapedFunctions.java:480
-#, java-format
-msgid "{0} function takes one and only one argument."
-msgstr "La fonction {0} n''accepte qu''un et un seul argument."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:181
-#: org/postgresql/jdbc2/EscapedFunctions.java:193
-#: org/postgresql/jdbc2/EscapedFunctions.java:255
-#: org/postgresql/jdbc2/EscapedFunctions.java:304
-#: org/postgresql/jdbc2/EscapedFunctions.java:582
-#, java-format
-msgid "{0} function takes two and only two arguments."
-msgstr "La fonction {0} n''accepte que deux et seulement deux arguments."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:230
-#, java-format
-msgid "{0} function takes four and only four argument."
-msgstr "La fonction {0} n''accepte que quatre et seulement quatre arguments."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:282
-#: org/postgresql/jdbc2/EscapedFunctions.java:342
-#, java-format
-msgid "{0} function takes two or three arguments."
-msgstr "La fonction {0} n''accepte que deux ou trois arguments."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:362
-#: org/postgresql/jdbc2/EscapedFunctions.java:371
-#: org/postgresql/jdbc2/EscapedFunctions.java:573
-#: org/postgresql/jdbc2/EscapedFunctions.java:591
-#, java-format
-msgid "{0} function doesn''t take any argument."
-msgstr "La fonction {0} n''accepte aucun argument."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:489
-#: org/postgresql/jdbc2/EscapedFunctions.java:531
-#, java-format
-msgid "{0} function takes three and only three arguments."
-msgstr "La fonction {0} n''accepte que trois et seulement trois arguments."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:501
-#: org/postgresql/jdbc2/EscapedFunctions.java:521
-#: org/postgresql/jdbc2/EscapedFunctions.java:523
-#: org/postgresql/jdbc2/EscapedFunctions.java:543
-#: org/postgresql/jdbc2/EscapedFunctions.java:564
-#: org/postgresql/jdbc2/EscapedFunctions.java:566
-#, java-format
-msgid "Interval {0} not yet implemented"
-msgstr "L''interval {0} n''est pas encore impl�ment�"
-
-#: org/postgresql/jdbc2/TimestampUtils.java:360
-msgid ""
-"Infinite value found for timestamp/date. This cannot be represented as time."
-msgstr ""
-"Valeur infinie trouv�e pour une date/timestamp. Cette valeur ne peut �tre "
-"repr�sent� comme une valeur temporelle."
-
-#: org/postgresql/jdbc2/TimestampUtils.java:648
-#: org/postgresql/jdbc2/TimestampUtils.java:680
-#: org/postgresql/jdbc2/TimestampUtils.java:727
-#, fuzzy, java-format
-msgid "Unsupported binary encoding of {0}."
-msgstr "Valeur de type non support�e�: {0}"
-
-#: org/postgresql/jdbc2/TypeInfoCache.java:161
-#, java-format
-msgid "The class {0} does not implement org.postgresql.util.PGobject."
-msgstr "La classe {0} n''impl�mente pas org.postgresql.util.PGobject."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:60
-#, java-format
-msgid "Unknown ResultSet holdability setting: {0}."
-msgstr "Param�tre holdability du ResultSet inconnu�: {0}."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:98
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:130
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:165
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:187
-msgid "Server versions prior to 8.0 do not support savepoints."
-msgstr ""
-"Les serveurs de version ant�rieure � 8.0 ne supportent pas les savepoints."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:100
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:132
-msgid "Cannot establish a savepoint in auto-commit mode."
-msgstr "Impossible d''�tablir un savepoint en mode auto-commit."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:419
-msgid "Returning autogenerated keys is not supported."
-msgstr "Le renvoi des cl�s automatiquement g�n�r�es n''est pas support�."
-
-#: org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java:81
-#, java-format
-msgid "The parameter index is out of range: {0}, number of parameters: {1}."
-msgstr ""
-"L''indice du param�tre est hors limites�: {0}, nombre de param�tres�: {1}."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:151
-#, fuzzy
-msgid ""
-"Returning autogenerated keys is only supported for 8.2 and later servers."
-msgstr "Le renvoi des cl�s automatiquement g�n�r�es n''est pas support�."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:199
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:317
-#, fuzzy
-msgid "Returning autogenerated keys by column index is not supported."
-msgstr "Le renvoi des cl�s automatiquement g�n�r�es n''est pas support�."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:38
-#: org/postgresql/jdbc3/PSQLSavepoint.java:50
-#: org/postgresql/jdbc3/PSQLSavepoint.java:66
-msgid "Cannot reference a savepoint after it has been released."
-msgstr "Impossible de r�f�rencer un savepoint apr�s qu''il ait �t� lib�r�."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:42
-msgid "Cannot retrieve the id of a named savepoint."
-msgstr "Impossible de retrouver l''identifiant d''un savepoint nomm�."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:54
-msgid "Cannot retrieve the name of an unnamed savepoint."
-msgstr "Impossible de retrouver le nom d''un savepoint sans nom."
-
-#: org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java:37
-#, fuzzy
-msgid "Invalid UUID data."
-msgstr "Drapeau invalide"
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:83
-#, java-format
-msgid "Unable to find server array type for provided name {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:121
-#, fuzzy, java-format
-msgid "Invalid timeout ({0}<0)."
-msgstr "Longueur de flux invalide {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:134
-msgid "Validating connection."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:157
-#, fuzzy, java-format
-msgid "Failed to set ClientInfo property: {0}"
-msgstr "�chec � la cr�ation de l''objet pour�: {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:166
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:188
-#, fuzzy
-msgid "ClientInfo property not supported."
-msgstr "Le renvoi des cl�s automatiquement g�n�r�es n''est pas support�."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Statement.java:127
-msgid "Object is too large to send over the protocol."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:147
-msgid "Unable to decode xml data."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:150
-#, java-format
-msgid "Unknown XML Source class: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:195
-#, fuzzy
-msgid "Unable to create SAXResult for SQLXML."
-msgstr "�chec � la cr�ation de l''objet pour�: {0}."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:209
-msgid "Unable to create StAXResult for SQLXML"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:213
-#, fuzzy, java-format
-msgid "Unknown XML Result class: {0}"
-msgstr "Param�tre holdability du ResultSet inconnu�: {0}."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:226
-#, fuzzy
-msgid "This SQLXML object has already been freed."
-msgstr "Cette PooledConnection a d�j� �t� ferm�e."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:233
-msgid ""
-"This SQLXML object has not been initialized, so you cannot retrieve data "
-"from it."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:244
-#, java-format
-msgid "Failed to convert binary xml data to encoding: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:269
-msgid "Unable to convert DOMResult SQLXML data to a string."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:282
-msgid ""
-"This SQLXML object has already been initialized, so you cannot manipulate it "
-"further."
-msgstr ""
-
-#: org/postgresql/largeobject/LargeObjectManager.java:138
-msgid "Failed to initialize LargeObject API"
-msgstr "�chec � l''initialisation de l''API LargeObject"
-
-#: org/postgresql/largeobject/LargeObjectManager.java:257
-#: org/postgresql/largeobject/LargeObjectManager.java:298
-msgid "Large Objects may not be used in auto-commit mode."
-msgstr "Les Large Objects ne devraient pas �tre utilis�s en mode auto-commit."
-
-#: org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java:58
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:110
-#, java-format
-msgid "The SSLSocketFactory class provided {0} could not be instantiated."
-msgstr "La classe SSLSocketFactory fournie {0} n''a pas pu �tre instanci�e."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:125
-#, java-format
-msgid "SSL error: {0}"
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:138
-#, fuzzy, java-format
-msgid "The HostnameVerifier class provided {0} could not be instantiated."
-msgstr "La classe SSLSocketFactory fournie {0} n''a pas pu �tre instanci�e."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:142
-#, java-format
-msgid "The hostname {0} could not be verified by hostnameverifier {1}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:149
-#, fuzzy, java-format
-msgid "The hostname {0} could not be verified."
-msgstr "La classe SSLSocketFactory fournie {0} n''a pas pu �tre instanci�e."
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:121
-msgid ""
-"Could not find a java cryptographic algorithm: X.509 CertificateFactory not "
-"available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:132
-#, java-format
-msgid "Could not open SSL certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:137
-#, java-format
-msgid "Loading the SSL certificate {0} into a KeyManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:194
-msgid "Enter SSL password: "
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:202
-msgid "Could not read password for SSL key file, console is not available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:204
-#, java-format
-msgid "Could not read password for SSL key file by callbackhandler {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:223
-#, java-format
-msgid "Could not decrypt SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:231
-#, java-format
-msgid "Could not read SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:235
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:173
-#, java-format
-msgid "Could not find a java cryptographic algorithm: {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:99
-#, fuzzy, java-format
-msgid "The password callback class provided {0} could not be instantiated."
-msgstr "La classe SSLSocketFactory fournie {0} n''a pas pu �tre instanci�e."
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:133
-#, java-format
-msgid "Could not open SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:150
-#, java-format
-msgid "Could not read SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:153
-#, java-format
-msgid "Loading the SSL root certificate {0} into a TrustManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:166
-msgid "Could not initialize SSL context."
-msgstr ""
-
-#: org/postgresql/util/PGInterval.java:164
-msgid "Conversion of interval failed"
-msgstr "La conversion de l''intervalle a �chou�"
-
-#: org/postgresql/util/PGmoney.java:73
-msgid "Conversion of money failed."
-msgstr "La conversion de money a �chou�."
-
-#: org/postgresql/util/ServerErrorMessage.java:155
-#, java-format
-msgid "Detail: {0}"
-msgstr "D�tail�: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:159
-#, java-format
-msgid "Hint: {0}"
-msgstr "Indice�: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:162
-#, java-format
-msgid "Position: {0}"
-msgstr "Position�: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:165
-#, java-format
-msgid "Where: {0}"
-msgstr "O��: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:171
-#, java-format
-msgid "Internal Query: {0}"
-msgstr "Requ�te interne: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:174
-#, java-format
-msgid "Internal Position: {0}"
-msgstr "Position interne�: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:180
-#, java-format
-msgid "Location: File: {0}, Routine: {1}, Line: {2}"
-msgstr "Localisation�: Fichier�: {0}, Routine�: {1}, Ligne�: {2}"
-
-#: org/postgresql/util/ServerErrorMessage.java:183
-#, java-format
-msgid "Server SQLState: {0}"
-msgstr "SQLState serveur�: {0}"
-
-#: org/postgresql/xa/PGXAConnection.java:148
-msgid ""
-"Transaction control methods setAutoCommit(true), commit, rollback and "
-"setSavePoint not allowed while an XA transaction is active."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:186
-#: org/postgresql/xa/PGXAConnection.java:245
-msgid "Invalid flags"
-msgstr "Drapeaux invalides"
-
-#: org/postgresql/xa/PGXAConnection.java:189
-#: org/postgresql/xa/PGXAConnection.java:248
-#: org/postgresql/xa/PGXAConnection.java:425
-msgid "xid must not be null"
-msgstr "xid ne doit pas �tre nul"
-
-#: org/postgresql/xa/PGXAConnection.java:192
-msgid "Connection is busy with another transaction"
-msgstr "La connection est occup�e avec une autre transaction"
-
-#: org/postgresql/xa/PGXAConnection.java:198
-#: org/postgresql/xa/PGXAConnection.java:255
-msgid "suspend/resume not implemented"
-msgstr "suspend/resume pas impl�ment�"
-
-#: org/postgresql/xa/PGXAConnection.java:204
-#: org/postgresql/xa/PGXAConnection.java:207
-#: org/postgresql/xa/PGXAConnection.java:209
-msgid "Transaction interleaving not implemented"
-msgstr "L''entrelacement des transactions n''est pas impl�ment�"
-
-#: org/postgresql/xa/PGXAConnection.java:218
-msgid "Error disabling autocommit"
-msgstr "Erreur en d�sactivant autocommit"
-
-#: org/postgresql/xa/PGXAConnection.java:251
-msgid "tried to call end without corresponding start call"
-msgstr "tentative d''appel de fin sans l''appel start correspondant"
-
-#: org/postgresql/xa/PGXAConnection.java:282
-msgid ""
-"Not implemented: Prepare must be issued using the same connection that "
-"started the transaction"
-msgstr ""
-"Pas impl�ment�: Prepare doit �tre envoy� sur la m�me connection qui a "
-"d�marr� la transaction"
-
-#: org/postgresql/xa/PGXAConnection.java:286
-msgid "Prepare called before end"
-msgstr "Pr�paration appel�e avant la fin"
-
-#: org/postgresql/xa/PGXAConnection.java:292
-msgid "Server versions prior to 8.1 do not support two-phase commit."
-msgstr ""
-"Les serveurs de versions ant�rieures � 8.1 ne supportent pas le commit � "
-"deux phases."
-
-#: org/postgresql/xa/PGXAConnection.java:313
-msgid "Error preparing transaction"
-msgstr "Erreur en pr�parant la transaction"
-
-#: org/postgresql/xa/PGXAConnection.java:328
-msgid "Invalid flag"
-msgstr "Drapeau invalide"
-
-#: org/postgresql/xa/PGXAConnection.java:368
-msgid "Error during recover"
-msgstr "Erreur durant la restauration"
-
-#: org/postgresql/xa/PGXAConnection.java:416
-msgid "Error rolling back prepared transaction"
-msgstr "Erreur en annulant une transaction pr�par�e"
-
-#: org/postgresql/xa/PGXAConnection.java:451
-msgid ""
-"Not implemented: one-phase commit must be issued using the same connection "
-"that was used to start it"
-msgstr ""
-"Pas impl�ment�: le commit � une phase doit avoir lieu en utilisant la m�me "
-"connection que celle o� il a commenc�"
-
-#: org/postgresql/xa/PGXAConnection.java:455
-msgid "commit called before end"
-msgstr "Commit appel� avant la fin"
-
-#: org/postgresql/xa/PGXAConnection.java:466
-msgid "Error during one-phase commit"
-msgstr "Erreur pendant le commit � une phase"
-
-#: org/postgresql/xa/PGXAConnection.java:487
-msgid ""
-"Not implemented: 2nd phase commit must be issued using an idle connection"
-msgstr ""
-"Pas impl�ment�: le commit � deux phase doit �tre envoy� sur une connection "
-"inutilis�e"
-
-#: org/postgresql/xa/PGXAConnection.java:507
-#, fuzzy
-msgid "Error committing prepared transaction"
-msgstr "Erreur en annulant une transaction pr�par�e"
-
-#: org/postgresql/xa/PGXAConnection.java:522
-msgid "Heuristic commit/rollback not supported"
-msgstr "Heuristic commit/rollback non support�"
-
-#~ msgid "The driver does not support SSL."
-#~ msgstr "Ce pilote ne supporte pas SSL."
-
-#~ msgid "Multi-dimensional arrays are currently not supported."
-#~ msgstr ""
-#~ "Les tableaux � plusieurs dimensions ne sont pas support�s pour le moment."
-
-#~ msgid "Exception: {0}"
-#~ msgstr "Exception�: {0}"
-
-#~ msgid "Stack Trace:"
-#~ msgstr "Pile d''appel�:"
-
-#~ msgid "End of Stack Trace"
-#~ msgstr "Fin de la pile d''appel"
-
-#~ msgid "Exception generating stacktrace for: {0} encountered: {1}"
-#~ msgstr ""
-#~ "Exception en g�n�rant la pile d''appel pour�: {0} erreur rencontr�e�: {1}"
diff --git a/org/postgresql/translation/it.po b/org/postgresql/translation/it.po
deleted file mode 100644
index 907dde4..0000000
--- a/org/postgresql/translation/it.po
+++ /dev/null
@@ -1,1612 +0,0 @@
-# Italian message translation for the PostgreSQL JDBC driver
-# This file is distributed under the same license as the package.
-#
-# First translation by Daniele Arduini <darduini at cinetica.it>
-# Updated by Giuseppe Sacco <eppesuig at debian.org> 2004, 2005.
-#
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PostgreSQL JDBC Driver 8.2\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-10-31 13:37+0000\n"
-"PO-Revision-Date: 2006-06-23 17:25+0200\n"
-"Last-Translator: Giuseppe Sacco <eppesuig at debian.org>\n"
-"Language-Team: Italian <tp at lists.linux.it>\n"
-"Language: it\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ISO-8859-1\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: org/postgresql/Driver.java.in:235
-msgid "Error loading default settings from driverconfig.properties"
-msgstr ""
-"Si � verificato un errore caricando le impostazioni predefinite da "
-"�driverconfig.properties�."
-
-#: org/postgresql/Driver.java.in:282
-msgid ""
-"Your security policy has prevented the connection from being attempted. You "
-"probably need to grant the connect java.net.SocketPermission to the database "
-"server host and port that you wish to connect to."
-msgstr ""
-
-#: org/postgresql/Driver.java.in:287 org/postgresql/Driver.java.in:351
-msgid ""
-"Something unusual has occurred to cause the driver to fail. Please report "
-"this exception."
-msgstr ""
-"Qualcosa di insolito si � verificato causando il fallimento del driver. Per "
-"favore riferire all''autore del driver questa eccezione."
-
-#: org/postgresql/Driver.java.in:359
-msgid "Connection attempt timed out."
-msgstr "Il tentativo di connessione � scaduto."
-
-#: org/postgresql/Driver.java.in:372
-msgid "Interrupted while attempting to connect."
-msgstr "Si � verificata una interruzione durante il tentativo di connessione."
-
-#: org/postgresql/Driver.java.in:714
-#, java-format
-msgid "Method {0} is not yet implemented."
-msgstr "Il metodo �{0}� non � stato ancora implementato."
-
-#: org/postgresql/copy/CopyManager.java:56
-#, java-format
-msgid "Requested CopyIn but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/CopyManager.java:67
-#, java-format
-msgid "Requested CopyOut but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:51
-#, fuzzy, java-format
-msgid "Copying from database failed: {0}"
-msgstr "Fallita la conversione di un ``box'': {0}."
-
-#: org/postgresql/copy/PGCopyInputStream.java:67
-#: org/postgresql/copy/PGCopyOutputStream.java:90
-#, fuzzy
-msgid "This copy stream is closed."
-msgstr "Questo �ResultSet� � chiuso."
-
-#: org/postgresql/copy/PGCopyInputStream.java:108
-msgid "Read from copy failed."
-msgstr ""
-
-#: org/postgresql/copy/PGCopyOutputStream.java:68
-#, java-format
-msgid "Cannot write to copy a byte of value {0}"
-msgstr ""
-
-#: org/postgresql/core/ConnectionFactory.java:69
-#, java-format
-msgid "A connection could not be made using the requested protocol {0}."
-msgstr ""
-"Non � stato possibile attivare la connessione utilizzando il protocollo "
-"richiesto {0}."
-
-#: org/postgresql/core/Oid.java:113
-#, java-format
-msgid "oid type {0} not known and not a number"
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:490
-#, java-format
-msgid "Premature end of input stream, expected {0} bytes, but only read {1}."
-msgstr ""
-"Il flusso di input � stato interrotto, sono arrivati {1} byte al posto dei "
-"{0} attesi."
-
-#: org/postgresql/core/PGStream.java:530
-#, java-format
-msgid "Expected an EOF from server, got: {0}"
-msgstr "Ricevuto dal server �{0}� mentre era atteso un EOF"
-
-#: org/postgresql/core/SetupQueryRunner.java:86
-msgid "An unexpected result was returned by a query."
-msgstr "Un risultato inaspettato � stato ricevuto dalla query."
-
-#: org/postgresql/core/UTF8Encoding.java:28
-#, java-format
-msgid ""
-"Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}"
-msgstr ""
-"Sequenza UTF-8 illegale: il byte {0} di una sequenza di {1} byte non � "
-"10xxxxxx: {2}"
-
-#: org/postgresql/core/UTF8Encoding.java:61
-#, java-format
-msgid "Illegal UTF-8 sequence: {0} bytes used to encode a {1} byte value: {2}"
-msgstr ""
-"Sequenza UTF-8 illegale: {0} byte utilizzati per codificare un valore di {1} "
-"byte: {2}"
-
-#: org/postgresql/core/UTF8Encoding.java:98
-#: org/postgresql/core/UTF8Encoding.java:125
-#, java-format
-msgid "Illegal UTF-8 sequence: initial byte is {0}: {1}"
-msgstr "Sequenza UTF-8 illegale: il byte iniziale � {0}: {1}"
-
-#: org/postgresql/core/UTF8Encoding.java:130
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is out of range: {0}"
-msgstr ""
-"Sequenza UTF-8 illegale: il valore finale � fuori dall''intervallo permesso: "
-"{0}"
-
-#: org/postgresql/core/UTF8Encoding.java:145
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is a surrogate value: {0}"
-msgstr "Sequenza UTF-8 illegale: il valore � finale � un surrogato: {0}"
-
-#: org/postgresql/core/Utils.java:95 org/postgresql/core/Utils.java:112
-msgid "Zero bytes may not occur in string parameters."
-msgstr ""
-"Byte con valore zero non possono essere contenuti nei parametri stringa."
-
-#: org/postgresql/core/Utils.java:145
-#, fuzzy
-msgid "Zero bytes may not occur in identifiers."
-msgstr ""
-"Byte con valore zero non possono essere contenuti nei parametri stringa."
-
-#: org/postgresql/core/types/PGBigDecimal.java:63
-#: org/postgresql/core/types/PGBoolean.java:62
-#: org/postgresql/core/types/PGByte.java:63
-#: org/postgresql/core/types/PGDouble.java:64
-#: org/postgresql/core/types/PGFloat.java:64
-#: org/postgresql/core/types/PGInteger.java:61
-#: org/postgresql/core/types/PGLong.java:62
-#: org/postgresql/core/types/PGNumber.java:62
-#: org/postgresql/core/types/PGShort.java:58
-#: org/postgresql/core/types/PGString.java:73
-#, java-format
-msgid "Cannot convert an instance of {0} to type {1}"
-msgstr "Non � possibile convertire una istanza di �{0}� nel tipo �{1}�"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:66
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:74
-#, fuzzy, java-format
-msgid "Invalid sslmode value: {0}"
-msgstr "La dimensione specificata, {0}, per lo �stream� non � valida."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:134
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:207
-msgid ""
-"Connection refused. Check that the hostname and port are correct and that "
-"the postmaster is accepting TCP/IP connections."
-msgstr ""
-"Connessione rifiutata. Controllare che il nome dell''host e la porta siano "
-"corretti, e che il server (postmaster) sia in esecuzione con l''opzione -i, "
-"che abilita le connessioni attraverso la rete TCP/IP."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:153
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:225
-msgid "The connection attempt failed."
-msgstr "Il tentativo di connessione � fallito."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:175
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:246
-#, fuzzy
-msgid "The connection url is invalid."
-msgstr "Il tentativo di connessione � fallito."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:198
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:210
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:295
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:307
-msgid "The server does not support SSL."
-msgstr "Il server non supporta SSL."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:223
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:320
-msgid "An error occurred while setting up the SSL connection."
-msgstr "Si � verificato un errore impostando la connessione SSL."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:272
-#, java-format
-msgid "Connection rejected: {0}."
-msgstr "Connessione rifiutata: {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:290
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:312
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:332
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:419
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:444
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:471
-msgid ""
-"The server requested password-based authentication, but no password was "
-"provided."
-msgstr ""
-"Il server ha richiesto l''autenticazione con password, ma tale password non "
-"� stata fornita."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:356
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:504
-#, java-format
-msgid ""
-"The authentication type {0} is not supported. Check that you have configured "
-"the pg_hba.conf file to include the client''s IP address or subnet, and that "
-"it is using an authentication scheme supported by the driver."
-msgstr ""
-"L''autenticazione di tipo {0} non � supportata. Verificare che nel file di "
-"configurazione pg_hba.conf sia presente l''indirizzo IP o la sottorete del "
-"client, e che lo schema di autenticazione utilizzato sia supportato dal "
-"driver."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:362
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:400
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:510
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:553
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:599
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:609
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:618
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:626
-#: org/postgresql/gss/MakeGSS.java:158
-msgid "Protocol error. Session setup failed."
-msgstr "Errore di protocollo. Impostazione della sessione fallita."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:390
-#, java-format
-msgid "Backend start-up failed: {0}."
-msgstr "Attivazione del backend fallita: {0}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:55
-#: org/postgresql/core/v2/FastpathParameterList.java:77
-#: org/postgresql/core/v2/FastpathParameterList.java:84
-#: org/postgresql/core/v2/SimpleParameterList.java:57
-#: org/postgresql/core/v2/SimpleParameterList.java:76
-#: org/postgresql/core/v2/SimpleParameterList.java:83
-#: org/postgresql/core/v2/SimpleParameterList.java:90
-#: org/postgresql/core/v3/CompositeParameterList.java:35
-#: org/postgresql/core/v3/SimpleParameterList.java:49
-#: org/postgresql/core/v3/SimpleParameterList.java:56
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2845
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java:419
-#, java-format
-msgid "The column index is out of range: {0}, number of columns: {1}."
-msgstr "Indice di colonna, {0}, � maggiore del numero di colonne {1}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:142
-#: org/postgresql/core/v2/SimpleParameterList.java:155
-#: org/postgresql/core/v3/SimpleParameterList.java:216
-#, java-format
-msgid "No value specified for parameter {0}."
-msgstr "Nessun valore specificato come parametro {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:72
-#: org/postgresql/core/v2/QueryExecutorImpl.java:337
-#: org/postgresql/core/v3/QueryExecutorImpl.java:443
-#: org/postgresql/core/v3/QueryExecutorImpl.java:507
-#, java-format
-msgid "Expected command status BEGIN, got {0}."
-msgstr "Lo stato del comando avrebbe dovuto essere BEGIN, mentre invece � {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:78
-#: org/postgresql/core/v3/QueryExecutorImpl.java:513
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1828
-#, java-format
-msgid "Unexpected command status: {0}."
-msgstr "Stato del comando non previsto: {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:118
-#: org/postgresql/core/v2/QueryExecutorImpl.java:129
-#: org/postgresql/core/v2/QueryExecutorImpl.java:174
-#: org/postgresql/core/v2/QueryExecutorImpl.java:369
-#: org/postgresql/core/v3/QueryExecutorImpl.java:281
-#: org/postgresql/core/v3/QueryExecutorImpl.java:411
-#: org/postgresql/core/v3/QueryExecutorImpl.java:485
-#: org/postgresql/core/v3/QueryExecutorImpl.java:551
-#: org/postgresql/core/v3/QueryExecutorImpl.java:631
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2094
-#, fuzzy
-msgid "An I/O error occured while sending to the backend."
-msgstr "Si � verificato un errore di I/O nella spedizione di dati al server."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:170
-#: org/postgresql/core/v2/QueryExecutorImpl.java:225
-#: org/postgresql/core/v2/QueryExecutorImpl.java:236
-#: org/postgresql/core/v3/QueryExecutorImpl.java:627
-#: org/postgresql/core/v3/QueryExecutorImpl.java:685
-#, java-format
-msgid "Unknown Response Type {0}."
-msgstr "Risposta di tipo sconosciuto {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:430
-#: org/postgresql/core/v2/QueryExecutorImpl.java:475
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1857
-msgid "Ran out of memory retrieving query results."
-msgstr "Fine memoria scaricando i risultati della query."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:597
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2199
-#, java-format
-msgid "Unable to interpret the update count in command completion tag: {0}."
-msgstr ""
-"Impossibile interpretare il numero degli aggiornamenti nel �tag� di "
-"completamento del comando: {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:610
-msgid "Copy not implemented for protocol version 2"
-msgstr ""
-
-#: org/postgresql/core/v3/CopyOperationImpl.java:56
-msgid "CommandComplete expected COPY but got: "
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:66
-msgid "Tried to obtain lock while already holding it"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:78
-msgid "Tried to break lock on database connection"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:93
-#, fuzzy
-msgid "Interrupted while waiting to obtain lock on database connection"
-msgstr "Si � verificata una interruzione durante il tentativo di connessione."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:275
-msgid "Unable to bind parameter values for statement."
-msgstr ""
-"Impossibile fare il �bind� dei valori passati come parametri per lo "
-"statement."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:726
-msgid "Database connection failed when starting copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:757
-msgid "Tried to cancel an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:794
-msgid "Database connection failed when canceling copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:799
-msgid "Missing expected error response to copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:801
-#, java-format
-msgid "Got {0} error responses to single copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:814
-msgid "Tried to end inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:827
-msgid "Database connection failed when ending copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:842
-#: org/postgresql/core/v3/QueryExecutorImpl.java:860
-msgid "Tried to write to an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:854
-#: org/postgresql/core/v3/QueryExecutorImpl.java:866
-msgid "Database connection failed when writing to copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:878
-msgid "Tried to read from inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:883
-msgid "Database connection failed when reading from copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:951
-#, java-format
-msgid "Received CommandComplete ''{0}'' without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:975
-#, java-format
-msgid "Got CopyInResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:988
-#, java-format
-msgid "Got CopyOutResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1003
-msgid "Got CopyData without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1005
-#, fuzzy, java-format
-msgid "Unexpected copydata from server for {0}"
-msgstr "Ricevuto dal server �{0}� mentre era atteso un EOF"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1056
-#, java-format
-msgid "Unexpected packet type during copy: {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1310
-#, java-format
-msgid ""
-"Bind message length {0} too long. This can be caused by very large or "
-"incorrect length specifications on InputStream parameters."
-msgstr ""
-"Il messaggio di �bind� � troppo lungo ({0}). Questo pu� essere causato da "
-"una dimensione eccessiva o non corretta dei parametri dell''�InputStream�."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1925
-#, fuzzy, java-format
-msgid ""
-"The server''s client_encoding parameter was changed to {0}. The JDBC driver "
-"requires client_encoding to be UTF8 for correct operation."
-msgstr ""
-"Il parametro �client_encoding� del server � stato cambiato in {0}. Il driver "
-"JDBC richiede che �client_encoding� sia UNICODE per un corretto "
-"funzionamento."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1932
-#, java-format
-msgid ""
-"The server''s DateStyle parameter was changed to {0}. The JDBC driver "
-"requires DateStyle to begin with ISO for correct operation."
-msgstr ""
-"Il parametro del server �DateStyle� � stato cambiato in {0}. Il driver JDBC "
-"richiede che �DateStyle� cominci con �ISO� per un corretto funzionamento."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1945
-#, fuzzy, java-format
-msgid ""
-"The server''s standard_conforming_strings parameter was reported as {0}. The "
-"JDBC driver expected on or off."
-msgstr ""
-"Il parametro �client_encoding� del server � stato cambiato in {0}. Il driver "
-"JDBC richiede che �client_encoding� sia UNICODE per un corretto "
-"funzionamento."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2015
-msgid "The driver currently does not support COPY operations."
-msgstr "Il driver non supporta al momento l''operazione �COPY�."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:112
-msgid "This PooledConnection has already been closed."
-msgstr "Questo �PooledConnection� � stato chiuso."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid ""
-"Connection has been closed automatically because a new connection was opened "
-"for the same PooledConnection or the PooledConnection has been closed."
-msgstr ""
-"La �Connection� � stata chiusa automaticamente perch� una nuova l''ha "
-"sostituita nello stesso �PooledConnection�, oppure il �PooledConnection� � "
-"stato chiuso."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid "Connection has been closed."
-msgstr "Questo �Connection� � stato chiuso."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:442
-msgid "Statement has been closed."
-msgstr "Questo �Statement� � stato chiuso."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:291
-msgid "Failed to setup DataSource."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:414
-msgid "DataSource has been closed."
-msgstr "Questo �DataSource� � stato chiuso."
-
-#: org/postgresql/fastpath/Fastpath.java:81
-#: org/postgresql/fastpath/Fastpath.java:128
-#, java-format
-msgid "Fastpath call {0} - No result was returned and we expected an integer."
-msgstr ""
-"Chiamata Fastpath �{0}�: Nessun risultato restituito mentre ci si aspettava "
-"un intero."
-
-#: org/postgresql/fastpath/Fastpath.java:237
-#, java-format
-msgid "The fastpath function {0} is unknown."
-msgstr "La funzione fastpath �{0}� � sconosciuta."
-
-#: org/postgresql/geometric/PGbox.java:83
-#: org/postgresql/geometric/PGcircle.java:82
-#: org/postgresql/geometric/PGcircle.java:91
-#: org/postgresql/geometric/PGline.java:80
-#: org/postgresql/geometric/PGlseg.java:77
-#: org/postgresql/geometric/PGpoint.java:85
-#, java-format
-msgid "Conversion to type {0} failed: {1}."
-msgstr "Conversione al tipo {0} fallita: {1}."
-
-#: org/postgresql/geometric/PGpath.java:81
-#, java-format
-msgid "Cannot tell if path is open or closed: {0}."
-msgstr "Impossibile stabilire se il percorso � aperto o chiuso: {0}."
-
-#: org/postgresql/gss/MakeGSS.java:47 org/postgresql/gss/MakeGSS.java:55
-#: org/postgresql/gss/MakeGSS.java:168
-msgid "GSS Authentication failed"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:153
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:790
-#, java-format
-msgid "The array index is out of range: {0}"
-msgstr "Indice di colonna fuori dall''intervallo ammissibile: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:168
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:807
-#, java-format
-msgid "The array index is out of range: {0}, number of elements: {1}."
-msgstr ""
-"L''indice dell''array � fuori intervallo: {0}, numero di elementi: {1}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:196
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1982
-#: org/postgresql/util/HStoreConverter.java:34
-#: org/postgresql/util/HStoreConverter.java:61
-msgid ""
-"Invalid character data was found. This is most likely caused by stored data "
-"containing characters that are invalid for the character set the database "
-"was created in. The most common example of this is storing 8bit data in a "
-"SQL_ASCII database."
-msgstr ""
-"Sono stati trovati caratteri non validi tra i dati. Molto probabilmente sono "
-"stati memorizzati dei caratteri che non sono validi per la codifica dei "
-"caratteri impostata alla creazione del database. Il caso pi� diffuso � "
-"quello nel quale si memorizzano caratteri a 8bit in un database con codifica "
-"SQL_ASCII."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:73
-msgid ""
-"Truncation of large objects is only implemented in 8.3 and later servers."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:77
-msgid "Cannot truncate LOB to a negative length."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:81
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:235
-#, java-format
-msgid "PostgreSQL LOBs can only index to: {0}"
-msgstr "Il massimo valore per l''indice dei LOB di PostgreSQL � {0}. "
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:231
-msgid "LOB positioning offsets start at 1."
-msgstr "L''offset per la posizione dei LOB comincia da 1."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:246
-msgid "free() was called on this LOB previously"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:225
-#, java-format
-msgid "Unsupported value for stringtype parameter: {0}"
-msgstr "Il valore per il parametro di tipo string �{0}� non � supportato."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:245
-msgid "unknownLength parameter value must be an integer"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:353
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:284
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:303
-#: org/postgresql/jdbc2/TypeInfoCache.java:201
-#: org/postgresql/jdbc2/TypeInfoCache.java:249
-#: org/postgresql/jdbc2/TypeInfoCache.java:287
-#: org/postgresql/jdbc2/TypeInfoCache.java:344
-#: org/postgresql/jdbc2/TypeInfoCache.java:348
-#: org/postgresql/jdbc2/TypeInfoCache.java:384
-#: org/postgresql/jdbc2/TypeInfoCache.java:388
-msgid "No results were returned by the query."
-msgstr "Nessun risultato � stato restituito dalla query."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:367
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:336
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:368
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2702
-msgid "A result was returned when none was expected."
-msgstr "� stato restituito un valore nonostante non ne fosse atteso nessuno."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:519
-msgid "Custom type maps are not supported."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:567
-#, java-format
-msgid "Failed to create object for: {0}."
-msgstr "Fallita la creazione dell''oggetto per: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:629
-#, java-format
-msgid "Unable to load the class {0} responsible for the datatype {1}"
-msgstr "Non � possibile caricare la class �{0}� per gestire il tipo �{1}�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:725
-msgid ""
-"Cannot change transaction read-only property in the middle of a transaction."
-msgstr ""
-"Non � possibile modificare la propriet� �read-only� delle transazioni nel "
-"mezzo di una transazione."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:813
-msgid "Cannot commit when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:822
-#, fuzzy
-msgid "This connection has been closed."
-msgstr "Questo �Connection� � stato chiuso."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:842
-msgid "Cannot rollback when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:929
-msgid ""
-"Cannot change transaction isolation level in the middle of a transaction."
-msgstr ""
-"Non � possibile cambiare il livello di isolamento delle transazioni nel "
-"mezzo di una transazione."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:934
-#, java-format
-msgid "Transaction isolation level {0} not supported."
-msgstr "Il livello di isolamento delle transazioni �{0}� non � supportato."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1001
-msgid "Finalizing a Connection that was never closed:"
-msgstr "Finalizzazione di una �Connection� che non � stata chiusa."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1103
-msgid "Unable to translate data into the desired encoding."
-msgstr "Impossibile tradurre i dati nella codifica richiesta."
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:63
-msgid ""
-"Unable to determine a value for MaxIndexKeys due to missing system catalog "
-"data."
-msgstr ""
-"Non � possibile trovare il valore di �MaxIndexKeys� nel catalogo si sistema."
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:86
-msgid "Unable to find name datatype in the system catalogs."
-msgstr "Non � possibile trovare il datatype �name� nel catalogo di sistema."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:235
-msgid ""
-"Operation requires a scrollable ResultSet, but this ResultSet is "
-"FORWARD_ONLY."
-msgstr ""
-"L''operazione richiete un �ResultSet� scorribile mentre questo � "
-"�FORWARD_ONLY�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:416
-msgid "Unexpected error while decoding character data from a large object."
-msgstr ""
-"Errore non previsto durante la decodifica di caratteri a partire da un "
-"�large object�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:462
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:491
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:525
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3129
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3174
-#, fuzzy, java-format
-msgid "Cannot convert the column of type {0} to requested type {1}."
-msgstr "Non � possibile convertire una istanza di �{0}� nel tipo �{1}�"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:744
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:768
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1892
-msgid "Can''t use relative move methods while on the insert row."
-msgstr ""
-"Non � possibile utilizzare gli spostamenti relativi durante l''inserimento "
-"di una riga."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:788
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2956
-#, java-format
-msgid "Invalid fetch direction constant: {0}."
-msgstr "Costante per la direzione dell''estrazione non valida: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:802
-msgid "Cannot call cancelRowUpdates() when on the insert row."
-msgstr ""
-"Non � possibile invocare �cancelRowUpdates()� durante l''inserimento di una "
-"riga."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:822
-msgid "Cannot call deleteRow() when on the insert row."
-msgstr ""
-"Non � possibile invocare �deleteRow()� durante l''inserimento di una riga."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:828
-msgid ""
-"Currently positioned before the start of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"La posizione attuale � precedente all''inizio del ResultSet. Non � possibile "
-"invocare �deleteRow()� qui."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:833
-msgid ""
-"Currently positioned after the end of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"La posizione attuale � successiva alla fine del ResultSet. Non � possibile "
-"invocare �deleteRow()� qui."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:838
-msgid "There are no rows in this ResultSet."
-msgstr "Non ci sono righe in questo �ResultSet�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:885
-msgid "Not on the insert row."
-msgstr "Non si � in una nuova riga."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:889
-msgid "You must specify at least one column value to insert a row."
-msgstr ""
-"Per inserire un record si deve specificare almeno il valore di una colonna."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1074
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1805
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2494
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2524
-#, java-format
-msgid "The JVM claims not to support the encoding: {0}"
-msgstr "La JVM sostiene di non supportare la codifica: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1078
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1121
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1534
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1663
-msgid "Provided InputStream failed."
-msgstr "L''�InputStream� fornito � fallito."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1191
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3137
-msgid "Provided Reader failed."
-msgstr "Il �Reader� fornito � fallito."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1259
-msgid "Can''t refresh the insert row."
-msgstr "Non � possibile aggiornare la riga in inserimento."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1327
-msgid "Cannot call updateRow() when on the insert row."
-msgstr ""
-"Non � possibile invocare �updateRow()� durante l''inserimento di una riga."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1333
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3190
-msgid ""
-"Cannot update the ResultSet because it is either before the start or after "
-"the end of the results."
-msgstr ""
-"Non � possibile aggiornare il �ResultSet� perch� la posizione attuale � "
-"precedente all''inizio o successiva alla file dei risultati."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1582
-msgid "ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."
-msgstr ""
-"I �ResultSet� in modalit� CONCUR_READ_ONLY non possono essere aggiornati."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1650
-#, java-format
-msgid "No primary key found for table {0}."
-msgstr "Non � stata trovata la chiave primaria della tabella �{0}�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1876
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2965
-msgid "Fetch size must be a value greater to or equal to 0."
-msgstr "La dimensione dell''area di �fetch� deve essere maggiore o eguale a 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2044
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2051
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2098
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2106
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2926
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2934
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2964
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2971
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2991
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3002
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3020
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3038
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3179
-#: org/postgresql/jdbc2/TimestampUtils.java:258
-#, java-format
-msgid "Bad value for type {0} : {1}"
-msgstr "Il valore �{1}� non � adeguato al tipo �{0}�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2727
-#, java-format
-msgid "The column name {0} was not found in this ResultSet."
-msgstr "Colonna denominata �{0}� non � presente in questo �ResultSet�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2827
-msgid ""
-"ResultSet is not updateable. The query that generated this result set must "
-"select only one table, and must select all primary keys from that table. See "
-"the JDBC 2.1 API Specification, section 5.6 for more details."
-msgstr ""
-"Il �ResultSet� non � aggiornabile. La query che lo genera deve selezionare "
-"una sola tabella e deve selezionarne tutti i campi che ne compongono la "
-"chiave primaria. Si vedano le specifiche dell''API JDBC 2.1, sezione 5.6, "
-"per ulteriori dettagli."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2839
-msgid "This ResultSet is closed."
-msgstr "Questo �ResultSet� � chiuso."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2860
-msgid "ResultSet not positioned properly, perhaps you need to call next."
-msgstr ""
-"Il �ResultSet� non � correttamente posizionato; forse � necessario invocare "
-"�next()�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:259
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:323
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:392
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2655
-msgid ""
-"Can''t use query methods that take a query string on a PreparedStatement."
-msgstr ""
-"Non si possono utilizzare i metodi \"query\" che hanno come argomento una "
-"stringa nel caso di �PreparedStatement�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:287
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:306
-msgid "Multiple ResultSets were returned by the query."
-msgstr "La query ha restituito �ResultSet� multipli."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:425
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:429
-msgid "A CallableStatement was executed with nothing returned."
-msgstr ""
-"Un �CallableStatement� � stato eseguito senza produrre alcun risultato. "
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:437
-#, fuzzy
-msgid "A CallableStatement was executed with an invalid number of parameters"
-msgstr ""
-"Un �CallableStatement� � stato eseguito con un numero errato di parametri."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:468
-#, java-format
-msgid ""
-"A CallableStatement function was executed and the out parameter {0} was of "
-"type {1} however type {2} was registered."
-msgstr ""
-"� stato eseguito un �CallableStatement� ma il parametro in uscita �{0}� era "
-"di tipo �{1}� al posto di �{2}�, che era stato dichiarato."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:674
-msgid "Maximum number of rows must be a value grater than or equal to 0."
-msgstr "Il numero massimo di righe deve essere maggiore o eguale a 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:717
-msgid "Query timeout must be a value greater than or equals to 0."
-msgstr "Il timeout relativo alle query deve essere maggiore o eguale a 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:809
-msgid "The maximum field size must be a value greater than or equal to 0."
-msgstr "La dimensione massima del campo deve essere maggiore o eguale a 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1226
-msgid "Unknown Types value."
-msgstr "Valore di tipo sconosciuto."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1499
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1624
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3108
-#, java-format
-msgid "Invalid stream length {0}."
-msgstr "La dimensione specificata, {0}, per lo �stream� non � valida."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1530
-#, java-format
-msgid "The JVM claims not to support the {0} encoding."
-msgstr "La JVM sostiene di non supportare la codifica {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1705
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3030
-#, java-format
-msgid "Unknown type {0}."
-msgstr "Tipo sconosciuto {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1720
-msgid "No hstore extension installed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1845
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1851
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1857
-#, java-format
-msgid "Cannot cast an instance of {0} to type {1}"
-msgstr "Non � possibile fare il cast di una istanza di �{0}� al tipo �{1}�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1869
-#, java-format
-msgid "Unsupported Types value: {0}"
-msgstr "Valore di tipo �{0}� non supportato."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1927
-#, java-format
-msgid ""
-"Can''t infer the SQL type to use for an instance of {0}. Use setObject() "
-"with an explicit Types value to specify the type to use."
-msgstr ""
-"Non � possibile identificare il tipo SQL da usare per l''istanza di tipo "
-"�{0}�. Usare �setObject()� specificando esplicitamente il tipo da usare per "
-"questo valore."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1975
-msgid ""
-"This statement does not declare an OUT parameter. Use '{' ?= call ... '}' "
-"to declare one."
-msgstr ""
-"Questo statement non dichiara il parametro in uscita. Usare �{ ?= "
-"call ... }� per farlo."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2025
-msgid "wasNull cannot be call before fetching a result."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2521
-#, java-format
-msgid "Malformed function or procedure escape syntax at offset {0}."
-msgstr ""
-"Sequenza di escape definita erroneamente nella funzione o procedura "
-"all''offset {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2571
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2585
-#, java-format
-msgid ""
-"Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was "
-"made."
-msgstr ""
-"� stato definito il parametro di tipo �{0}�, ma poi � stato invocato il "
-"metodo �get{1}()� (sqltype={2})."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2604
-msgid ""
-"A CallableStatement was declared, but no call to registerOutParameter(1, "
-"<some type>) was made."
-msgstr ""
-"� stato definito un �CallableStatement� ma non � stato invocato il metodo "
-"�registerOutParameter(1, <tipo>)�."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2608
-msgid "No function outputs were registered."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2611
-msgid ""
-"Results cannot be retrieved from a CallableStatement before it is executed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2644
-msgid "This statement has been closed."
-msgstr "Questo statement � stato chiuso."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2724
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2794
-msgid "Too many update results were returned."
-msgstr "Sono stati restituiti troppi aggiornamenti."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2753
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2823
-#, java-format
-msgid ""
-"Batch entry {0} {1} was aborted. Call getNextException to see the cause."
-msgstr ""
-"L''operazione �batch� {0} {1} � stata interrotta. Chiamare "
-"�getNextException� per scoprirne il motivo."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3078
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3167
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3207
-msgid "Unexpected error writing large object to database."
-msgstr "Errore inatteso inviando un �large object� al database."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:145
-#: org/postgresql/jdbc2/EscapedFunctions.java:157
-#: org/postgresql/jdbc2/EscapedFunctions.java:169
-#: org/postgresql/jdbc2/EscapedFunctions.java:206
-#: org/postgresql/jdbc2/EscapedFunctions.java:243
-#: org/postgresql/jdbc2/EscapedFunctions.java:267
-#: org/postgresql/jdbc2/EscapedFunctions.java:292
-#: org/postgresql/jdbc2/EscapedFunctions.java:316
-#: org/postgresql/jdbc2/EscapedFunctions.java:328
-#: org/postgresql/jdbc2/EscapedFunctions.java:352
-#: org/postgresql/jdbc2/EscapedFunctions.java:380
-#: org/postgresql/jdbc2/EscapedFunctions.java:389
-#: org/postgresql/jdbc2/EscapedFunctions.java:399
-#: org/postgresql/jdbc2/EscapedFunctions.java:408
-#: org/postgresql/jdbc2/EscapedFunctions.java:417
-#: org/postgresql/jdbc2/EscapedFunctions.java:426
-#: org/postgresql/jdbc2/EscapedFunctions.java:435
-#: org/postgresql/jdbc2/EscapedFunctions.java:444
-#: org/postgresql/jdbc2/EscapedFunctions.java:453
-#: org/postgresql/jdbc2/EscapedFunctions.java:462
-#: org/postgresql/jdbc2/EscapedFunctions.java:471
-#: org/postgresql/jdbc2/EscapedFunctions.java:480
-#, java-format
-msgid "{0} function takes one and only one argument."
-msgstr "Il metodo �{0}� accetta un ed un solo argomento."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:181
-#: org/postgresql/jdbc2/EscapedFunctions.java:193
-#: org/postgresql/jdbc2/EscapedFunctions.java:255
-#: org/postgresql/jdbc2/EscapedFunctions.java:304
-#: org/postgresql/jdbc2/EscapedFunctions.java:582
-#, java-format
-msgid "{0} function takes two and only two arguments."
-msgstr "Il metodo �{0}� accetta due e solo due argomenti."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:230
-#, java-format
-msgid "{0} function takes four and only four argument."
-msgstr "Il metodo �{0}� accetta quattro e solo quattro argomenti."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:282
-#: org/postgresql/jdbc2/EscapedFunctions.java:342
-#, java-format
-msgid "{0} function takes two or three arguments."
-msgstr "Il metodo �{0}� accetta due o tre argomenti."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:362
-#: org/postgresql/jdbc2/EscapedFunctions.java:371
-#: org/postgresql/jdbc2/EscapedFunctions.java:573
-#: org/postgresql/jdbc2/EscapedFunctions.java:591
-#, java-format
-msgid "{0} function doesn''t take any argument."
-msgstr "Il metodo �{0}� non accetta argomenti."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:489
-#: org/postgresql/jdbc2/EscapedFunctions.java:531
-#, java-format
-msgid "{0} function takes three and only three arguments."
-msgstr "Il metodo �{0}� accetta tre e solo tre argomenti."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:501
-#: org/postgresql/jdbc2/EscapedFunctions.java:521
-#: org/postgresql/jdbc2/EscapedFunctions.java:523
-#: org/postgresql/jdbc2/EscapedFunctions.java:543
-#: org/postgresql/jdbc2/EscapedFunctions.java:564
-#: org/postgresql/jdbc2/EscapedFunctions.java:566
-#, java-format
-msgid "Interval {0} not yet implemented"
-msgstr "L''intervallo �{0}� non � stato ancora implementato."
-
-#: org/postgresql/jdbc2/TimestampUtils.java:360
-msgid ""
-"Infinite value found for timestamp/date. This cannot be represented as time."
-msgstr ""
-"Il valore specificato per il tipo �timestamp� o �date�, infinito, non pu� "
-"essere rappresentato come �time�."
-
-#: org/postgresql/jdbc2/TimestampUtils.java:648
-#: org/postgresql/jdbc2/TimestampUtils.java:680
-#: org/postgresql/jdbc2/TimestampUtils.java:727
-#, fuzzy, java-format
-msgid "Unsupported binary encoding of {0}."
-msgstr "Valore di tipo �{0}� non supportato."
-
-#: org/postgresql/jdbc2/TypeInfoCache.java:161
-#, java-format
-msgid "The class {0} does not implement org.postgresql.util.PGobject."
-msgstr "La class �{0}� non implementa �org.postgresql.util.PGobject�."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:60
-#, java-format
-msgid "Unknown ResultSet holdability setting: {0}."
-msgstr "Il parametro �holdability� per il �ResultSet� � sconosciuto: {0}."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:98
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:130
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:165
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:187
-msgid "Server versions prior to 8.0 do not support savepoints."
-msgstr ""
-"Le versioni del server precedenti alla 8.0 non permettono i punti di "
-"ripristino."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:100
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:132
-msgid "Cannot establish a savepoint in auto-commit mode."
-msgstr ""
-"Non � possibile impostare i punti di ripristino in modalit� �auto-commit�."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:419
-msgid "Returning autogenerated keys is not supported."
-msgstr "La restituzione di chiavi autogenerate non � supportata."
-
-#: org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java:81
-#, java-format
-msgid "The parameter index is out of range: {0}, number of parameters: {1}."
-msgstr "Il parametro indice � fuori intervallo: {0}, numero di elementi: {1}."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:151
-#, fuzzy
-msgid ""
-"Returning autogenerated keys is only supported for 8.2 and later servers."
-msgstr "La restituzione di chiavi autogenerate non � supportata."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:199
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:317
-#, fuzzy
-msgid "Returning autogenerated keys by column index is not supported."
-msgstr "La restituzione di chiavi autogenerate non � supportata."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:38
-#: org/postgresql/jdbc3/PSQLSavepoint.java:50
-#: org/postgresql/jdbc3/PSQLSavepoint.java:66
-msgid "Cannot reference a savepoint after it has been released."
-msgstr ""
-"Non � possibile utilizzare un punto di ripristino successivamente al suo "
-"rilascio."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:42
-msgid "Cannot retrieve the id of a named savepoint."
-msgstr "Non � possibile trovare l''id del punto di ripristino indicato."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:54
-msgid "Cannot retrieve the name of an unnamed savepoint."
-msgstr "Non � possibile trovare il nome di un punto di ripristino anonimo."
-
-#: org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java:37
-#, fuzzy
-msgid "Invalid UUID data."
-msgstr "Flag non valido"
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:83
-#, java-format
-msgid "Unable to find server array type for provided name {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:121
-#, fuzzy, java-format
-msgid "Invalid timeout ({0}<0)."
-msgstr "La dimensione specificata, {0}, per lo �stream� non � valida."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:134
-msgid "Validating connection."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:157
-#, fuzzy, java-format
-msgid "Failed to set ClientInfo property: {0}"
-msgstr "Fallita la creazione dell''oggetto per: {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:166
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:188
-#, fuzzy
-msgid "ClientInfo property not supported."
-msgstr "La restituzione di chiavi autogenerate non � supportata."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Statement.java:127
-msgid "Object is too large to send over the protocol."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:147
-msgid "Unable to decode xml data."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:150
-#, java-format
-msgid "Unknown XML Source class: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:195
-#, fuzzy
-msgid "Unable to create SAXResult for SQLXML."
-msgstr "Fallita la creazione dell''oggetto per: {0}."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:209
-msgid "Unable to create StAXResult for SQLXML"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:213
-#, fuzzy, java-format
-msgid "Unknown XML Result class: {0}"
-msgstr "Il parametro �holdability� per il �ResultSet� � sconosciuto: {0}."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:226
-#, fuzzy
-msgid "This SQLXML object has already been freed."
-msgstr "Questo �PooledConnection� � stato chiuso."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:233
-msgid ""
-"This SQLXML object has not been initialized, so you cannot retrieve data "
-"from it."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:244
-#, java-format
-msgid "Failed to convert binary xml data to encoding: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:269
-msgid "Unable to convert DOMResult SQLXML data to a string."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:282
-msgid ""
-"This SQLXML object has already been initialized, so you cannot manipulate it "
-"further."
-msgstr ""
-
-#: org/postgresql/largeobject/LargeObjectManager.java:138
-msgid "Failed to initialize LargeObject API"
-msgstr "Inizializzazione di LargeObject API fallita."
-
-#: org/postgresql/largeobject/LargeObjectManager.java:257
-#: org/postgresql/largeobject/LargeObjectManager.java:298
-msgid "Large Objects may not be used in auto-commit mode."
-msgstr "Non � possibile impostare i �Large Object� in modalit� �auto-commit�."
-
-#: org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java:58
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:110
-#, java-format
-msgid "The SSLSocketFactory class provided {0} could not be instantiated."
-msgstr ""
-"La classe �SSLSocketFactory� specificata, �{0}�, non pu� essere istanziata."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:125
-#, java-format
-msgid "SSL error: {0}"
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:138
-#, fuzzy, java-format
-msgid "The HostnameVerifier class provided {0} could not be instantiated."
-msgstr ""
-"La classe �SSLSocketFactory� specificata, �{0}�, non pu� essere istanziata."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:142
-#, java-format
-msgid "The hostname {0} could not be verified by hostnameverifier {1}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:149
-#, fuzzy, java-format
-msgid "The hostname {0} could not be verified."
-msgstr ""
-"La classe �SSLSocketFactory� specificata, �{0}�, non pu� essere istanziata."
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:121
-msgid ""
-"Could not find a java cryptographic algorithm: X.509 CertificateFactory not "
-"available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:132
-#, java-format
-msgid "Could not open SSL certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:137
-#, java-format
-msgid "Loading the SSL certificate {0} into a KeyManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:194
-msgid "Enter SSL password: "
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:202
-msgid "Could not read password for SSL key file, console is not available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:204
-#, java-format
-msgid "Could not read password for SSL key file by callbackhandler {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:223
-#, java-format
-msgid "Could not decrypt SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:231
-#, java-format
-msgid "Could not read SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:235
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:173
-#, java-format
-msgid "Could not find a java cryptographic algorithm: {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:99
-#, fuzzy, java-format
-msgid "The password callback class provided {0} could not be instantiated."
-msgstr ""
-"La classe �SSLSocketFactory� specificata, �{0}�, non pu� essere istanziata."
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:133
-#, java-format
-msgid "Could not open SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:150
-#, java-format
-msgid "Could not read SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:153
-#, java-format
-msgid "Loading the SSL root certificate {0} into a TrustManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:166
-msgid "Could not initialize SSL context."
-msgstr ""
-
-#: org/postgresql/util/PGInterval.java:164
-msgid "Conversion of interval failed"
-msgstr "Fallita la conversione di un �interval�."
-
-#: org/postgresql/util/PGmoney.java:73
-msgid "Conversion of money failed."
-msgstr "Fallita la conversione di un �money�."
-
-#: org/postgresql/util/ServerErrorMessage.java:155
-#, java-format
-msgid "Detail: {0}"
-msgstr "Dettaglio: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:159
-#, java-format
-msgid "Hint: {0}"
-msgstr "Suggerimento: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:162
-#, java-format
-msgid "Position: {0}"
-msgstr "Posizione: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:165
-#, java-format
-msgid "Where: {0}"
-msgstr "Dove: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:171
-#, java-format
-msgid "Internal Query: {0}"
-msgstr "Query interna: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:174
-#, java-format
-msgid "Internal Position: {0}"
-msgstr "Posizione interna: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:180
-#, java-format
-msgid "Location: File: {0}, Routine: {1}, Line: {2}"
-msgstr "Individuazione: file: \"{0}\", routine: {1}, linea: {2}"
-
-#: org/postgresql/util/ServerErrorMessage.java:183
-#, java-format
-msgid "Server SQLState: {0}"
-msgstr "SQLState del server: {0}"
-
-#: org/postgresql/xa/PGXAConnection.java:148
-msgid ""
-"Transaction control methods setAutoCommit(true), commit, rollback and "
-"setSavePoint not allowed while an XA transaction is active."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:186
-#: org/postgresql/xa/PGXAConnection.java:245
-msgid "Invalid flags"
-msgstr "Flag non validi"
-
-#: org/postgresql/xa/PGXAConnection.java:189
-#: org/postgresql/xa/PGXAConnection.java:248
-#: org/postgresql/xa/PGXAConnection.java:425
-msgid "xid must not be null"
-msgstr "xid non pu� essere NULL"
-
-#: org/postgresql/xa/PGXAConnection.java:192
-msgid "Connection is busy with another transaction"
-msgstr "La connessione � utilizzata da un''altra transazione"
-
-#: org/postgresql/xa/PGXAConnection.java:198
-#: org/postgresql/xa/PGXAConnection.java:255
-msgid "suspend/resume not implemented"
-msgstr "�suspend�/�resume� non implementato"
-
-#: org/postgresql/xa/PGXAConnection.java:204
-#: org/postgresql/xa/PGXAConnection.java:207
-#: org/postgresql/xa/PGXAConnection.java:209
-msgid "Transaction interleaving not implemented"
-msgstr "L''\"interleaving\" delle transazioni �{0}� non � supportato."
-
-#: org/postgresql/xa/PGXAConnection.java:218
-#, fuzzy
-msgid "Error disabling autocommit"
-msgstr "Errore durante il commit \"one-phase\""
-
-#: org/postgresql/xa/PGXAConnection.java:251
-msgid "tried to call end without corresponding start call"
-msgstr "� stata chiamata �end� senza la corrispondente chiamata a �start�"
-
-#: org/postgresql/xa/PGXAConnection.java:282
-msgid ""
-"Not implemented: Prepare must be issued using the same connection that "
-"started the transaction"
-msgstr ""
-"Non implementato: �Prepare� deve essere eseguito nella stessa connessione "
-"che ha iniziato la transazione."
-
-#: org/postgresql/xa/PGXAConnection.java:286
-msgid "Prepare called before end"
-msgstr "�Prepare� invocato prima della fine"
-
-#: org/postgresql/xa/PGXAConnection.java:292
-msgid "Server versions prior to 8.1 do not support two-phase commit."
-msgstr ""
-"Le versioni del server precedenti alla 8.1 non permettono i commit \"two-"
-"phase\"."
-
-#: org/postgresql/xa/PGXAConnection.java:313
-msgid "Error preparing transaction"
-msgstr "Errore nel preparare una transazione"
-
-#: org/postgresql/xa/PGXAConnection.java:328
-msgid "Invalid flag"
-msgstr "Flag non valido"
-
-#: org/postgresql/xa/PGXAConnection.java:368
-msgid "Error during recover"
-msgstr "Errore durante il ripristino"
-
-#: org/postgresql/xa/PGXAConnection.java:416
-msgid "Error rolling back prepared transaction"
-msgstr "Errore durante il �rollback� di una transazione preparata"
-
-#: org/postgresql/xa/PGXAConnection.java:451
-msgid ""
-"Not implemented: one-phase commit must be issued using the same connection "
-"that was used to start it"
-msgstr ""
-"Non implementato: il commit \"one-phase\" deve essere invocato sulla stessa "
-"connessione che ha iniziato la transazione."
-
-#: org/postgresql/xa/PGXAConnection.java:455
-msgid "commit called before end"
-msgstr "�Commit� � stato chiamato prima della fine"
-
-#: org/postgresql/xa/PGXAConnection.java:466
-msgid "Error during one-phase commit"
-msgstr "Errore durante il commit \"one-phase\""
-
-#: org/postgresql/xa/PGXAConnection.java:487
-msgid ""
-"Not implemented: 2nd phase commit must be issued using an idle connection"
-msgstr ""
-"Non implementato: la seconda fase del �commit� deve essere effettuata con "
-"una connessione non in uso"
-
-#: org/postgresql/xa/PGXAConnection.java:507
-#, fuzzy
-msgid "Error committing prepared transaction"
-msgstr "Errore durante il �rollback� di una transazione preparata"
-
-#: org/postgresql/xa/PGXAConnection.java:522
-msgid "Heuristic commit/rollback not supported"
-msgstr "�Commit� e �rollback� euristici non sono supportati"
-
-#~ msgid "The driver does not support SSL."
-#~ msgstr "Il driver non supporta SSL."
-
-#~ msgid "Multi-dimensional arrays are currently not supported."
-#~ msgstr "Gli array multidimensionali non sono attualmente gestiti."
-
-#~ msgid "rand function only takes zero or one argument(the seed)."
-#~ msgstr "Il metodo �rand� vuole al massimo un argomento (il seme)."
-
-#~ msgid "Exception: {0}"
-#~ msgstr "Eccezione: {0}."
-
-#~ msgid "Stack Trace:"
-#~ msgstr "Stack trace:"
-
-#~ msgid "End of Stack Trace"
-#~ msgstr "Fine dello stack trace"
-
-#~ msgid "Exception generating stacktrace for: {0} encountered: {1}"
-#~ msgstr ""
-#~ "Eccezione durante la generazione dello stack trace per: �{0}� trovata: {1}"
-
-#~ msgid "suspend/resume and join not implemented"
-#~ msgstr "�Suspend�, �resume� e �join� non sono implementati"
-
-#~ msgid ""
-#~ "Cannot call setXXX(1, ..) on a CallableStatement. This is an output that "
-#~ "must be configured with registerOutParameter instead."
-#~ msgstr ""
-#~ "Non � possibile invocare �setXXX(1,...)� per un �CallableStatement�. Si "
-#~ "tratta di un valore restituito che va configurato usando il metodo "
-#~ "�registerOutParameter()�."
-
-#~ msgid ""
-#~ "PostgreSQL only supports a single OUT function return value at index 1."
-#~ msgstr ""
-#~ "PostgreSQL permette di avere un solo valore restituito dalle funzioni, "
-#~ "utilizzando l''indice 1."
-
-#~ msgid "Conversion of circle failed: {0}."
-#~ msgstr "Fallita la conversione di un ``circle'': {0}."
-
-#~ msgid "Conversion of line failed: {0}."
-#~ msgstr "Fallita la conversione di un ``line'': {0}."
-
-#~ msgid "Conversion of point failed: {0}."
-#~ msgstr "Fallita la conversione di un ``point'': {0}."
-
-#~ msgid "No results where returned by the query."
-#~ msgstr "Nessun risultato � stato restituito dalla query."
-
-#~ msgid "Bad byte: {0}"
-#~ msgstr "�Byte� non corretto: {0}"
-
-#~ msgid "Bad short: {0}"
-#~ msgstr "�Short� non corretto: {0}"
-
-#~ msgid "The JVM claims not to support the UTF-8 encoding."
-#~ msgstr "La JVM sostiene di non supportare la codifica UTF-8."
-
-#~ msgid "Bad int: {0}"
-#~ msgstr "�Int� non corretto: {0}"
-
-#~ msgid "Bad long: {0}"
-#~ msgstr "�Long� non corretto: {0}"
-
-#~ msgid "Bad BigDecimal: {0}"
-#~ msgstr "�BigDecimal� non corretto: {0}"
-
-#~ msgid "Bad float: {0}"
-#~ msgstr "�Float� non corretto: {0}"
-
-#~ msgid "Bad double: {0}"
-#~ msgstr "�Double� non corretto: {0}"
-
-#~ msgid "Bad date: {0}"
-#~ msgstr "�Date� non corretto: {0}"
-
-#~ msgid "The given date {0} does not match the format required: {1}."
-#~ msgstr "La data fornita {0} non corrisponde al formato richiesto: {1}."
-
-#~ msgid "The time given {0} does not match the format required: {1}."
-#~ msgstr "L''orario fornito {0} non corrisponde al formato richiesto: {1}."
-
-#~ msgid "The timestamp given {0} does not match the format required: {1}."
-#~ msgstr ""
-#~ "La marca temporale fornita {0} non corrisponde al formato richiesto: {1}."
-
-#~ msgid "Could not extract nanoseconds from {0}."
-#~ msgstr "Non � possibile estrarre i nanosecondi da {0}."
-
-#~ msgid "ResultSet holdability of HOLD_CURSORS_OVER_COMMIT is not supported."
-#~ msgstr ""
-#~ "Il mantenimento del ResultSet tramite HOLD_CURSOR_OVER_COMMIT non � "
-#~ "supportato."
diff --git a/org/postgresql/translation/ja.po b/org/postgresql/translation/ja.po
deleted file mode 100644
index 6ec462a..0000000
--- a/org/postgresql/translation/ja.po
+++ /dev/null
@@ -1,1561 +0,0 @@
-# translation of head-de.po to Deutsch
-# German message translation for the PostgreSQL JDBC driver
-# This file is distributed under the same license as the package.
-#
-# Andre Bialojahn <ab.spamnews at freenet.de>, 2005, 2006, 2008.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: head-ja\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-10-31 13:37+0000\n"
-"PO-Revision-Date: 2010-04-11 22:58+0900\n"
-"Last-Translator: Hiroshi Saito <z-saito at guitar.ocn.ne.jp>\n"
-"Language-Team: PostgreSQL <z-saito at guitar.ocn.ne.jp>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: KBabel 1.0.2\n"
-"X-Poedit-Language: Japanese\n"
-"X-Poedit-Country: Japan\n"
-
-#: org/postgresql/Driver.java.in:235
-msgid "Error loading default settings from driverconfig.properties"
-msgstr "driverconfig.propertiesによる初期設定のロードエラー"
-
-#: org/postgresql/Driver.java.in:282
-msgid ""
-"Your security policy has prevented the connection from being attempted. You "
-"probably need to grant the connect java.net.SocketPermission to the database "
-"server host and port that you wish to connect to."
-msgstr ""
-"セキュリティ・ポリシーは、接続を妨げました。おそらく、データベース・サー"
-"バー・ホスト接続のためjava.net.SocketPermissionを許可する必要があります。"
-
-#: org/postgresql/Driver.java.in:287 org/postgresql/Driver.java.in:351
-msgid ""
-"Something unusual has occurred to cause the driver to fail. Please report "
-"this exception."
-msgstr ""
-"なにかドライバを失敗させる変化が起こりました。どうぞこの例外を報告して下さ"
-"い。"
-
-#: org/postgresql/Driver.java.in:359
-msgid "Connection attempt timed out."
-msgstr "接続中にタイムアウトしました。"
-
-#: org/postgresql/Driver.java.in:372
-msgid "Interrupted while attempting to connect."
-msgstr "接続中に割り込みがありました。"
-
-#: org/postgresql/Driver.java.in:714
-#, java-format
-msgid "Method {0} is not yet implemented."
-msgstr "方法 {0} はまだ装備されていません。"
-
-#: org/postgresql/copy/CopyManager.java:56
-#, java-format
-msgid "Requested CopyIn but got {0}"
-msgstr "CopyInを要求しましたが {0} を得ます"
-
-#: org/postgresql/copy/CopyManager.java:67
-#, java-format
-msgid "Requested CopyOut but got {0}"
-msgstr "CopyOutを要求しましたが {0} を得ます"
-
-#: org/postgresql/copy/PGCopyInputStream.java:51
-#, java-format
-msgid "Copying from database failed: {0}"
-msgstr "データベースからコピーに失敗しました: {0}"
-
-#: org/postgresql/copy/PGCopyInputStream.java:67
-#: org/postgresql/copy/PGCopyOutputStream.java:90
-msgid "This copy stream is closed."
-msgstr "copyストリームは閉じられました。"
-
-#: org/postgresql/copy/PGCopyInputStream.java:108
-msgid "Read from copy failed."
-msgstr "copyからの読み取りに失敗しました。"
-
-#: org/postgresql/copy/PGCopyOutputStream.java:68
-#, java-format
-msgid "Cannot write to copy a byte of value {0}"
-msgstr "値{0}のバイトコピーで書き込みができません。"
-
-#: org/postgresql/core/ConnectionFactory.java:69
-#, java-format
-msgid "A connection could not be made using the requested protocol {0}."
-msgstr "要求されたプロトコル {0} を使用して接続することができません。"
-
-#: org/postgresql/core/Oid.java:113
-#, java-format
-msgid "oid type {0} not known and not a number"
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:490
-#, java-format
-msgid "Premature end of input stream, expected {0} bytes, but only read {1}."
-msgstr ""
-"早すぎた入力ストリームの終了です、{0} バイトが想定されました、しかし唯一 {1} "
-"は読み込まれました。"
-
-#: org/postgresql/core/PGStream.java:530
-#, java-format
-msgid "Expected an EOF from server, got: {0}"
-msgstr "サーバから EOF が想定されました、取得: {0}"
-
-#: org/postgresql/core/SetupQueryRunner.java:86
-msgid "An unexpected result was returned by a query."
-msgstr "クエリーによって想定しない結果が返されました。"
-
-#: org/postgresql/core/UTF8Encoding.java:28
-#, java-format
-msgid ""
-"Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}"
-msgstr ""
-"UTF-8シーケンス違反: {1} バイトシーケンスの {0} バイト は、10xxxxxx でありま"
-"せん: {2}"
-
-#: org/postgresql/core/UTF8Encoding.java:61
-#, java-format
-msgid "Illegal UTF-8 sequence: {0} bytes used to encode a {1} byte value: {2}"
-msgstr ""
-"UTF-8シーケンス違反: {0} バイトは、 {1} バイト値のエンコードに使いました: {2}"
-
-#: org/postgresql/core/UTF8Encoding.java:98
-#: org/postgresql/core/UTF8Encoding.java:125
-#, java-format
-msgid "Illegal UTF-8 sequence: initial byte is {0}: {1}"
-msgstr "UTF-8シーケンス違反: 初期バイトは、{0}: {1}"
-
-#: org/postgresql/core/UTF8Encoding.java:130
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is out of range: {0}"
-msgstr "UTF-8シーケンス違反: 最終値は範囲外です: {0}"
-
-#: org/postgresql/core/UTF8Encoding.java:145
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is a surrogate value: {0}"
-msgstr "UTF-8シーケンス違反: 最終値はサロゲート値です: {0}"
-
-#: org/postgresql/core/Utils.java:95 org/postgresql/core/Utils.java:112
-msgid "Zero bytes may not occur in string parameters."
-msgstr "ゼロ・バイトは、文字列パラメーターにできないかもしれません。"
-
-#: org/postgresql/core/Utils.java:145
-msgid "Zero bytes may not occur in identifiers."
-msgstr "ゼロ・バイトは、識別できないかもしれません。"
-
-#: org/postgresql/core/types/PGBigDecimal.java:63
-#: org/postgresql/core/types/PGBoolean.java:62
-#: org/postgresql/core/types/PGByte.java:63
-#: org/postgresql/core/types/PGDouble.java:64
-#: org/postgresql/core/types/PGFloat.java:64
-#: org/postgresql/core/types/PGInteger.java:61
-#: org/postgresql/core/types/PGLong.java:62
-#: org/postgresql/core/types/PGNumber.java:62
-#: org/postgresql/core/types/PGShort.java:58
-#: org/postgresql/core/types/PGString.java:73
-#, java-format
-msgid "Cannot convert an instance of {0} to type {1}"
-msgstr "型 {1} に {0} のインスタンスを変換できません。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:66
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:74
-#, fuzzy, java-format
-msgid "Invalid sslmode value: {0}"
-msgstr "無効なストリーム長 {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:134
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:207
-msgid ""
-"Connection refused. Check that the hostname and port are correct and that "
-"the postmaster is accepting TCP/IP connections."
-msgstr ""
-"接続は拒絶されました。ホスト名とポート番号が正しいか、または、ポストマスタが"
-"TCP/IP接続を受け入れているかを調べて下さい。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:153
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:225
-msgid "The connection attempt failed."
-msgstr "接続の試みは失敗しました。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:175
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:246
-#, fuzzy
-msgid "The connection url is invalid."
-msgstr "接続の試みは失敗しました。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:198
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:210
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:295
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:307
-msgid "The server does not support SSL."
-msgstr "サーバはSSLをサポートしていません。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:223
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:320
-msgid "An error occurred while setting up the SSL connection."
-msgstr "SSL接続のセットアップ中に、エラーが起こりました。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:272
-#, java-format
-msgid "Connection rejected: {0}."
-msgstr "接続は拒絶されました: {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:290
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:312
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:332
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:419
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:444
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:471
-msgid ""
-"The server requested password-based authentication, but no password was "
-"provided."
-msgstr ""
-"サーバーは、パスワード・ベースの認証を要求しました、しかし、いかなるパスワー"
-"ドも提供されませんでした。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:356
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:504
-#, java-format
-msgid ""
-"The authentication type {0} is not supported. Check that you have configured "
-"the pg_hba.conf file to include the client''s IP address or subnet, and that "
-"it is using an authentication scheme supported by the driver."
-msgstr ""
-"認証型 {0} はサポートされません、pg_hba.confファイルの構成でクライアントのIP"
-"アドレス、サブネットが含まれているか、そしてドライバがサポートする認証機構を"
-"使っているかを調べてください。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:362
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:400
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:510
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:553
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:599
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:609
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:618
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:626
-#: org/postgresql/gss/MakeGSS.java:158
-msgid "Protocol error. Session setup failed."
-msgstr "プロトコルエラー, セッション設定は失敗しました。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:390
-#, java-format
-msgid "Backend start-up failed: {0}."
-msgstr "バックエンドの開始に失敗しました: {0}"
-
-#: org/postgresql/core/v2/FastpathParameterList.java:55
-#: org/postgresql/core/v2/FastpathParameterList.java:77
-#: org/postgresql/core/v2/FastpathParameterList.java:84
-#: org/postgresql/core/v2/SimpleParameterList.java:57
-#: org/postgresql/core/v2/SimpleParameterList.java:76
-#: org/postgresql/core/v2/SimpleParameterList.java:83
-#: org/postgresql/core/v2/SimpleParameterList.java:90
-#: org/postgresql/core/v3/CompositeParameterList.java:35
-#: org/postgresql/core/v3/SimpleParameterList.java:49
-#: org/postgresql/core/v3/SimpleParameterList.java:56
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2845
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java:419
-#, java-format
-msgid "The column index is out of range: {0}, number of columns: {1}."
-msgstr "列インデックスは範囲外です: {0} , 列の数: {1}"
-
-#: org/postgresql/core/v2/FastpathParameterList.java:142
-#: org/postgresql/core/v2/SimpleParameterList.java:155
-#: org/postgresql/core/v3/SimpleParameterList.java:216
-#, java-format
-msgid "No value specified for parameter {0}."
-msgstr "パラメータ {0} の明確な値がありません。"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:72
-#: org/postgresql/core/v2/QueryExecutorImpl.java:337
-#: org/postgresql/core/v3/QueryExecutorImpl.java:443
-#: org/postgresql/core/v3/QueryExecutorImpl.java:507
-#, java-format
-msgid "Expected command status BEGIN, got {0}."
-msgstr "BEGINコマンドステータスを想定しました, 取得 {0}"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:78
-#: org/postgresql/core/v3/QueryExecutorImpl.java:513
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1828
-#, java-format
-msgid "Unexpected command status: {0}."
-msgstr "想定外のコマンドステータス: {0}"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:118
-#: org/postgresql/core/v2/QueryExecutorImpl.java:129
-#: org/postgresql/core/v2/QueryExecutorImpl.java:174
-#: org/postgresql/core/v2/QueryExecutorImpl.java:369
-#: org/postgresql/core/v3/QueryExecutorImpl.java:281
-#: org/postgresql/core/v3/QueryExecutorImpl.java:411
-#: org/postgresql/core/v3/QueryExecutorImpl.java:485
-#: org/postgresql/core/v3/QueryExecutorImpl.java:551
-#: org/postgresql/core/v3/QueryExecutorImpl.java:631
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2094
-#, fuzzy
-msgid "An I/O error occured while sending to the backend."
-msgstr "バックエンドに送信中に、入出力エラーはが起こりました。"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:170
-#: org/postgresql/core/v2/QueryExecutorImpl.java:225
-#: org/postgresql/core/v2/QueryExecutorImpl.java:236
-#: org/postgresql/core/v3/QueryExecutorImpl.java:627
-#: org/postgresql/core/v3/QueryExecutorImpl.java:685
-#, java-format
-msgid "Unknown Response Type {0}."
-msgstr "未知の応答型 {0} です。"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:430
-#: org/postgresql/core/v2/QueryExecutorImpl.java:475
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1857
-msgid "Ran out of memory retrieving query results."
-msgstr "メモリを使い果たし、クエリー結果を回収しました。"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:597
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2199
-#, java-format
-msgid "Unable to interpret the update count in command completion tag: {0}."
-msgstr "コマンド完了タグで更新数を解釈することができません: {0}"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:610
-msgid "Copy not implemented for protocol version 2"
-msgstr "プロトコルバージョン2でCopyは装備されていません"
-
-#: org/postgresql/core/v3/CopyOperationImpl.java:56
-msgid "CommandComplete expected COPY but got: "
-msgstr "コマンド完了はCOPYを想定します、しかし取得は:"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:66
-msgid "Tried to obtain lock while already holding it"
-msgstr "すでに占有している最中のロック取得です"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:78
-msgid "Tried to break lock on database connection"
-msgstr "データベース接続のロック中断を試みます。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:93
-msgid "Interrupted while waiting to obtain lock on database connection"
-msgstr "データベース接続でロック待ちの最中に割り込みがありました。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:275
-msgid "Unable to bind parameter values for statement."
-msgstr "ステートメントのバインドパラメーター値ができません。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:726
-msgid "Database connection failed when starting copy"
-msgstr "文字列copy中にデータベース接続に失敗しました。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:757
-msgid "Tried to cancel an inactive copy operation"
-msgstr "不活発なコピー操作の取り消しを試みました"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:794
-msgid "Database connection failed when canceling copy operation"
-msgstr "コピー操作取り消し中にデータベース接続に失敗しました"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:799
-msgid "Missing expected error response to copy cancel request"
-msgstr "コピー取り消し要求のエラー応答を想定しました"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:801
-#, java-format
-msgid "Got {0} error responses to single copy cancel request"
-msgstr "単一copy取り消し要求の {0} エラー応答を得ました"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:814
-msgid "Tried to end inactive copy"
-msgstr "不活発なコピーの終了を試みました。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:827
-msgid "Database connection failed when ending copy"
-msgstr "コピーを終えるときに、データベース接続は失敗しました"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:842
-#: org/postgresql/core/v3/QueryExecutorImpl.java:860
-msgid "Tried to write to an inactive copy operation"
-msgstr "不活発なコピー操作で書き込みを試みました。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:854
-#: org/postgresql/core/v3/QueryExecutorImpl.java:866
-msgid "Database connection failed when writing to copy"
-msgstr "copy書き込み中にデータベース接続に失敗しました"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:878
-msgid "Tried to read from inactive copy"
-msgstr "活動していないcopyから読み取りを試みました。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:883
-msgid "Database connection failed when reading from copy"
-msgstr "copyから読み取り中にデータベース接続が失敗しました"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:951
-#, java-format
-msgid "Received CommandComplete ''{0}'' without an active copy operation"
-msgstr "活動中のコピー操作なしでCommandComplete ''{0}'' を受け取りました"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:975
-#, java-format
-msgid "Got CopyInResponse from server during an active {0}"
-msgstr "活動中のサーバ {0} からCopyInResponseを得ました"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:988
-#, java-format
-msgid "Got CopyOutResponse from server during an active {0}"
-msgstr "活動中のサーバ {0} からCopyOutResponseを得ました"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1003
-msgid "Got CopyData without an active copy operation"
-msgstr "活動中のコピー操作なしでCopyDataを得ました"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1005
-#, java-format
-msgid "Unexpected copydata from server for {0}"
-msgstr "{0} のサーバからの思いがけない copydata です。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1056
-#, java-format
-msgid "Unexpected packet type during copy: {0}"
-msgstr "copy最中に思いがけないパケット型です: {0}"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1310
-#, java-format
-msgid ""
-"Bind message length {0} too long. This can be caused by very large or "
-"incorrect length specifications on InputStream parameters."
-msgstr ""
-"バインドメッセージ長 {0} は長すぎます。これはとても大きくする要因となるか、あ"
-"るいは、InputStreamパラメーターの不正確な長さ記述です。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1925
-#, fuzzy, java-format
-msgid ""
-"The server''s client_encoding parameter was changed to {0}. The JDBC driver "
-"requires client_encoding to be UTF8 for correct operation."
-msgstr ""
-"サーバーのclient_encodingパラメーターが {0} に変わりました、JDBCドライバー"
-"は、正しい操作のためclient_encodingをUNICODEにすることを要求します。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1932
-#, java-format
-msgid ""
-"The server''s DateStyle parameter was changed to {0}. The JDBC driver "
-"requires DateStyle to begin with ISO for correct operation."
-msgstr ""
-"サーバーのDateStyleパラメーターは、{0} に変わりました,JDBCドライバーは、正し"
-"い操作のISOで、開始するためのDateStyleを必要とします。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1945
-#, java-format
-msgid ""
-"The server''s standard_conforming_strings parameter was reported as {0}. The "
-"JDBC driver expected on or off."
-msgstr ""
-"サーバーのstandard_conforming_stringsパラメーターは、{0}として報告されまし"
-"た。JDBCドライバーは、on または off を想定します。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2015
-msgid "The driver currently does not support COPY operations."
-msgstr "現在、ドライバはコピー操作をサポートしません。"
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:112
-msgid "This PooledConnection has already been closed."
-msgstr "PooledConnectionは、すでに閉じられています。"
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid ""
-"Connection has been closed automatically because a new connection was opened "
-"for the same PooledConnection or the PooledConnection has been closed."
-msgstr ""
-"同じPooledConnectionが開かれたので新しい接続は自動的に閉じられました、また"
-"は、PooledConnectionが閉じられました。"
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid "Connection has been closed."
-msgstr "接続は閉じられました。"
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:442
-msgid "Statement has been closed."
-msgstr "構文は閉じられました。"
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:291
-msgid "Failed to setup DataSource."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:414
-msgid "DataSource has been closed."
-msgstr "データソースは閉じられました。"
-
-#: org/postgresql/fastpath/Fastpath.java:81
-#: org/postgresql/fastpath/Fastpath.java:128
-#, java-format
-msgid "Fastpath call {0} - No result was returned and we expected an integer."
-msgstr ""
-"Fastpath 呼び出し {0} - いかなる結果も返されません、整数を予想しました。"
-
-#: org/postgresql/fastpath/Fastpath.java:237
-#, java-format
-msgid "The fastpath function {0} is unknown."
-msgstr " {0} は未知の fastpath 関数です。"
-
-#: org/postgresql/geometric/PGbox.java:83
-#: org/postgresql/geometric/PGcircle.java:82
-#: org/postgresql/geometric/PGcircle.java:91
-#: org/postgresql/geometric/PGline.java:80
-#: org/postgresql/geometric/PGlseg.java:77
-#: org/postgresql/geometric/PGpoint.java:85
-#, java-format
-msgid "Conversion to type {0} failed: {1}."
-msgstr "型変換 {0} は失敗しました: {1}."
-
-#: org/postgresql/geometric/PGpath.java:81
-#, java-format
-msgid "Cannot tell if path is open or closed: {0}."
-msgstr "もし path が オープン、またはクローズされていたら話せません: {0}"
-
-#: org/postgresql/gss/MakeGSS.java:47 org/postgresql/gss/MakeGSS.java:55
-#: org/postgresql/gss/MakeGSS.java:168
-msgid "GSS Authentication failed"
-msgstr "GSS認証は失敗しました"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:153
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:790
-#, java-format
-msgid "The array index is out of range: {0}"
-msgstr "配列インデックスは、範囲外です: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:168
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:807
-#, java-format
-msgid "The array index is out of range: {0}, number of elements: {1}."
-msgstr "配列インデックスは、範囲外です: {0} , 要素の数: {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:196
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1982
-#: org/postgresql/util/HStoreConverter.java:34
-#: org/postgresql/util/HStoreConverter.java:61
-msgid ""
-"Invalid character data was found. This is most likely caused by stored data "
-"containing characters that are invalid for the character set the database "
-"was created in. The most common example of this is storing 8bit data in a "
-"SQL_ASCII database."
-msgstr ""
-"不正な文字データが見つかりました。これは、恐らく作成されたデータベースの文字"
-"セットにとって無効である文字を含むデータによって引き起こされます。最も共通の"
-"例として、8bitデータがSQL_ASCIIデータベースに保存されています。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:73
-msgid ""
-"Truncation of large objects is only implemented in 8.3 and later servers."
-msgstr ""
-"ラージオブジェクトの除去は、サーババージョンが 8.3 以上で装備されています。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:77
-msgid "Cannot truncate LOB to a negative length."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:81
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:235
-#, java-format
-msgid "PostgreSQL LOBs can only index to: {0}"
-msgstr "PostgreSQL LOB は、インデックス {0} のみ可能です。 "
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:231
-msgid "LOB positioning offsets start at 1."
-msgstr "LOB オフセット開始位置を 1 としてください。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:246
-msgid "free() was called on this LOB previously"
-msgstr "free() は、 このLOB以前に呼ばれました"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:225
-#, java-format
-msgid "Unsupported value for stringtype parameter: {0}"
-msgstr "文字列型パラメータのサポートされない値です: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:245
-msgid "unknownLength parameter value must be an integer"
-msgstr "未知の長さパラメータ値は整数でなければなりません"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:353
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:284
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:303
-#: org/postgresql/jdbc2/TypeInfoCache.java:201
-#: org/postgresql/jdbc2/TypeInfoCache.java:249
-#: org/postgresql/jdbc2/TypeInfoCache.java:287
-#: org/postgresql/jdbc2/TypeInfoCache.java:344
-#: org/postgresql/jdbc2/TypeInfoCache.java:348
-#: org/postgresql/jdbc2/TypeInfoCache.java:384
-#: org/postgresql/jdbc2/TypeInfoCache.java:388
-msgid "No results were returned by the query."
-msgstr "いかなる結果も、クエリーによって返されませんでした。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:367
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:336
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:368
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2702
-msgid "A result was returned when none was expected."
-msgstr "何も予想しなかったときに、結果が返されました。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:519
-msgid "Custom type maps are not supported."
-msgstr "カスタム・型のマップはサポートされません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:567
-#, java-format
-msgid "Failed to create object for: {0}."
-msgstr "{0} へのオブジェクト生成に失敗しました。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:629
-#, java-format
-msgid "Unable to load the class {0} responsible for the datatype {1}"
-msgstr "データ型 {1} 対応のクラス{0} をロードできません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:725
-msgid ""
-"Cannot change transaction read-only property in the middle of a transaction."
-msgstr ""
-"トランザクション中に、読み出し専用プロパティトランザクションに変えることがで"
-"きません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:813
-msgid "Cannot commit when autoCommit is enabled."
-msgstr "オートコミット有効時にコミットできません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:822
-msgid "This connection has been closed."
-msgstr "接続は既に閉じられました。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:842
-msgid "Cannot rollback when autoCommit is enabled."
-msgstr "オートコミット有効時にロールバックできません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:929
-msgid ""
-"Cannot change transaction isolation level in the middle of a transaction."
-msgstr "トランザクションの最中に隔離レベルを変えることができません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:934
-#, java-format
-msgid "Transaction isolation level {0} not supported."
-msgstr "トランザクション隔離レベル{0} はサポートされていません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1001
-msgid "Finalizing a Connection that was never closed:"
-msgstr "接続終了で閉じられませんでした:"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1103
-msgid "Unable to translate data into the desired encoding."
-msgstr "望む符号化にデータを訳すことができません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:63
-msgid ""
-"Unable to determine a value for MaxIndexKeys due to missing system catalog "
-"data."
-msgstr ""
-"間違ったシステム・カタログ・データのためにMaxIndexKeysの値を決めることができ"
-"ません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:86
-msgid "Unable to find name datatype in the system catalogs."
-msgstr "名前データ型をシステムカタログで見つけることができません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:235
-msgid ""
-"Operation requires a scrollable ResultSet, but this ResultSet is "
-"FORWARD_ONLY."
-msgstr ""
-"操作は、スクロール可能なResultSetを必要とします、しかし、このResultSetは、 "
-"FORWARD_ONLYです。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:416
-msgid "Unexpected error while decoding character data from a large object."
-msgstr ""
-"ラージオブジェクトから文字データの複合化中に思いがけないエラーが起きました。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:462
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:491
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:525
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3129
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3174
-#, fuzzy, java-format
-msgid "Cannot convert the column of type {0} to requested type {1}."
-msgstr "型 {1} に {0} のインスタンスを変換できません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:744
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:768
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1892
-msgid "Can''t use relative move methods while on the insert row."
-msgstr "行挿入の最中に関連の動作方法を使うことはできません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:788
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2956
-#, java-format
-msgid "Invalid fetch direction constant: {0}."
-msgstr "フェッチ方向コンスタントが不正です: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:802
-msgid "Cannot call cancelRowUpdates() when on the insert row."
-msgstr "行挿入の最中にcancelRowUpdates()を呼び出せません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:822
-msgid "Cannot call deleteRow() when on the insert row."
-msgstr "行挿入時に deleteRow() を呼び出せません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:828
-msgid ""
-"Currently positioned before the start of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"ResultSetの開始の前に置かれました。ここでdeleteRowを呼ぶことはできません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:833
-msgid ""
-"Currently positioned after the end of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"ResultSetの終わりの後に置かれました。ここでdeleteRowを呼ぶことはできません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:838
-msgid "There are no rows in this ResultSet."
-msgstr "このResultSetにいかなる行もありません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:885
-msgid "Not on the insert row."
-msgstr "挿入行がありません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:889
-msgid "You must specify at least one column value to insert a row."
-msgstr "行挿入には、最低でも1つの列の値が必要です。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1074
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1805
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2494
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2524
-#, java-format
-msgid "The JVM claims not to support the encoding: {0}"
-msgstr "JVMでサポートされないエンコーディングです: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1078
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1121
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1534
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1663
-msgid "Provided InputStream failed."
-msgstr "提供の InputStream は失敗しました。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1191
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3137
-msgid "Provided Reader failed."
-msgstr "提供の Reader は失敗しました。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1259
-msgid "Can''t refresh the insert row."
-msgstr "挿入行を回復することはできません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1327
-msgid "Cannot call updateRow() when on the insert row."
-msgstr "列を挿入したときに、updateRow() を呼び出すことができません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1333
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3190
-msgid ""
-"Cannot update the ResultSet because it is either before the start or after "
-"the end of the results."
-msgstr ""
-"開始前にResultSetを更新することができません、または結果の終わりの後です。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1582
-msgid "ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."
-msgstr "CONCUR_READ_ONLYを伴うResultSetsは更新できませんでした。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1650
-#, java-format
-msgid "No primary key found for table {0}."
-msgstr "テーブル {0} の主キーがありません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1876
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2965
-msgid "Fetch size must be a value greater to or equal to 0."
-msgstr "フェッチサイズは、0に等しいか、より以上の値でなくてはなりません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2044
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2051
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2098
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2106
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2926
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2934
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2964
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2971
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2991
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3002
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3020
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3038
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3179
-#: org/postgresql/jdbc2/TimestampUtils.java:258
-#, java-format
-msgid "Bad value for type {0} : {1}"
-msgstr "型 {0} : {1} で不正な値"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2727
-#, java-format
-msgid "The column name {0} was not found in this ResultSet."
-msgstr "ResultSet に列名 {0} は見つかりませんでした。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2827
-msgid ""
-"ResultSet is not updateable. The query that generated this result set must "
-"select only one table, and must select all primary keys from that table. See "
-"the JDBC 2.1 API Specification, section 5.6 for more details."
-msgstr ""
-"ResultSetは変更可能ではありません。この結果セットを生成したクエリーは、ただ一"
-"つのテーブルを選ばなくてはいけません、そしてそのテーブルから全ての主キーを選"
-"ばなくてはいけません。より多くの詳細に関して JDBC 2.1 API仕様、章 5.6 を参照"
-"して下さい。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2839
-msgid "This ResultSet is closed."
-msgstr "ResultSetは閉じられました。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2860
-msgid "ResultSet not positioned properly, perhaps you need to call next."
-msgstr ""
-"ResultSetは適切に配置されませんでした、たぶん、次に呼ぶ必要があります。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:259
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:323
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:392
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2655
-msgid ""
-"Can''t use query methods that take a query string on a PreparedStatement."
-msgstr "PreparedStatementでクエリー文字を含むクエリー方法は使えません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:287
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:306
-msgid "Multiple ResultSets were returned by the query."
-msgstr "クエリーで、マルチのResultSetsが返されました。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:425
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:429
-msgid "A CallableStatement was executed with nothing returned."
-msgstr "CallableStatementは、戻りなしで実行されました。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:437
-msgid "A CallableStatement was executed with an invalid number of parameters"
-msgstr "CallableStatementは、パラメーターの不正な数で実行されました"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:468
-#, java-format
-msgid ""
-"A CallableStatement function was executed and the out parameter {0} was of "
-"type {1} however type {2} was registered."
-msgstr ""
-"CallableStatement機能は実行されました、そして、出力パラメーター {0} は、型 "
-"{1} です。しかし、型 {2} が登録されました。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:674
-msgid "Maximum number of rows must be a value grater than or equal to 0."
-msgstr "行の最大数は、0に等しいか、より以上の値でなくてはなりません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:717
-msgid "Query timeout must be a value greater than or equals to 0."
-msgstr ""
-"クエリータイムアウトは、0に等しいか、より以上の値でなくてはなりません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:809
-msgid "The maximum field size must be a value greater than or equal to 0."
-msgstr "最大の項目サイズは、0に等しいか、または以上の値でなくてはなりません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1226
-msgid "Unknown Types value."
-msgstr "未知の型の値です。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1499
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1624
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3108
-#, java-format
-msgid "Invalid stream length {0}."
-msgstr "無効なストリーム長 {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1530
-#, java-format
-msgid "The JVM claims not to support the {0} encoding."
-msgstr "JVMは、エンコーディング {0} をサポートしません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1705
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3030
-#, java-format
-msgid "Unknown type {0}."
-msgstr "未知の型 {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1720
-msgid "No hstore extension installed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1845
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1851
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1857
-#, java-format
-msgid "Cannot cast an instance of {0} to type {1}"
-msgstr "インスタンス {0} は型 {1} へのキャストはできません"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1869
-#, java-format
-msgid "Unsupported Types value: {0}"
-msgstr "サポートされない型の値: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1927
-#, java-format
-msgid ""
-"Can''t infer the SQL type to use for an instance of {0}. Use setObject() "
-"with an explicit Types value to specify the type to use."
-msgstr ""
-"{0} で使うべきSQL型を推測できません。明確な型値で記述した setObject() を使っ"
-"てください。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1975
-msgid ""
-"This statement does not declare an OUT parameter. Use '{' ?= call ... '}' "
-"to declare one."
-msgstr ""
-"ステートメントは、OUTパラメーターを宣言しません。'{' ?= call ... '}' を使って"
-"宣言して下さい。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2025
-msgid "wasNull cannot be call before fetching a result."
-msgstr "wasNullは、結果フェッチ前に呼び出せません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2521
-#, java-format
-msgid "Malformed function or procedure escape syntax at offset {0}."
-msgstr "奇形の関数または手順は、位置 {0} で文法を逸しました。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2571
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2585
-#, java-format
-msgid ""
-"Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was "
-"made."
-msgstr ""
-"型 {0} のパラメータは登録されました,、しかし、{1} 取得呼び出し(sqltype={2})"
-"が作られました。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2604
-msgid ""
-"A CallableStatement was declared, but no call to registerOutParameter(1, "
-"<some type>) was made."
-msgstr ""
-"CallableStatementは宣言されました、しかし registerOutParameterwas(1, <some "
-"type>) のいかなる呼び出しも作られません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2608
-msgid "No function outputs were registered."
-msgstr "関数出力は登録されませんでした。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2611
-msgid ""
-"Results cannot be retrieved from a CallableStatement before it is executed."
-msgstr "実行される前に、CallableStatement から結果を得ることはできません。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2644
-msgid "This statement has been closed."
-msgstr "このステートメントは閉じられました。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2724
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2794
-msgid "Too many update results were returned."
-msgstr "多すぎる更新結果が返されました。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2753
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2823
-#, java-format
-msgid ""
-"Batch entry {0} {1} was aborted. Call getNextException to see the cause."
-msgstr ""
-"バッチ投入 {0} {1} は停止しました、getNextExceptionを呼んで原因を見て下さい。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3078
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3167
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3207
-msgid "Unexpected error writing large object to database."
-msgstr ""
-"ラージオブジェクトをデータベースへ書き込み中に想定外のエラーが起きました。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:145
-#: org/postgresql/jdbc2/EscapedFunctions.java:157
-#: org/postgresql/jdbc2/EscapedFunctions.java:169
-#: org/postgresql/jdbc2/EscapedFunctions.java:206
-#: org/postgresql/jdbc2/EscapedFunctions.java:243
-#: org/postgresql/jdbc2/EscapedFunctions.java:267
-#: org/postgresql/jdbc2/EscapedFunctions.java:292
-#: org/postgresql/jdbc2/EscapedFunctions.java:316
-#: org/postgresql/jdbc2/EscapedFunctions.java:328
-#: org/postgresql/jdbc2/EscapedFunctions.java:352
-#: org/postgresql/jdbc2/EscapedFunctions.java:380
-#: org/postgresql/jdbc2/EscapedFunctions.java:389
-#: org/postgresql/jdbc2/EscapedFunctions.java:399
-#: org/postgresql/jdbc2/EscapedFunctions.java:408
-#: org/postgresql/jdbc2/EscapedFunctions.java:417
-#: org/postgresql/jdbc2/EscapedFunctions.java:426
-#: org/postgresql/jdbc2/EscapedFunctions.java:435
-#: org/postgresql/jdbc2/EscapedFunctions.java:444
-#: org/postgresql/jdbc2/EscapedFunctions.java:453
-#: org/postgresql/jdbc2/EscapedFunctions.java:462
-#: org/postgresql/jdbc2/EscapedFunctions.java:471
-#: org/postgresql/jdbc2/EscapedFunctions.java:480
-#, java-format
-msgid "{0} function takes one and only one argument."
-msgstr "{0} 関数は、単一の引数のみを用います。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:181
-#: org/postgresql/jdbc2/EscapedFunctions.java:193
-#: org/postgresql/jdbc2/EscapedFunctions.java:255
-#: org/postgresql/jdbc2/EscapedFunctions.java:304
-#: org/postgresql/jdbc2/EscapedFunctions.java:582
-#, java-format
-msgid "{0} function takes two and only two arguments."
-msgstr "{0} 関数は、二つの引数のみを用います。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:230
-#, java-format
-msgid "{0} function takes four and only four argument."
-msgstr "{0} 関数は、四つの引数のみを用います。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:282
-#: org/postgresql/jdbc2/EscapedFunctions.java:342
-#, java-format
-msgid "{0} function takes two or three arguments."
-msgstr "{0} 関数は、二つ、または三つの引数を用います。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:362
-#: org/postgresql/jdbc2/EscapedFunctions.java:371
-#: org/postgresql/jdbc2/EscapedFunctions.java:573
-#: org/postgresql/jdbc2/EscapedFunctions.java:591
-#, java-format
-msgid "{0} function doesn''t take any argument."
-msgstr "{0} 関数は、どのような引数も用いません。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:489
-#: org/postgresql/jdbc2/EscapedFunctions.java:531
-#, java-format
-msgid "{0} function takes three and only three arguments."
-msgstr "{0} 関数は、三つの引数のみを用います。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:501
-#: org/postgresql/jdbc2/EscapedFunctions.java:521
-#: org/postgresql/jdbc2/EscapedFunctions.java:523
-#: org/postgresql/jdbc2/EscapedFunctions.java:543
-#: org/postgresql/jdbc2/EscapedFunctions.java:564
-#: org/postgresql/jdbc2/EscapedFunctions.java:566
-#, java-format
-msgid "Interval {0} not yet implemented"
-msgstr "間隔 {0} はまだ装備されていません"
-
-#: org/postgresql/jdbc2/TimestampUtils.java:360
-msgid ""
-"Infinite value found for timestamp/date. This cannot be represented as time."
-msgstr ""
-"timestamp/date で無限値が見つかりました、これは、時間として表すことができませ"
-"ん。"
-
-#: org/postgresql/jdbc2/TimestampUtils.java:648
-#: org/postgresql/jdbc2/TimestampUtils.java:680
-#: org/postgresql/jdbc2/TimestampUtils.java:727
-#, fuzzy, java-format
-msgid "Unsupported binary encoding of {0}."
-msgstr "サポートされない型の値: {0}."
-
-#: org/postgresql/jdbc2/TypeInfoCache.java:161
-#, java-format
-msgid "The class {0} does not implement org.postgresql.util.PGobject."
-msgstr "クラス {0} は、org.postgresql.util.PGobject を装備していません。"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:60
-#, java-format
-msgid "Unknown ResultSet holdability setting: {0}."
-msgstr "未知の ResultSet 保持的設定: {0}"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:98
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:130
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:165
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:187
-msgid "Server versions prior to 8.0 do not support savepoints."
-msgstr "サーバーバージョン 8.0 以前は、savepointをサポートしません。"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:100
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:132
-msgid "Cannot establish a savepoint in auto-commit mode."
-msgstr "オートコミットモードでsavepointを確立できません。"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:419
-msgid "Returning autogenerated keys is not supported."
-msgstr "自動生成キーを返すことはサポートされていません。"
-
-#: org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java:81
-#, java-format
-msgid "The parameter index is out of range: {0}, number of parameters: {1}."
-msgstr "パラメーター・インデックスは範囲外です: {0} , パラメータ数: {1}"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:151
-msgid ""
-"Returning autogenerated keys is only supported for 8.2 and later servers."
-msgstr "自動生成キーの戻りは 8.2 以上でサポートされます。"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:199
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:317
-msgid "Returning autogenerated keys by column index is not supported."
-msgstr "列インデックスの自動生成キーの戻りはサポートされていません。"
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:38
-#: org/postgresql/jdbc3/PSQLSavepoint.java:50
-#: org/postgresql/jdbc3/PSQLSavepoint.java:66
-msgid "Cannot reference a savepoint after it has been released."
-msgstr "savepointは、解放された後で参照することはできません。"
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:42
-msgid "Cannot retrieve the id of a named savepoint."
-msgstr "名前の付いたsavepointのidを回収することができません。"
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:54
-msgid "Cannot retrieve the name of an unnamed savepoint."
-msgstr "名前のないsavepointを回収することができません。"
-
-#: org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java:37
-msgid "Invalid UUID data."
-msgstr "UUIDデータ不正です。"
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:83
-#, java-format
-msgid "Unable to find server array type for provided name {0}."
-msgstr "提供名 {0} で、サーバーの配列型を見つけることができません。"
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:121
-#, fuzzy, java-format
-msgid "Invalid timeout ({0}<0)."
-msgstr "無効なストリーム長 {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:134
-msgid "Validating connection."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:157
-#, fuzzy, java-format
-msgid "Failed to set ClientInfo property: {0}"
-msgstr "{0} へのオブジェクト生成に失敗しました。"
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:166
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:188
-msgid "ClientInfo property not supported."
-msgstr "ClientInfo プロパティはサポートされていません。"
-
-#: org/postgresql/jdbc4/AbstractJdbc4Statement.java:127
-msgid "Object is too large to send over the protocol."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:147
-msgid "Unable to decode xml data."
-msgstr "xmlデータを復号化できません。"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:150
-#, java-format
-msgid "Unknown XML Source class: {0}"
-msgstr "未知のXMLソースクラス: {0}"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:195
-msgid "Unable to create SAXResult for SQLXML."
-msgstr "SQLXMLへのSAXResult生成ができません。"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:209
-msgid "Unable to create StAXResult for SQLXML"
-msgstr "SQLXMLのStAXResultを生成できません。"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:213
-#, java-format
-msgid "Unknown XML Result class: {0}"
-msgstr "未知のXML結果クラス: {0}"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:226
-msgid "This SQLXML object has already been freed."
-msgstr "SQLXMLオブジェクトはすでに解放されました。"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:233
-msgid ""
-"This SQLXML object has not been initialized, so you cannot retrieve data "
-"from it."
-msgstr ""
-"このSQLXMLオブジェクトは、初期化されませんでした、そこからデータを回収するこ"
-"とができません。"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:244
-#, java-format
-msgid "Failed to convert binary xml data to encoding: {0}."
-msgstr "バイナリxmlデータをエンコード {0} に変換できません。"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:269
-msgid "Unable to convert DOMResult SQLXML data to a string."
-msgstr "DOMResult SQLXMLデータを文字列に変えることができません。"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:282
-msgid ""
-"This SQLXML object has already been initialized, so you cannot manipulate it "
-"further."
-msgstr ""
-"このSQLXMLオブジェクトは、すでに初期化されました、それ以上操作することができ"
-"ません。"
-
-#: org/postgresql/largeobject/LargeObjectManager.java:138
-msgid "Failed to initialize LargeObject API"
-msgstr "ラージオブジェクトAPIの初期化に失敗しました。"
-
-#: org/postgresql/largeobject/LargeObjectManager.java:257
-#: org/postgresql/largeobject/LargeObjectManager.java:298
-msgid "Large Objects may not be used in auto-commit mode."
-msgstr "ラージオブジェクトでは、オートコミットモードを使うことができません。"
-
-#: org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java:58
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:110
-#, java-format
-msgid "The SSLSocketFactory class provided {0} could not be instantiated."
-msgstr "提供のSSLSocketFactoryクラス {0} は、即応しないかもしれません。"
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:125
-#, java-format
-msgid "SSL error: {0}"
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:138
-#, fuzzy, java-format
-msgid "The HostnameVerifier class provided {0} could not be instantiated."
-msgstr "提供のSSLSocketFactoryクラス {0} は、即応しないかもしれません。"
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:142
-#, java-format
-msgid "The hostname {0} could not be verified by hostnameverifier {1}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:149
-#, fuzzy, java-format
-msgid "The hostname {0} could not be verified."
-msgstr "提供のSSLSocketFactoryクラス {0} は、即応しないかもしれません。"
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:121
-msgid ""
-"Could not find a java cryptographic algorithm: X.509 CertificateFactory not "
-"available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:132
-#, java-format
-msgid "Could not open SSL certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:137
-#, java-format
-msgid "Loading the SSL certificate {0} into a KeyManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:194
-msgid "Enter SSL password: "
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:202
-msgid "Could not read password for SSL key file, console is not available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:204
-#, java-format
-msgid "Could not read password for SSL key file by callbackhandler {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:223
-#, java-format
-msgid "Could not decrypt SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:231
-#, java-format
-msgid "Could not read SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:235
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:173
-#, java-format
-msgid "Could not find a java cryptographic algorithm: {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:99
-#, fuzzy, java-format
-msgid "The password callback class provided {0} could not be instantiated."
-msgstr "提供のSSLSocketFactoryクラス {0} は、即応しないかもしれません。"
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:133
-#, java-format
-msgid "Could not open SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:150
-#, java-format
-msgid "Could not read SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:153
-#, java-format
-msgid "Loading the SSL root certificate {0} into a TrustManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:166
-msgid "Could not initialize SSL context."
-msgstr ""
-
-#: org/postgresql/util/PGInterval.java:164
-msgid "Conversion of interval failed"
-msgstr "間隔の変換に失敗しました。"
-
-#: org/postgresql/util/PGmoney.java:73
-msgid "Conversion of money failed."
-msgstr "通貨の変換に失敗しました。"
-
-#: org/postgresql/util/ServerErrorMessage.java:155
-#, java-format
-msgid "Detail: {0}"
-msgstr "詳細l: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:159
-#, java-format
-msgid "Hint: {0}"
-msgstr "ヒント: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:162
-#, java-format
-msgid "Position: {0}"
-msgstr "ポジション: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:165
-#, java-format
-msgid "Where: {0}"
-msgstr "場所: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:171
-#, java-format
-msgid "Internal Query: {0}"
-msgstr "インターナル・クエリー: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:174
-#, java-format
-msgid "Internal Position: {0}"
-msgstr "インターナル・ポジション: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:180
-#, java-format
-msgid "Location: File: {0}, Routine: {1}, Line: {2}"
-msgstr "場所: ファイル: {0}, ルーチン: {1},行: {2}"
-
-#: org/postgresql/util/ServerErrorMessage.java:183
-#, java-format
-msgid "Server SQLState: {0}"
-msgstr "サーバー SQLState: {0}"
-
-#: org/postgresql/xa/PGXAConnection.java:148
-msgid ""
-"Transaction control methods setAutoCommit(true), commit, rollback and "
-"setSavePoint not allowed while an XA transaction is active."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:186
-#: org/postgresql/xa/PGXAConnection.java:245
-msgid "Invalid flags"
-msgstr "フラグ不正"
-
-#: org/postgresql/xa/PGXAConnection.java:189
-#: org/postgresql/xa/PGXAConnection.java:248
-#: org/postgresql/xa/PGXAConnection.java:425
-msgid "xid must not be null"
-msgstr "xidはnullではいけません"
-
-#: org/postgresql/xa/PGXAConnection.java:192
-msgid "Connection is busy with another transaction"
-msgstr "接続は、別のトランザクションで忙しいです"
-
-#: org/postgresql/xa/PGXAConnection.java:198
-#: org/postgresql/xa/PGXAConnection.java:255
-msgid "suspend/resume not implemented"
-msgstr "停止/再開 は装備されていません"
-
-#: org/postgresql/xa/PGXAConnection.java:204
-#: org/postgresql/xa/PGXAConnection.java:207
-#: org/postgresql/xa/PGXAConnection.java:209
-msgid "Transaction interleaving not implemented"
-msgstr "トランザクションの間に実施されませんでした。"
-
-#: org/postgresql/xa/PGXAConnection.java:218
-msgid "Error disabling autocommit"
-msgstr "オート・コミット無効エラー"
-
-#: org/postgresql/xa/PGXAConnection.java:251
-msgid "tried to call end without corresponding start call"
-msgstr "対応する開始呼び出しなしで、終了呼び出しを得ました。"
-
-#: org/postgresql/xa/PGXAConnection.java:282
-msgid ""
-"Not implemented: Prepare must be issued using the same connection that "
-"started the transaction"
-msgstr ""
-"装備されていません: 準備は、開始トランザクションと同じ接続で使わなくてはなり"
-"ません。"
-
-#: org/postgresql/xa/PGXAConnection.java:286
-msgid "Prepare called before end"
-msgstr "終了前に\"準備\"が呼ばれました"
-
-#: org/postgresql/xa/PGXAConnection.java:292
-msgid "Server versions prior to 8.1 do not support two-phase commit."
-msgstr "2フェーズ COMMIT は、サーババージョン 8.1以前はサポートされません。"
-
-#: org/postgresql/xa/PGXAConnection.java:313
-msgid "Error preparing transaction"
-msgstr "準備トランザクションエラー"
-
-#: org/postgresql/xa/PGXAConnection.java:328
-msgid "Invalid flag"
-msgstr "無効なフラグ"
-
-#: org/postgresql/xa/PGXAConnection.java:368
-msgid "Error during recover"
-msgstr "回復中にエラー"
-
-#: org/postgresql/xa/PGXAConnection.java:416
-msgid "Error rolling back prepared transaction"
-msgstr "準備トランザクションのロールバッグエラー"
-
-#: org/postgresql/xa/PGXAConnection.java:451
-msgid ""
-"Not implemented: one-phase commit must be issued using the same connection "
-"that was used to start it"
-msgstr ""
-"装備されていません: 単一フェーズのCOMMITは同じ接続を使って始めなければなりま"
-"せん。"
-
-#: org/postgresql/xa/PGXAConnection.java:455
-msgid "commit called before end"
-msgstr "終了の前に COMMIT を呼びました"
-
-#: org/postgresql/xa/PGXAConnection.java:466
-msgid "Error during one-phase commit"
-msgstr "単一フェーズのCOMMITの最中にエラー"
-
-#: org/postgresql/xa/PGXAConnection.java:487
-msgid ""
-"Not implemented: 2nd phase commit must be issued using an idle connection"
-msgstr ""
-"装備されていません: 第二フェーズの COMMIT は、待機接続で使わなくてはなりませ"
-"ん。"
-
-#: org/postgresql/xa/PGXAConnection.java:507
-msgid "Error committing prepared transaction"
-msgstr "準備トランザクションのコミットエラー"
-
-#: org/postgresql/xa/PGXAConnection.java:522
-msgid "Heuristic commit/rollback not supported"
-msgstr "サポートされない commit/rollback が見つかりました。"
-
-#~ msgid "The driver does not support SSL."
-#~ msgstr "ドライバはSSLをサポートしていません。"
-
-#~ msgid "Exception: {0}"
-#~ msgstr "例外: {0}."
-
-#~ msgid "Stack Trace:"
-#~ msgstr "スタック・トレース:"
-
-#~ msgid "End of Stack Trace"
-#~ msgstr "スタック・トレースの終り:"
-
-#~ msgid "Exception generating stacktrace for: {0} encountered: {1}"
-#~ msgstr "スタック・トレース例外生成: {0} 遭遇: {1}"
-
-#~ msgid "Multi-dimensional arrays are currently not supported."
-#~ msgstr "Mehrdimensionale Arrays werden derzeit nicht unterstützt."
-
-#~ msgid "rand function only takes zero or one argument(the seed)."
-#~ msgstr ""
-#~ "Die Funktion ''rand'' erwartet kein oder genau ein Argument (den "
-#~ "''seed'')."
-
-#~ msgid "suspend/resume and join not implemented"
-#~ msgstr "Anhalten/Fortsetzen und Join sind nicht implementiert."
-
-#~ msgid ""
-#~ "setNull(i,Types.OTHER) is not supported; use setObject(i,nullobject,Types."
-#~ "OTHER) instead."
-#~ msgstr ""
-#~ "''setNull(i, Types.OTHER)'' wird nicht unterstützt; benutzen Sie "
-#~ "stattdessen ''setObject(i, nullobject, Types.OTHER)''."
-
-#~ msgid ""
-#~ "setObject(i,null) is not supported. Instead, use setNull(i,type) or "
-#~ "setObject(i,null,type)"
-#~ msgstr ""
-#~ "''setObejct(i, null)'' ist nicht unterstützt. Benutzen Sie ''setNull(i, "
-#~ "type)'' oder ''setObject(i, null, type)'' stattdessen."
-
-#~ msgid ""
-#~ "Cannot call setXXX(1, ..) on a CallableStatement. This is an output that "
-#~ "must be configured with registerOutParameter instead."
-#~ msgstr ""
-#~ "''setXXX(1, ..)'' kann auf einem CallableStatement nicht aufgerufen "
-#~ "werden. Diese Ausgabe muss stattdessen mit ''registerOutParameter'' "
-#~ "konfiguriert werden."
-
-#~ msgid ""
-#~ "PostgreSQL only supports a single OUT function return value at index 1."
-#~ msgstr ""
-#~ "PostgreSQL unterstützt auf dem Index 1 nur einen einzigen Rückgabewert "
-#~ "für die OUT-Funktion."
-
-#, fuzzy
-#~ msgid "Conversion of circle failed: {0}."
-#~ msgstr "Konnte »{0}« nicht in Typ »circle« umwandeln"
-
-#, fuzzy
-#~ msgid "Conversion of line failed: {0}."
-#~ msgstr "Konnte »{0}« nicht in Typ »line« umwandeln"
-
-#, fuzzy
-#~ msgid "Conversion of point failed: {0}."
-#~ msgstr "Konnte »{0}« nicht in Typ »point« umwandeln"
-
-#, fuzzy
-#~ msgid "No results where returned by the query."
-#~ msgstr "Die Abfrage ergab kein Ergebnis."
-
-#, fuzzy
-#~ msgid "Bad byte: {0}"
-#~ msgstr "Ungültiges Format für Byte: {0}"
-
-#, fuzzy
-#~ msgid "Bad short: {0}"
-#~ msgstr "Ungültiges Format für Short: {0}"
-
-#, fuzzy
-#~ msgid "Bad int: {0}"
-#~ msgstr "Ungültiges Format für Long: {0}"
-
-#, fuzzy
-#~ msgid "Bad long: {0}"
-#~ msgstr "Ungültiges Format für Long: {0}"
-
-#, fuzzy
-#~ msgid "Bad BigDecimal: {0}"
-#~ msgstr "Ungültiges Format für BigDecimal: {0}"
-
-#, fuzzy
-#~ msgid "Bad float: {0}"
-#~ msgstr "Ungültiges Format für Float: {0}"
-
-#, fuzzy
-#~ msgid "Bad double: {0}"
-#~ msgstr "Ungültiges Format für Double: {0}"
-
-#, fuzzy
-#~ msgid "Bad date: {0}"
-#~ msgstr "Ungültiges Format für Byte: {0}"
diff --git a/org/postgresql/translation/messages_bg.class b/org/postgresql/translation/messages_bg.class
deleted file mode 100644
index c5d5f25..0000000
Binary files a/org/postgresql/translation/messages_bg.class and /dev/null differ
diff --git a/org/postgresql/translation/messages_cs.class b/org/postgresql/translation/messages_cs.class
deleted file mode 100644
index 707838c..0000000
Binary files a/org/postgresql/translation/messages_cs.class and /dev/null differ
diff --git a/org/postgresql/translation/messages_de.class b/org/postgresql/translation/messages_de.class
deleted file mode 100644
index 027be25..0000000
Binary files a/org/postgresql/translation/messages_de.class and /dev/null differ
diff --git a/org/postgresql/translation/messages_es.class b/org/postgresql/translation/messages_es.class
deleted file mode 100644
index ec6b800..0000000
Binary files a/org/postgresql/translation/messages_es.class and /dev/null differ
diff --git a/org/postgresql/translation/messages_fr.class b/org/postgresql/translation/messages_fr.class
deleted file mode 100644
index b516e96..0000000
Binary files a/org/postgresql/translation/messages_fr.class and /dev/null differ
diff --git a/org/postgresql/translation/messages_it.class b/org/postgresql/translation/messages_it.class
deleted file mode 100644
index 70d422f..0000000
Binary files a/org/postgresql/translation/messages_it.class and /dev/null differ
diff --git a/org/postgresql/translation/messages_ja.class b/org/postgresql/translation/messages_ja.class
deleted file mode 100644
index c23401f..0000000
Binary files a/org/postgresql/translation/messages_ja.class and /dev/null differ
diff --git a/org/postgresql/translation/messages_nl.class b/org/postgresql/translation/messages_nl.class
deleted file mode 100644
index d0e2ef2..0000000
Binary files a/org/postgresql/translation/messages_nl.class and /dev/null differ
diff --git a/org/postgresql/translation/messages_pl.class b/org/postgresql/translation/messages_pl.class
deleted file mode 100644
index 25cc37a..0000000
Binary files a/org/postgresql/translation/messages_pl.class and /dev/null differ
diff --git a/org/postgresql/translation/messages_pt_BR.class b/org/postgresql/translation/messages_pt_BR.class
deleted file mode 100644
index c877fd7..0000000
Binary files a/org/postgresql/translation/messages_pt_BR.class and /dev/null differ
diff --git a/org/postgresql/translation/messages_ru.class b/org/postgresql/translation/messages_ru.class
deleted file mode 100644
index 02011c6..0000000
Binary files a/org/postgresql/translation/messages_ru.class and /dev/null differ
diff --git a/org/postgresql/translation/messages_sr.class b/org/postgresql/translation/messages_sr.class
deleted file mode 100644
index bbc8378..0000000
Binary files a/org/postgresql/translation/messages_sr.class and /dev/null differ
diff --git a/org/postgresql/translation/messages_tr.class b/org/postgresql/translation/messages_tr.class
deleted file mode 100644
index 923630d..0000000
Binary files a/org/postgresql/translation/messages_tr.class and /dev/null differ
diff --git a/org/postgresql/translation/messages_zh_CN.class b/org/postgresql/translation/messages_zh_CN.class
deleted file mode 100644
index 71e1f27..0000000
Binary files a/org/postgresql/translation/messages_zh_CN.class and /dev/null differ
diff --git a/org/postgresql/translation/messages_zh_TW.class b/org/postgresql/translation/messages_zh_TW.class
deleted file mode 100644
index 07f72ee..0000000
Binary files a/org/postgresql/translation/messages_zh_TW.class and /dev/null differ
diff --git a/org/postgresql/translation/nl.po b/org/postgresql/translation/nl.po
deleted file mode 100644
index f6e5a58..0000000
--- a/org/postgresql/translation/nl.po
+++ /dev/null
@@ -1,1457 +0,0 @@
-# Dutch message translation for the PostgreSQL JDBC driver
-# This file is distributed under the same license as the package.
-#
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PostgreSQL JDBC Driver 8.0\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-10-31 13:37+0000\n"
-"PO-Revision-Date: 2004-10-11 23:55-0700\n"
-"Last-Translator: Arnout Kuiper <ajkuiper at wxs.nl>\n"
-"Language-Team: Dutch <ajkuiper at wxs.nl>\n"
-"Language: nl\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ISO-8859-1\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: org/postgresql/Driver.java.in:235
-msgid "Error loading default settings from driverconfig.properties"
-msgstr ""
-
-#: org/postgresql/Driver.java.in:282
-msgid ""
-"Your security policy has prevented the connection from being attempted. You "
-"probably need to grant the connect java.net.SocketPermission to the database "
-"server host and port that you wish to connect to."
-msgstr ""
-
-#: org/postgresql/Driver.java.in:287 org/postgresql/Driver.java.in:351
-msgid ""
-"Something unusual has occurred to cause the driver to fail. Please report "
-"this exception."
-msgstr ""
-"Iets ongewoons is opgetreden, wat deze driver doet falen. Rapporteer deze "
-"fout AUB: {0}"
-
-#: org/postgresql/Driver.java.in:359
-#, fuzzy
-msgid "Connection attempt timed out."
-msgstr "De poging om verbinding the maken faalde omdat {0}"
-
-#: org/postgresql/Driver.java.in:372
-#, fuzzy
-msgid "Interrupted while attempting to connect."
-msgstr "Een fout trad op tijdens het ophalen van het authenticatie verzoek."
-
-#: org/postgresql/Driver.java.in:714
-#, fuzzy, java-format
-msgid "Method {0} is not yet implemented."
-msgstr "Deze methode is nog niet geimplementeerd"
-
-#: org/postgresql/copy/CopyManager.java:56
-#, java-format
-msgid "Requested CopyIn but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/CopyManager.java:67
-#, java-format
-msgid "Requested CopyOut but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:51
-#, fuzzy, java-format
-msgid "Copying from database failed: {0}"
-msgstr "Conversie van lseg faalde - {0}"
-
-#: org/postgresql/copy/PGCopyInputStream.java:67
-#: org/postgresql/copy/PGCopyOutputStream.java:90
-msgid "This copy stream is closed."
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:108
-msgid "Read from copy failed."
-msgstr ""
-
-#: org/postgresql/copy/PGCopyOutputStream.java:68
-#, java-format
-msgid "Cannot write to copy a byte of value {0}"
-msgstr ""
-
-#: org/postgresql/core/ConnectionFactory.java:69
-#, java-format
-msgid "A connection could not be made using the requested protocol {0}."
-msgstr ""
-
-#: org/postgresql/core/Oid.java:113
-#, java-format
-msgid "oid type {0} not known and not a number"
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:490
-#, java-format
-msgid "Premature end of input stream, expected {0} bytes, but only read {1}."
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:530
-#, java-format
-msgid "Expected an EOF from server, got: {0}"
-msgstr ""
-
-#: org/postgresql/core/SetupQueryRunner.java:86
-msgid "An unexpected result was returned by a query."
-msgstr "Een onverwacht resultaat werd teruggegeven door een query"
-
-#: org/postgresql/core/UTF8Encoding.java:28
-#, java-format
-msgid ""
-"Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:61
-#, java-format
-msgid "Illegal UTF-8 sequence: {0} bytes used to encode a {1} byte value: {2}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:98
-#: org/postgresql/core/UTF8Encoding.java:125
-#, java-format
-msgid "Illegal UTF-8 sequence: initial byte is {0}: {1}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:130
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is out of range: {0}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:145
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is a surrogate value: {0}"
-msgstr ""
-
-#: org/postgresql/core/Utils.java:95 org/postgresql/core/Utils.java:112
-msgid "Zero bytes may not occur in string parameters."
-msgstr ""
-
-#: org/postgresql/core/Utils.java:145
-msgid "Zero bytes may not occur in identifiers."
-msgstr ""
-
-#: org/postgresql/core/types/PGBigDecimal.java:63
-#: org/postgresql/core/types/PGBoolean.java:62
-#: org/postgresql/core/types/PGByte.java:63
-#: org/postgresql/core/types/PGDouble.java:64
-#: org/postgresql/core/types/PGFloat.java:64
-#: org/postgresql/core/types/PGInteger.java:61
-#: org/postgresql/core/types/PGLong.java:62
-#: org/postgresql/core/types/PGNumber.java:62
-#: org/postgresql/core/types/PGShort.java:58
-#: org/postgresql/core/types/PGString.java:73
-#, java-format
-msgid "Cannot convert an instance of {0} to type {1}"
-msgstr ""
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:66
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:74
-#, java-format
-msgid "Invalid sslmode value: {0}"
-msgstr ""
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:134
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:207
-msgid ""
-"Connection refused. Check that the hostname and port are correct and that "
-"the postmaster is accepting TCP/IP connections."
-msgstr ""
-"Verbinding geweigerd. Controleer dat de hostnaam en poort correct zijn, en "
-"dat de postmaster is opgestart met de -i vlag, welke TCP/IP networking "
-"aanzet."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:153
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:225
-#, fuzzy
-msgid "The connection attempt failed."
-msgstr "De poging om verbinding the maken faalde omdat {0}"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:175
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:246
-#, fuzzy
-msgid "The connection url is invalid."
-msgstr "De poging om verbinding the maken faalde omdat {0}"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:198
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:210
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:295
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:307
-msgid "The server does not support SSL."
-msgstr ""
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:223
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:320
-#, fuzzy
-msgid "An error occurred while setting up the SSL connection."
-msgstr "Een fout trad op tijdens het ophalen van het authenticatie verzoek."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:272
-#, java-format
-msgid "Connection rejected: {0}."
-msgstr ""
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:290
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:312
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:332
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:419
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:444
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:471
-msgid ""
-"The server requested password-based authentication, but no password was "
-"provided."
-msgstr ""
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:356
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:504
-#, fuzzy, java-format
-msgid ""
-"The authentication type {0} is not supported. Check that you have configured "
-"the pg_hba.conf file to include the client''s IP address or subnet, and that "
-"it is using an authentication scheme supported by the driver."
-msgstr ""
-"Het authenticatie type {0} wordt niet ondersteund. Controleer dat het IP "
-"adres of subnet van de client is geconfigureerd in de pg_hba.conf file, en "
-"dat het een authenticatie protocol gebruikt dat door de driver ondersteund "
-"wordt."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:362
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:400
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:510
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:553
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:599
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:609
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:618
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:626
-#: org/postgresql/gss/MakeGSS.java:158
-msgid "Protocol error. Session setup failed."
-msgstr ""
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:390
-#, java-format
-msgid "Backend start-up failed: {0}."
-msgstr ""
-
-#: org/postgresql/core/v2/FastpathParameterList.java:55
-#: org/postgresql/core/v2/FastpathParameterList.java:77
-#: org/postgresql/core/v2/FastpathParameterList.java:84
-#: org/postgresql/core/v2/SimpleParameterList.java:57
-#: org/postgresql/core/v2/SimpleParameterList.java:76
-#: org/postgresql/core/v2/SimpleParameterList.java:83
-#: org/postgresql/core/v2/SimpleParameterList.java:90
-#: org/postgresql/core/v3/CompositeParameterList.java:35
-#: org/postgresql/core/v3/SimpleParameterList.java:49
-#: org/postgresql/core/v3/SimpleParameterList.java:56
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2845
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java:419
-#, fuzzy, java-format
-msgid "The column index is out of range: {0}, number of columns: {1}."
-msgstr "De kolom index is buiten bereik."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:142
-#: org/postgresql/core/v2/SimpleParameterList.java:155
-#: org/postgresql/core/v3/SimpleParameterList.java:216
-#, fuzzy, java-format
-msgid "No value specified for parameter {0}."
-msgstr "Geen waarde opgegeven voor parameter {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:72
-#: org/postgresql/core/v2/QueryExecutorImpl.java:337
-#: org/postgresql/core/v3/QueryExecutorImpl.java:443
-#: org/postgresql/core/v3/QueryExecutorImpl.java:507
-#, java-format
-msgid "Expected command status BEGIN, got {0}."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:78
-#: org/postgresql/core/v3/QueryExecutorImpl.java:513
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1828
-#, java-format
-msgid "Unexpected command status: {0}."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:118
-#: org/postgresql/core/v2/QueryExecutorImpl.java:129
-#: org/postgresql/core/v2/QueryExecutorImpl.java:174
-#: org/postgresql/core/v2/QueryExecutorImpl.java:369
-#: org/postgresql/core/v3/QueryExecutorImpl.java:281
-#: org/postgresql/core/v3/QueryExecutorImpl.java:411
-#: org/postgresql/core/v3/QueryExecutorImpl.java:485
-#: org/postgresql/core/v3/QueryExecutorImpl.java:551
-#: org/postgresql/core/v3/QueryExecutorImpl.java:631
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2094
-#, fuzzy
-msgid "An I/O error occured while sending to the backend."
-msgstr "Een I/O fout trad op tijdens het zenden naar de achterkant - {0}"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:170
-#: org/postgresql/core/v2/QueryExecutorImpl.java:225
-#: org/postgresql/core/v2/QueryExecutorImpl.java:236
-#: org/postgresql/core/v3/QueryExecutorImpl.java:627
-#: org/postgresql/core/v3/QueryExecutorImpl.java:685
-#, fuzzy, java-format
-msgid "Unknown Response Type {0}."
-msgstr "Onbekend antwoord type {0}"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:430
-#: org/postgresql/core/v2/QueryExecutorImpl.java:475
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1857
-msgid "Ran out of memory retrieving query results."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:597
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2199
-#, java-format
-msgid "Unable to interpret the update count in command completion tag: {0}."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:610
-msgid "Copy not implemented for protocol version 2"
-msgstr ""
-
-#: org/postgresql/core/v3/CopyOperationImpl.java:56
-msgid "CommandComplete expected COPY but got: "
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:66
-msgid "Tried to obtain lock while already holding it"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:78
-msgid "Tried to break lock on database connection"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:93
-msgid "Interrupted while waiting to obtain lock on database connection"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:275
-msgid "Unable to bind parameter values for statement."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:726
-msgid "Database connection failed when starting copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:757
-msgid "Tried to cancel an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:794
-msgid "Database connection failed when canceling copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:799
-msgid "Missing expected error response to copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:801
-#, java-format
-msgid "Got {0} error responses to single copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:814
-msgid "Tried to end inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:827
-msgid "Database connection failed when ending copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:842
-#: org/postgresql/core/v3/QueryExecutorImpl.java:860
-msgid "Tried to write to an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:854
-#: org/postgresql/core/v3/QueryExecutorImpl.java:866
-msgid "Database connection failed when writing to copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:878
-msgid "Tried to read from inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:883
-msgid "Database connection failed when reading from copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:951
-#, java-format
-msgid "Received CommandComplete ''{0}'' without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:975
-#, java-format
-msgid "Got CopyInResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:988
-#, java-format
-msgid "Got CopyOutResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1003
-msgid "Got CopyData without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1005
-#, java-format
-msgid "Unexpected copydata from server for {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1056
-#, java-format
-msgid "Unexpected packet type during copy: {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1310
-#, java-format
-msgid ""
-"Bind message length {0} too long. This can be caused by very large or "
-"incorrect length specifications on InputStream parameters."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1925
-#, java-format
-msgid ""
-"The server''s client_encoding parameter was changed to {0}. The JDBC driver "
-"requires client_encoding to be UTF8 for correct operation."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1932
-#, java-format
-msgid ""
-"The server''s DateStyle parameter was changed to {0}. The JDBC driver "
-"requires DateStyle to begin with ISO for correct operation."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1945
-#, java-format
-msgid ""
-"The server''s standard_conforming_strings parameter was reported as {0}. The "
-"JDBC driver expected on or off."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2015
-msgid "The driver currently does not support COPY operations."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:112
-msgid "This PooledConnection has already been closed."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid ""
-"Connection has been closed automatically because a new connection was opened "
-"for the same PooledConnection or the PooledConnection has been closed."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid "Connection has been closed."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:442
-msgid "Statement has been closed."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:291
-msgid "Failed to setup DataSource."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:414
-msgid "DataSource has been closed."
-msgstr ""
-
-#: org/postgresql/fastpath/Fastpath.java:81
-#: org/postgresql/fastpath/Fastpath.java:128
-#, java-format
-msgid "Fastpath call {0} - No result was returned and we expected an integer."
-msgstr ""
-"Fastpath aanroep {0} - Geen resultaat werd teruggegeven, terwijl we een "
-"integer verwacht hadden."
-
-#: org/postgresql/fastpath/Fastpath.java:237
-#, java-format
-msgid "The fastpath function {0} is unknown."
-msgstr "De fastpath functie {0} is onbekend."
-
-#: org/postgresql/geometric/PGbox.java:83
-#: org/postgresql/geometric/PGcircle.java:82
-#: org/postgresql/geometric/PGcircle.java:91
-#: org/postgresql/geometric/PGline.java:80
-#: org/postgresql/geometric/PGlseg.java:77
-#: org/postgresql/geometric/PGpoint.java:85
-#, fuzzy, java-format
-msgid "Conversion to type {0} failed: {1}."
-msgstr "Conversie van line faalde - {0}"
-
-#: org/postgresql/geometric/PGpath.java:81
-#, fuzzy, java-format
-msgid "Cannot tell if path is open or closed: {0}."
-msgstr "Kan niet zeggen of path open of gesloten is."
-
-#: org/postgresql/gss/MakeGSS.java:47 org/postgresql/gss/MakeGSS.java:55
-#: org/postgresql/gss/MakeGSS.java:168
-msgid "GSS Authentication failed"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:153
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:790
-#, fuzzy, java-format
-msgid "The array index is out of range: {0}"
-msgstr "De kolom index is buiten bereik."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:168
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:807
-#, java-format
-msgid "The array index is out of range: {0}, number of elements: {1}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:196
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1982
-#: org/postgresql/util/HStoreConverter.java:34
-#: org/postgresql/util/HStoreConverter.java:61
-msgid ""
-"Invalid character data was found. This is most likely caused by stored data "
-"containing characters that are invalid for the character set the database "
-"was created in. The most common example of this is storing 8bit data in a "
-"SQL_ASCII database."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:73
-msgid ""
-"Truncation of large objects is only implemented in 8.3 and later servers."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:77
-msgid "Cannot truncate LOB to a negative length."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:81
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:235
-#, java-format
-msgid "PostgreSQL LOBs can only index to: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:231
-msgid "LOB positioning offsets start at 1."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:246
-msgid "free() was called on this LOB previously"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:225
-#, java-format
-msgid "Unsupported value for stringtype parameter: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:245
-msgid "unknownLength parameter value must be an integer"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:353
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:284
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:303
-#: org/postgresql/jdbc2/TypeInfoCache.java:201
-#: org/postgresql/jdbc2/TypeInfoCache.java:249
-#: org/postgresql/jdbc2/TypeInfoCache.java:287
-#: org/postgresql/jdbc2/TypeInfoCache.java:344
-#: org/postgresql/jdbc2/TypeInfoCache.java:348
-#: org/postgresql/jdbc2/TypeInfoCache.java:384
-#: org/postgresql/jdbc2/TypeInfoCache.java:388
-msgid "No results were returned by the query."
-msgstr "Geen resultaten werden teruggegeven door de query."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:367
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:336
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:368
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2702
-msgid "A result was returned when none was expected."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:519
-msgid "Custom type maps are not supported."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:567
-#, fuzzy, java-format
-msgid "Failed to create object for: {0}."
-msgstr "Kon geen object aanmaken voor {0} {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:629
-#, java-format
-msgid "Unable to load the class {0} responsible for the datatype {1}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:725
-msgid ""
-"Cannot change transaction read-only property in the middle of a transaction."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:813
-msgid "Cannot commit when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:822
-#, fuzzy
-msgid "This connection has been closed."
-msgstr "De poging om verbinding the maken faalde omdat {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:842
-msgid "Cannot rollback when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:929
-msgid ""
-"Cannot change transaction isolation level in the middle of a transaction."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:934
-#, java-format
-msgid "Transaction isolation level {0} not supported."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1001
-msgid "Finalizing a Connection that was never closed:"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1103
-msgid "Unable to translate data into the desired encoding."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:63
-msgid ""
-"Unable to determine a value for MaxIndexKeys due to missing system catalog "
-"data."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:86
-msgid "Unable to find name datatype in the system catalogs."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:235
-msgid ""
-"Operation requires a scrollable ResultSet, but this ResultSet is "
-"FORWARD_ONLY."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:416
-msgid "Unexpected error while decoding character data from a large object."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:462
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:491
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:525
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3129
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3174
-#, java-format
-msgid "Cannot convert the column of type {0} to requested type {1}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:744
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:768
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1892
-msgid "Can''t use relative move methods while on the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:788
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2956
-#, java-format
-msgid "Invalid fetch direction constant: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:802
-msgid "Cannot call cancelRowUpdates() when on the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:822
-msgid "Cannot call deleteRow() when on the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:828
-msgid ""
-"Currently positioned before the start of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:833
-msgid ""
-"Currently positioned after the end of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:838
-#, fuzzy
-msgid "There are no rows in this ResultSet."
-msgstr "De kolom naam {0} is niet gevonden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:885
-msgid "Not on the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:889
-msgid "You must specify at least one column value to insert a row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1074
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1805
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2494
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2524
-#, java-format
-msgid "The JVM claims not to support the encoding: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1078
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1121
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1534
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1663
-msgid "Provided InputStream failed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1191
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3137
-msgid "Provided Reader failed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1259
-msgid "Can''t refresh the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1327
-msgid "Cannot call updateRow() when on the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1333
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3190
-msgid ""
-"Cannot update the ResultSet because it is either before the start or after "
-"the end of the results."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1582
-msgid "ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1650
-#, java-format
-msgid "No primary key found for table {0}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1876
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2965
-msgid "Fetch size must be a value greater to or equal to 0."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2044
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2051
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2098
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2106
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2926
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2934
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2964
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2971
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2991
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3002
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3020
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3038
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3179
-#: org/postgresql/jdbc2/TimestampUtils.java:258
-#, java-format
-msgid "Bad value for type {0} : {1}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2727
-#, fuzzy, java-format
-msgid "The column name {0} was not found in this ResultSet."
-msgstr "De kolom naam {0} is niet gevonden."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2827
-msgid ""
-"ResultSet is not updateable. The query that generated this result set must "
-"select only one table, and must select all primary keys from that table. See "
-"the JDBC 2.1 API Specification, section 5.6 for more details."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2839
-msgid "This ResultSet is closed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2860
-msgid "ResultSet not positioned properly, perhaps you need to call next."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:259
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:323
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:392
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2655
-msgid ""
-"Can''t use query methods that take a query string on a PreparedStatement."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:287
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:306
-#, fuzzy
-msgid "Multiple ResultSets were returned by the query."
-msgstr "Geen resultaten werden teruggegeven door de query."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:425
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:429
-#, fuzzy
-msgid "A CallableStatement was executed with nothing returned."
-msgstr "Callable Statements worden op dit moment niet ondersteund."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:437
-#, fuzzy
-msgid "A CallableStatement was executed with an invalid number of parameters"
-msgstr "Callable Statements worden op dit moment niet ondersteund."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:468
-#, java-format
-msgid ""
-"A CallableStatement function was executed and the out parameter {0} was of "
-"type {1} however type {2} was registered."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:674
-msgid "Maximum number of rows must be a value grater than or equal to 0."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:717
-msgid "Query timeout must be a value greater than or equals to 0."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:809
-msgid "The maximum field size must be a value greater than or equal to 0."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1226
-msgid "Unknown Types value."
-msgstr "Onbekende Types waarde."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1499
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1624
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3108
-#, java-format
-msgid "Invalid stream length {0}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1530
-#, java-format
-msgid "The JVM claims not to support the {0} encoding."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1705
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3030
-#, fuzzy, java-format
-msgid "Unknown type {0}."
-msgstr "Onbekend antwoord type {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1720
-msgid "No hstore extension installed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1845
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1851
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1857
-#, java-format
-msgid "Cannot cast an instance of {0} to type {1}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1869
-#, fuzzy, java-format
-msgid "Unsupported Types value: {0}"
-msgstr "Onbekende Types waarde."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1927
-#, java-format
-msgid ""
-"Can''t infer the SQL type to use for an instance of {0}. Use setObject() "
-"with an explicit Types value to specify the type to use."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1975
-msgid ""
-"This statement does not declare an OUT parameter. Use '{' ?= call ... '}' "
-"to declare one."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2025
-msgid "wasNull cannot be call before fetching a result."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2521
-#, java-format
-msgid "Malformed function or procedure escape syntax at offset {0}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2571
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2585
-#, java-format
-msgid ""
-"Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was "
-"made."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2604
-msgid ""
-"A CallableStatement was declared, but no call to registerOutParameter(1, "
-"<some type>) was made."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2608
-msgid "No function outputs were registered."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2611
-msgid ""
-"Results cannot be retrieved from a CallableStatement before it is executed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2644
-msgid "This statement has been closed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2724
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2794
-#, fuzzy
-msgid "Too many update results were returned."
-msgstr "Geen resultaten werden teruggegeven door de query."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2753
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2823
-#, fuzzy, java-format
-msgid ""
-"Batch entry {0} {1} was aborted. Call getNextException to see the cause."
-msgstr "Batch invoer {0} {1} werd afgebroken."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3078
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3167
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3207
-msgid "Unexpected error writing large object to database."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:145
-#: org/postgresql/jdbc2/EscapedFunctions.java:157
-#: org/postgresql/jdbc2/EscapedFunctions.java:169
-#: org/postgresql/jdbc2/EscapedFunctions.java:206
-#: org/postgresql/jdbc2/EscapedFunctions.java:243
-#: org/postgresql/jdbc2/EscapedFunctions.java:267
-#: org/postgresql/jdbc2/EscapedFunctions.java:292
-#: org/postgresql/jdbc2/EscapedFunctions.java:316
-#: org/postgresql/jdbc2/EscapedFunctions.java:328
-#: org/postgresql/jdbc2/EscapedFunctions.java:352
-#: org/postgresql/jdbc2/EscapedFunctions.java:380
-#: org/postgresql/jdbc2/EscapedFunctions.java:389
-#: org/postgresql/jdbc2/EscapedFunctions.java:399
-#: org/postgresql/jdbc2/EscapedFunctions.java:408
-#: org/postgresql/jdbc2/EscapedFunctions.java:417
-#: org/postgresql/jdbc2/EscapedFunctions.java:426
-#: org/postgresql/jdbc2/EscapedFunctions.java:435
-#: org/postgresql/jdbc2/EscapedFunctions.java:444
-#: org/postgresql/jdbc2/EscapedFunctions.java:453
-#: org/postgresql/jdbc2/EscapedFunctions.java:462
-#: org/postgresql/jdbc2/EscapedFunctions.java:471
-#: org/postgresql/jdbc2/EscapedFunctions.java:480
-#, java-format
-msgid "{0} function takes one and only one argument."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:181
-#: org/postgresql/jdbc2/EscapedFunctions.java:193
-#: org/postgresql/jdbc2/EscapedFunctions.java:255
-#: org/postgresql/jdbc2/EscapedFunctions.java:304
-#: org/postgresql/jdbc2/EscapedFunctions.java:582
-#, java-format
-msgid "{0} function takes two and only two arguments."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:230
-#, java-format
-msgid "{0} function takes four and only four argument."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:282
-#: org/postgresql/jdbc2/EscapedFunctions.java:342
-#, java-format
-msgid "{0} function takes two or three arguments."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:362
-#: org/postgresql/jdbc2/EscapedFunctions.java:371
-#: org/postgresql/jdbc2/EscapedFunctions.java:573
-#: org/postgresql/jdbc2/EscapedFunctions.java:591
-#, java-format
-msgid "{0} function doesn''t take any argument."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:489
-#: org/postgresql/jdbc2/EscapedFunctions.java:531
-#, java-format
-msgid "{0} function takes three and only three arguments."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:501
-#: org/postgresql/jdbc2/EscapedFunctions.java:521
-#: org/postgresql/jdbc2/EscapedFunctions.java:523
-#: org/postgresql/jdbc2/EscapedFunctions.java:543
-#: org/postgresql/jdbc2/EscapedFunctions.java:564
-#: org/postgresql/jdbc2/EscapedFunctions.java:566
-#, fuzzy, java-format
-msgid "Interval {0} not yet implemented"
-msgstr "Deze methode is nog niet geimplementeerd"
-
-#: org/postgresql/jdbc2/TimestampUtils.java:360
-msgid ""
-"Infinite value found for timestamp/date. This cannot be represented as time."
-msgstr ""
-
-#: org/postgresql/jdbc2/TimestampUtils.java:648
-#: org/postgresql/jdbc2/TimestampUtils.java:680
-#: org/postgresql/jdbc2/TimestampUtils.java:727
-#, fuzzy, java-format
-msgid "Unsupported binary encoding of {0}."
-msgstr "Onbekende Types waarde."
-
-#: org/postgresql/jdbc2/TypeInfoCache.java:161
-#, java-format
-msgid "The class {0} does not implement org.postgresql.util.PGobject."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:60
-#, java-format
-msgid "Unknown ResultSet holdability setting: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:98
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:130
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:165
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:187
-msgid "Server versions prior to 8.0 do not support savepoints."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:100
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:132
-msgid "Cannot establish a savepoint in auto-commit mode."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:419
-msgid "Returning autogenerated keys is not supported."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java:81
-#, fuzzy, java-format
-msgid "The parameter index is out of range: {0}, number of parameters: {1}."
-msgstr "De kolom index is buiten bereik."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:151
-msgid ""
-"Returning autogenerated keys is only supported for 8.2 and later servers."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:199
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:317
-msgid "Returning autogenerated keys by column index is not supported."
-msgstr ""
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:38
-#: org/postgresql/jdbc3/PSQLSavepoint.java:50
-#: org/postgresql/jdbc3/PSQLSavepoint.java:66
-msgid "Cannot reference a savepoint after it has been released."
-msgstr ""
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:42
-msgid "Cannot retrieve the id of a named savepoint."
-msgstr ""
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:54
-msgid "Cannot retrieve the name of an unnamed savepoint."
-msgstr ""
-
-#: org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java:37
-msgid "Invalid UUID data."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:83
-#, java-format
-msgid "Unable to find server array type for provided name {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:121
-#, java-format
-msgid "Invalid timeout ({0}<0)."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:134
-msgid "Validating connection."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:157
-#, fuzzy, java-format
-msgid "Failed to set ClientInfo property: {0}"
-msgstr "Kon geen object aanmaken voor {0} {1}"
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:166
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:188
-msgid "ClientInfo property not supported."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Statement.java:127
-msgid "Object is too large to send over the protocol."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:147
-msgid "Unable to decode xml data."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:150
-#, java-format
-msgid "Unknown XML Source class: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:195
-#, fuzzy
-msgid "Unable to create SAXResult for SQLXML."
-msgstr "Kon geen object aanmaken voor {0} {1}"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:209
-msgid "Unable to create StAXResult for SQLXML"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:213
-#, java-format
-msgid "Unknown XML Result class: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:226
-msgid "This SQLXML object has already been freed."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:233
-msgid ""
-"This SQLXML object has not been initialized, so you cannot retrieve data "
-"from it."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:244
-#, java-format
-msgid "Failed to convert binary xml data to encoding: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:269
-msgid "Unable to convert DOMResult SQLXML data to a string."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:282
-msgid ""
-"This SQLXML object has already been initialized, so you cannot manipulate it "
-"further."
-msgstr ""
-
-#: org/postgresql/largeobject/LargeObjectManager.java:138
-#, fuzzy
-msgid "Failed to initialize LargeObject API"
-msgstr "Kon LargeObject API niet initialiseren"
-
-#: org/postgresql/largeobject/LargeObjectManager.java:257
-#: org/postgresql/largeobject/LargeObjectManager.java:298
-msgid "Large Objects may not be used in auto-commit mode."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java:58
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:110
-#, java-format
-msgid "The SSLSocketFactory class provided {0} could not be instantiated."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:125
-#, java-format
-msgid "SSL error: {0}"
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:138
-#, java-format
-msgid "The HostnameVerifier class provided {0} could not be instantiated."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:142
-#, java-format
-msgid "The hostname {0} could not be verified by hostnameverifier {1}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:149
-#, java-format
-msgid "The hostname {0} could not be verified."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:121
-msgid ""
-"Could not find a java cryptographic algorithm: X.509 CertificateFactory not "
-"available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:132
-#, java-format
-msgid "Could not open SSL certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:137
-#, java-format
-msgid "Loading the SSL certificate {0} into a KeyManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:194
-msgid "Enter SSL password: "
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:202
-msgid "Could not read password for SSL key file, console is not available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:204
-#, java-format
-msgid "Could not read password for SSL key file by callbackhandler {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:223
-#, java-format
-msgid "Could not decrypt SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:231
-#, java-format
-msgid "Could not read SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:235
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:173
-#, java-format
-msgid "Could not find a java cryptographic algorithm: {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:99
-#, java-format
-msgid "The password callback class provided {0} could not be instantiated."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:133
-#, java-format
-msgid "Could not open SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:150
-#, java-format
-msgid "Could not read SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:153
-#, java-format
-msgid "Loading the SSL root certificate {0} into a TrustManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:166
-msgid "Could not initialize SSL context."
-msgstr ""
-
-#: org/postgresql/util/PGInterval.java:164
-#, fuzzy
-msgid "Conversion of interval failed"
-msgstr "Conversie van money faalde - {0}."
-
-#: org/postgresql/util/PGmoney.java:73
-#, fuzzy
-msgid "Conversion of money failed."
-msgstr "Conversie van money faalde - {0}."
-
-#: org/postgresql/util/ServerErrorMessage.java:155
-#, java-format
-msgid "Detail: {0}"
-msgstr ""
-
-#: org/postgresql/util/ServerErrorMessage.java:159
-#, java-format
-msgid "Hint: {0}"
-msgstr ""
-
-#: org/postgresql/util/ServerErrorMessage.java:162
-#, java-format
-msgid "Position: {0}"
-msgstr ""
-
-#: org/postgresql/util/ServerErrorMessage.java:165
-#, java-format
-msgid "Where: {0}"
-msgstr ""
-
-#: org/postgresql/util/ServerErrorMessage.java:171
-#, java-format
-msgid "Internal Query: {0}"
-msgstr ""
-
-#: org/postgresql/util/ServerErrorMessage.java:174
-#, java-format
-msgid "Internal Position: {0}"
-msgstr ""
-
-#: org/postgresql/util/ServerErrorMessage.java:180
-#, java-format
-msgid "Location: File: {0}, Routine: {1}, Line: {2}"
-msgstr ""
-
-#: org/postgresql/util/ServerErrorMessage.java:183
-#, java-format
-msgid "Server SQLState: {0}"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:148
-msgid ""
-"Transaction control methods setAutoCommit(true), commit, rollback and "
-"setSavePoint not allowed while an XA transaction is active."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:186
-#: org/postgresql/xa/PGXAConnection.java:245
-msgid "Invalid flags"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:189
-#: org/postgresql/xa/PGXAConnection.java:248
-#: org/postgresql/xa/PGXAConnection.java:425
-msgid "xid must not be null"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:192
-msgid "Connection is busy with another transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:198
-#: org/postgresql/xa/PGXAConnection.java:255
-#, fuzzy
-msgid "suspend/resume not implemented"
-msgstr "Deze methode is nog niet geimplementeerd"
-
-#: org/postgresql/xa/PGXAConnection.java:204
-#: org/postgresql/xa/PGXAConnection.java:207
-#: org/postgresql/xa/PGXAConnection.java:209
-msgid "Transaction interleaving not implemented"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:218
-msgid "Error disabling autocommit"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:251
-msgid "tried to call end without corresponding start call"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:282
-msgid ""
-"Not implemented: Prepare must be issued using the same connection that "
-"started the transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:286
-msgid "Prepare called before end"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:292
-msgid "Server versions prior to 8.1 do not support two-phase commit."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:313
-msgid "Error preparing transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:328
-msgid "Invalid flag"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:368
-msgid "Error during recover"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:416
-msgid "Error rolling back prepared transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:451
-msgid ""
-"Not implemented: one-phase commit must be issued using the same connection "
-"that was used to start it"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:455
-msgid "commit called before end"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:466
-msgid "Error during one-phase commit"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:487
-msgid ""
-"Not implemented: 2nd phase commit must be issued using an idle connection"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:507
-msgid "Error committing prepared transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:522
-msgid "Heuristic commit/rollback not supported"
-msgstr ""
-
-#, fuzzy
-#~ msgid "Conversion of box failed: {0}."
-#~ msgstr "Conversie van box faalde - {0}"
-
-#, fuzzy
-#~ msgid "Conversion of circle failed: {0}."
-#~ msgstr "Conversie van circle faalde - {0}"
-
-#, fuzzy
-#~ msgid "Conversion of point failed: {0}."
-#~ msgstr "Conversie van point faalde - {0}"
-
-#, fuzzy
-#~ msgid "No results where returned by the query."
-#~ msgstr "Geen resultaten werden teruggegeven door de query."
-
-#, fuzzy
-#~ msgid "Bad byte: {0}"
-#~ msgstr "Foute Byte {0}"
-
-#, fuzzy
-#~ msgid "Bad short: {0}"
-#~ msgstr "Foute Short {0}"
-
-#, fuzzy
-#~ msgid "Bad int: {0}"
-#~ msgstr "Foute Long {0}"
-
-#, fuzzy
-#~ msgid "Bad long: {0}"
-#~ msgstr "Foute Long {0}"
-
-#, fuzzy
-#~ msgid "Bad BigDecimal: {0}"
-#~ msgstr "Foute BigDecimal {0}"
-
-#, fuzzy
-#~ msgid "Bad float: {0}"
-#~ msgstr "Foute Float {0}"
-
-#, fuzzy
-#~ msgid "Bad double: {0}"
-#~ msgstr "Foute Double {0}"
-
-#, fuzzy
-#~ msgid "Bad date: {0}"
-#~ msgstr "Foute Byte {0}"
diff --git a/org/postgresql/translation/pl.po b/org/postgresql/translation/pl.po
deleted file mode 100644
index a95dfe4..0000000
--- a/org/postgresql/translation/pl.po
+++ /dev/null
@@ -1,1444 +0,0 @@
-# translation of head-pl.po to
-# translation of head-pl.po to Polish
-# Polish message translation for the PostgreSQL JDBC driver
-# This file is distributed under the same license as the package.
-#
-# Piotr Maj <piotr.maj at kernelpanic.pl>
-# Jarosław Jan Pyszny <jarek at pyszny.net>, 2005.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: head-pl\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-10-31 13:37+0000\n"
-"PO-Revision-Date: 2005-05-22 03:01+0200\n"
-"Last-Translator: Jarosław Jan Pyszny <jarek at pyszny.net>\n"
-"Language-Team: <pl at li.org>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: KBabel 1.10\n"
-"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n"
-"%100<10 || n%100>=20) ? 1 : 2);\n"
-
-#: org/postgresql/Driver.java.in:235
-msgid "Error loading default settings from driverconfig.properties"
-msgstr "Błąd podczas wczytywania ustawień domyślnych z driverconfig.properties"
-
-#: org/postgresql/Driver.java.in:282
-msgid ""
-"Your security policy has prevented the connection from being attempted. You "
-"probably need to grant the connect java.net.SocketPermission to the database "
-"server host and port that you wish to connect to."
-msgstr ""
-
-#: org/postgresql/Driver.java.in:287 org/postgresql/Driver.java.in:351
-msgid ""
-"Something unusual has occurred to cause the driver to fail. Please report "
-"this exception."
-msgstr "Coś niezwykłego spowodowało pad sterownika. Proszę, zgłoś ten wyjątek."
-
-#: org/postgresql/Driver.java.in:359
-msgid "Connection attempt timed out."
-msgstr ""
-
-#: org/postgresql/Driver.java.in:372
-msgid "Interrupted while attempting to connect."
-msgstr ""
-
-#: org/postgresql/Driver.java.in:714
-#, java-format
-msgid "Method {0} is not yet implemented."
-msgstr "Metoda {0}nie jest jeszcze obsługiwana."
-
-#: org/postgresql/copy/CopyManager.java:56
-#, java-format
-msgid "Requested CopyIn but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/CopyManager.java:67
-#, java-format
-msgid "Requested CopyOut but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:51
-#, java-format
-msgid "Copying from database failed: {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:67
-#: org/postgresql/copy/PGCopyOutputStream.java:90
-#, fuzzy
-msgid "This copy stream is closed."
-msgstr "Ten ResultSet jest zamknięty."
-
-#: org/postgresql/copy/PGCopyInputStream.java:108
-msgid "Read from copy failed."
-msgstr ""
-
-#: org/postgresql/copy/PGCopyOutputStream.java:68
-#, java-format
-msgid "Cannot write to copy a byte of value {0}"
-msgstr ""
-
-#: org/postgresql/core/ConnectionFactory.java:69
-#, java-format
-msgid "A connection could not be made using the requested protocol {0}."
-msgstr "Nie można było nawiązać połączenia stosując żądany protokołu {0}."
-
-#: org/postgresql/core/Oid.java:113
-#, java-format
-msgid "oid type {0} not known and not a number"
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:490
-#, java-format
-msgid "Premature end of input stream, expected {0} bytes, but only read {1}."
-msgstr ""
-"Przedwczesny koniec strumienia wejściowego, oczekiwano {0} bajtów, odczytano "
-"tylko {1}."
-
-#: org/postgresql/core/PGStream.java:530
-#, java-format
-msgid "Expected an EOF from server, got: {0}"
-msgstr ""
-
-#: org/postgresql/core/SetupQueryRunner.java:86
-msgid "An unexpected result was returned by a query."
-msgstr "Zapytanie zwróciło nieoczekiwany wynik."
-
-#: org/postgresql/core/UTF8Encoding.java:28
-#, java-format
-msgid ""
-"Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:61
-#, java-format
-msgid "Illegal UTF-8 sequence: {0} bytes used to encode a {1} byte value: {2}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:98
-#: org/postgresql/core/UTF8Encoding.java:125
-#, java-format
-msgid "Illegal UTF-8 sequence: initial byte is {0}: {1}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:130
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is out of range: {0}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:145
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is a surrogate value: {0}"
-msgstr ""
-
-#: org/postgresql/core/Utils.java:95 org/postgresql/core/Utils.java:112
-msgid "Zero bytes may not occur in string parameters."
-msgstr "Zerowe bajty nie mogą pojawiać się w parametrach typu łańcuch znakowy."
-
-#: org/postgresql/core/Utils.java:145
-#, fuzzy
-msgid "Zero bytes may not occur in identifiers."
-msgstr "Zerowe bajty nie mogą pojawiać się w parametrach typu łańcuch znakowy."
-
-#: org/postgresql/core/types/PGBigDecimal.java:63
-#: org/postgresql/core/types/PGBoolean.java:62
-#: org/postgresql/core/types/PGByte.java:63
-#: org/postgresql/core/types/PGDouble.java:64
-#: org/postgresql/core/types/PGFloat.java:64
-#: org/postgresql/core/types/PGInteger.java:61
-#: org/postgresql/core/types/PGLong.java:62
-#: org/postgresql/core/types/PGNumber.java:62
-#: org/postgresql/core/types/PGShort.java:58
-#: org/postgresql/core/types/PGString.java:73
-#, java-format
-msgid "Cannot convert an instance of {0} to type {1}"
-msgstr ""
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:66
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:74
-#, java-format
-msgid "Invalid sslmode value: {0}"
-msgstr ""
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:134
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:207
-msgid ""
-"Connection refused. Check that the hostname and port are correct and that "
-"the postmaster is accepting TCP/IP connections."
-msgstr ""
-"Połączenie odrzucone. Sprawdź, czy prawidłowo ustawiłeś nazwę hosta oraz "
-"port i upewnij się, czy postmaster przyjmuje połączenia TCP/IP."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:153
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:225
-msgid "The connection attempt failed."
-msgstr "Próba nawiązania połączenia nie powiodła się."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:175
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:246
-#, fuzzy
-msgid "The connection url is invalid."
-msgstr "Próba nawiązania połączenia nie powiodła się."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:198
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:210
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:295
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:307
-msgid "The server does not support SSL."
-msgstr "Serwer nie obsługuje SSL."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:223
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:320
-msgid "An error occurred while setting up the SSL connection."
-msgstr "Wystąpił błąd podczas ustanawiania połączenia SSL."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:272
-#, java-format
-msgid "Connection rejected: {0}."
-msgstr "Połączenie odrzucone: {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:290
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:312
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:332
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:419
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:444
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:471
-msgid ""
-"The server requested password-based authentication, but no password was "
-"provided."
-msgstr ""
-"Serwer zażądał uwierzytelnienia opartego na haśle, ale żadne hasło nie "
-"zostało dostarczone."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:356
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:504
-#, java-format
-msgid ""
-"The authentication type {0} is not supported. Check that you have configured "
-"the pg_hba.conf file to include the client''s IP address or subnet, and that "
-"it is using an authentication scheme supported by the driver."
-msgstr ""
-"Uwierzytelnienie typu {0} nie jest obsługiwane. Upewnij się, że "
-"skonfigurowałeś plik pg_hba.conf tak, że zawiera on adres IP lub podsieć "
-"klienta oraz że użyta metoda uwierzytelnienia jest wspierana przez ten "
-"sterownik."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:362
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:400
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:510
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:553
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:599
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:609
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:618
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:626
-#: org/postgresql/gss/MakeGSS.java:158
-msgid "Protocol error. Session setup failed."
-msgstr "Błąd protokołu. Nie udało się utworzyć sesji."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:390
-#, java-format
-msgid "Backend start-up failed: {0}."
-msgstr "Start serwera się nie powiódł: {0}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:55
-#: org/postgresql/core/v2/FastpathParameterList.java:77
-#: org/postgresql/core/v2/FastpathParameterList.java:84
-#: org/postgresql/core/v2/SimpleParameterList.java:57
-#: org/postgresql/core/v2/SimpleParameterList.java:76
-#: org/postgresql/core/v2/SimpleParameterList.java:83
-#: org/postgresql/core/v2/SimpleParameterList.java:90
-#: org/postgresql/core/v3/CompositeParameterList.java:35
-#: org/postgresql/core/v3/SimpleParameterList.java:49
-#: org/postgresql/core/v3/SimpleParameterList.java:56
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2845
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java:419
-#, java-format
-msgid "The column index is out of range: {0}, number of columns: {1}."
-msgstr "Indeks kolumny jest poza zakresem: {0}, liczba kolumn: {1}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:142
-#: org/postgresql/core/v2/SimpleParameterList.java:155
-#: org/postgresql/core/v3/SimpleParameterList.java:216
-#, java-format
-msgid "No value specified for parameter {0}."
-msgstr "Nie podano wartości dla parametru {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:72
-#: org/postgresql/core/v2/QueryExecutorImpl.java:337
-#: org/postgresql/core/v3/QueryExecutorImpl.java:443
-#: org/postgresql/core/v3/QueryExecutorImpl.java:507
-#, java-format
-msgid "Expected command status BEGIN, got {0}."
-msgstr "Spodziewano się statusu komendy BEGIN, otrzymano {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:78
-#: org/postgresql/core/v3/QueryExecutorImpl.java:513
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1828
-#, java-format
-msgid "Unexpected command status: {0}."
-msgstr "Nieoczekiwany status komendy: {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:118
-#: org/postgresql/core/v2/QueryExecutorImpl.java:129
-#: org/postgresql/core/v2/QueryExecutorImpl.java:174
-#: org/postgresql/core/v2/QueryExecutorImpl.java:369
-#: org/postgresql/core/v3/QueryExecutorImpl.java:281
-#: org/postgresql/core/v3/QueryExecutorImpl.java:411
-#: org/postgresql/core/v3/QueryExecutorImpl.java:485
-#: org/postgresql/core/v3/QueryExecutorImpl.java:551
-#: org/postgresql/core/v3/QueryExecutorImpl.java:631
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2094
-#, fuzzy
-msgid "An I/O error occured while sending to the backend."
-msgstr "Wystąpił błąd We/Wy podczas wysyłania do serwera."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:170
-#: org/postgresql/core/v2/QueryExecutorImpl.java:225
-#: org/postgresql/core/v2/QueryExecutorImpl.java:236
-#: org/postgresql/core/v3/QueryExecutorImpl.java:627
-#: org/postgresql/core/v3/QueryExecutorImpl.java:685
-#, java-format
-msgid "Unknown Response Type {0}."
-msgstr "Nieznany typ odpowiedzi {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:430
-#: org/postgresql/core/v2/QueryExecutorImpl.java:475
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1857
-msgid "Ran out of memory retrieving query results."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:597
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2199
-#, java-format
-msgid "Unable to interpret the update count in command completion tag: {0}."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:610
-msgid "Copy not implemented for protocol version 2"
-msgstr ""
-
-#: org/postgresql/core/v3/CopyOperationImpl.java:56
-msgid "CommandComplete expected COPY but got: "
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:66
-msgid "Tried to obtain lock while already holding it"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:78
-msgid "Tried to break lock on database connection"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:93
-msgid "Interrupted while waiting to obtain lock on database connection"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:275
-msgid "Unable to bind parameter values for statement."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:726
-msgid "Database connection failed when starting copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:757
-msgid "Tried to cancel an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:794
-msgid "Database connection failed when canceling copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:799
-msgid "Missing expected error response to copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:801
-#, java-format
-msgid "Got {0} error responses to single copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:814
-msgid "Tried to end inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:827
-msgid "Database connection failed when ending copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:842
-#: org/postgresql/core/v3/QueryExecutorImpl.java:860
-msgid "Tried to write to an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:854
-#: org/postgresql/core/v3/QueryExecutorImpl.java:866
-msgid "Database connection failed when writing to copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:878
-msgid "Tried to read from inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:883
-msgid "Database connection failed when reading from copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:951
-#, java-format
-msgid "Received CommandComplete ''{0}'' without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:975
-#, java-format
-msgid "Got CopyInResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:988
-#, java-format
-msgid "Got CopyOutResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1003
-msgid "Got CopyData without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1005
-#, fuzzy, java-format
-msgid "Unexpected copydata from server for {0}"
-msgstr "Nieoczekiwany status komendy: {0}."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1056
-#, java-format
-msgid "Unexpected packet type during copy: {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1310
-#, java-format
-msgid ""
-"Bind message length {0} too long. This can be caused by very large or "
-"incorrect length specifications on InputStream parameters."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1925
-#, java-format
-msgid ""
-"The server''s client_encoding parameter was changed to {0}. The JDBC driver "
-"requires client_encoding to be UTF8 for correct operation."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1932
-#, java-format
-msgid ""
-"The server''s DateStyle parameter was changed to {0}. The JDBC driver "
-"requires DateStyle to begin with ISO for correct operation."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1945
-#, java-format
-msgid ""
-"The server''s standard_conforming_strings parameter was reported as {0}. The "
-"JDBC driver expected on or off."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2015
-msgid "The driver currently does not support COPY operations."
-msgstr "Sterownik nie obsługuje aktualnie operacji COPY."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:112
-msgid "This PooledConnection has already been closed."
-msgstr "To PooledConnection zostało już zamknięte."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid ""
-"Connection has been closed automatically because a new connection was opened "
-"for the same PooledConnection or the PooledConnection has been closed."
-msgstr ""
-"Połączenie zostało zamknięte automatycznie, ponieważ nowe połączenie zostało "
-"otwarte dla tego samego PooledConnection lub PooledConnection zostało "
-"zamknięte."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid "Connection has been closed."
-msgstr "Połączenie zostało zamknięte."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:442
-msgid "Statement has been closed."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:291
-msgid "Failed to setup DataSource."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:414
-msgid "DataSource has been closed."
-msgstr "DataSource zostało zamknięte."
-
-#: org/postgresql/fastpath/Fastpath.java:81
-#: org/postgresql/fastpath/Fastpath.java:128
-#, java-format
-msgid "Fastpath call {0} - No result was returned and we expected an integer."
-msgstr ""
-"Wywołanie fastpath {0} - Nie otrzymano żadnego wyniku, a oczekiwano liczby "
-"całkowitej."
-
-#: org/postgresql/fastpath/Fastpath.java:237
-#, java-format
-msgid "The fastpath function {0} is unknown."
-msgstr "Funkcja fastpath {0} jest nieznana."
-
-#: org/postgresql/geometric/PGbox.java:83
-#: org/postgresql/geometric/PGcircle.java:82
-#: org/postgresql/geometric/PGcircle.java:91
-#: org/postgresql/geometric/PGline.java:80
-#: org/postgresql/geometric/PGlseg.java:77
-#: org/postgresql/geometric/PGpoint.java:85
-#, java-format
-msgid "Conversion to type {0} failed: {1}."
-msgstr "Konwersja do typu {0} nie powiodła się: {1}."
-
-#: org/postgresql/geometric/PGpath.java:81
-#, java-format
-msgid "Cannot tell if path is open or closed: {0}."
-msgstr "Nie można stwierdzić, czy ścieżka jest otwarta czy zamknięta: {0}."
-
-#: org/postgresql/gss/MakeGSS.java:47 org/postgresql/gss/MakeGSS.java:55
-#: org/postgresql/gss/MakeGSS.java:168
-msgid "GSS Authentication failed"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:153
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:790
-#, java-format
-msgid "The array index is out of range: {0}"
-msgstr "Indeks tablicy jest poza zakresem: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:168
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:807
-#, java-format
-msgid "The array index is out of range: {0}, number of elements: {1}."
-msgstr "Indeks tablicy jest poza zakresem: {0}, liczba elementów: {1}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:196
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1982
-#: org/postgresql/util/HStoreConverter.java:34
-#: org/postgresql/util/HStoreConverter.java:61
-msgid ""
-"Invalid character data was found. This is most likely caused by stored data "
-"containing characters that are invalid for the character set the database "
-"was created in. The most common example of this is storing 8bit data in a "
-"SQL_ASCII database."
-msgstr ""
-"Znaleziono nieprawidłowy znak. Najprawdopodobniej jest to spowodowane "
-"przechowywaniem w bazie znaków, które nie pasują do zestawu znaków wybranego "
-"podczas tworzenia bazy danych. Najczęstszy przykład to przechowywanie 8-"
-"bitowych znaków w bazie o kodowaniu SQL_ASCII."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:73
-msgid ""
-"Truncation of large objects is only implemented in 8.3 and later servers."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:77
-msgid "Cannot truncate LOB to a negative length."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:81
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:235
-#, java-format
-msgid "PostgreSQL LOBs can only index to: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:231
-msgid "LOB positioning offsets start at 1."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:246
-msgid "free() was called on this LOB previously"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:225
-#, fuzzy, java-format
-msgid "Unsupported value for stringtype parameter: {0}"
-msgstr "Nieznana wartość Types: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:245
-msgid "unknownLength parameter value must be an integer"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:353
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:284
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:303
-#: org/postgresql/jdbc2/TypeInfoCache.java:201
-#: org/postgresql/jdbc2/TypeInfoCache.java:249
-#: org/postgresql/jdbc2/TypeInfoCache.java:287
-#: org/postgresql/jdbc2/TypeInfoCache.java:344
-#: org/postgresql/jdbc2/TypeInfoCache.java:348
-#: org/postgresql/jdbc2/TypeInfoCache.java:384
-#: org/postgresql/jdbc2/TypeInfoCache.java:388
-msgid "No results were returned by the query."
-msgstr "Zapytanie nie zwróciło żadnych wyników."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:367
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:336
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:368
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2702
-msgid "A result was returned when none was expected."
-msgstr "Zwrócono wynik zapytania, choć nie był on oczekiwany."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:519
-msgid "Custom type maps are not supported."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:567
-#, java-format
-msgid "Failed to create object for: {0}."
-msgstr "Nie powiodło się utworzenie obiektu dla: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:629
-#, java-format
-msgid "Unable to load the class {0} responsible for the datatype {1}"
-msgstr ""
-"Nie jest możliwe załadowanie klasy {0} odpowiedzialnej za typ danych {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:725
-msgid ""
-"Cannot change transaction read-only property in the middle of a transaction."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:813
-msgid "Cannot commit when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:822
-#, fuzzy
-msgid "This connection has been closed."
-msgstr "Połączenie zostało zamknięte."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:842
-msgid "Cannot rollback when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:929
-msgid ""
-"Cannot change transaction isolation level in the middle of a transaction."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:934
-#, java-format
-msgid "Transaction isolation level {0} not supported."
-msgstr "Poziom izolacji transakcji {0} nie jest obsługiwany."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1001
-#, fuzzy
-msgid "Finalizing a Connection that was never closed:"
-msgstr "Połączenie zostało zamknięte."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1103
-msgid "Unable to translate data into the desired encoding."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:63
-msgid ""
-"Unable to determine a value for MaxIndexKeys due to missing system catalog "
-"data."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:86
-msgid "Unable to find name datatype in the system catalogs."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:235
-msgid ""
-"Operation requires a scrollable ResultSet, but this ResultSet is "
-"FORWARD_ONLY."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:416
-msgid "Unexpected error while decoding character data from a large object."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:462
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:491
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:525
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3129
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3174
-#, java-format
-msgid "Cannot convert the column of type {0} to requested type {1}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:744
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:768
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1892
-msgid "Can''t use relative move methods while on the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:788
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2956
-#, java-format
-msgid "Invalid fetch direction constant: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:802
-msgid "Cannot call cancelRowUpdates() when on the insert row."
-msgstr "Nie można wywołać cancelRowUpdates() na wstawianym rekordzie."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:822
-msgid "Cannot call deleteRow() when on the insert row."
-msgstr "Nie można wywołać deleteRow() na wstawianym rekordzie."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:828
-msgid ""
-"Currently positioned before the start of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"Aktualna pozycja przed początkiem ResultSet. Nie można wywołać deleteRow()."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:833
-msgid ""
-"Currently positioned after the end of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr "Aktualna pozycja za końcem ResultSet. Nie można wywołać deleteRow()."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:838
-msgid "There are no rows in this ResultSet."
-msgstr "Nie ma żadnych wierszy w tym ResultSet."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:885
-msgid "Not on the insert row."
-msgstr "Nie na wstawianym rekordzie."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:889
-msgid "You must specify at least one column value to insert a row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1074
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1805
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2494
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2524
-#, java-format
-msgid "The JVM claims not to support the encoding: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1078
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1121
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1534
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1663
-msgid "Provided InputStream failed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1191
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3137
-msgid "Provided Reader failed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1259
-msgid "Can''t refresh the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1327
-msgid "Cannot call updateRow() when on the insert row."
-msgstr "Nie można wywołać updateRow() na wstawianym rekordzie."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1333
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3190
-msgid ""
-"Cannot update the ResultSet because it is either before the start or after "
-"the end of the results."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1582
-msgid "ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1650
-#, java-format
-msgid "No primary key found for table {0}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1876
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2965
-msgid "Fetch size must be a value greater to or equal to 0."
-msgstr "Rozmiar pobierania musi być wartością dodatnią lub 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2044
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2051
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2098
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2106
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2926
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2934
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2964
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2971
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2991
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3002
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3020
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3038
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3179
-#: org/postgresql/jdbc2/TimestampUtils.java:258
-#, java-format
-msgid "Bad value for type {0} : {1}"
-msgstr "Zła wartość dla typu {0}: {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2727
-#, java-format
-msgid "The column name {0} was not found in this ResultSet."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2827
-msgid ""
-"ResultSet is not updateable. The query that generated this result set must "
-"select only one table, and must select all primary keys from that table. See "
-"the JDBC 2.1 API Specification, section 5.6 for more details."
-msgstr ""
-"ResultSet nie jest modyfikowalny (not updateable). Zapytanie, które zwróciło "
-"ten wynik musi dotyczyć tylko jednej tabeli oraz musi pobierać wszystkie "
-"klucze główne tej tabeli. Zobacz Specyfikację JDBC 2.1 API, rozdział 5.6, by "
-"uzyskać więcej szczegółów."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2839
-msgid "This ResultSet is closed."
-msgstr "Ten ResultSet jest zamknięty."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2860
-msgid "ResultSet not positioned properly, perhaps you need to call next."
-msgstr "Zła pozycja w ResultSet, może musisz wywołać next."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:259
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:323
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:392
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2655
-msgid ""
-"Can''t use query methods that take a query string on a PreparedStatement."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:287
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:306
-msgid "Multiple ResultSets were returned by the query."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:425
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:429
-msgid "A CallableStatement was executed with nothing returned."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:437
-msgid "A CallableStatement was executed with an invalid number of parameters"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:468
-#, java-format
-msgid ""
-"A CallableStatement function was executed and the out parameter {0} was of "
-"type {1} however type {2} was registered."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:674
-msgid "Maximum number of rows must be a value grater than or equal to 0."
-msgstr "Maksymalna liczba rekordów musi być wartością dodatnią lub 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:717
-msgid "Query timeout must be a value greater than or equals to 0."
-msgstr "Timeout zapytania musi być wartością dodatnią lub 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:809
-msgid "The maximum field size must be a value greater than or equal to 0."
-msgstr "Maksymalny rozmiar pola musi być wartością dodatnią lub 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1226
-msgid "Unknown Types value."
-msgstr "Nieznana wartość Types."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1499
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1624
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3108
-#, java-format
-msgid "Invalid stream length {0}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1530
-#, java-format
-msgid "The JVM claims not to support the {0} encoding."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1705
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3030
-#, java-format
-msgid "Unknown type {0}."
-msgstr "Nieznany typ {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1720
-msgid "No hstore extension installed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1845
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1851
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1857
-#, java-format
-msgid "Cannot cast an instance of {0} to type {1}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1869
-#, java-format
-msgid "Unsupported Types value: {0}"
-msgstr "Nieznana wartość Types: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1927
-#, java-format
-msgid ""
-"Can''t infer the SQL type to use for an instance of {0}. Use setObject() "
-"with an explicit Types value to specify the type to use."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1975
-msgid ""
-"This statement does not declare an OUT parameter. Use '{' ?= call ... '}' "
-"to declare one."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2025
-msgid "wasNull cannot be call before fetching a result."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2521
-#, java-format
-msgid "Malformed function or procedure escape syntax at offset {0}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2571
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2585
-#, java-format
-msgid ""
-"Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was "
-"made."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2604
-msgid ""
-"A CallableStatement was declared, but no call to registerOutParameter(1, "
-"<some type>) was made."
-msgstr ""
-"Funkcja CallableStatement została zadeklarowana, ale nie wywołano "
-"registerOutParameter (1, <jakiś typ>)."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2608
-msgid "No function outputs were registered."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2611
-msgid ""
-"Results cannot be retrieved from a CallableStatement before it is executed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2644
-msgid "This statement has been closed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2724
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2794
-msgid "Too many update results were returned."
-msgstr "Zapytanie nie zwróciło żadnych wyników."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2753
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2823
-#, java-format
-msgid ""
-"Batch entry {0} {1} was aborted. Call getNextException to see the cause."
-msgstr ""
-"Zadanie wsadowe {0} {1} zostało przerwane. Wywołaj getNextException by "
-"poznać przyczynę."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3078
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3167
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3207
-msgid "Unexpected error writing large object to database."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:145
-#: org/postgresql/jdbc2/EscapedFunctions.java:157
-#: org/postgresql/jdbc2/EscapedFunctions.java:169
-#: org/postgresql/jdbc2/EscapedFunctions.java:206
-#: org/postgresql/jdbc2/EscapedFunctions.java:243
-#: org/postgresql/jdbc2/EscapedFunctions.java:267
-#: org/postgresql/jdbc2/EscapedFunctions.java:292
-#: org/postgresql/jdbc2/EscapedFunctions.java:316
-#: org/postgresql/jdbc2/EscapedFunctions.java:328
-#: org/postgresql/jdbc2/EscapedFunctions.java:352
-#: org/postgresql/jdbc2/EscapedFunctions.java:380
-#: org/postgresql/jdbc2/EscapedFunctions.java:389
-#: org/postgresql/jdbc2/EscapedFunctions.java:399
-#: org/postgresql/jdbc2/EscapedFunctions.java:408
-#: org/postgresql/jdbc2/EscapedFunctions.java:417
-#: org/postgresql/jdbc2/EscapedFunctions.java:426
-#: org/postgresql/jdbc2/EscapedFunctions.java:435
-#: org/postgresql/jdbc2/EscapedFunctions.java:444
-#: org/postgresql/jdbc2/EscapedFunctions.java:453
-#: org/postgresql/jdbc2/EscapedFunctions.java:462
-#: org/postgresql/jdbc2/EscapedFunctions.java:471
-#: org/postgresql/jdbc2/EscapedFunctions.java:480
-#, java-format
-msgid "{0} function takes one and only one argument."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:181
-#: org/postgresql/jdbc2/EscapedFunctions.java:193
-#: org/postgresql/jdbc2/EscapedFunctions.java:255
-#: org/postgresql/jdbc2/EscapedFunctions.java:304
-#: org/postgresql/jdbc2/EscapedFunctions.java:582
-#, java-format
-msgid "{0} function takes two and only two arguments."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:230
-#, java-format
-msgid "{0} function takes four and only four argument."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:282
-#: org/postgresql/jdbc2/EscapedFunctions.java:342
-#, java-format
-msgid "{0} function takes two or three arguments."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:362
-#: org/postgresql/jdbc2/EscapedFunctions.java:371
-#: org/postgresql/jdbc2/EscapedFunctions.java:573
-#: org/postgresql/jdbc2/EscapedFunctions.java:591
-#, java-format
-msgid "{0} function doesn''t take any argument."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:489
-#: org/postgresql/jdbc2/EscapedFunctions.java:531
-#, java-format
-msgid "{0} function takes three and only three arguments."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:501
-#: org/postgresql/jdbc2/EscapedFunctions.java:521
-#: org/postgresql/jdbc2/EscapedFunctions.java:523
-#: org/postgresql/jdbc2/EscapedFunctions.java:543
-#: org/postgresql/jdbc2/EscapedFunctions.java:564
-#: org/postgresql/jdbc2/EscapedFunctions.java:566
-#, fuzzy, java-format
-msgid "Interval {0} not yet implemented"
-msgstr "Metoda {0}nie jest jeszcze obsługiwana."
-
-#: org/postgresql/jdbc2/TimestampUtils.java:360
-msgid ""
-"Infinite value found for timestamp/date. This cannot be represented as time."
-msgstr ""
-
-#: org/postgresql/jdbc2/TimestampUtils.java:648
-#: org/postgresql/jdbc2/TimestampUtils.java:680
-#: org/postgresql/jdbc2/TimestampUtils.java:727
-#, fuzzy, java-format
-msgid "Unsupported binary encoding of {0}."
-msgstr "Nieznana wartość Types: {0}"
-
-#: org/postgresql/jdbc2/TypeInfoCache.java:161
-#, java-format
-msgid "The class {0} does not implement org.postgresql.util.PGobject."
-msgstr "Klasa {0} nie implementuje org.postgresql.util.PGobject."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:60
-#, java-format
-msgid "Unknown ResultSet holdability setting: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:98
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:130
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:165
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:187
-msgid "Server versions prior to 8.0 do not support savepoints."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:100
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:132
-msgid "Cannot establish a savepoint in auto-commit mode."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:419
-msgid "Returning autogenerated keys is not supported."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java:81
-#, java-format
-msgid "The parameter index is out of range: {0}, number of parameters: {1}."
-msgstr "Indeks parametru jest poza zakresem: {0}, liczba parametrów: {1}."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:151
-msgid ""
-"Returning autogenerated keys is only supported for 8.2 and later servers."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:199
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:317
-msgid "Returning autogenerated keys by column index is not supported."
-msgstr ""
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:38
-#: org/postgresql/jdbc3/PSQLSavepoint.java:50
-#: org/postgresql/jdbc3/PSQLSavepoint.java:66
-msgid "Cannot reference a savepoint after it has been released."
-msgstr ""
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:42
-msgid "Cannot retrieve the id of a named savepoint."
-msgstr ""
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:54
-msgid "Cannot retrieve the name of an unnamed savepoint."
-msgstr ""
-
-#: org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java:37
-msgid "Invalid UUID data."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:83
-#, java-format
-msgid "Unable to find server array type for provided name {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:121
-#, java-format
-msgid "Invalid timeout ({0}<0)."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:134
-msgid "Validating connection."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:157
-#, fuzzy, java-format
-msgid "Failed to set ClientInfo property: {0}"
-msgstr "Nie powiodło się utworzenie obiektu dla: {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:166
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:188
-msgid "ClientInfo property not supported."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Statement.java:127
-msgid "Object is too large to send over the protocol."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:147
-msgid "Unable to decode xml data."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:150
-#, java-format
-msgid "Unknown XML Source class: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:195
-#, fuzzy
-msgid "Unable to create SAXResult for SQLXML."
-msgstr "Nie powiodło się utworzenie obiektu dla: {0}."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:209
-msgid "Unable to create StAXResult for SQLXML"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:213
-#, java-format
-msgid "Unknown XML Result class: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:226
-#, fuzzy
-msgid "This SQLXML object has already been freed."
-msgstr "To PooledConnection zostało już zamknięte."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:233
-msgid ""
-"This SQLXML object has not been initialized, so you cannot retrieve data "
-"from it."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:244
-#, java-format
-msgid "Failed to convert binary xml data to encoding: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:269
-msgid "Unable to convert DOMResult SQLXML data to a string."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:282
-msgid ""
-"This SQLXML object has already been initialized, so you cannot manipulate it "
-"further."
-msgstr ""
-
-#: org/postgresql/largeobject/LargeObjectManager.java:138
-msgid "Failed to initialize LargeObject API"
-msgstr "Nie udało się zainicjować LargeObject API"
-
-#: org/postgresql/largeobject/LargeObjectManager.java:257
-#: org/postgresql/largeobject/LargeObjectManager.java:298
-msgid "Large Objects may not be used in auto-commit mode."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java:58
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:110
-#, java-format
-msgid "The SSLSocketFactory class provided {0} could not be instantiated."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:125
-#, java-format
-msgid "SSL error: {0}"
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:138
-#, java-format
-msgid "The HostnameVerifier class provided {0} could not be instantiated."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:142
-#, java-format
-msgid "The hostname {0} could not be verified by hostnameverifier {1}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:149
-#, java-format
-msgid "The hostname {0} could not be verified."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:121
-msgid ""
-"Could not find a java cryptographic algorithm: X.509 CertificateFactory not "
-"available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:132
-#, java-format
-msgid "Could not open SSL certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:137
-#, java-format
-msgid "Loading the SSL certificate {0} into a KeyManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:194
-msgid "Enter SSL password: "
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:202
-msgid "Could not read password for SSL key file, console is not available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:204
-#, java-format
-msgid "Could not read password for SSL key file by callbackhandler {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:223
-#, java-format
-msgid "Could not decrypt SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:231
-#, java-format
-msgid "Could not read SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:235
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:173
-#, java-format
-msgid "Could not find a java cryptographic algorithm: {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:99
-#, java-format
-msgid "The password callback class provided {0} could not be instantiated."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:133
-#, java-format
-msgid "Could not open SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:150
-#, java-format
-msgid "Could not read SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:153
-#, java-format
-msgid "Loading the SSL root certificate {0} into a TrustManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:166
-msgid "Could not initialize SSL context."
-msgstr ""
-
-#: org/postgresql/util/PGInterval.java:164
-msgid "Conversion of interval failed"
-msgstr "Konwersja typu interval nie powiodła się"
-
-#: org/postgresql/util/PGmoney.java:73
-msgid "Conversion of money failed."
-msgstr "Konwersja typu money nie powiodła się."
-
-#: org/postgresql/util/ServerErrorMessage.java:155
-#, java-format
-msgid "Detail: {0}"
-msgstr "Szczegóły: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:159
-#, java-format
-msgid "Hint: {0}"
-msgstr "Wskazówka: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:162
-#, java-format
-msgid "Position: {0}"
-msgstr "Pozycja: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:165
-#, java-format
-msgid "Where: {0}"
-msgstr "Gdzie: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:171
-#, java-format
-msgid "Internal Query: {0}"
-msgstr "Wewnętrzne Zapytanie: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:174
-#, java-format
-msgid "Internal Position: {0}"
-msgstr "Wewnętrzna Pozycja: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:180
-#, java-format
-msgid "Location: File: {0}, Routine: {1}, Line: {2}"
-msgstr "Lokalizacja: Plik: {0}, Procedura: {1}, Linia: {2}"
-
-#: org/postgresql/util/ServerErrorMessage.java:183
-#, java-format
-msgid "Server SQLState: {0}"
-msgstr "Serwer SQLState: {0}"
-
-#: org/postgresql/xa/PGXAConnection.java:148
-msgid ""
-"Transaction control methods setAutoCommit(true), commit, rollback and "
-"setSavePoint not allowed while an XA transaction is active."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:186
-#: org/postgresql/xa/PGXAConnection.java:245
-msgid "Invalid flags"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:189
-#: org/postgresql/xa/PGXAConnection.java:248
-#: org/postgresql/xa/PGXAConnection.java:425
-msgid "xid must not be null"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:192
-msgid "Connection is busy with another transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:198
-#: org/postgresql/xa/PGXAConnection.java:255
-msgid "suspend/resume not implemented"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:204
-#: org/postgresql/xa/PGXAConnection.java:207
-#: org/postgresql/xa/PGXAConnection.java:209
-#, fuzzy
-msgid "Transaction interleaving not implemented"
-msgstr "Poziom izolacji transakcji {0} nie jest obsługiwany."
-
-#: org/postgresql/xa/PGXAConnection.java:218
-msgid "Error disabling autocommit"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:251
-msgid "tried to call end without corresponding start call"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:282
-msgid ""
-"Not implemented: Prepare must be issued using the same connection that "
-"started the transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:286
-msgid "Prepare called before end"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:292
-msgid "Server versions prior to 8.1 do not support two-phase commit."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:313
-msgid "Error preparing transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:328
-msgid "Invalid flag"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:368
-msgid "Error during recover"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:416
-msgid "Error rolling back prepared transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:451
-msgid ""
-"Not implemented: one-phase commit must be issued using the same connection "
-"that was used to start it"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:455
-msgid "commit called before end"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:466
-msgid "Error during one-phase commit"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:487
-msgid ""
-"Not implemented: 2nd phase commit must be issued using an idle connection"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:507
-msgid "Error committing prepared transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:522
-msgid "Heuristic commit/rollback not supported"
-msgstr ""
-
-#~ msgid "The driver does not support SSL."
-#~ msgstr "Sterownik nie wspiera SSL."
-
-#~ msgid "Multi-dimensional arrays are currently not supported."
-#~ msgstr "Wielowymiarowe tablice nie są aktualnie obsługiwane."
-
-#~ msgid "Exception: {0}"
-#~ msgstr "Wyjątek: {0}"
-
-#~ msgid "Stack Trace:"
-#~ msgstr "Ślad stosu:"
-
-#~ msgid "End of Stack Trace"
-#~ msgstr "Koniec śladu stosu"
-
-#~ msgid "Exception generating stacktrace for: {0} encountered: {1}"
-#~ msgstr "Ślad stosu utworzony dla wyjątku: {0} napotkanego: {1}"
diff --git a/org/postgresql/translation/pt_BR.po b/org/postgresql/translation/pt_BR.po
deleted file mode 100644
index 3123cfb..0000000
--- a/org/postgresql/translation/pt_BR.po
+++ /dev/null
@@ -1,1494 +0,0 @@
-# Brazilian Portuguese message translation for the PostgreSQL JDBC driver
-# This file is distributed under the same license as the package.
-#
-#
-# Euler Taveira de Oliveira <euler at timbira.com>, 2004-2009.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PostgreSQL 8.4\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-10-31 13:37+0000\n"
-"PO-Revision-Date: 2004-10-31 20:48-0300\n"
-"Last-Translator: Euler Taveira de Oliveira <euler at timbira.com>\n"
-"Language-Team: Brazilian Portuguese <pgbr-dev at listas.postgresql.org.br>\n"
-"Language: pt_BR\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: org/postgresql/Driver.java.in:235
-msgid "Error loading default settings from driverconfig.properties"
-msgstr "Erro ao carregar configurações padrão do driverconfig.properties"
-
-#: org/postgresql/Driver.java.in:282
-msgid ""
-"Your security policy has prevented the connection from being attempted. You "
-"probably need to grant the connect java.net.SocketPermission to the database "
-"server host and port that you wish to connect to."
-msgstr ""
-"Sua política de segurança impediu que a conexão pudesse ser estabelecida. "
-"Você provavelmente precisa conceder permissão em java.net.SocketPermission "
-"para a máquina e a porta do servidor de banco de dados que você deseja se "
-"conectar."
-
-#: org/postgresql/Driver.java.in:287 org/postgresql/Driver.java.in:351
-msgid ""
-"Something unusual has occurred to cause the driver to fail. Please report "
-"this exception."
-msgstr ""
-"Alguma coisa não usual ocorreu para causar a falha do driver. Por favor "
-"reporte esta exceção."
-
-#: org/postgresql/Driver.java.in:359
-msgid "Connection attempt timed out."
-msgstr "Tentativa de conexão falhou."
-
-#: org/postgresql/Driver.java.in:372
-msgid "Interrupted while attempting to connect."
-msgstr "Interrompido ao tentar se conectar."
-
-#: org/postgresql/Driver.java.in:714
-#, java-format
-msgid "Method {0} is not yet implemented."
-msgstr "Método {0} ainda não foi implementado."
-
-#: org/postgresql/copy/CopyManager.java:56
-#, java-format
-msgid "Requested CopyIn but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/CopyManager.java:67
-#, java-format
-msgid "Requested CopyOut but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:51
-#, java-format
-msgid "Copying from database failed: {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:67
-#: org/postgresql/copy/PGCopyOutputStream.java:90
-#, fuzzy
-msgid "This copy stream is closed."
-msgstr "Este ResultSet está fechado."
-
-#: org/postgresql/copy/PGCopyInputStream.java:108
-msgid "Read from copy failed."
-msgstr ""
-
-#: org/postgresql/copy/PGCopyOutputStream.java:68
-#, java-format
-msgid "Cannot write to copy a byte of value {0}"
-msgstr ""
-
-#: org/postgresql/core/ConnectionFactory.java:69
-#, java-format
-msgid "A connection could not be made using the requested protocol {0}."
-msgstr "A conexão não pode ser feita usando protocolo informado {0}."
-
-#: org/postgresql/core/Oid.java:113
-#, java-format
-msgid "oid type {0} not known and not a number"
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:490
-#, java-format
-msgid "Premature end of input stream, expected {0} bytes, but only read {1}."
-msgstr ""
-"Fim de entrada prematuro, eram esperados {0} bytes, mas somente {1} foram "
-"lidos."
-
-#: org/postgresql/core/PGStream.java:530
-#, java-format
-msgid "Expected an EOF from server, got: {0}"
-msgstr "Esperado um EOF do servidor, recebido: {0}"
-
-#: org/postgresql/core/SetupQueryRunner.java:86
-msgid "An unexpected result was returned by a query."
-msgstr "Um resultado inesperado foi retornado pela consulta."
-
-#: org/postgresql/core/UTF8Encoding.java:28
-#, java-format
-msgid ""
-"Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}"
-msgstr ""
-"Sequência UTF-8 ilegal: byte {0} da sequência de bytes {1} não é 10xxxxxx: "
-"{2}"
-
-#: org/postgresql/core/UTF8Encoding.java:61
-#, java-format
-msgid "Illegal UTF-8 sequence: {0} bytes used to encode a {1} byte value: {2}"
-msgstr ""
-"Sequência UTF-8 ilegal: {0} bytes utilizados para codificar um valor de {1} "
-"bytes: {2}"
-
-#: org/postgresql/core/UTF8Encoding.java:98
-#: org/postgresql/core/UTF8Encoding.java:125
-#, java-format
-msgid "Illegal UTF-8 sequence: initial byte is {0}: {1}"
-msgstr "Sequência UTF-8 ilegal: byte inicial é {0}: {1}"
-
-#: org/postgresql/core/UTF8Encoding.java:130
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is out of range: {0}"
-msgstr "Sequência UTF-8 ilegal: valor final está fora do intervalo: {0}"
-
-#: org/postgresql/core/UTF8Encoding.java:145
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is a surrogate value: {0}"
-msgstr "Sequência UTF-8 ilegal: valor final é um valor suplementar: {0}"
-
-#: org/postgresql/core/Utils.java:95 org/postgresql/core/Utils.java:112
-msgid "Zero bytes may not occur in string parameters."
-msgstr "Zero bytes não podem ocorrer em parâmetros de cadeia de caracteres."
-
-#: org/postgresql/core/Utils.java:145
-msgid "Zero bytes may not occur in identifiers."
-msgstr "Zero bytes não podem ocorrer em identificadores."
-
-#: org/postgresql/core/types/PGBigDecimal.java:63
-#: org/postgresql/core/types/PGBoolean.java:62
-#: org/postgresql/core/types/PGByte.java:63
-#: org/postgresql/core/types/PGDouble.java:64
-#: org/postgresql/core/types/PGFloat.java:64
-#: org/postgresql/core/types/PGInteger.java:61
-#: org/postgresql/core/types/PGLong.java:62
-#: org/postgresql/core/types/PGNumber.java:62
-#: org/postgresql/core/types/PGShort.java:58
-#: org/postgresql/core/types/PGString.java:73
-#, java-format
-msgid "Cannot convert an instance of {0} to type {1}"
-msgstr "Não pode converter uma instância de {0} para tipo {1}"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:66
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:74
-#, fuzzy, java-format
-msgid "Invalid sslmode value: {0}"
-msgstr "Tamanho de dado {0} é inválido."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:134
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:207
-msgid ""
-"Connection refused. Check that the hostname and port are correct and that "
-"the postmaster is accepting TCP/IP connections."
-msgstr ""
-"Conexão negada. Verifique se o nome da máquina e a porta estão corretos e se "
-"o postmaster está aceitando conexões TCP/IP."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:153
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:225
-msgid "The connection attempt failed."
-msgstr "A tentativa de conexão falhou."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:175
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:246
-#, fuzzy
-msgid "The connection url is invalid."
-msgstr "A tentativa de conexão falhou."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:198
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:210
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:295
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:307
-msgid "The server does not support SSL."
-msgstr "O servidor não suporta SSL."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:223
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:320
-msgid "An error occurred while setting up the SSL connection."
-msgstr "Um erro ocorreu ao estabelecer uma conexão SSL."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:272
-#, java-format
-msgid "Connection rejected: {0}."
-msgstr "Conexão negada: {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:290
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:312
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:332
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:419
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:444
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:471
-msgid ""
-"The server requested password-based authentication, but no password was "
-"provided."
-msgstr ""
-"O servidor pediu autenticação baseada em senha, mas nenhuma senha foi "
-"fornecida."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:356
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:504
-#, java-format
-msgid ""
-"The authentication type {0} is not supported. Check that you have configured "
-"the pg_hba.conf file to include the client''s IP address or subnet, and that "
-"it is using an authentication scheme supported by the driver."
-msgstr ""
-"O tipo de autenticação {0} não é suportado. Verifique se você configurou o "
-"arquivo pg_hba.conf incluindo a subrede ou endereço IP do cliente, e se está "
-"utilizando o esquema de autenticação suportado pelo driver."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:362
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:400
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:510
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:553
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:599
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:609
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:618
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:626
-#: org/postgresql/gss/MakeGSS.java:158
-msgid "Protocol error. Session setup failed."
-msgstr "Erro de Protocolo. Configuração da sessão falhou."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:390
-#, java-format
-msgid "Backend start-up failed: {0}."
-msgstr "Inicialização do processo servidor falhou: {0}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:55
-#: org/postgresql/core/v2/FastpathParameterList.java:77
-#: org/postgresql/core/v2/FastpathParameterList.java:84
-#: org/postgresql/core/v2/SimpleParameterList.java:57
-#: org/postgresql/core/v2/SimpleParameterList.java:76
-#: org/postgresql/core/v2/SimpleParameterList.java:83
-#: org/postgresql/core/v2/SimpleParameterList.java:90
-#: org/postgresql/core/v3/CompositeParameterList.java:35
-#: org/postgresql/core/v3/SimpleParameterList.java:49
-#: org/postgresql/core/v3/SimpleParameterList.java:56
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2845
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java:419
-#, java-format
-msgid "The column index is out of range: {0}, number of columns: {1}."
-msgstr ""
-"O índice da coluna está fora do intervalo: {0}, número de colunas: {1}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:142
-#: org/postgresql/core/v2/SimpleParameterList.java:155
-#: org/postgresql/core/v3/SimpleParameterList.java:216
-#, java-format
-msgid "No value specified for parameter {0}."
-msgstr "Nenhum valor especificado para parâmetro {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:72
-#: org/postgresql/core/v2/QueryExecutorImpl.java:337
-#: org/postgresql/core/v3/QueryExecutorImpl.java:443
-#: org/postgresql/core/v3/QueryExecutorImpl.java:507
-#, java-format
-msgid "Expected command status BEGIN, got {0}."
-msgstr "Status do comando BEGIN esperado, recebeu {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:78
-#: org/postgresql/core/v3/QueryExecutorImpl.java:513
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1828
-#, java-format
-msgid "Unexpected command status: {0}."
-msgstr "Status do comando inesperado: {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:118
-#: org/postgresql/core/v2/QueryExecutorImpl.java:129
-#: org/postgresql/core/v2/QueryExecutorImpl.java:174
-#: org/postgresql/core/v2/QueryExecutorImpl.java:369
-#: org/postgresql/core/v3/QueryExecutorImpl.java:281
-#: org/postgresql/core/v3/QueryExecutorImpl.java:411
-#: org/postgresql/core/v3/QueryExecutorImpl.java:485
-#: org/postgresql/core/v3/QueryExecutorImpl.java:551
-#: org/postgresql/core/v3/QueryExecutorImpl.java:631
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2094
-#, fuzzy
-msgid "An I/O error occured while sending to the backend."
-msgstr "Um erro de E/S ocorreu ao enviar para o processo servidor."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:170
-#: org/postgresql/core/v2/QueryExecutorImpl.java:225
-#: org/postgresql/core/v2/QueryExecutorImpl.java:236
-#: org/postgresql/core/v3/QueryExecutorImpl.java:627
-#: org/postgresql/core/v3/QueryExecutorImpl.java:685
-#, java-format
-msgid "Unknown Response Type {0}."
-msgstr "Tipo de Resposta Desconhecido {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:430
-#: org/postgresql/core/v2/QueryExecutorImpl.java:475
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1857
-msgid "Ran out of memory retrieving query results."
-msgstr "Memória insuficiente ao recuperar resultados da consulta."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:597
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2199
-#, java-format
-msgid "Unable to interpret the update count in command completion tag: {0}."
-msgstr ""
-"Não foi possível interpretar o contador de atualização na marcação de "
-"comando completo: {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:610
-msgid "Copy not implemented for protocol version 2"
-msgstr ""
-
-#: org/postgresql/core/v3/CopyOperationImpl.java:56
-msgid "CommandComplete expected COPY but got: "
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:66
-msgid "Tried to obtain lock while already holding it"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:78
-msgid "Tried to break lock on database connection"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:93
-#, fuzzy
-msgid "Interrupted while waiting to obtain lock on database connection"
-msgstr "Interrompido ao tentar se conectar."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:275
-msgid "Unable to bind parameter values for statement."
-msgstr "Não foi possível ligar valores de parâmetro ao comando."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:726
-msgid "Database connection failed when starting copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:757
-msgid "Tried to cancel an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:794
-msgid "Database connection failed when canceling copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:799
-msgid "Missing expected error response to copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:801
-#, java-format
-msgid "Got {0} error responses to single copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:814
-msgid "Tried to end inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:827
-msgid "Database connection failed when ending copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:842
-#: org/postgresql/core/v3/QueryExecutorImpl.java:860
-msgid "Tried to write to an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:854
-#: org/postgresql/core/v3/QueryExecutorImpl.java:866
-msgid "Database connection failed when writing to copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:878
-msgid "Tried to read from inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:883
-msgid "Database connection failed when reading from copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:951
-#, java-format
-msgid "Received CommandComplete ''{0}'' without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:975
-#, java-format
-msgid "Got CopyInResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:988
-#, java-format
-msgid "Got CopyOutResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1003
-msgid "Got CopyData without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1005
-#, fuzzy, java-format
-msgid "Unexpected copydata from server for {0}"
-msgstr "Esperado um EOF do servidor, recebido: {0}"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1056
-#, java-format
-msgid "Unexpected packet type during copy: {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1310
-#, java-format
-msgid ""
-"Bind message length {0} too long. This can be caused by very large or "
-"incorrect length specifications on InputStream parameters."
-msgstr ""
-"Tamanho de mensagem de ligação {0} é muito longo. Isso pode ser causado por "
-"especificações de tamanho incorretas ou muito grandes nos parâmetros do "
-"InputStream."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1925
-#, fuzzy, java-format
-msgid ""
-"The server''s client_encoding parameter was changed to {0}. The JDBC driver "
-"requires client_encoding to be UTF8 for correct operation."
-msgstr ""
-"O parâmetro do servidor client_encoding foi alterado para {0}. O driver JDBC "
-"requer que o client_encoding seja UNICODE para operação normal."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1932
-#, java-format
-msgid ""
-"The server''s DateStyle parameter was changed to {0}. The JDBC driver "
-"requires DateStyle to begin with ISO for correct operation."
-msgstr ""
-"O parâmetro do servidor DateStyle foi alterado para {0}. O driver JDBC "
-"requer que o DateStyle começe com ISO para operação normal."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1945
-#, java-format
-msgid ""
-"The server''s standard_conforming_strings parameter was reported as {0}. The "
-"JDBC driver expected on or off."
-msgstr ""
-"O parâmetro do servidor standard_conforming_strings foi definido como {0}. O "
-"driver JDBC espera que seja on ou off."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2015
-msgid "The driver currently does not support COPY operations."
-msgstr "O driver atualmente não suporta operações COPY."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:112
-msgid "This PooledConnection has already been closed."
-msgstr "Este PooledConnection já foi fechado."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid ""
-"Connection has been closed automatically because a new connection was opened "
-"for the same PooledConnection or the PooledConnection has been closed."
-msgstr ""
-"Conexão foi fechada automaticamente porque uma nova conexão foi aberta pelo "
-"mesmo PooledConnection ou o PooledConnection foi fechado."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid "Connection has been closed."
-msgstr "Conexão foi fechada."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:442
-msgid "Statement has been closed."
-msgstr "Comando foi fechado."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:291
-msgid "Failed to setup DataSource."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:414
-msgid "DataSource has been closed."
-msgstr "DataSource foi fechado."
-
-#: org/postgresql/fastpath/Fastpath.java:81
-#: org/postgresql/fastpath/Fastpath.java:128
-#, java-format
-msgid "Fastpath call {0} - No result was returned and we expected an integer."
-msgstr ""
-"Chamada ao Fastpath {0} - Nenhum resultado foi retornado e nós esperávamos "
-"um inteiro."
-
-#: org/postgresql/fastpath/Fastpath.java:237
-#, java-format
-msgid "The fastpath function {0} is unknown."
-msgstr "A função do fastpath {0} é desconhecida."
-
-#: org/postgresql/geometric/PGbox.java:83
-#: org/postgresql/geometric/PGcircle.java:82
-#: org/postgresql/geometric/PGcircle.java:91
-#: org/postgresql/geometric/PGline.java:80
-#: org/postgresql/geometric/PGlseg.java:77
-#: org/postgresql/geometric/PGpoint.java:85
-#, java-format
-msgid "Conversion to type {0} failed: {1}."
-msgstr "Conversão para tipo {0} falhou: {1}."
-
-#: org/postgresql/geometric/PGpath.java:81
-#, java-format
-msgid "Cannot tell if path is open or closed: {0}."
-msgstr "Não pode dizer se caminho está aberto ou fechado: {0}."
-
-#: org/postgresql/gss/MakeGSS.java:47 org/postgresql/gss/MakeGSS.java:55
-#: org/postgresql/gss/MakeGSS.java:168
-msgid "GSS Authentication failed"
-msgstr "Autenticação GSS falhou"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:153
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:790
-#, java-format
-msgid "The array index is out of range: {0}"
-msgstr "O índice da matriz está fora do intervalo: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:168
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:807
-#, java-format
-msgid "The array index is out of range: {0}, number of elements: {1}."
-msgstr ""
-"O índice da matriz está fora do intervalo: {0}, número de elementos: {1}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:196
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1982
-#: org/postgresql/util/HStoreConverter.java:34
-#: org/postgresql/util/HStoreConverter.java:61
-msgid ""
-"Invalid character data was found. This is most likely caused by stored data "
-"containing characters that are invalid for the character set the database "
-"was created in. The most common example of this is storing 8bit data in a "
-"SQL_ASCII database."
-msgstr ""
-"Caracter inválido foi encontrado. Isso é mais comumente causado por dado "
-"armazenado que contém caracteres que são inválidos para a codificação que "
-"foi criado o banco de dados. O exemplo mais comum disso é armazenar dados de "
-"8 bits em um banco de dados SQL_ASCII."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:73
-msgid ""
-"Truncation of large objects is only implemented in 8.3 and later servers."
-msgstr ""
-"Truncar objetos grandes só é implementado por servidores 8.3 ou superiores."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:77
-msgid "Cannot truncate LOB to a negative length."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:81
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:235
-#, java-format
-msgid "PostgreSQL LOBs can only index to: {0}"
-msgstr "LOBs do PostgreSQL só podem indexar até: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:231
-msgid "LOB positioning offsets start at 1."
-msgstr "Deslocamentos da posição de LOB começam em 1."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:246
-msgid "free() was called on this LOB previously"
-msgstr "free() já foi chamado neste LOB"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:225
-#, java-format
-msgid "Unsupported value for stringtype parameter: {0}"
-msgstr "Valor do parâmetro stringtype não é suportado: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:245
-msgid "unknownLength parameter value must be an integer"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:353
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:284
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:303
-#: org/postgresql/jdbc2/TypeInfoCache.java:201
-#: org/postgresql/jdbc2/TypeInfoCache.java:249
-#: org/postgresql/jdbc2/TypeInfoCache.java:287
-#: org/postgresql/jdbc2/TypeInfoCache.java:344
-#: org/postgresql/jdbc2/TypeInfoCache.java:348
-#: org/postgresql/jdbc2/TypeInfoCache.java:384
-#: org/postgresql/jdbc2/TypeInfoCache.java:388
-msgid "No results were returned by the query."
-msgstr "Nenhum resultado foi retornado pela consulta."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:367
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:336
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:368
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2702
-msgid "A result was returned when none was expected."
-msgstr "Um resultado foi retornado quando nenhum era esperado."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:519
-msgid "Custom type maps are not supported."
-msgstr "Mapeamento de tipos personalizados não são suportados."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:567
-#, java-format
-msgid "Failed to create object for: {0}."
-msgstr "Falhou ao criar objeto para: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:629
-#, java-format
-msgid "Unable to load the class {0} responsible for the datatype {1}"
-msgstr ""
-"Não foi possível carregar a classe {0} responsável pelo tipo de dado {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:725
-msgid ""
-"Cannot change transaction read-only property in the middle of a transaction."
-msgstr ""
-"Não pode mudar propriedade somente-leitura da transação no meio de uma "
-"transação."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:813
-msgid "Cannot commit when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:822
-#, fuzzy
-msgid "This connection has been closed."
-msgstr "Conexão foi fechada."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:842
-msgid "Cannot rollback when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:929
-msgid ""
-"Cannot change transaction isolation level in the middle of a transaction."
-msgstr ""
-"Não pode mudar nível de isolamento da transação no meio de uma transação."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:934
-#, java-format
-msgid "Transaction isolation level {0} not supported."
-msgstr "Nível de isolamento da transação {0} não é suportado."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1001
-msgid "Finalizing a Connection that was never closed:"
-msgstr "Fechando uma Conexão que não foi fechada:"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1103
-msgid "Unable to translate data into the desired encoding."
-msgstr "Não foi possível traduzir dado para codificação desejada."
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:63
-msgid ""
-"Unable to determine a value for MaxIndexKeys due to missing system catalog "
-"data."
-msgstr ""
-"Não foi possível determinar um valor para MaxIndexKeys por causa de falta de "
-"dados no catálogo do sistema."
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:86
-msgid "Unable to find name datatype in the system catalogs."
-msgstr "Não foi possível encontrar tipo de dado name nos catálogos do sistema."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:235
-msgid ""
-"Operation requires a scrollable ResultSet, but this ResultSet is "
-"FORWARD_ONLY."
-msgstr ""
-"Operação requer um ResultSet rolável, mas este ResultSet é FORWARD_ONLY "
-"(somente para frente)."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:416
-msgid "Unexpected error while decoding character data from a large object."
-msgstr "Erro inesperado ao decodificar caracter de um objeto grande."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:462
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:491
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:525
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3129
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3174
-#, fuzzy, java-format
-msgid "Cannot convert the column of type {0} to requested type {1}."
-msgstr "Não pode converter uma instância de {0} para tipo {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:744
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:768
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1892
-msgid "Can''t use relative move methods while on the insert row."
-msgstr ""
-"Não pode utilizar métodos de movimentação relativos enquanto estiver "
-"inserindo registro."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:788
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2956
-#, java-format
-msgid "Invalid fetch direction constant: {0}."
-msgstr "Constante de direção da busca é inválida: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:802
-msgid "Cannot call cancelRowUpdates() when on the insert row."
-msgstr "Não pode chamar cancelRowUpdates() quando estiver inserindo registro."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:822
-msgid "Cannot call deleteRow() when on the insert row."
-msgstr "Não pode chamar deleteRow() quando estiver inserindo registro."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:828
-msgid ""
-"Currently positioned before the start of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"Posicionado antes do início do ResultSet. Você não pode chamar deleteRow() "
-"aqui."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:833
-msgid ""
-"Currently positioned after the end of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"Posicionado depois do fim do ResultSet. Você não pode chamar deleteRow() "
-"aqui."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:838
-msgid "There are no rows in this ResultSet."
-msgstr "Não há nenhum registro neste ResultSet."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:885
-msgid "Not on the insert row."
-msgstr "Não está inserindo um registro."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:889
-msgid "You must specify at least one column value to insert a row."
-msgstr "Você deve especificar pelo menos uma coluna para inserir um registro."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1074
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1805
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2494
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2524
-#, java-format
-msgid "The JVM claims not to support the encoding: {0}"
-msgstr "A JVM reclamou que não suporta a codificação: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1078
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1121
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1534
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1663
-msgid "Provided InputStream failed."
-msgstr "InputStream fornecido falhou."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1191
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3137
-msgid "Provided Reader failed."
-msgstr "Reader fornecido falhou."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1259
-msgid "Can''t refresh the insert row."
-msgstr "Não pode renovar um registro inserido."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1327
-msgid "Cannot call updateRow() when on the insert row."
-msgstr "Não pode chamar updateRow() quando estiver inserindo registro."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1333
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3190
-msgid ""
-"Cannot update the ResultSet because it is either before the start or after "
-"the end of the results."
-msgstr ""
-"Não pode atualizar o ResultSet porque ele está antes do início ou depois do "
-"fim dos resultados."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1582
-msgid "ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."
-msgstr ""
-"ResultSets com CONCUR_READ_ONLY concorrentes não podem ser atualizados."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1650
-#, java-format
-msgid "No primary key found for table {0}."
-msgstr "Nenhuma chave primária foi encontrada para tabela {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1876
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2965
-msgid "Fetch size must be a value greater to or equal to 0."
-msgstr "Tamanho da busca deve ser um valor maior ou igual a 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2044
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2051
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2098
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2106
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2926
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2934
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2964
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2971
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2991
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3002
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3020
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3038
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3179
-#: org/postgresql/jdbc2/TimestampUtils.java:258
-#, java-format
-msgid "Bad value for type {0} : {1}"
-msgstr "Valor inválido para tipo {0} : {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2727
-#, java-format
-msgid "The column name {0} was not found in this ResultSet."
-msgstr "A nome da coluna {0} não foi encontrado neste ResultSet."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2827
-msgid ""
-"ResultSet is not updateable. The query that generated this result set must "
-"select only one table, and must select all primary keys from that table. See "
-"the JDBC 2.1 API Specification, section 5.6 for more details."
-msgstr ""
-"ResultSet não é atualizável. A consulta que gerou esse conjunto de "
-"resultados deve selecionar somente uma tabela, e deve selecionar todas as "
-"chaves primárias daquela tabela. Veja a especificação na API do JDBC 2.1, "
-"seção 5.6 para obter mais detalhes."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2839
-msgid "This ResultSet is closed."
-msgstr "Este ResultSet está fechado."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2860
-msgid "ResultSet not positioned properly, perhaps you need to call next."
-msgstr ""
-"ResultSet não está posicionado corretamente, talvez você precise chamar next."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:259
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:323
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:392
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2655
-msgid ""
-"Can''t use query methods that take a query string on a PreparedStatement."
-msgstr ""
-"Não pode utilizar métodos de consulta que pegam uma consulta de um comando "
-"preparado."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:287
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:306
-msgid "Multiple ResultSets were returned by the query."
-msgstr "ResultSets múltiplos foram retornados pela consulta."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:425
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:429
-msgid "A CallableStatement was executed with nothing returned."
-msgstr "Uma função foi executada e nada foi retornado."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:437
-msgid "A CallableStatement was executed with an invalid number of parameters"
-msgstr "Uma função foi executada com um número inválido de parâmetros"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:468
-#, java-format
-msgid ""
-"A CallableStatement function was executed and the out parameter {0} was of "
-"type {1} however type {2} was registered."
-msgstr ""
-"Uma função foi executada e o parâmetro de retorno {0} era do tipo {1} "
-"contudo tipo {2} foi registrado."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:674
-msgid "Maximum number of rows must be a value grater than or equal to 0."
-msgstr "Número máximo de registros deve ser um valor maior ou igual a 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:717
-msgid "Query timeout must be a value greater than or equals to 0."
-msgstr "Tempo de espera da consulta deve ser um valor maior ou igual a 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:809
-msgid "The maximum field size must be a value greater than or equal to 0."
-msgstr "O tamanho máximo de um campo deve ser um valor maior ou igual a 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1226
-msgid "Unknown Types value."
-msgstr "Valor de Types desconhecido."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1499
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1624
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3108
-#, java-format
-msgid "Invalid stream length {0}."
-msgstr "Tamanho de dado {0} é inválido."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1530
-#, java-format
-msgid "The JVM claims not to support the {0} encoding."
-msgstr "A JVM reclamou que não suporta a codificação {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1705
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3030
-#, java-format
-msgid "Unknown type {0}."
-msgstr "Tipo desconhecido {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1720
-msgid "No hstore extension installed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1845
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1851
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1857
-#, java-format
-msgid "Cannot cast an instance of {0} to type {1}"
-msgstr "Não pode converter uma instância de {0} para tipo {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1869
-#, java-format
-msgid "Unsupported Types value: {0}"
-msgstr "Valor de Types não é suportado: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1927
-#, java-format
-msgid ""
-"Can''t infer the SQL type to use for an instance of {0}. Use setObject() "
-"with an explicit Types value to specify the type to use."
-msgstr ""
-"Não pode inferir um tipo SQL a ser usado para uma instância de {0}. Use "
-"setObject() com um valor de Types explícito para especificar o tipo a ser "
-"usado."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1975
-msgid ""
-"This statement does not declare an OUT parameter. Use '{' ?= call ... '}' "
-"to declare one."
-msgstr ""
-"Este comando não declara um parâmetro de saída. Utilize '{' ?= chamada ... "
-"'}' para declarar um)"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2025
-msgid "wasNull cannot be call before fetching a result."
-msgstr "wasNull não pode ser chamado antes de obter um resultado."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2521
-#, java-format
-msgid "Malformed function or procedure escape syntax at offset {0}."
-msgstr ""
-"Sintaxe de escape mal formada da função ou do procedimento no deslocamento "
-"{0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2571
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2585
-#, java-format
-msgid ""
-"Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was "
-"made."
-msgstr ""
-"Parâmetro do tipo {0} foi registrado, mas uma chamada a get{1} (tiposql={2}) "
-"foi feita."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2604
-msgid ""
-"A CallableStatement was declared, but no call to registerOutParameter(1, "
-"<some type>) was made."
-msgstr ""
-"Uma função foi declarada mas nenhuma chamada a registerOutParameter (1, "
-"<algum_tipo>) foi feita."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2608
-msgid "No function outputs were registered."
-msgstr "Nenhum saída de função foi registrada."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2611
-msgid ""
-"Results cannot be retrieved from a CallableStatement before it is executed."
-msgstr ""
-"Resultados não podem ser recuperados de uma função antes dela ser executada."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2644
-msgid "This statement has been closed."
-msgstr "Este comando foi fechado."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2724
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2794
-msgid "Too many update results were returned."
-msgstr "Muitos resultados de atualização foram retornados."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2753
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2823
-#, java-format
-msgid ""
-"Batch entry {0} {1} was aborted. Call getNextException to see the cause."
-msgstr ""
-"Entrada em lote {0} {1} foi abortada. Chame getNextException para ver a "
-"causa."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3078
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3167
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3207
-msgid "Unexpected error writing large object to database."
-msgstr "Erro inesperado ao escrever objeto grande no banco de dados."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:145
-#: org/postgresql/jdbc2/EscapedFunctions.java:157
-#: org/postgresql/jdbc2/EscapedFunctions.java:169
-#: org/postgresql/jdbc2/EscapedFunctions.java:206
-#: org/postgresql/jdbc2/EscapedFunctions.java:243
-#: org/postgresql/jdbc2/EscapedFunctions.java:267
-#: org/postgresql/jdbc2/EscapedFunctions.java:292
-#: org/postgresql/jdbc2/EscapedFunctions.java:316
-#: org/postgresql/jdbc2/EscapedFunctions.java:328
-#: org/postgresql/jdbc2/EscapedFunctions.java:352
-#: org/postgresql/jdbc2/EscapedFunctions.java:380
-#: org/postgresql/jdbc2/EscapedFunctions.java:389
-#: org/postgresql/jdbc2/EscapedFunctions.java:399
-#: org/postgresql/jdbc2/EscapedFunctions.java:408
-#: org/postgresql/jdbc2/EscapedFunctions.java:417
-#: org/postgresql/jdbc2/EscapedFunctions.java:426
-#: org/postgresql/jdbc2/EscapedFunctions.java:435
-#: org/postgresql/jdbc2/EscapedFunctions.java:444
-#: org/postgresql/jdbc2/EscapedFunctions.java:453
-#: org/postgresql/jdbc2/EscapedFunctions.java:462
-#: org/postgresql/jdbc2/EscapedFunctions.java:471
-#: org/postgresql/jdbc2/EscapedFunctions.java:480
-#, java-format
-msgid "{0} function takes one and only one argument."
-msgstr "função {0} recebe somente um argumento."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:181
-#: org/postgresql/jdbc2/EscapedFunctions.java:193
-#: org/postgresql/jdbc2/EscapedFunctions.java:255
-#: org/postgresql/jdbc2/EscapedFunctions.java:304
-#: org/postgresql/jdbc2/EscapedFunctions.java:582
-#, java-format
-msgid "{0} function takes two and only two arguments."
-msgstr "função {0} recebe somente dois argumentos."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:230
-#, java-format
-msgid "{0} function takes four and only four argument."
-msgstr "função {0} recebe somente quatro argumentos."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:282
-#: org/postgresql/jdbc2/EscapedFunctions.java:342
-#, java-format
-msgid "{0} function takes two or three arguments."
-msgstr "função {0} recebe dois ou três argumentos."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:362
-#: org/postgresql/jdbc2/EscapedFunctions.java:371
-#: org/postgresql/jdbc2/EscapedFunctions.java:573
-#: org/postgresql/jdbc2/EscapedFunctions.java:591
-#, java-format
-msgid "{0} function doesn''t take any argument."
-msgstr "função {0} não recebe nenhum argumento."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:489
-#: org/postgresql/jdbc2/EscapedFunctions.java:531
-#, java-format
-msgid "{0} function takes three and only three arguments."
-msgstr "função {0} recebe três e somente três argumentos."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:501
-#: org/postgresql/jdbc2/EscapedFunctions.java:521
-#: org/postgresql/jdbc2/EscapedFunctions.java:523
-#: org/postgresql/jdbc2/EscapedFunctions.java:543
-#: org/postgresql/jdbc2/EscapedFunctions.java:564
-#: org/postgresql/jdbc2/EscapedFunctions.java:566
-#, java-format
-msgid "Interval {0} not yet implemented"
-msgstr "Intervalo {0} ainda não foi implementado"
-
-#: org/postgresql/jdbc2/TimestampUtils.java:360
-msgid ""
-"Infinite value found for timestamp/date. This cannot be represented as time."
-msgstr ""
-"Valor infinito encontrado em timestamp/date. Isto não pode ser representado "
-"como tempo."
-
-#: org/postgresql/jdbc2/TimestampUtils.java:648
-#: org/postgresql/jdbc2/TimestampUtils.java:680
-#: org/postgresql/jdbc2/TimestampUtils.java:727
-#, fuzzy, java-format
-msgid "Unsupported binary encoding of {0}."
-msgstr "Valor de Types não é suportado: {0}"
-
-#: org/postgresql/jdbc2/TypeInfoCache.java:161
-#, java-format
-msgid "The class {0} does not implement org.postgresql.util.PGobject."
-msgstr "A classe {0} não implementa org.postgresql.util.PGobject."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:60
-#, java-format
-msgid "Unknown ResultSet holdability setting: {0}."
-msgstr "Definição de durabilidade do ResultSet desconhecida: {0}."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:98
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:130
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:165
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:187
-msgid "Server versions prior to 8.0 do not support savepoints."
-msgstr "Versões do servidor anteriores a 8.0 não suportam savepoints."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:100
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:132
-msgid "Cannot establish a savepoint in auto-commit mode."
-msgstr ""
-"Não pode estabelecer um savepoint no modo de efetivação automática (auto-"
-"commit)."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:419
-msgid "Returning autogenerated keys is not supported."
-msgstr "Retorno de chaves geradas automaticamente não é suportado."
-
-#: org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java:81
-#, java-format
-msgid "The parameter index is out of range: {0}, number of parameters: {1}."
-msgstr ""
-"O índice de parâmetro está fora do intervalo: {0}, número de parâmetros: {1}."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:151
-msgid ""
-"Returning autogenerated keys is only supported for 8.2 and later servers."
-msgstr ""
-"Retorno de chaves geradas automaticamente só é suportado por servidores 8.2 "
-"ou mais recentes."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:199
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:317
-msgid "Returning autogenerated keys by column index is not supported."
-msgstr ""
-"Retorno de chaves geradas automaticamente por índice de coluna não é "
-"suportado."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:38
-#: org/postgresql/jdbc3/PSQLSavepoint.java:50
-#: org/postgresql/jdbc3/PSQLSavepoint.java:66
-msgid "Cannot reference a savepoint after it has been released."
-msgstr "Não pode referenciar um savepoint após ele ser descartado."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:42
-msgid "Cannot retrieve the id of a named savepoint."
-msgstr "Não pode recuperar o id de um savepoint com nome."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:54
-msgid "Cannot retrieve the name of an unnamed savepoint."
-msgstr "Não pode recuperar o nome de um savepoint sem nome."
-
-#: org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java:37
-msgid "Invalid UUID data."
-msgstr "dado UUID é inválido."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:83
-#, java-format
-msgid "Unable to find server array type for provided name {0}."
-msgstr "Não foi possível encontrar tipo matriz para nome fornecido {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:121
-#, fuzzy, java-format
-msgid "Invalid timeout ({0}<0)."
-msgstr "Tamanho de dado {0} é inválido."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:134
-msgid "Validating connection."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:157
-#, fuzzy, java-format
-msgid "Failed to set ClientInfo property: {0}"
-msgstr "Falhou ao criar objeto para: {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:166
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:188
-msgid "ClientInfo property not supported."
-msgstr "propriedade ClientInfo não é suportada."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Statement.java:127
-msgid "Object is too large to send over the protocol."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:147
-msgid "Unable to decode xml data."
-msgstr "Não foi possível decodificar dado xml."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:150
-#, java-format
-msgid "Unknown XML Source class: {0}"
-msgstr "Classe XML Source desconhecida: {0}"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:195
-msgid "Unable to create SAXResult for SQLXML."
-msgstr "Não foi possível criar SAXResult para SQLXML."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:209
-msgid "Unable to create StAXResult for SQLXML"
-msgstr "Não foi possível criar StAXResult para SQLXML"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:213
-#, java-format
-msgid "Unknown XML Result class: {0}"
-msgstr "Classe XML Result desconhecida: {0}"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:226
-msgid "This SQLXML object has already been freed."
-msgstr "Este objeto SQLXML já foi liberado."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:233
-msgid ""
-"This SQLXML object has not been initialized, so you cannot retrieve data "
-"from it."
-msgstr ""
-"Este objeto SQLXML não foi inicializado, então você não pode recuperar dados "
-"dele."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:244
-#, java-format
-msgid "Failed to convert binary xml data to encoding: {0}."
-msgstr "Falhou ao converter dados xml binários para codificação: {0}."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:269
-msgid "Unable to convert DOMResult SQLXML data to a string."
-msgstr ""
-"Não foi possível converter dado SQLXML do DOMResult para uma cadeia de "
-"caracteres."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:282
-msgid ""
-"This SQLXML object has already been initialized, so you cannot manipulate it "
-"further."
-msgstr ""
-"Este objeto SQLXML já foi inicializado, então você não pode manipulá-lo "
-"depois."
-
-#: org/postgresql/largeobject/LargeObjectManager.java:138
-msgid "Failed to initialize LargeObject API"
-msgstr "Falhou ao inicializar API de Objetos Grandes"
-
-#: org/postgresql/largeobject/LargeObjectManager.java:257
-#: org/postgresql/largeobject/LargeObjectManager.java:298
-msgid "Large Objects may not be used in auto-commit mode."
-msgstr ""
-"Objetos Grandes não podem ser usados no modo de efetivação automática (auto-"
-"commit)."
-
-#: org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java:58
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:110
-#, java-format
-msgid "The SSLSocketFactory class provided {0} could not be instantiated."
-msgstr "A classe SSLSocketFactory forneceu {0} que não pôde ser instanciado."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:125
-#, java-format
-msgid "SSL error: {0}"
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:138
-#, fuzzy, java-format
-msgid "The HostnameVerifier class provided {0} could not be instantiated."
-msgstr "A classe SSLSocketFactory forneceu {0} que não pôde ser instanciado."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:142
-#, java-format
-msgid "The hostname {0} could not be verified by hostnameverifier {1}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:149
-#, fuzzy, java-format
-msgid "The hostname {0} could not be verified."
-msgstr "A classe SSLSocketFactory forneceu {0} que não pôde ser instanciado."
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:121
-msgid ""
-"Could not find a java cryptographic algorithm: X.509 CertificateFactory not "
-"available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:132
-#, java-format
-msgid "Could not open SSL certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:137
-#, java-format
-msgid "Loading the SSL certificate {0} into a KeyManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:194
-msgid "Enter SSL password: "
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:202
-msgid "Could not read password for SSL key file, console is not available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:204
-#, java-format
-msgid "Could not read password for SSL key file by callbackhandler {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:223
-#, java-format
-msgid "Could not decrypt SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:231
-#, java-format
-msgid "Could not read SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:235
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:173
-#, java-format
-msgid "Could not find a java cryptographic algorithm: {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:99
-#, fuzzy, java-format
-msgid "The password callback class provided {0} could not be instantiated."
-msgstr "A classe SSLSocketFactory forneceu {0} que não pôde ser instanciado."
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:133
-#, java-format
-msgid "Could not open SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:150
-#, java-format
-msgid "Could not read SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:153
-#, java-format
-msgid "Loading the SSL root certificate {0} into a TrustManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:166
-msgid "Could not initialize SSL context."
-msgstr ""
-
-#: org/postgresql/util/PGInterval.java:164
-msgid "Conversion of interval failed"
-msgstr "Conversão de interval falhou"
-
-#: org/postgresql/util/PGmoney.java:73
-msgid "Conversion of money failed."
-msgstr "Conversão de money falhou."
-
-#: org/postgresql/util/ServerErrorMessage.java:155
-#, java-format
-msgid "Detail: {0}"
-msgstr "Detalhe: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:159
-#, java-format
-msgid "Hint: {0}"
-msgstr "Dica: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:162
-#, java-format
-msgid "Position: {0}"
-msgstr "Posição: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:165
-#, java-format
-msgid "Where: {0}"
-msgstr "Onde: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:171
-#, java-format
-msgid "Internal Query: {0}"
-msgstr "Consulta Interna: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:174
-#, java-format
-msgid "Internal Position: {0}"
-msgstr "Posição Interna: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:180
-#, java-format
-msgid "Location: File: {0}, Routine: {1}, Line: {2}"
-msgstr "Local: Arquivo: {0}, Rotina: {1}, Linha: {2}"
-
-#: org/postgresql/util/ServerErrorMessage.java:183
-#, java-format
-msgid "Server SQLState: {0}"
-msgstr "SQLState: {0}"
-
-#: org/postgresql/xa/PGXAConnection.java:148
-msgid ""
-"Transaction control methods setAutoCommit(true), commit, rollback and "
-"setSavePoint not allowed while an XA transaction is active."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:186
-#: org/postgresql/xa/PGXAConnection.java:245
-msgid "Invalid flags"
-msgstr "Marcadores inválidos"
-
-#: org/postgresql/xa/PGXAConnection.java:189
-#: org/postgresql/xa/PGXAConnection.java:248
-#: org/postgresql/xa/PGXAConnection.java:425
-msgid "xid must not be null"
-msgstr "xid não deve ser nulo"
-
-#: org/postgresql/xa/PGXAConnection.java:192
-msgid "Connection is busy with another transaction"
-msgstr "Conexão está ocupada com outra transação"
-
-#: org/postgresql/xa/PGXAConnection.java:198
-#: org/postgresql/xa/PGXAConnection.java:255
-msgid "suspend/resume not implemented"
-msgstr "suspender/recomeçar não está implementado"
-
-#: org/postgresql/xa/PGXAConnection.java:204
-#: org/postgresql/xa/PGXAConnection.java:207
-#: org/postgresql/xa/PGXAConnection.java:209
-msgid "Transaction interleaving not implemented"
-msgstr "Intercalação de transação não está implementado"
-
-#: org/postgresql/xa/PGXAConnection.java:218
-msgid "Error disabling autocommit"
-msgstr "Erro ao desabilitar autocommit"
-
-#: org/postgresql/xa/PGXAConnection.java:251
-msgid "tried to call end without corresponding start call"
-msgstr "tentou executar end sem a chamada ao start correspondente"
-
-#: org/postgresql/xa/PGXAConnection.java:282
-msgid ""
-"Not implemented: Prepare must be issued using the same connection that "
-"started the transaction"
-msgstr ""
-"Não está implementado: Prepare deve ser executado utilizando a mesma conexão "
-"que iniciou a transação"
-
-#: org/postgresql/xa/PGXAConnection.java:286
-msgid "Prepare called before end"
-msgstr "Prepare executado antes do end"
-
-#: org/postgresql/xa/PGXAConnection.java:292
-msgid "Server versions prior to 8.1 do not support two-phase commit."
-msgstr ""
-"Versões do servidor anteriores a 8.1 não suportam efetivação em duas fases."
-
-#: org/postgresql/xa/PGXAConnection.java:313
-msgid "Error preparing transaction"
-msgstr "Erro ao preparar transação"
-
-#: org/postgresql/xa/PGXAConnection.java:328
-msgid "Invalid flag"
-msgstr "Marcador inválido"
-
-#: org/postgresql/xa/PGXAConnection.java:368
-msgid "Error during recover"
-msgstr "Erro durante recuperação"
-
-#: org/postgresql/xa/PGXAConnection.java:416
-msgid "Error rolling back prepared transaction"
-msgstr "Erro ao cancelar transação preparada"
-
-#: org/postgresql/xa/PGXAConnection.java:451
-msgid ""
-"Not implemented: one-phase commit must be issued using the same connection "
-"that was used to start it"
-msgstr ""
-"Não está implementado: efetivada da primeira fase deve ser executada "
-"utilizando a mesma conexão que foi utilizada para iniciá-la"
-
-#: org/postgresql/xa/PGXAConnection.java:455
-msgid "commit called before end"
-msgstr "commit executado antes do end"
-
-#: org/postgresql/xa/PGXAConnection.java:466
-msgid "Error during one-phase commit"
-msgstr "Erro durante efetivação de uma fase"
-
-#: org/postgresql/xa/PGXAConnection.java:487
-msgid ""
-"Not implemented: 2nd phase commit must be issued using an idle connection"
-msgstr ""
-"Não está implementado: efetivação da segunda fase deve ser executada "
-"utilizado uma conexão ociosa"
-
-#: org/postgresql/xa/PGXAConnection.java:507
-#, fuzzy
-msgid "Error committing prepared transaction"
-msgstr "Erro ao cancelar transação preparada"
-
-#: org/postgresql/xa/PGXAConnection.java:522
-msgid "Heuristic commit/rollback not supported"
-msgstr "Efetivação/Cancelamento heurístico não é suportado"
diff --git a/org/postgresql/translation/ru.po b/org/postgresql/translation/ru.po
deleted file mode 100644
index 255baf5..0000000
--- a/org/postgresql/translation/ru.po
+++ /dev/null
@@ -1,1545 +0,0 @@
-# ru.po
-# JDBC Translation into Russian, (C) 2003-2004 Serguei A. Mokhov, <mokhov at cs.concordia.ca>
-# Distributed under the same licensing terms as the JDBC driver itself.
-#
-#
-# ChangeLog:
-#
-# - October 6 - November 15, 2004 - Updates for PostgreSQL 8.0 and corresponding JDBC driver, <mokhov at cs.concordia.ca>
-# - Change to .po from .properties. Incorporate original messages.
-# - October 12, 2003 - ... Initial translation, Serguei Mokhov, <mokhov at cs.concordia.ca>
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: JDBC Driver for PostgreSQL 8.x.x\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-10-31 13:37+0000\n"
-"PO-Revision-Date: 2004-11-15 12:19-0500\n"
-"Last-Translator: Serguei A. Mokhov <mokhov at cs.concordia.ca>\n"
-"Language-Team: pgsql-rus <pgsql-rus at yahoogroups.com>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Poedit-Language: Russian\n"
-"X-Poedit-Country: RUSSIAN FEDERATION\n"
-
-#: org/postgresql/Driver.java.in:235
-msgid "Error loading default settings from driverconfig.properties"
-msgstr ""
-
-#: org/postgresql/Driver.java.in:282
-msgid ""
-"Your security policy has prevented the connection from being attempted. You "
-"probably need to grant the connect java.net.SocketPermission to the database "
-"server host and port that you wish to connect to."
-msgstr ""
-
-# key: postgresql.unusual
-#: org/postgresql/Driver.java.in:287 org/postgresql/Driver.java.in:351
-msgid ""
-"Something unusual has occurred to cause the driver to fail. Please report "
-"this exception."
-msgstr ""
-"Случилось что-то необычное, что заставило драйвер произвести ошибку. "
-"Пожалуйста сообщите это исключение."
-
-# key: postgresql.con.failed
-#: org/postgresql/Driver.java.in:359
-#, fuzzy
-msgid "Connection attempt timed out."
-msgstr "Ошибка при попытке подсоединения."
-
-# key: postgresql.con.sslfail
-#: org/postgresql/Driver.java.in:372
-#, fuzzy
-msgid "Interrupted while attempting to connect."
-msgstr "Ошибка при установке SSL-подсоединения."
-
-# key: postgresql.unimplemented
-#: org/postgresql/Driver.java.in:714
-#, fuzzy, java-format
-msgid "Method {0} is not yet implemented."
-msgstr "Этот метод ещё не реализован."
-
-#: org/postgresql/copy/CopyManager.java:56
-#, java-format
-msgid "Requested CopyIn but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/CopyManager.java:67
-#, java-format
-msgid "Requested CopyOut but got {0}"
-msgstr ""
-
-# key: postgresql.geo.box
-#: org/postgresql/copy/PGCopyInputStream.java:51
-#, fuzzy, java-format
-msgid "Copying from database failed: {0}"
-msgstr "Ошибка при преобразовании типа box: {0}."
-
-#: org/postgresql/copy/PGCopyInputStream.java:67
-#: org/postgresql/copy/PGCopyOutputStream.java:90
-#, fuzzy
-msgid "This copy stream is closed."
-msgstr "ResultSet закрыт."
-
-#: org/postgresql/copy/PGCopyInputStream.java:108
-msgid "Read from copy failed."
-msgstr ""
-
-#: org/postgresql/copy/PGCopyOutputStream.java:68
-#, java-format
-msgid "Cannot write to copy a byte of value {0}"
-msgstr ""
-
-#: org/postgresql/core/ConnectionFactory.java:69
-#, fuzzy, java-format
-msgid "A connection could not be made using the requested protocol {0}."
-msgstr ""
-"Подсодинение невозможно было установить для запрошенного протокола {0}."
-
-#: org/postgresql/core/Oid.java:113
-#, java-format
-msgid "oid type {0} not known and not a number"
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:490
-#, java-format
-msgid "Premature end of input stream, expected {0} bytes, but only read {1}."
-msgstr ""
-"Раннее завершение входного потока, ожидалось байт: {0}, но считано только "
-"{1}."
-
-#: org/postgresql/core/PGStream.java:530
-#, java-format
-msgid "Expected an EOF from server, got: {0}"
-msgstr ""
-
-# key: postgresql.unexpected
-#: org/postgresql/core/SetupQueryRunner.java:86
-msgid "An unexpected result was returned by a query."
-msgstr "Запрос вернул неожиданный результат."
-
-#: org/postgresql/core/UTF8Encoding.java:28
-#, java-format
-msgid ""
-"Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:61
-#, java-format
-msgid "Illegal UTF-8 sequence: {0} bytes used to encode a {1} byte value: {2}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:98
-#: org/postgresql/core/UTF8Encoding.java:125
-#, java-format
-msgid "Illegal UTF-8 sequence: initial byte is {0}: {1}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:130
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is out of range: {0}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:145
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is a surrogate value: {0}"
-msgstr ""
-
-#: org/postgresql/core/Utils.java:95 org/postgresql/core/Utils.java:112
-msgid "Zero bytes may not occur in string parameters."
-msgstr "Ноль байт не может быть в строковых параметрах."
-
-#: org/postgresql/core/Utils.java:145
-#, fuzzy
-msgid "Zero bytes may not occur in identifiers."
-msgstr "Ноль байт не может быть в строковых параметрах."
-
-#: org/postgresql/core/types/PGBigDecimal.java:63
-#: org/postgresql/core/types/PGBoolean.java:62
-#: org/postgresql/core/types/PGByte.java:63
-#: org/postgresql/core/types/PGDouble.java:64
-#: org/postgresql/core/types/PGFloat.java:64
-#: org/postgresql/core/types/PGInteger.java:61
-#: org/postgresql/core/types/PGLong.java:62
-#: org/postgresql/core/types/PGNumber.java:62
-#: org/postgresql/core/types/PGShort.java:58
-#: org/postgresql/core/types/PGString.java:73
-#, java-format
-msgid "Cannot convert an instance of {0} to type {1}"
-msgstr ""
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:66
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:74
-#, fuzzy, java-format
-msgid "Invalid sslmode value: {0}"
-msgstr "Неверная длина потока {0}."
-
-# key: postgresql.con.refused
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:134
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:207
-msgid ""
-"Connection refused. Check that the hostname and port are correct and that "
-"the postmaster is accepting TCP/IP connections."
-msgstr ""
-"Подсоединение отклонено. Проверьте что хост и порт указаны правильно и что "
-"postmaster принимает TCP/IP-подсоединения."
-
-# key: postgresql.con.failed
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:153
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:225
-msgid "The connection attempt failed."
-msgstr "Ошибка при попытке подсоединения."
-
-# key: postgresql.con.failed
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:175
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:246
-#, fuzzy
-msgid "The connection url is invalid."
-msgstr "Ошибка при попытке подсоединения."
-
-# key: postgresql.con.sslnotsupported
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:198
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:210
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:295
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:307
-msgid "The server does not support SSL."
-msgstr "Сервер не поддерживает SSL."
-
-# key: postgresql.con.sslfail
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:223
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:320
-msgid "An error occurred while setting up the SSL connection."
-msgstr "Ошибка при установке SSL-подсоединения."
-
-# key: postgresql.con.misc
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:272
-#, java-format
-msgid "Connection rejected: {0}."
-msgstr "Подсоединение отвергнуто: {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:290
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:312
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:332
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:419
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:444
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:471
-msgid ""
-"The server requested password-based authentication, but no password was "
-"provided."
-msgstr "Сервер запросил парольную аутентификацию, но пароль не был указан."
-
-# key: postgresql.con.auth
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:356
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:504
-#, fuzzy, java-format
-msgid ""
-"The authentication type {0} is not supported. Check that you have configured "
-"the pg_hba.conf file to include the client''s IP address or subnet, and that "
-"it is using an authentication scheme supported by the driver."
-msgstr ""
-"Тип аутентификации {0} не поддерживается. Проверьте если вы сконфигурировали "
-"файл pg_hba.conf чтобы включить IP-адреса клиентов или подсеть. Также "
-"удостовертесь что он использует схему аутентификации поддерживаемую "
-"драйвером."
-
-# key: postgresql.con.setup
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:362
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:400
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:510
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:553
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:599
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:609
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:618
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:626
-#: org/postgresql/gss/MakeGSS.java:158
-msgid "Protocol error. Session setup failed."
-msgstr "Ошибка протокола. Установление сессии не удалось."
-
-# key: postgresql.con.backend
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:390
-#, java-format
-msgid "Backend start-up failed: {0}."
-msgstr "Запуск бэкенда не удался: {0}."
-
-# key: postgresql.res.colrange
-#: org/postgresql/core/v2/FastpathParameterList.java:55
-#: org/postgresql/core/v2/FastpathParameterList.java:77
-#: org/postgresql/core/v2/FastpathParameterList.java:84
-#: org/postgresql/core/v2/SimpleParameterList.java:57
-#: org/postgresql/core/v2/SimpleParameterList.java:76
-#: org/postgresql/core/v2/SimpleParameterList.java:83
-#: org/postgresql/core/v2/SimpleParameterList.java:90
-#: org/postgresql/core/v3/CompositeParameterList.java:35
-#: org/postgresql/core/v3/SimpleParameterList.java:49
-#: org/postgresql/core/v3/SimpleParameterList.java:56
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2845
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java:419
-#, java-format
-msgid "The column index is out of range: {0}, number of columns: {1}."
-msgstr "Индекс колонки вне диапазона: {0}, число колонок: {1}."
-
-# key: postgresql.prep.param
-#: org/postgresql/core/v2/FastpathParameterList.java:142
-#: org/postgresql/core/v2/SimpleParameterList.java:155
-#: org/postgresql/core/v3/SimpleParameterList.java:216
-#, java-format
-msgid "No value specified for parameter {0}."
-msgstr "Не указано значение для параметра {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:72
-#: org/postgresql/core/v2/QueryExecutorImpl.java:337
-#: org/postgresql/core/v3/QueryExecutorImpl.java:443
-#: org/postgresql/core/v3/QueryExecutorImpl.java:507
-#, java-format
-msgid "Expected command status BEGIN, got {0}."
-msgstr "Ожидался статус команды BEGIN, но получен для {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:78
-#: org/postgresql/core/v3/QueryExecutorImpl.java:513
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1828
-#, java-format
-msgid "Unexpected command status: {0}."
-msgstr "Неожиданный статус команды: {0}."
-
-# key: postgresql.con.ioerror
-#: org/postgresql/core/v2/QueryExecutorImpl.java:118
-#: org/postgresql/core/v2/QueryExecutorImpl.java:129
-#: org/postgresql/core/v2/QueryExecutorImpl.java:174
-#: org/postgresql/core/v2/QueryExecutorImpl.java:369
-#: org/postgresql/core/v3/QueryExecutorImpl.java:281
-#: org/postgresql/core/v3/QueryExecutorImpl.java:411
-#: org/postgresql/core/v3/QueryExecutorImpl.java:485
-#: org/postgresql/core/v3/QueryExecutorImpl.java:551
-#: org/postgresql/core/v3/QueryExecutorImpl.java:631
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2094
-#, fuzzy
-msgid "An I/O error occured while sending to the backend."
-msgstr "Ошибка ввода/ввывода при отправке бэкенду."
-
-# key: postgresql.con.type
-#: org/postgresql/core/v2/QueryExecutorImpl.java:170
-#: org/postgresql/core/v2/QueryExecutorImpl.java:225
-#: org/postgresql/core/v2/QueryExecutorImpl.java:236
-#: org/postgresql/core/v3/QueryExecutorImpl.java:627
-#: org/postgresql/core/v3/QueryExecutorImpl.java:685
-#, java-format
-msgid "Unknown Response Type {0}."
-msgstr "Неизвестный тип ответа {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:430
-#: org/postgresql/core/v2/QueryExecutorImpl.java:475
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1857
-msgid "Ran out of memory retrieving query results."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:597
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2199
-#, java-format
-msgid "Unable to interpret the update count in command completion tag: {0}."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:610
-msgid "Copy not implemented for protocol version 2"
-msgstr ""
-
-#: org/postgresql/core/v3/CopyOperationImpl.java:56
-msgid "CommandComplete expected COPY but got: "
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:66
-msgid "Tried to obtain lock while already holding it"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:78
-msgid "Tried to break lock on database connection"
-msgstr ""
-
-# key: postgresql.con.sslfail
-#: org/postgresql/core/v3/QueryExecutorImpl.java:93
-#, fuzzy
-msgid "Interrupted while waiting to obtain lock on database connection"
-msgstr "Ошибка при установке SSL-подсоединения."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:275
-msgid "Unable to bind parameter values for statement."
-msgstr "Не в состоянии ассоциировать значения параметров для команды."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:726
-msgid "Database connection failed when starting copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:757
-msgid "Tried to cancel an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:794
-msgid "Database connection failed when canceling copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:799
-msgid "Missing expected error response to copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:801
-#, java-format
-msgid "Got {0} error responses to single copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:814
-msgid "Tried to end inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:827
-msgid "Database connection failed when ending copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:842
-#: org/postgresql/core/v3/QueryExecutorImpl.java:860
-msgid "Tried to write to an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:854
-#: org/postgresql/core/v3/QueryExecutorImpl.java:866
-msgid "Database connection failed when writing to copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:878
-msgid "Tried to read from inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:883
-msgid "Database connection failed when reading from copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:951
-#, java-format
-msgid "Received CommandComplete ''{0}'' without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:975
-#, java-format
-msgid "Got CopyInResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:988
-#, java-format
-msgid "Got CopyOutResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1003
-msgid "Got CopyData without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1005
-#, fuzzy, java-format
-msgid "Unexpected copydata from server for {0}"
-msgstr "Неожиданный статус команды: {0}."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1056
-#, java-format
-msgid "Unexpected packet type during copy: {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1310
-#, java-format
-msgid ""
-"Bind message length {0} too long. This can be caused by very large or "
-"incorrect length specifications on InputStream parameters."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1925
-#, java-format
-msgid ""
-"The server''s client_encoding parameter was changed to {0}. The JDBC driver "
-"requires client_encoding to be UTF8 for correct operation."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1932
-#, java-format
-msgid ""
-"The server''s DateStyle parameter was changed to {0}. The JDBC driver "
-"requires DateStyle to begin with ISO for correct operation."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1945
-#, java-format
-msgid ""
-"The server''s standard_conforming_strings parameter was reported as {0}. The "
-"JDBC driver expected on or off."
-msgstr ""
-
-# key: postgresql.con.sslnotsupported
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2015
-msgid "The driver currently does not support COPY operations."
-msgstr "Драйвер в данный момент не поддерживате операции COPY."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:112
-msgid "This PooledConnection has already been closed."
-msgstr "Это PooledConnection уже было закрыто."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid ""
-"Connection has been closed automatically because a new connection was opened "
-"for the same PooledConnection or the PooledConnection has been closed."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid "Connection has been closed."
-msgstr "Это Connection было закрыт."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:442
-msgid "Statement has been closed."
-msgstr "Statement закрыт."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:291
-msgid "Failed to setup DataSource."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:414
-msgid "DataSource has been closed."
-msgstr "DataSource закрыт."
-
-# key: postgresql.fp.expint
-#: org/postgresql/fastpath/Fastpath.java:81
-#: org/postgresql/fastpath/Fastpath.java:128
-#, java-format
-msgid "Fastpath call {0} - No result was returned and we expected an integer."
-msgstr ""
-
-# key: postgresql.fp.unknown
-#: org/postgresql/fastpath/Fastpath.java:237
-#, java-format
-msgid "The fastpath function {0} is unknown."
-msgstr ""
-
-# key: postgresql.geo.lseg
-#: org/postgresql/geometric/PGbox.java:83
-#: org/postgresql/geometric/PGcircle.java:82
-#: org/postgresql/geometric/PGcircle.java:91
-#: org/postgresql/geometric/PGline.java:80
-#: org/postgresql/geometric/PGlseg.java:77
-#: org/postgresql/geometric/PGpoint.java:85
-#, fuzzy, java-format
-msgid "Conversion to type {0} failed: {1}."
-msgstr "Ошибка при преобразовании типа lseg: {0}."
-
-# key: postgresql.geo.path
-#: org/postgresql/geometric/PGpath.java:81
-#, java-format
-msgid "Cannot tell if path is open or closed: {0}."
-msgstr ""
-
-#: org/postgresql/gss/MakeGSS.java:47 org/postgresql/gss/MakeGSS.java:55
-#: org/postgresql/gss/MakeGSS.java:168
-msgid "GSS Authentication failed"
-msgstr ""
-
-# key: postgresql.arr.range
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:153
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:790
-#, java-format
-msgid "The array index is out of range: {0}"
-msgstr "Индекс массива вне диапазона: {0}"
-
-# key: postgresql.arr.range
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:168
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:807
-#, java-format
-msgid "The array index is out of range: {0}, number of elements: {1}."
-msgstr "Индекс массива вне диапазона: {0}, число элементов: {1}."
-
-# key: postgresql.con.invalidchar
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:196
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1982
-#: org/postgresql/util/HStoreConverter.java:34
-#: org/postgresql/util/HStoreConverter.java:61
-msgid ""
-"Invalid character data was found. This is most likely caused by stored data "
-"containing characters that are invalid for the character set the database "
-"was created in. The most common example of this is storing 8bit data in a "
-"SQL_ASCII database."
-msgstr ""
-"Найдены неверные символьные данные. Причиной этого скорее всего являются "
-"хранимые данные содержащие символы не соответствующие набору символов базы. "
-"Типичным примером этого является хранение 8-битных данных в базе SQL_ASCII."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:73
-msgid ""
-"Truncation of large objects is only implemented in 8.3 and later servers."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:77
-msgid "Cannot truncate LOB to a negative length."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:81
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:235
-#, java-format
-msgid "PostgreSQL LOBs can only index to: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:231
-msgid "LOB positioning offsets start at 1."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:246
-msgid "free() was called on this LOB previously"
-msgstr ""
-
-# key: postgresql.prep.type
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:225
-#, fuzzy, java-format
-msgid "Unsupported value for stringtype parameter: {0}"
-msgstr "Неизвестное значение Types."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:245
-msgid "unknownLength parameter value must be an integer"
-msgstr ""
-
-# key: postgresql.stat.noresult
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:353
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:284
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:303
-#: org/postgresql/jdbc2/TypeInfoCache.java:201
-#: org/postgresql/jdbc2/TypeInfoCache.java:249
-#: org/postgresql/jdbc2/TypeInfoCache.java:287
-#: org/postgresql/jdbc2/TypeInfoCache.java:344
-#: org/postgresql/jdbc2/TypeInfoCache.java:348
-#: org/postgresql/jdbc2/TypeInfoCache.java:384
-#: org/postgresql/jdbc2/TypeInfoCache.java:388
-msgid "No results were returned by the query."
-msgstr "Запрос не вернул результатов."
-
-# key: postgresql.stat.result
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:367
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:336
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:368
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2702
-msgid "A result was returned when none was expected."
-msgstr "Результат возвращён когда его не ожидалось."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:519
-msgid "Custom type maps are not supported."
-msgstr ""
-
-# key: postgresql.con.creobj
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:567
-#, java-format
-msgid "Failed to create object for: {0}."
-msgstr "Ошибка при создании объект для: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:629
-#, java-format
-msgid "Unable to load the class {0} responsible for the datatype {1}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:725
-msgid ""
-"Cannot change transaction read-only property in the middle of a transaction."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:813
-msgid "Cannot commit when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:822
-#, fuzzy
-msgid "This connection has been closed."
-msgstr "Это Connection было закрыт."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:842
-msgid "Cannot rollback when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:929
-msgid ""
-"Cannot change transaction isolation level in the middle of a transaction."
-msgstr ""
-
-# key: postgresql.con.isolevel
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:934
-#, java-format
-msgid "Transaction isolation level {0} not supported."
-msgstr "Уровень изоляции транзакций {0} не поддерживается."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1001
-#, fuzzy
-msgid "Finalizing a Connection that was never closed:"
-msgstr "Это Connection было закрыт."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1103
-msgid "Unable to translate data into the desired encoding."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:63
-msgid ""
-"Unable to determine a value for MaxIndexKeys due to missing system catalog "
-"data."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:86
-msgid "Unable to find name datatype in the system catalogs."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:235
-msgid ""
-"Operation requires a scrollable ResultSet, but this ResultSet is "
-"FORWARD_ONLY."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:416
-msgid "Unexpected error while decoding character data from a large object."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:462
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:491
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:525
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3129
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3174
-#, java-format
-msgid "Cannot convert the column of type {0} to requested type {1}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:744
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:768
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1892
-msgid "Can''t use relative move methods while on the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:788
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2956
-#, java-format
-msgid "Invalid fetch direction constant: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:802
-msgid "Cannot call cancelRowUpdates() when on the insert row."
-msgstr ""
-
-# key: postgresql.updateable.oninsertrow
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:822
-msgid "Cannot call deleteRow() when on the insert row."
-msgstr ""
-
-# key: postgresql.updateable.beforestartdelete
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:828
-msgid ""
-"Currently positioned before the start of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-
-# key: postgresql.updateable.afterlastdelete
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:833
-msgid ""
-"Currently positioned after the end of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:838
-#, fuzzy
-msgid "There are no rows in this ResultSet."
-msgstr "Имя колонки {0} не найдено в этом ResultSet''е."
-
-# key: postgresql.updateable.notoninsertrow
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:885
-msgid "Not on the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:889
-msgid "You must specify at least one column value to insert a row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1074
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1805
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2494
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2524
-#, java-format
-msgid "The JVM claims not to support the encoding: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1078
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1121
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1534
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1663
-msgid "Provided InputStream failed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1191
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3137
-msgid "Provided Reader failed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1259
-msgid "Can''t refresh the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1327
-msgid "Cannot call updateRow() when on the insert row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1333
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3190
-msgid ""
-"Cannot update the ResultSet because it is either before the start or after "
-"the end of the results."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1582
-msgid "ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1650
-#, java-format
-msgid "No primary key found for table {0}."
-msgstr ""
-
-# key: postgresql.input.fetch.gt0
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1876
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2965
-msgid "Fetch size must be a value greater to or equal to 0."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2044
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2051
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2098
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2106
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2926
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2934
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2964
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2971
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2991
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3002
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3020
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3038
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3179
-#: org/postgresql/jdbc2/TimestampUtils.java:258
-#, java-format
-msgid "Bad value for type {0} : {1}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2727
-#, java-format
-msgid "The column name {0} was not found in this ResultSet."
-msgstr "Имя колонки {0} не найдено в этом ResultSet''е."
-
-# key: postgresql.updateable.notupdateable
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2827
-msgid ""
-"ResultSet is not updateable. The query that generated this result set must "
-"select only one table, and must select all primary keys from that table. See "
-"the JDBC 2.1 API Specification, section 5.6 for more details."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2839
-msgid "This ResultSet is closed."
-msgstr "ResultSet закрыт."
-
-# key: postgresql.res.nextrequired
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2860
-msgid "ResultSet not positioned properly, perhaps you need to call next."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:259
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:323
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:392
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2655
-msgid ""
-"Can''t use query methods that take a query string on a PreparedStatement."
-msgstr ""
-
-# key: postgresql.stat.noresult
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:287
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:306
-msgid "Multiple ResultSets were returned by the query."
-msgstr ""
-
-# key: postgresql.call.noreturnval
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:425
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:429
-msgid "A CallableStatement was executed with nothing returned."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:437
-msgid "A CallableStatement was executed with an invalid number of parameters"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:468
-#, java-format
-msgid ""
-"A CallableStatement function was executed and the out parameter {0} was of "
-"type {1} however type {2} was registered."
-msgstr ""
-
-# key: postgresql.input.rows.gt0
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:674
-msgid "Maximum number of rows must be a value grater than or equal to 0."
-msgstr ""
-
-# key: postgresql.input.query.gt0
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:717
-msgid "Query timeout must be a value greater than or equals to 0."
-msgstr ""
-
-# key: postgresql.input.field.gt0
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:809
-msgid "The maximum field size must be a value greater than or equal to 0."
-msgstr ""
-
-# key: postgresql.prep.type
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1226
-msgid "Unknown Types value."
-msgstr "Неизвестное значение Types."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1499
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1624
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3108
-#, java-format
-msgid "Invalid stream length {0}."
-msgstr "Неверная длина потока {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1530
-#, java-format
-msgid "The JVM claims not to support the {0} encoding."
-msgstr ""
-
-# key: postgresql.con.type
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1705
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3030
-#, java-format
-msgid "Unknown type {0}."
-msgstr "Неизвестный тип {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1720
-msgid "No hstore extension installed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1845
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1851
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1857
-#, java-format
-msgid "Cannot cast an instance of {0} to type {1}"
-msgstr ""
-
-# key: postgresql.prep.type
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1869
-#, fuzzy, java-format
-msgid "Unsupported Types value: {0}"
-msgstr "Неизвестное значение Types."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1927
-#, java-format
-msgid ""
-"Can''t infer the SQL type to use for an instance of {0}. Use setObject() "
-"with an explicit Types value to specify the type to use."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1975
-msgid ""
-"This statement does not declare an OUT parameter. Use '{' ?= call ... '}' "
-"to declare one."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2025
-msgid "wasNull cannot be call before fetching a result."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2521
-#, java-format
-msgid "Malformed function or procedure escape syntax at offset {0}."
-msgstr ""
-
-# key: postgresql.call.wrongget
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2571
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2585
-#, java-format
-msgid ""
-"Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was "
-"made."
-msgstr ""
-
-# key: postgresql.call.noreturntype
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2604
-msgid ""
-"A CallableStatement was declared, but no call to registerOutParameter(1, "
-"<some type>) was made."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2608
-msgid "No function outputs were registered."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2611
-msgid ""
-"Results cannot be retrieved from a CallableStatement before it is executed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2644
-msgid "This statement has been closed."
-msgstr "Этот Sstatement был закрыт."
-
-# key: postgresql.stat.noresult
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2724
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2794
-msgid "Too many update results were returned."
-msgstr "Возвращено слишком много результатов обновления."
-
-# key: postgresql.stat.batch.error
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2753
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2823
-#, java-format
-msgid ""
-"Batch entry {0} {1} was aborted. Call getNextException to see the cause."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3078
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3167
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3207
-msgid "Unexpected error writing large object to database."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:145
-#: org/postgresql/jdbc2/EscapedFunctions.java:157
-#: org/postgresql/jdbc2/EscapedFunctions.java:169
-#: org/postgresql/jdbc2/EscapedFunctions.java:206
-#: org/postgresql/jdbc2/EscapedFunctions.java:243
-#: org/postgresql/jdbc2/EscapedFunctions.java:267
-#: org/postgresql/jdbc2/EscapedFunctions.java:292
-#: org/postgresql/jdbc2/EscapedFunctions.java:316
-#: org/postgresql/jdbc2/EscapedFunctions.java:328
-#: org/postgresql/jdbc2/EscapedFunctions.java:352
-#: org/postgresql/jdbc2/EscapedFunctions.java:380
-#: org/postgresql/jdbc2/EscapedFunctions.java:389
-#: org/postgresql/jdbc2/EscapedFunctions.java:399
-#: org/postgresql/jdbc2/EscapedFunctions.java:408
-#: org/postgresql/jdbc2/EscapedFunctions.java:417
-#: org/postgresql/jdbc2/EscapedFunctions.java:426
-#: org/postgresql/jdbc2/EscapedFunctions.java:435
-#: org/postgresql/jdbc2/EscapedFunctions.java:444
-#: org/postgresql/jdbc2/EscapedFunctions.java:453
-#: org/postgresql/jdbc2/EscapedFunctions.java:462
-#: org/postgresql/jdbc2/EscapedFunctions.java:471
-#: org/postgresql/jdbc2/EscapedFunctions.java:480
-#, java-format
-msgid "{0} function takes one and only one argument."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:181
-#: org/postgresql/jdbc2/EscapedFunctions.java:193
-#: org/postgresql/jdbc2/EscapedFunctions.java:255
-#: org/postgresql/jdbc2/EscapedFunctions.java:304
-#: org/postgresql/jdbc2/EscapedFunctions.java:582
-#, java-format
-msgid "{0} function takes two and only two arguments."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:230
-#, java-format
-msgid "{0} function takes four and only four argument."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:282
-#: org/postgresql/jdbc2/EscapedFunctions.java:342
-#, java-format
-msgid "{0} function takes two or three arguments."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:362
-#: org/postgresql/jdbc2/EscapedFunctions.java:371
-#: org/postgresql/jdbc2/EscapedFunctions.java:573
-#: org/postgresql/jdbc2/EscapedFunctions.java:591
-#, java-format
-msgid "{0} function doesn''t take any argument."
-msgstr ""
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:489
-#: org/postgresql/jdbc2/EscapedFunctions.java:531
-#, java-format
-msgid "{0} function takes three and only three arguments."
-msgstr ""
-
-# key: postgresql.unimplemented
-#: org/postgresql/jdbc2/EscapedFunctions.java:501
-#: org/postgresql/jdbc2/EscapedFunctions.java:521
-#: org/postgresql/jdbc2/EscapedFunctions.java:523
-#: org/postgresql/jdbc2/EscapedFunctions.java:543
-#: org/postgresql/jdbc2/EscapedFunctions.java:564
-#: org/postgresql/jdbc2/EscapedFunctions.java:566
-#, fuzzy, java-format
-msgid "Interval {0} not yet implemented"
-msgstr "Этот метод ещё не реализован."
-
-#: org/postgresql/jdbc2/TimestampUtils.java:360
-msgid ""
-"Infinite value found for timestamp/date. This cannot be represented as time."
-msgstr ""
-
-# key: postgresql.prep.type
-#: org/postgresql/jdbc2/TimestampUtils.java:648
-#: org/postgresql/jdbc2/TimestampUtils.java:680
-#: org/postgresql/jdbc2/TimestampUtils.java:727
-#, fuzzy, java-format
-msgid "Unsupported binary encoding of {0}."
-msgstr "Неизвестное значение Types."
-
-#: org/postgresql/jdbc2/TypeInfoCache.java:161
-#, java-format
-msgid "The class {0} does not implement org.postgresql.util.PGobject."
-msgstr "Класс {0} не реализует org.postgresql.util.PGobject."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:60
-#, java-format
-msgid "Unknown ResultSet holdability setting: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:98
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:130
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:165
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:187
-msgid "Server versions prior to 8.0 do not support savepoints."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:100
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:132
-msgid "Cannot establish a savepoint in auto-commit mode."
-msgstr ""
-
-# key: postgresql.con.isolevel
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:419
-msgid "Returning autogenerated keys is not supported."
-msgstr ""
-
-# key: postgresql.arr.range
-#: org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java:81
-#, fuzzy, java-format
-msgid "The parameter index is out of range: {0}, number of parameters: {1}."
-msgstr "Индекс массива вне диапазона: {0}, число элементов: {1}."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:151
-msgid ""
-"Returning autogenerated keys is only supported for 8.2 and later servers."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:199
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:317
-msgid "Returning autogenerated keys by column index is not supported."
-msgstr ""
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:38
-#: org/postgresql/jdbc3/PSQLSavepoint.java:50
-#: org/postgresql/jdbc3/PSQLSavepoint.java:66
-msgid "Cannot reference a savepoint after it has been released."
-msgstr ""
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:42
-msgid "Cannot retrieve the id of a named savepoint."
-msgstr ""
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:54
-msgid "Cannot retrieve the name of an unnamed savepoint."
-msgstr ""
-
-#: org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java:37
-msgid "Invalid UUID data."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:83
-#, java-format
-msgid "Unable to find server array type for provided name {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:121
-#, fuzzy, java-format
-msgid "Invalid timeout ({0}<0)."
-msgstr "Неверная длина потока {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:134
-msgid "Validating connection."
-msgstr ""
-
-# key: postgresql.con.creobj
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:157
-#, fuzzy, java-format
-msgid "Failed to set ClientInfo property: {0}"
-msgstr "Ошибка при создании объект для: {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:166
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:188
-msgid "ClientInfo property not supported."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Statement.java:127
-msgid "Object is too large to send over the protocol."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:147
-msgid "Unable to decode xml data."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:150
-#, java-format
-msgid "Unknown XML Source class: {0}"
-msgstr ""
-
-# key: postgresql.con.creobj
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:195
-#, fuzzy
-msgid "Unable to create SAXResult for SQLXML."
-msgstr "Ошибка при создании объект для: {0}."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:209
-msgid "Unable to create StAXResult for SQLXML"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:213
-#, java-format
-msgid "Unknown XML Result class: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:226
-#, fuzzy
-msgid "This SQLXML object has already been freed."
-msgstr "Это PooledConnection уже было закрыто."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:233
-msgid ""
-"This SQLXML object has not been initialized, so you cannot retrieve data "
-"from it."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:244
-#, java-format
-msgid "Failed to convert binary xml data to encoding: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:269
-msgid "Unable to convert DOMResult SQLXML data to a string."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:282
-msgid ""
-"This SQLXML object has already been initialized, so you cannot manipulate it "
-"further."
-msgstr ""
-
-# key: postgresql.lo.init
-#: org/postgresql/largeobject/LargeObjectManager.java:138
-msgid "Failed to initialize LargeObject API"
-msgstr "Ошибка при инициализации LargeObject API"
-
-#: org/postgresql/largeobject/LargeObjectManager.java:257
-#: org/postgresql/largeobject/LargeObjectManager.java:298
-msgid "Large Objects may not be used in auto-commit mode."
-msgstr ""
-"Большие объекты не могут использоваться в режиме авто-подтверждения (auto-"
-"commit)."
-
-#: org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java:58
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:110
-#, java-format
-msgid "The SSLSocketFactory class provided {0} could not be instantiated."
-msgstr "Предоставленный класс SSLSocketFactory {0} нельзя инстанциировать."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:125
-#, java-format
-msgid "SSL error: {0}"
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:138
-#, fuzzy, java-format
-msgid "The HostnameVerifier class provided {0} could not be instantiated."
-msgstr "Предоставленный класс SSLSocketFactory {0} нельзя инстанциировать."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:142
-#, java-format
-msgid "The hostname {0} could not be verified by hostnameverifier {1}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:149
-#, fuzzy, java-format
-msgid "The hostname {0} could not be verified."
-msgstr "Предоставленный класс SSLSocketFactory {0} нельзя инстанциировать."
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:121
-msgid ""
-"Could not find a java cryptographic algorithm: X.509 CertificateFactory not "
-"available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:132
-#, java-format
-msgid "Could not open SSL certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:137
-#, java-format
-msgid "Loading the SSL certificate {0} into a KeyManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:194
-msgid "Enter SSL password: "
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:202
-msgid "Could not read password for SSL key file, console is not available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:204
-#, java-format
-msgid "Could not read password for SSL key file by callbackhandler {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:223
-#, java-format
-msgid "Could not decrypt SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:231
-#, java-format
-msgid "Could not read SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:235
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:173
-#, java-format
-msgid "Could not find a java cryptographic algorithm: {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:99
-#, fuzzy, java-format
-msgid "The password callback class provided {0} could not be instantiated."
-msgstr "Предоставленный класс SSLSocketFactory {0} нельзя инстанциировать."
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:133
-#, java-format
-msgid "Could not open SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:150
-#, java-format
-msgid "Could not read SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:153
-#, java-format
-msgid "Loading the SSL root certificate {0} into a TrustManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:166
-msgid "Could not initialize SSL context."
-msgstr ""
-
-# key: postgresql.money
-#: org/postgresql/util/PGInterval.java:164
-#, fuzzy
-msgid "Conversion of interval failed"
-msgstr "Ошибка при преобразовании типа money."
-
-# key: postgresql.money
-#: org/postgresql/util/PGmoney.java:73
-msgid "Conversion of money failed."
-msgstr "Ошибка при преобразовании типа money."
-
-# key: postgresql.error.detail
-#: org/postgresql/util/ServerErrorMessage.java:155
-#, java-format
-msgid "Detail: {0}"
-msgstr "Подробности: {0}"
-
-# key: postgresql.error.hint
-#: org/postgresql/util/ServerErrorMessage.java:159
-#, java-format
-msgid "Hint: {0}"
-msgstr "Подсказка: {0}"
-
-# key: postgresql.error.position
-#: org/postgresql/util/ServerErrorMessage.java:162
-#, java-format
-msgid "Position: {0}"
-msgstr "Позиция: {0}"
-
-# key: postgresql.error.where
-#: org/postgresql/util/ServerErrorMessage.java:165
-#, java-format
-msgid "Where: {0}"
-msgstr "Где: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:171
-#, java-format
-msgid "Internal Query: {0}"
-msgstr ""
-
-# key: postgresql.error.position
-#: org/postgresql/util/ServerErrorMessage.java:174
-#, fuzzy, java-format
-msgid "Internal Position: {0}"
-msgstr "Позиция: {0}"
-
-# key: postgresql.error.location
-#: org/postgresql/util/ServerErrorMessage.java:180
-#, java-format
-msgid "Location: File: {0}, Routine: {1}, Line: {2}"
-msgstr "Местонахождение: Файл {0}, Процедура: {1}, Строка: {2}"
-
-#: org/postgresql/util/ServerErrorMessage.java:183
-#, java-format
-msgid "Server SQLState: {0}"
-msgstr "SQLState сервера: {0}"
-
-#: org/postgresql/xa/PGXAConnection.java:148
-msgid ""
-"Transaction control methods setAutoCommit(true), commit, rollback and "
-"setSavePoint not allowed while an XA transaction is active."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:186
-#: org/postgresql/xa/PGXAConnection.java:245
-msgid "Invalid flags"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:189
-#: org/postgresql/xa/PGXAConnection.java:248
-#: org/postgresql/xa/PGXAConnection.java:425
-msgid "xid must not be null"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:192
-msgid "Connection is busy with another transaction"
-msgstr ""
-
-# key: postgresql.unimplemented
-#: org/postgresql/xa/PGXAConnection.java:198
-#: org/postgresql/xa/PGXAConnection.java:255
-#, fuzzy
-msgid "suspend/resume not implemented"
-msgstr "Этот метод ещё не реализован."
-
-# key: postgresql.con.isolevel
-#: org/postgresql/xa/PGXAConnection.java:204
-#: org/postgresql/xa/PGXAConnection.java:207
-#: org/postgresql/xa/PGXAConnection.java:209
-#, fuzzy
-msgid "Transaction interleaving not implemented"
-msgstr "Уровень изоляции транзакций {0} не поддерживается."
-
-#: org/postgresql/xa/PGXAConnection.java:218
-msgid "Error disabling autocommit"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:251
-msgid "tried to call end without corresponding start call"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:282
-msgid ""
-"Not implemented: Prepare must be issued using the same connection that "
-"started the transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:286
-msgid "Prepare called before end"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:292
-msgid "Server versions prior to 8.1 do not support two-phase commit."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:313
-msgid "Error preparing transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:328
-msgid "Invalid flag"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:368
-msgid "Error during recover"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:416
-msgid "Error rolling back prepared transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:451
-msgid ""
-"Not implemented: one-phase commit must be issued using the same connection "
-"that was used to start it"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:455
-msgid "commit called before end"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:466
-msgid "Error during one-phase commit"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:487
-msgid ""
-"Not implemented: 2nd phase commit must be issued using an idle connection"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:507
-msgid "Error committing prepared transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:522
-msgid "Heuristic commit/rollback not supported"
-msgstr ""
-
-# key: postgresql.con.sslnotsupported
-#~ msgid "The driver does not support SSL."
-#~ msgstr "Драйвер не поддерживает SSL."
-
-# key: postgresql.error.position
-#~ msgid "Exception: {0}"
-#~ msgstr "Ошибка/исключение: {0}"
-
-# key: postgresql.geo.circle
-#~ msgid "Conversion of circle failed: {0}."
-#~ msgstr "Ошибка при преобразовании типа circle: {0}."
-
-# key: postgresql.geo.line
-#~ msgid "Conversion of line failed: {0}."
-#~ msgstr "Ошибка при преобразовании типа line: {0}."
-
-# key: postgresql.geo.point
-#~ msgid "Conversion of point failed: {0}."
-#~ msgstr "Ошибка при преобразовании типа point: {0}."
-
-# key: postgresql.res.badbyte
-#~ msgid "Bad byte: {0}"
-#~ msgstr "Плохой byte: {0}"
-
-# key: postgresql.res.badshort
-#~ msgid "Bad short: {0}"
-#~ msgstr "Плохой short: {0}"
-
-# key: postgresql.error.hint
-#~ msgid "Bad int: {0}"
-#~ msgstr "Плохой int: {0}"
-
-# key: postgresql.res.badlong
-#~ msgid "Bad long: {0}"
-#~ msgstr "Плохой long: {0}"
-
-# key: postgresql.res.badbigdec
-#~ msgid "Bad BigDecimal: {0}"
-#~ msgstr "Плохой BigDecimal: {0}"
-
-# key: postgresql.res.badfloat
-#~ msgid "Bad float: {0}"
-#~ msgstr "Плохой float: {0}"
-
-# key: postgresql.res.baddouble
-#~ msgid "Bad double: {0}"
-#~ msgstr "Плохой double: {0}"
-
-# key: postgresql.res.badbyte
-#~ msgid "Bad date: {0}"
-#~ msgstr "Плохая date: {0}"
-
-#~ msgid "Could not extract nanoseconds from {0}."
-#~ msgstr "Не получилось извлечь наносекунды из {0}."
diff --git a/org/postgresql/translation/sr.po b/org/postgresql/translation/sr.po
deleted file mode 100644
index 06043f1..0000000
--- a/org/postgresql/translation/sr.po
+++ /dev/null
@@ -1,1502 +0,0 @@
-# Serbian message translation for the PostgreSQL JDBC driver
-# This file is distributed under the same license as the package.
-#
-#
-# Bojan Skaljac <skaljac at gmail.com> 2006.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PostgreSQL 8.1\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-10-31 13:37+0000\n"
-"PO-Revision-Date: 2009-05-26 11:13+0100\n"
-"Last-Translator: Bojan Škaljac <skaljac (at) gmail.com>\n"
-"Language-Team: Srpski <skaljac at gmail.com>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Poedit-Language: Serbian\n"
-"X-Poedit-Country: YUGOSLAVIA\n"
-
-#: org/postgresql/Driver.java.in:235
-msgid "Error loading default settings from driverconfig.properties"
-msgstr "Greška u čitanju standardnih podešavanja iz driverconfig.properties"
-
-#: org/postgresql/Driver.java.in:282
-msgid ""
-"Your security policy has prevented the connection from being attempted. You "
-"probably need to grant the connect java.net.SocketPermission to the database "
-"server host and port that you wish to connect to."
-msgstr ""
-"Sigurnosna podešavanja su sprečila konekciju. Verovatno je potrebno da "
-"dozvolite konekciju klasi java.net.SocketPermission na bazu na serveru."
-
-#: org/postgresql/Driver.java.in:287 org/postgresql/Driver.java.in:351
-msgid ""
-"Something unusual has occurred to cause the driver to fail. Please report "
-"this exception."
-msgstr ""
-"Nešto neobično se dogodilo i drajver je zakazao. Molim prijavite ovaj "
-"izuzetak."
-
-#: org/postgresql/Driver.java.in:359
-msgid "Connection attempt timed out."
-msgstr "Isteklo je vreme za pokušaj konektovanja."
-
-#: org/postgresql/Driver.java.in:372
-msgid "Interrupted while attempting to connect."
-msgstr "Prekinut pokušaj konektovanja."
-
-#: org/postgresql/Driver.java.in:714
-#, java-format
-msgid "Method {0} is not yet implemented."
-msgstr "Metod {0} nije još impelemtiran."
-
-#: org/postgresql/copy/CopyManager.java:56
-#, java-format
-msgid "Requested CopyIn but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/CopyManager.java:67
-#, java-format
-msgid "Requested CopyOut but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:51
-#, java-format
-msgid "Copying from database failed: {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:67
-#: org/postgresql/copy/PGCopyOutputStream.java:90
-#, fuzzy
-msgid "This copy stream is closed."
-msgstr "ResultSet je zatvoren."
-
-#: org/postgresql/copy/PGCopyInputStream.java:108
-msgid "Read from copy failed."
-msgstr ""
-
-#: org/postgresql/copy/PGCopyOutputStream.java:68
-#, java-format
-msgid "Cannot write to copy a byte of value {0}"
-msgstr ""
-
-#: org/postgresql/core/ConnectionFactory.java:69
-#, java-format
-msgid "A connection could not be made using the requested protocol {0}."
-msgstr "Konekciju nije moguće kreirati uz pomoć protokola {0}."
-
-#: org/postgresql/core/Oid.java:113
-#, java-format
-msgid "oid type {0} not known and not a number"
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:490
-#, java-format
-msgid "Premature end of input stream, expected {0} bytes, but only read {1}."
-msgstr ""
-"Prevremen završetak ulaznog toka podataka,očekivano {0} bajtova, a pročitano "
-"samo {1}."
-
-#: org/postgresql/core/PGStream.java:530
-#, java-format
-msgid "Expected an EOF from server, got: {0}"
-msgstr "Očekivan EOF od servera, a dobijeno: {0}"
-
-#: org/postgresql/core/SetupQueryRunner.java:86
-msgid "An unexpected result was returned by a query."
-msgstr "Nepredviđen rezultat je vraćen od strane upita."
-
-#: org/postgresql/core/UTF8Encoding.java:28
-#, java-format
-msgid ""
-"Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}"
-msgstr ""
-"Ilegalna UTF-8 sekvenca: bajt {0} od {1} bajtova sekvence nije 10xxxxxx: {2}"
-
-#: org/postgresql/core/UTF8Encoding.java:61
-#, java-format
-msgid "Illegal UTF-8 sequence: {0} bytes used to encode a {1} byte value: {2}"
-msgstr ""
-"Ilegalna UTF-8 sekvenca: {0} bytes used to encode a {1} byte value: {2}"
-
-#: org/postgresql/core/UTF8Encoding.java:98
-#: org/postgresql/core/UTF8Encoding.java:125
-#, java-format
-msgid "Illegal UTF-8 sequence: initial byte is {0}: {1}"
-msgstr "Ilegalna UTF-8 sekvenca: inicijalni bajt je {0}: {1}"
-
-#: org/postgresql/core/UTF8Encoding.java:130
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is out of range: {0}"
-msgstr "Ilegalna UTF-8 sekvenca: finalna vrednost je van opsega: {0}"
-
-#: org/postgresql/core/UTF8Encoding.java:145
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is a surrogate value: {0}"
-msgstr "Ilegalna UTF-8 sekvenca: finalna vrednost je zamena vrednosti: {0}"
-
-#: org/postgresql/core/Utils.java:95 org/postgresql/core/Utils.java:112
-msgid "Zero bytes may not occur in string parameters."
-msgstr "Nula bajtovji se ne smeju pojavljivati u string parametrima."
-
-#: org/postgresql/core/Utils.java:145
-msgid "Zero bytes may not occur in identifiers."
-msgstr "Nula bajtovji se ne smeju pojavljivati u identifikatorima."
-
-#: org/postgresql/core/types/PGBigDecimal.java:63
-#: org/postgresql/core/types/PGBoolean.java:62
-#: org/postgresql/core/types/PGByte.java:63
-#: org/postgresql/core/types/PGDouble.java:64
-#: org/postgresql/core/types/PGFloat.java:64
-#: org/postgresql/core/types/PGInteger.java:61
-#: org/postgresql/core/types/PGLong.java:62
-#: org/postgresql/core/types/PGNumber.java:62
-#: org/postgresql/core/types/PGShort.java:58
-#: org/postgresql/core/types/PGString.java:73
-#, java-format
-msgid "Cannot convert an instance of {0} to type {1}"
-msgstr "Nije moguće konvertovati instancu {0} u tip {1}"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:66
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:74
-#, fuzzy, java-format
-msgid "Invalid sslmode value: {0}"
-msgstr "Nevažeća dužina toka {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:134
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:207
-msgid ""
-"Connection refused. Check that the hostname and port are correct and that "
-"the postmaster is accepting TCP/IP connections."
-msgstr ""
-"Konekcija odbijena. Proverite dali je ime domćina (host) koretno i da "
-"postmaster podržava TCP/IP konekcije."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:153
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:225
-msgid "The connection attempt failed."
-msgstr "Pokušaj konektovanja propao."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:175
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:246
-#, fuzzy
-msgid "The connection url is invalid."
-msgstr "Pokušaj konektovanja propao."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:198
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:210
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:295
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:307
-msgid "The server does not support SSL."
-msgstr "Server ne podržava SSL."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:223
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:320
-msgid "An error occurred while setting up the SSL connection."
-msgstr "Greška se dogodila prilikom podešavanja SSL konekcije."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:272
-#, java-format
-msgid "Connection rejected: {0}."
-msgstr "Konekcija odbačena: {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:290
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:312
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:332
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:419
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:444
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:471
-msgid ""
-"The server requested password-based authentication, but no password was "
-"provided."
-msgstr ""
-"Server zahteva autentifikaciju baziranu na šifri, ali šifra nije prosleđena."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:356
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:504
-#, java-format
-msgid ""
-"The authentication type {0} is not supported. Check that you have configured "
-"the pg_hba.conf file to include the client''s IP address or subnet, and that "
-"it is using an authentication scheme supported by the driver."
-msgstr ""
-"Tip autentifikacije {0} nije podržan. Proverite dali imate podešen pg_hba."
-"conf fajl koji uključuje klijentovu IP adresu ili podmrežu, i da ta mreža "
-"koristi šemu autentifikacije koja je podržana od strane ovog drajvera."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:362
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:400
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:510
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:553
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:599
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:609
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:618
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:626
-#: org/postgresql/gss/MakeGSS.java:158
-msgid "Protocol error. Session setup failed."
-msgstr "Greška protokola. Zakazivanje sesije propalo."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:390
-#, java-format
-msgid "Backend start-up failed: {0}."
-msgstr "Pozadinsko startovanje propalo: {0}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:55
-#: org/postgresql/core/v2/FastpathParameterList.java:77
-#: org/postgresql/core/v2/FastpathParameterList.java:84
-#: org/postgresql/core/v2/SimpleParameterList.java:57
-#: org/postgresql/core/v2/SimpleParameterList.java:76
-#: org/postgresql/core/v2/SimpleParameterList.java:83
-#: org/postgresql/core/v2/SimpleParameterList.java:90
-#: org/postgresql/core/v3/CompositeParameterList.java:35
-#: org/postgresql/core/v3/SimpleParameterList.java:49
-#: org/postgresql/core/v3/SimpleParameterList.java:56
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2845
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java:419
-#, java-format
-msgid "The column index is out of range: {0}, number of columns: {1}."
-msgstr "Indeks kolone van osega: {0}, broj kolona: {1}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:142
-#: org/postgresql/core/v2/SimpleParameterList.java:155
-#: org/postgresql/core/v3/SimpleParameterList.java:216
-#, java-format
-msgid "No value specified for parameter {0}."
-msgstr "Nije zadata vrednost za parametar {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:72
-#: org/postgresql/core/v2/QueryExecutorImpl.java:337
-#: org/postgresql/core/v3/QueryExecutorImpl.java:443
-#: org/postgresql/core/v3/QueryExecutorImpl.java:507
-#, java-format
-msgid "Expected command status BEGIN, got {0}."
-msgstr "Očekivan status komande je BEGIN, a dobijeno je {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:78
-#: org/postgresql/core/v3/QueryExecutorImpl.java:513
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1828
-#, java-format
-msgid "Unexpected command status: {0}."
-msgstr "Neočekivan komandni status: {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:118
-#: org/postgresql/core/v2/QueryExecutorImpl.java:129
-#: org/postgresql/core/v2/QueryExecutorImpl.java:174
-#: org/postgresql/core/v2/QueryExecutorImpl.java:369
-#: org/postgresql/core/v3/QueryExecutorImpl.java:281
-#: org/postgresql/core/v3/QueryExecutorImpl.java:411
-#: org/postgresql/core/v3/QueryExecutorImpl.java:485
-#: org/postgresql/core/v3/QueryExecutorImpl.java:551
-#: org/postgresql/core/v3/QueryExecutorImpl.java:631
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2094
-#, fuzzy
-msgid "An I/O error occured while sending to the backend."
-msgstr ""
-"Ulazno/izlazna greška se dogodila prilikom slanja podataka pozadinskom "
-"procesu."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:170
-#: org/postgresql/core/v2/QueryExecutorImpl.java:225
-#: org/postgresql/core/v2/QueryExecutorImpl.java:236
-#: org/postgresql/core/v3/QueryExecutorImpl.java:627
-#: org/postgresql/core/v3/QueryExecutorImpl.java:685
-#, java-format
-msgid "Unknown Response Type {0}."
-msgstr "Nepoznat tip odziva {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:430
-#: org/postgresql/core/v2/QueryExecutorImpl.java:475
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1857
-msgid "Ran out of memory retrieving query results."
-msgstr "Nestalo je memorije prilikom preuzimanja rezultata upita."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:597
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2199
-#, java-format
-msgid "Unable to interpret the update count in command completion tag: {0}."
-msgstr ""
-"Neuspešno prekidanje prebrojavanja ažurivanja u tagu zakompletiranje "
-"komandi: {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:610
-msgid "Copy not implemented for protocol version 2"
-msgstr ""
-
-#: org/postgresql/core/v3/CopyOperationImpl.java:56
-msgid "CommandComplete expected COPY but got: "
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:66
-msgid "Tried to obtain lock while already holding it"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:78
-msgid "Tried to break lock on database connection"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:93
-#, fuzzy
-msgid "Interrupted while waiting to obtain lock on database connection"
-msgstr "Prekinut pokušaj konektovanja."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:275
-msgid "Unable to bind parameter values for statement."
-msgstr "Nije moguće naći vrednost vezivnog parametra za izjavu (statement)."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:726
-msgid "Database connection failed when starting copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:757
-msgid "Tried to cancel an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:794
-msgid "Database connection failed when canceling copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:799
-msgid "Missing expected error response to copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:801
-#, java-format
-msgid "Got {0} error responses to single copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:814
-msgid "Tried to end inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:827
-msgid "Database connection failed when ending copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:842
-#: org/postgresql/core/v3/QueryExecutorImpl.java:860
-msgid "Tried to write to an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:854
-#: org/postgresql/core/v3/QueryExecutorImpl.java:866
-msgid "Database connection failed when writing to copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:878
-msgid "Tried to read from inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:883
-msgid "Database connection failed when reading from copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:951
-#, java-format
-msgid "Received CommandComplete ''{0}'' without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:975
-#, java-format
-msgid "Got CopyInResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:988
-#, java-format
-msgid "Got CopyOutResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1003
-msgid "Got CopyData without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1005
-#, fuzzy, java-format
-msgid "Unexpected copydata from server for {0}"
-msgstr "Očekivan EOF od servera, a dobijeno: {0}"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1056
-#, java-format
-msgid "Unexpected packet type during copy: {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1310
-#, java-format
-msgid ""
-"Bind message length {0} too long. This can be caused by very large or "
-"incorrect length specifications on InputStream parameters."
-msgstr ""
-"Dužina vezivne poruke {0} prevelika. Ovo je možda rezultat veoma velike ili "
-"pogrešne dužine specifikacije za InputStream parametre."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1925
-#, fuzzy, java-format
-msgid ""
-"The server''s client_encoding parameter was changed to {0}. The JDBC driver "
-"requires client_encoding to be UTF8 for correct operation."
-msgstr ""
-"Serverov client_encoding parametar je promenjen u {0}.JDBC darajver zahteva "
-"UNICODE client_encoding za uspešno izvršavanje operacije."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1932
-#, java-format
-msgid ""
-"The server''s DateStyle parameter was changed to {0}. The JDBC driver "
-"requires DateStyle to begin with ISO for correct operation."
-msgstr ""
-"Serverov DataStyle parametar promenjen u {0}. JDBC zahteva da DateStyle "
-"počinje sa ISO za uspešno završavanje operacije."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1945
-#, java-format
-msgid ""
-"The server''s standard_conforming_strings parameter was reported as {0}. The "
-"JDBC driver expected on or off."
-msgstr ""
-"Serverov standard_conforming_strings parametar javlja {0}. JDBC drajver "
-"ocekuje on ili off."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2015
-msgid "The driver currently does not support COPY operations."
-msgstr "Drajver trenutno ne podržava COPY operacije."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:112
-msgid "This PooledConnection has already been closed."
-msgstr "PooledConnection je već zatvoren."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid ""
-"Connection has been closed automatically because a new connection was opened "
-"for the same PooledConnection or the PooledConnection has been closed."
-msgstr ""
-"Konekcija je zatvorena automatski zato što je nova konekcija otvorena za "
-"isti PooledConnection ili je PooledConnection zatvoren."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid "Connection has been closed."
-msgstr "Konekcija je već zatvorena."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:442
-msgid "Statement has been closed."
-msgstr "Statemen je već zatvoren."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:291
-msgid "Failed to setup DataSource."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:414
-msgid "DataSource has been closed."
-msgstr "DataSource je zatvoren."
-
-#: org/postgresql/fastpath/Fastpath.java:81
-#: org/postgresql/fastpath/Fastpath.java:128
-#, java-format
-msgid "Fastpath call {0} - No result was returned and we expected an integer."
-msgstr ""
-"Fastpath poziv {0} - Nikakav rezultat nije vraćen a očekivan je integer."
-
-#: org/postgresql/fastpath/Fastpath.java:237
-#, java-format
-msgid "The fastpath function {0} is unknown."
-msgstr "Fastpath funkcija {0} je nepoznata."
-
-#: org/postgresql/geometric/PGbox.java:83
-#: org/postgresql/geometric/PGcircle.java:82
-#: org/postgresql/geometric/PGcircle.java:91
-#: org/postgresql/geometric/PGline.java:80
-#: org/postgresql/geometric/PGlseg.java:77
-#: org/postgresql/geometric/PGpoint.java:85
-#, java-format
-msgid "Conversion to type {0} failed: {1}."
-msgstr "Konverzija u tip {0} propala: {1}."
-
-#: org/postgresql/geometric/PGpath.java:81
-#, java-format
-msgid "Cannot tell if path is open or closed: {0}."
-msgstr "Nije moguće utvrditi dali je putanja otvorena ili zatvorena: {0}."
-
-#: org/postgresql/gss/MakeGSS.java:47 org/postgresql/gss/MakeGSS.java:55
-#: org/postgresql/gss/MakeGSS.java:168
-msgid "GSS Authentication failed"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:153
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:790
-#, java-format
-msgid "The array index is out of range: {0}"
-msgstr "Indeks niza je van opsega: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:168
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:807
-#, java-format
-msgid "The array index is out of range: {0}, number of elements: {1}."
-msgstr "Indeks niza je van opsega: {0}, broj elemenata: {1}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:196
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1982
-#: org/postgresql/util/HStoreConverter.java:34
-#: org/postgresql/util/HStoreConverter.java:61
-msgid ""
-"Invalid character data was found. This is most likely caused by stored data "
-"containing characters that are invalid for the character set the database "
-"was created in. The most common example of this is storing 8bit data in a "
-"SQL_ASCII database."
-msgstr ""
-"Pronađeni su nevažeći karakter podaci. Uzrok je najverovatnije to što "
-"pohranjeni podaci sadrže karaktere koji su nevažeći u setu karaktera sa "
-"kojima je baza kreirana. Npr. Čuvanje 8bit podataka u SQL_ASCII bazi "
-"podataka."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:73
-msgid ""
-"Truncation of large objects is only implemented in 8.3 and later servers."
-msgstr ""
-"Skraćivanje velikih objekata je implementirano samo u 8.3 i novijim "
-"serverima."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:77
-msgid "Cannot truncate LOB to a negative length."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:81
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:235
-#, java-format
-msgid "PostgreSQL LOBs can only index to: {0}"
-msgstr "PostgreSQL LOB mogu jedino da označavaju: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:231
-msgid "LOB positioning offsets start at 1."
-msgstr "LOB pozicija ofset počinje kod 1."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:246
-msgid "free() was called on this LOB previously"
-msgstr "free() je pozvan na ovom LOB-u prethodno"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:225
-#, java-format
-msgid "Unsupported value for stringtype parameter: {0}"
-msgstr "Vrednost za parametar tipa string nije podržana: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:245
-msgid "unknownLength parameter value must be an integer"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:353
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:284
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:303
-#: org/postgresql/jdbc2/TypeInfoCache.java:201
-#: org/postgresql/jdbc2/TypeInfoCache.java:249
-#: org/postgresql/jdbc2/TypeInfoCache.java:287
-#: org/postgresql/jdbc2/TypeInfoCache.java:344
-#: org/postgresql/jdbc2/TypeInfoCache.java:348
-#: org/postgresql/jdbc2/TypeInfoCache.java:384
-#: org/postgresql/jdbc2/TypeInfoCache.java:388
-msgid "No results were returned by the query."
-msgstr "Nikakav rezultat nije vraćen od strane upita."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:367
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:336
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:368
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2702
-msgid "A result was returned when none was expected."
-msgstr "Rezultat vraćen ali nikakav rezultat nije očekivan."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:519
-msgid "Custom type maps are not supported."
-msgstr "Mape sa korisnički definisanim tipovima nisu podržane."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:567
-#, java-format
-msgid "Failed to create object for: {0}."
-msgstr "Propao pokušaj kreiranja objekta za: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:629
-#, java-format
-msgid "Unable to load the class {0} responsible for the datatype {1}"
-msgstr "Nije moguće učitati kalsu {0} odgovornu za tip podataka {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:725
-msgid ""
-"Cannot change transaction read-only property in the middle of a transaction."
-msgstr ""
-"Nije moguće izmeniti read-only osobinu transakcije u sred izvršavanja "
-"transakcije."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:813
-msgid "Cannot commit when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:822
-#, fuzzy
-msgid "This connection has been closed."
-msgstr "Konekcija je već zatvorena."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:842
-msgid "Cannot rollback when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:929
-msgid ""
-"Cannot change transaction isolation level in the middle of a transaction."
-msgstr ""
-"Nije moguće izmeniti nivo izolacije transakcije u sred izvršavanja "
-"transakcije."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:934
-#, java-format
-msgid "Transaction isolation level {0} not supported."
-msgstr "Nivo izolacije transakcije {0} nije podržan."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1001
-msgid "Finalizing a Connection that was never closed:"
-msgstr "Dovršavanje konekcije koja nikada nije zatvorena:"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1103
-msgid "Unable to translate data into the desired encoding."
-msgstr "Nije moguće prevesti podatke u odabrani encoding format."
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:63
-msgid ""
-"Unable to determine a value for MaxIndexKeys due to missing system catalog "
-"data."
-msgstr ""
-"Nije moguće odrediti vrednost za MaxIndexKezs zbog nedostatka podataka u "
-"sistemskom katalogu."
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:86
-msgid "Unable to find name datatype in the system catalogs."
-msgstr "Nije moguće pronaći ime tipa podatka u sistemskom katalogu."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:235
-msgid ""
-"Operation requires a scrollable ResultSet, but this ResultSet is "
-"FORWARD_ONLY."
-msgstr ""
-"Operacija zahteva skrolabilan ResultSet,ali ovaj ResultSet je FORWARD_ONLY."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:416
-msgid "Unexpected error while decoding character data from a large object."
-msgstr "Neočekivana greška prilikom dekodiranja karaktera iz velikog objekta."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:462
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:491
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:525
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3129
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3174
-#, fuzzy, java-format
-msgid "Cannot convert the column of type {0} to requested type {1}."
-msgstr "Nije moguće konvertovati instancu {0} u tip {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:744
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:768
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1892
-msgid "Can''t use relative move methods while on the insert row."
-msgstr ""
-"Ne može se koristiti metod relativnog pomeranja prilikom ubacivanja redova."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:788
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2956
-#, java-format
-msgid "Invalid fetch direction constant: {0}."
-msgstr "Pogrešna konstanta za direkciju donošenja: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:802
-msgid "Cannot call cancelRowUpdates() when on the insert row."
-msgstr "Nije moguće pozvati cancelRowUpdates() prilikom ubacivanja redova."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:822
-msgid "Cannot call deleteRow() when on the insert row."
-msgstr "Nije moguće pozvati deleteRow() prilikom ubacivanja redova."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:828
-msgid ""
-"Currently positioned before the start of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"Trenutna pozicija pre početka ResultSet-a. Ne možete pozvati deleteRow() na "
-"toj poziciji."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:833
-msgid ""
-"Currently positioned after the end of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"Trenutna pozicija posle kraja ResultSet-a. Ne možete pozvati deleteRow() na "
-"toj poziciji."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:838
-msgid "There are no rows in this ResultSet."
-msgstr "U ResultSet-u nema redova."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:885
-msgid "Not on the insert row."
-msgstr "Nije mod ubacivanja redova."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:889
-msgid "You must specify at least one column value to insert a row."
-msgstr ""
-"Morate specificirati barem jednu vrednost za kolonu da bi ste ubacili red."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1074
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1805
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2494
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2524
-#, java-format
-msgid "The JVM claims not to support the encoding: {0}"
-msgstr "JVM tvrdi da ne podržava encoding: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1078
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1121
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1534
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1663
-msgid "Provided InputStream failed."
-msgstr "Pribaljeni InputStream zakazao."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1191
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3137
-msgid "Provided Reader failed."
-msgstr "Pribavljeni čitač (Reader) zakazao."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1259
-msgid "Can''t refresh the insert row."
-msgstr "Nije moguće osvežiti ubačeni red."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1327
-msgid "Cannot call updateRow() when on the insert row."
-msgstr "Nije moguće pozvati updateRow() prilikom ubacivanja redova."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1333
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3190
-msgid ""
-"Cannot update the ResultSet because it is either before the start or after "
-"the end of the results."
-msgstr ""
-"Nije moguće ažurirati ResultSet zato što je ili početak ili kraj rezultata."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1582
-msgid "ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."
-msgstr "ResultSets sa osobinom CONCUR_READ_ONLY ne moeže biti ažuriran."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1650
-#, java-format
-msgid "No primary key found for table {0}."
-msgstr "Nije pronađen ključ za tabelu {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1876
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2965
-msgid "Fetch size must be a value greater to or equal to 0."
-msgstr "Doneta veličina mora biti vrednost veća ili jednaka 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2044
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2051
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2098
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2106
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2926
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2934
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2964
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2971
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2991
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3002
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3020
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3038
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3179
-#: org/postgresql/jdbc2/TimestampUtils.java:258
-#, java-format
-msgid "Bad value for type {0} : {1}"
-msgstr "Pogrešna vrednost za tip {0} : {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2727
-#, java-format
-msgid "The column name {0} was not found in this ResultSet."
-msgstr "Ime kolone {0} nije pronadjeno u ResultSet."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2827
-msgid ""
-"ResultSet is not updateable. The query that generated this result set must "
-"select only one table, and must select all primary keys from that table. See "
-"the JDBC 2.1 API Specification, section 5.6 for more details."
-msgstr ""
-"ResultSet nije moguće ažurirati. Upit koji je generisao ovaj razultat mora "
-"selektoati jedino tabelu,i mora selektovati sve primrne ključeve iz te "
-"tabele. Pogledajte API specifikaciju za JDBC 2.1, sekciju 5.6 za više "
-"detalja."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2839
-msgid "This ResultSet is closed."
-msgstr "ResultSet je zatvoren."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2860
-msgid "ResultSet not positioned properly, perhaps you need to call next."
-msgstr ""
-"ResultSet nije pravilno pozicioniran, možda je potrebno da pozovete next."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:259
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:323
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:392
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2655
-msgid ""
-"Can''t use query methods that take a query string on a PreparedStatement."
-msgstr ""
-"Ne možete da koristite metode za upit koji uzimaju string iz upita u "
-"PreparedStatement-u."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:287
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:306
-msgid "Multiple ResultSets were returned by the query."
-msgstr "Višestruki ResultSet-vi su vraćeni od strane upita."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:425
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:429
-msgid "A CallableStatement was executed with nothing returned."
-msgstr "CallableStatement je izvršen ali ništa nije vrećeno kao rezultat."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:437
-msgid "A CallableStatement was executed with an invalid number of parameters"
-msgstr "CallableStatement je izvršen sa nevažećim brojem parametara"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:468
-#, java-format
-msgid ""
-"A CallableStatement function was executed and the out parameter {0} was of "
-"type {1} however type {2} was registered."
-msgstr ""
-"CallableStatement funkcija je izvršena dok je izlazni parametar {0} tipa {1} "
-"a tip {2} je registrovan kao izlazni parametar."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:674
-msgid "Maximum number of rows must be a value grater than or equal to 0."
-msgstr "Maksimalni broj redova mora biti vrednosti veće ili jednake 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:717
-msgid "Query timeout must be a value greater than or equals to 0."
-msgstr "Tajm-aut mora biti vrednost veća ili jednaka 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:809
-msgid "The maximum field size must be a value greater than or equal to 0."
-msgstr ""
-"Maksimalna vrednost veličine polja mora biti vrednost veća ili jednaka 0."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1226
-msgid "Unknown Types value."
-msgstr "Nepoznata vrednost za Types."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1499
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1624
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3108
-#, java-format
-msgid "Invalid stream length {0}."
-msgstr "Nevažeća dužina toka {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1530
-#, java-format
-msgid "The JVM claims not to support the {0} encoding."
-msgstr "JVM tvrdi da ne podržava {0} encoding."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1705
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3030
-#, java-format
-msgid "Unknown type {0}."
-msgstr "Nepoznat tip {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1720
-msgid "No hstore extension installed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1845
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1851
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1857
-#, java-format
-msgid "Cannot cast an instance of {0} to type {1}"
-msgstr "Nije moguće kastovati instancu {0} u tip {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1869
-#, java-format
-msgid "Unsupported Types value: {0}"
-msgstr "Za tip nije podržana vrednost: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1927
-#, java-format
-msgid ""
-"Can''t infer the SQL type to use for an instance of {0}. Use setObject() "
-"with an explicit Types value to specify the type to use."
-msgstr ""
-"Nije moguće zaključiti SQL tip koji bi se koristio sa instancom {0}. "
-"Koristite setObject() sa zadatim eksplicitnim tipom vrednosti."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1975
-msgid ""
-"This statement does not declare an OUT parameter. Use '{' ?= call ... '}' "
-"to declare one."
-msgstr ""
-"Izraz ne deklariše izlazni parametar. Koristite '{' ?= poziv ... '}' za "
-"deklarisanje."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2025
-msgid "wasNull cannot be call before fetching a result."
-msgstr "wasNull nemože biti pozvan pre zahvatanja rezultata."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2521
-#, java-format
-msgid "Malformed function or procedure escape syntax at offset {0}."
-msgstr "Pogrešna sintaksa u funkciji ili proceduri na poziciji {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2571
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2585
-#, java-format
-msgid ""
-"Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was "
-"made."
-msgstr ""
-"Parametar tipa {0} je registrovan,ali poziv za get{1} (sql tip={2}) je "
-"izvršen."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2604
-msgid ""
-"A CallableStatement was declared, but no call to registerOutParameter(1, "
-"<some type>) was made."
-msgstr ""
-"CallableStatement jedeklarisan ali nije bilo poziva registerOutParameter (1, "
-"<neki_tip>)."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2608
-msgid "No function outputs were registered."
-msgstr "Nije registrovan nikakv izlaz iz funkcije."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2611
-msgid ""
-"Results cannot be retrieved from a CallableStatement before it is executed."
-msgstr ""
-"Razultat nemože da se primi iz CallableStatement pre nego što se on izvrši."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2644
-msgid "This statement has been closed."
-msgstr "Statement je zatvoren."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2724
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2794
-msgid "Too many update results were returned."
-msgstr "Previše rezultata za ažuriranje je vraćeno."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2753
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2823
-#, java-format
-msgid ""
-"Batch entry {0} {1} was aborted. Call getNextException to see the cause."
-msgstr ""
-"Smeša prijava {0} {1} je odbačena. Pozovite getNextException da proverite "
-"rezlog."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3078
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3167
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3207
-msgid "Unexpected error writing large object to database."
-msgstr "Neočekivana greška prilikom upisa velikog objekta u bazu podataka."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:145
-#: org/postgresql/jdbc2/EscapedFunctions.java:157
-#: org/postgresql/jdbc2/EscapedFunctions.java:169
-#: org/postgresql/jdbc2/EscapedFunctions.java:206
-#: org/postgresql/jdbc2/EscapedFunctions.java:243
-#: org/postgresql/jdbc2/EscapedFunctions.java:267
-#: org/postgresql/jdbc2/EscapedFunctions.java:292
-#: org/postgresql/jdbc2/EscapedFunctions.java:316
-#: org/postgresql/jdbc2/EscapedFunctions.java:328
-#: org/postgresql/jdbc2/EscapedFunctions.java:352
-#: org/postgresql/jdbc2/EscapedFunctions.java:380
-#: org/postgresql/jdbc2/EscapedFunctions.java:389
-#: org/postgresql/jdbc2/EscapedFunctions.java:399
-#: org/postgresql/jdbc2/EscapedFunctions.java:408
-#: org/postgresql/jdbc2/EscapedFunctions.java:417
-#: org/postgresql/jdbc2/EscapedFunctions.java:426
-#: org/postgresql/jdbc2/EscapedFunctions.java:435
-#: org/postgresql/jdbc2/EscapedFunctions.java:444
-#: org/postgresql/jdbc2/EscapedFunctions.java:453
-#: org/postgresql/jdbc2/EscapedFunctions.java:462
-#: org/postgresql/jdbc2/EscapedFunctions.java:471
-#: org/postgresql/jdbc2/EscapedFunctions.java:480
-#, java-format
-msgid "{0} function takes one and only one argument."
-msgstr "Funkcija {0} prima jedan i samo jedan parametar."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:181
-#: org/postgresql/jdbc2/EscapedFunctions.java:193
-#: org/postgresql/jdbc2/EscapedFunctions.java:255
-#: org/postgresql/jdbc2/EscapedFunctions.java:304
-#: org/postgresql/jdbc2/EscapedFunctions.java:582
-#, java-format
-msgid "{0} function takes two and only two arguments."
-msgstr "Funkcija {0} prima dva i samo dva parametra."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:230
-#, java-format
-msgid "{0} function takes four and only four argument."
-msgstr "Funkcija {0} prima četiri i samo četiri parametra."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:282
-#: org/postgresql/jdbc2/EscapedFunctions.java:342
-#, java-format
-msgid "{0} function takes two or three arguments."
-msgstr "Funkcija {0} prima dva ili tri parametra."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:362
-#: org/postgresql/jdbc2/EscapedFunctions.java:371
-#: org/postgresql/jdbc2/EscapedFunctions.java:573
-#: org/postgresql/jdbc2/EscapedFunctions.java:591
-#, java-format
-msgid "{0} function doesn''t take any argument."
-msgstr "Funkcija {0} nema parametara."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:489
-#: org/postgresql/jdbc2/EscapedFunctions.java:531
-#, java-format
-msgid "{0} function takes three and only three arguments."
-msgstr "Funkcija {0} prima tri i samo tri parametra."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:501
-#: org/postgresql/jdbc2/EscapedFunctions.java:521
-#: org/postgresql/jdbc2/EscapedFunctions.java:523
-#: org/postgresql/jdbc2/EscapedFunctions.java:543
-#: org/postgresql/jdbc2/EscapedFunctions.java:564
-#: org/postgresql/jdbc2/EscapedFunctions.java:566
-#, java-format
-msgid "Interval {0} not yet implemented"
-msgstr "Interval {0} još nije implementiran."
-
-#: org/postgresql/jdbc2/TimestampUtils.java:360
-msgid ""
-"Infinite value found for timestamp/date. This cannot be represented as time."
-msgstr ""
-"Beskonačna vrednost je pronađena za tipestamp/date. To se nemože predstaviti "
-"kao vreme."
-
-#: org/postgresql/jdbc2/TimestampUtils.java:648
-#: org/postgresql/jdbc2/TimestampUtils.java:680
-#: org/postgresql/jdbc2/TimestampUtils.java:727
-#, fuzzy, java-format
-msgid "Unsupported binary encoding of {0}."
-msgstr "Za tip nije podržana vrednost: {0}"
-
-#: org/postgresql/jdbc2/TypeInfoCache.java:161
-#, java-format
-msgid "The class {0} does not implement org.postgresql.util.PGobject."
-msgstr "Klasa {0} ne implementira org.postgresql.util.PGobject."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:60
-#, java-format
-msgid "Unknown ResultSet holdability setting: {0}."
-msgstr ""
-"Nepoznata ResultSet podešavanja za mogućnost držanja (holdability): {0}."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:98
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:130
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:165
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:187
-msgid "Server versions prior to 8.0 do not support savepoints."
-msgstr "Verzije servera manje od 8.0 ne podržavaju tačke snimanja."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:100
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:132
-msgid "Cannot establish a savepoint in auto-commit mode."
-msgstr "U auto-commit modu nije moguće podešavanje tački snimanja."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:419
-msgid "Returning autogenerated keys is not supported."
-msgstr "Vraćanje autogenerisanih ključeva nije podržano."
-
-#: org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java:81
-#, java-format
-msgid "The parameter index is out of range: {0}, number of parameters: {1}."
-msgstr "Index parametra je van opsega: {0}, broj parametara je: {1}."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:151
-msgid ""
-"Returning autogenerated keys is only supported for 8.2 and later servers."
-msgstr ""
-"Vraćanje autogenerisanih ključeva je podržano samo za verzije servera od 8.2 "
-"pa na dalje."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:199
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:317
-msgid "Returning autogenerated keys by column index is not supported."
-msgstr "Vraćanje autogenerisanih ključeva po kloloni nije podržano."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:38
-#: org/postgresql/jdbc3/PSQLSavepoint.java:50
-#: org/postgresql/jdbc3/PSQLSavepoint.java:66
-msgid "Cannot reference a savepoint after it has been released."
-msgstr "Nije moguće referenciranje tačke snimanja nakon njenog oslobađanja."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:42
-msgid "Cannot retrieve the id of a named savepoint."
-msgstr "Nije moguće primiti id imena tačke snimanja."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:54
-msgid "Cannot retrieve the name of an unnamed savepoint."
-msgstr "Nije moguće izvaditi ime tačke snimanja koja nema ime."
-
-#: org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java:37
-msgid "Invalid UUID data."
-msgstr "Nevažeća UUID podatak."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:83
-#, java-format
-msgid "Unable to find server array type for provided name {0}."
-msgstr "Neuspešno nalaženje liste servera za zadato ime {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:121
-#, fuzzy, java-format
-msgid "Invalid timeout ({0}<0)."
-msgstr "Nevažeća dužina toka {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:134
-msgid "Validating connection."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:157
-#, fuzzy, java-format
-msgid "Failed to set ClientInfo property: {0}"
-msgstr "Propao pokušaj kreiranja objekta za: {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:166
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:188
-msgid "ClientInfo property not supported."
-msgstr "ClientInfo property nije podržan."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Statement.java:127
-msgid "Object is too large to send over the protocol."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:147
-msgid "Unable to decode xml data."
-msgstr "Neuspešno dekodiranje XML podataka."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:150
-#, java-format
-msgid "Unknown XML Source class: {0}"
-msgstr "Nepoznata XML ulazna klasa: {0}"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:195
-msgid "Unable to create SAXResult for SQLXML."
-msgstr "Nije moguće kreirati SAXResult za SQLXML."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:209
-msgid "Unable to create StAXResult for SQLXML"
-msgstr "Nije moguće kreirati StAXResult za SQLXML"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:213
-#, java-format
-msgid "Unknown XML Result class: {0}"
-msgstr "nepoznata XML klasa rezultata: {0}"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:226
-msgid "This SQLXML object has already been freed."
-msgstr "Ovaj SQLXML je već obrisan."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:233
-msgid ""
-"This SQLXML object has not been initialized, so you cannot retrieve data "
-"from it."
-msgstr ""
-"SQLXML objekat nije inicijalizovan tako da nije moguće preuzimati podatke iz "
-"njega."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:244
-#, java-format
-msgid "Failed to convert binary xml data to encoding: {0}."
-msgstr "Neuspešno konvertovanje binarnih XML podataka u kodnu stranu: {0}."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:269
-msgid "Unable to convert DOMResult SQLXML data to a string."
-msgstr "Nije moguće konvertovati DOMResult SQLXML podatke u string."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:282
-msgid ""
-"This SQLXML object has already been initialized, so you cannot manipulate it "
-"further."
-msgstr ""
-"SQLXML objekat je već inicijalizovan, tako da ga nije moguće dodatno menjati."
-
-#: org/postgresql/largeobject/LargeObjectManager.java:138
-msgid "Failed to initialize LargeObject API"
-msgstr "Propao pokušaj inicijalizacije LargeObject API-ja."
-
-#: org/postgresql/largeobject/LargeObjectManager.java:257
-#: org/postgresql/largeobject/LargeObjectManager.java:298
-msgid "Large Objects may not be used in auto-commit mode."
-msgstr "Veliki objekti (Large Object) se nemogu koristiti u auto-commit modu."
-
-#: org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java:58
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:110
-#, java-format
-msgid "The SSLSocketFactory class provided {0} could not be instantiated."
-msgstr "SSLSocketFactory klasa koju pruža {0} se nemože instancirati."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:125
-#, java-format
-msgid "SSL error: {0}"
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:138
-#, fuzzy, java-format
-msgid "The HostnameVerifier class provided {0} could not be instantiated."
-msgstr "SSLSocketFactory klasa koju pruža {0} se nemože instancirati."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:142
-#, java-format
-msgid "The hostname {0} could not be verified by hostnameverifier {1}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:149
-#, fuzzy, java-format
-msgid "The hostname {0} could not be verified."
-msgstr "SSLSocketFactory klasa koju pruža {0} se nemože instancirati."
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:121
-msgid ""
-"Could not find a java cryptographic algorithm: X.509 CertificateFactory not "
-"available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:132
-#, java-format
-msgid "Could not open SSL certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:137
-#, java-format
-msgid "Loading the SSL certificate {0} into a KeyManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:194
-msgid "Enter SSL password: "
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:202
-msgid "Could not read password for SSL key file, console is not available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:204
-#, java-format
-msgid "Could not read password for SSL key file by callbackhandler {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:223
-#, java-format
-msgid "Could not decrypt SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:231
-#, java-format
-msgid "Could not read SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:235
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:173
-#, java-format
-msgid "Could not find a java cryptographic algorithm: {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:99
-#, fuzzy, java-format
-msgid "The password callback class provided {0} could not be instantiated."
-msgstr "SSLSocketFactory klasa koju pruža {0} se nemože instancirati."
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:133
-#, java-format
-msgid "Could not open SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:150
-#, java-format
-msgid "Could not read SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:153
-#, java-format
-msgid "Loading the SSL root certificate {0} into a TrustManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:166
-msgid "Could not initialize SSL context."
-msgstr ""
-
-#: org/postgresql/util/PGInterval.java:164
-msgid "Conversion of interval failed"
-msgstr "Konverzija intervala propala."
-
-#: org/postgresql/util/PGmoney.java:73
-msgid "Conversion of money failed."
-msgstr "Konverzija novca (money) propala."
-
-#: org/postgresql/util/ServerErrorMessage.java:155
-#, java-format
-msgid "Detail: {0}"
-msgstr "Detalji: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:159
-#, java-format
-msgid "Hint: {0}"
-msgstr "Nagovest: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:162
-#, java-format
-msgid "Position: {0}"
-msgstr "Pozicija: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:165
-#, java-format
-msgid "Where: {0}"
-msgstr "Gde: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:171
-#, java-format
-msgid "Internal Query: {0}"
-msgstr "Interni upit: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:174
-#, java-format
-msgid "Internal Position: {0}"
-msgstr "Interna pozicija: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:180
-#, java-format
-msgid "Location: File: {0}, Routine: {1}, Line: {2}"
-msgstr "Lokacija: Fajl: {0}, Rutina: {1}, Linija: {2}"
-
-#: org/postgresql/util/ServerErrorMessage.java:183
-#, java-format
-msgid "Server SQLState: {0}"
-msgstr "SQLState servera: {0}"
-
-#: org/postgresql/xa/PGXAConnection.java:148
-msgid ""
-"Transaction control methods setAutoCommit(true), commit, rollback and "
-"setSavePoint not allowed while an XA transaction is active."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:186
-#: org/postgresql/xa/PGXAConnection.java:245
-msgid "Invalid flags"
-msgstr "Nevažeće zastavice"
-
-#: org/postgresql/xa/PGXAConnection.java:189
-#: org/postgresql/xa/PGXAConnection.java:248
-#: org/postgresql/xa/PGXAConnection.java:425
-msgid "xid must not be null"
-msgstr "xid ne sme biti null"
-
-#: org/postgresql/xa/PGXAConnection.java:192
-msgid "Connection is busy with another transaction"
-msgstr "Konekcija je zauzeta sa drugom transakciom."
-
-#: org/postgresql/xa/PGXAConnection.java:198
-#: org/postgresql/xa/PGXAConnection.java:255
-msgid "suspend/resume not implemented"
-msgstr "obustavljanje/nastavljanje nije implementirano."
-
-#: org/postgresql/xa/PGXAConnection.java:204
-#: org/postgresql/xa/PGXAConnection.java:207
-#: org/postgresql/xa/PGXAConnection.java:209
-msgid "Transaction interleaving not implemented"
-msgstr "Preplitanje transakcija nije implementirano."
-
-#: org/postgresql/xa/PGXAConnection.java:218
-msgid "Error disabling autocommit"
-msgstr "Greška u isključivanju autokomita"
-
-#: org/postgresql/xa/PGXAConnection.java:251
-msgid "tried to call end without corresponding start call"
-msgstr "Pokušaj pozivanja kraja pre odgovarajućeg početka."
-
-#: org/postgresql/xa/PGXAConnection.java:282
-msgid ""
-"Not implemented: Prepare must be issued using the same connection that "
-"started the transaction"
-msgstr ""
-"Nije implementirano: Spremanje mora biti pozvano uz korišćenje iste "
-"konekcije koja se koristi za startovanje transakcije."
-
-#: org/postgresql/xa/PGXAConnection.java:286
-msgid "Prepare called before end"
-msgstr "Pripremanje poziva pre kraja."
-
-#: org/postgresql/xa/PGXAConnection.java:292
-msgid "Server versions prior to 8.1 do not support two-phase commit."
-msgstr "Verzije servera pre 8.1 verzije ne podržavaju commit iz dve faze."
-
-#: org/postgresql/xa/PGXAConnection.java:313
-msgid "Error preparing transaction"
-msgstr "Greška u pripremanju transakcije."
-
-#: org/postgresql/xa/PGXAConnection.java:328
-msgid "Invalid flag"
-msgstr "Nevažeća zastavica (flag)"
-
-#: org/postgresql/xa/PGXAConnection.java:368
-msgid "Error during recover"
-msgstr "Greška prilikom oporavljanja."
-
-#: org/postgresql/xa/PGXAConnection.java:416
-msgid "Error rolling back prepared transaction"
-msgstr "Greška prilikom povratka na prethodo pripremljenu transakciju."
-
-#: org/postgresql/xa/PGXAConnection.java:451
-msgid ""
-"Not implemented: one-phase commit must be issued using the same connection "
-"that was used to start it"
-msgstr ""
-"Nije implementirano: Commit iz jedne faze mora biti izdat uz korištenje iste "
-"konekcije koja je korištena za startovanje."
-
-#: org/postgresql/xa/PGXAConnection.java:455
-msgid "commit called before end"
-msgstr "commit pozvan pre kraja."
-
-#: org/postgresql/xa/PGXAConnection.java:466
-msgid "Error during one-phase commit"
-msgstr "Kreška prilikom commit-a iz jedne faze."
-
-#: org/postgresql/xa/PGXAConnection.java:487
-msgid ""
-"Not implemented: 2nd phase commit must be issued using an idle connection"
-msgstr ""
-"Nije implementirano: Dvofazni commit mora biti izdat uz korištenje "
-"besposlene konekcije."
-
-#: org/postgresql/xa/PGXAConnection.java:507
-#, fuzzy
-msgid "Error committing prepared transaction"
-msgstr "Greška prilikom povratka na prethodo pripremljenu transakciju."
-
-#: org/postgresql/xa/PGXAConnection.java:522
-msgid "Heuristic commit/rollback not supported"
-msgstr "Heuristički commit/rollback nije podržan."
-
-#~ msgid "Query returning autogenerated keys didn't return anything."
-#~ msgstr "Upit koji vraća autogenerisane ključeve nije vratio rezultat."
-
-#~ msgid "The driver does not support SSL."
-#~ msgstr "Ovaj drajver ne podržava SSL."
-
-#~ msgid "Multi-dimensional arrays are currently not supported."
-#~ msgstr "Multidimenzionalni nizovi nisu trenutno podržani."
-
-#~ msgid "Exception: {0}"
-#~ msgstr "Izuzetak: {0}"
-
-#~ msgid "Stack Trace:"
-#~ msgstr "Trag steka:"
-
-#~ msgid "End of Stack Trace"
-#~ msgstr "Kraj traga steka."
-
-#~ msgid "Exception generating stacktrace for: {0} encountered: {1}"
-#~ msgstr "Izuzetak u generisanju traga steka za: {0} nailazak na: {1}"
-
-#~ msgid "rand function only takes zero or one argument(the seed)."
-#~ msgstr "Slučajna funkcija ne prima parametre ili prima samo argument(seme)."
-
-#~ msgid "suspend/resume and join not implemented"
-#~ msgstr "obustavljanje/nastavljanje i spajanje nije implementirano."
diff --git a/org/postgresql/translation/tr.po b/org/postgresql/translation/tr.po
deleted file mode 100644
index f3e3be9..0000000
--- a/org/postgresql/translation/tr.po
+++ /dev/null
@@ -1,1489 +0,0 @@
-# This file is distributed under the same license as the PACKAGE package.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER.
-# Devrim GUNDUZ <devrim at PostgreSQL.org>, 2004.
-# Nicolai TUFAR <ntufar at gmail.com>, 2004, 2005.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: jdbc-tr\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-10-31 13:37+0000\n"
-"PO-Revision-Date: 2009-05-31 21:47+0200\n"
-"Last-Translator: Devrim GÜNDÜZ <devrim at gunduz.org>\n"
-"Language-Team: Turkish <pgsql-tr-genel at PostgreSQL.org>\n"
-"Language: tr\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: KBabel 1.3.1\n"
-"X-Poedit-Language: Turkish\n"
-"X-Poedit-Country: TURKEY\n"
-
-#: org/postgresql/Driver.java.in:235
-msgid "Error loading default settings from driverconfig.properties"
-msgstr "driverconfig.properties dosyasından varsayılan ayarları yükleme hatası"
-
-#: org/postgresql/Driver.java.in:282
-msgid ""
-"Your security policy has prevented the connection from being attempted. You "
-"probably need to grant the connect java.net.SocketPermission to the database "
-"server host and port that you wish to connect to."
-msgstr ""
-"Güvenlik politikanız bağlantının kurulmasını engelledi. java.net."
-"SocketPermission'a veritabanına ve de bağlanacağı porta bağlantı izni "
-"vermelisiniz."
-
-#: org/postgresql/Driver.java.in:287 org/postgresql/Driver.java.in:351
-msgid ""
-"Something unusual has occurred to cause the driver to fail. Please report "
-"this exception."
-msgstr ""
-"Sıradışı bir durum sürücünün hata vermesine sebep oldu. Lütfen bu durumu "
-"geliştiricilere bildirin."
-
-#: org/postgresql/Driver.java.in:359
-msgid "Connection attempt timed out."
-msgstr "Bağlantı denemesi zaman aşımına uğradı."
-
-#: org/postgresql/Driver.java.in:372
-msgid "Interrupted while attempting to connect."
-msgstr "Bağlanırken kesildi."
-
-#: org/postgresql/Driver.java.in:714
-#, java-format
-msgid "Method {0} is not yet implemented."
-msgstr "{0} yöntemi henüz kodlanmadı."
-
-#: org/postgresql/copy/CopyManager.java:56
-#, java-format
-msgid "Requested CopyIn but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/CopyManager.java:67
-#, java-format
-msgid "Requested CopyOut but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:51
-#, java-format
-msgid "Copying from database failed: {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:67
-#: org/postgresql/copy/PGCopyOutputStream.java:90
-#, fuzzy
-msgid "This copy stream is closed."
-msgstr "ResultSet kapalıdır."
-
-#: org/postgresql/copy/PGCopyInputStream.java:108
-msgid "Read from copy failed."
-msgstr ""
-
-#: org/postgresql/copy/PGCopyOutputStream.java:68
-#, java-format
-msgid "Cannot write to copy a byte of value {0}"
-msgstr ""
-
-#: org/postgresql/core/ConnectionFactory.java:69
-#, java-format
-msgid "A connection could not be made using the requested protocol {0}."
-msgstr "İstenilen protokol ile bağlantı kurulamadı {0}"
-
-#: org/postgresql/core/Oid.java:113
-#, java-format
-msgid "oid type {0} not known and not a number"
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:490
-#, java-format
-msgid "Premature end of input stream, expected {0} bytes, but only read {1}."
-msgstr ""
-"Giriş akımında beklenmeyen dosya sonu, {0} bayt beklenirken sadece {1} bayt "
-"alındı."
-
-#: org/postgresql/core/PGStream.java:530
-#, java-format
-msgid "Expected an EOF from server, got: {0}"
-msgstr "Sunucudan EOF beklendi; ama {0} alındı."
-
-#: org/postgresql/core/SetupQueryRunner.java:86
-msgid "An unexpected result was returned by a query."
-msgstr "Sorgu beklenmeyen bir sonuç döndürdü."
-
-#: org/postgresql/core/UTF8Encoding.java:28
-#, java-format
-msgid ""
-"Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}"
-msgstr ""
-"Geçersiz UTF-8 çoklu bayt karakteri: {0}/{1} baytı 10xxxxxx değildir: {2}"
-
-#: org/postgresql/core/UTF8Encoding.java:61
-#, java-format
-msgid "Illegal UTF-8 sequence: {0} bytes used to encode a {1} byte value: {2}"
-msgstr ""
-"Geçersiz UTF-8 çoklu bayt karakteri: {0} bayt, {1} bayt değeri kodlamak için "
-"kullanılmış: {2}"
-
-#: org/postgresql/core/UTF8Encoding.java:98
-#: org/postgresql/core/UTF8Encoding.java:125
-#, java-format
-msgid "Illegal UTF-8 sequence: initial byte is {0}: {1}"
-msgstr "Geçersiz UTF-8 çoklu bayt karakteri: ilk bayt {0}: {1}"
-
-#: org/postgresql/core/UTF8Encoding.java:130
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is out of range: {0}"
-msgstr "Geçersiz UTF-8 çoklu bayt karakteri: son değer sıra dışıdır: {0}"
-
-#: org/postgresql/core/UTF8Encoding.java:145
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is a surrogate value: {0}"
-msgstr "Geçersiz UTF-8 çoklu bayt karakteri: son değer yapay bir değerdir: {0}"
-
-#: org/postgresql/core/Utils.java:95 org/postgresql/core/Utils.java:112
-msgid "Zero bytes may not occur in string parameters."
-msgstr "String parametrelerinde sıfır bayt olamaz."
-
-#: org/postgresql/core/Utils.java:145
-msgid "Zero bytes may not occur in identifiers."
-msgstr "Belirteçlerde sıfır bayt olamaz."
-
-#: org/postgresql/core/types/PGBigDecimal.java:63
-#: org/postgresql/core/types/PGBoolean.java:62
-#: org/postgresql/core/types/PGByte.java:63
-#: org/postgresql/core/types/PGDouble.java:64
-#: org/postgresql/core/types/PGFloat.java:64
-#: org/postgresql/core/types/PGInteger.java:61
-#: org/postgresql/core/types/PGLong.java:62
-#: org/postgresql/core/types/PGNumber.java:62
-#: org/postgresql/core/types/PGShort.java:58
-#: org/postgresql/core/types/PGString.java:73
-#, java-format
-msgid "Cannot convert an instance of {0} to type {1}"
-msgstr "{0} instance, {1} tipine dönüştürülemiyor"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:66
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:74
-#, fuzzy, java-format
-msgid "Invalid sslmode value: {0}"
-msgstr "Geçersiz akım uzunluğu {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:134
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:207
-msgid ""
-"Connection refused. Check that the hostname and port are correct and that "
-"the postmaster is accepting TCP/IP connections."
-msgstr ""
-"Bağlantı reddedildi. Sunucu adı ve portun doğru olup olmadığını ve "
-"postmaster''in TCP/IP bağlantılarını kabul edip etmediğini kontrol ediniz."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:153
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:225
-msgid "The connection attempt failed."
-msgstr "Bağlantı denemesi başarısız oldu."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:175
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:246
-#, fuzzy
-msgid "The connection url is invalid."
-msgstr "Bağlantı denemesi başarısız oldu."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:198
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:210
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:295
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:307
-msgid "The server does not support SSL."
-msgstr "Sunucu SSL desteklemiyor."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:223
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:320
-msgid "An error occurred while setting up the SSL connection."
-msgstr "SSL bağlantısı ayarlanırken bir hata oluştu."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:272
-#, java-format
-msgid "Connection rejected: {0}."
-msgstr "Bağlantı reddedildi {0}"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:290
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:312
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:332
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:419
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:444
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:471
-msgid ""
-"The server requested password-based authentication, but no password was "
-"provided."
-msgstr "Sunucu şifre tabanlı yetkilendirme istedi; ancak bir şifre sağlanmadı."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:356
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:504
-#, java-format
-msgid ""
-"The authentication type {0} is not supported. Check that you have configured "
-"the pg_hba.conf file to include the client''s IP address or subnet, and that "
-"it is using an authentication scheme supported by the driver."
-msgstr ""
-"{0} yetkinlendirme tipi desteklenmemektedir. pg_hba.conf dosyanızı "
-"istemcinin IP adresini ya da subnetini içerecek şekilde ayarlayıp "
-"ayarlamadığınızı ve sürücü tarafından desteklenen yetkilendirme "
-"yöntemlerinden birisini kullanıp kullanmadığını kontrol ediniz."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:362
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:400
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:510
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:553
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:599
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:609
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:618
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:626
-#: org/postgresql/gss/MakeGSS.java:158
-msgid "Protocol error. Session setup failed."
-msgstr "Protokol hatası. Oturum kurulumu başarısız oldu."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:390
-#, java-format
-msgid "Backend start-up failed: {0}."
-msgstr "Backend başlaması başarısız oldu: {0}"
-
-#: org/postgresql/core/v2/FastpathParameterList.java:55
-#: org/postgresql/core/v2/FastpathParameterList.java:77
-#: org/postgresql/core/v2/FastpathParameterList.java:84
-#: org/postgresql/core/v2/SimpleParameterList.java:57
-#: org/postgresql/core/v2/SimpleParameterList.java:76
-#: org/postgresql/core/v2/SimpleParameterList.java:83
-#: org/postgresql/core/v2/SimpleParameterList.java:90
-#: org/postgresql/core/v3/CompositeParameterList.java:35
-#: org/postgresql/core/v3/SimpleParameterList.java:49
-#: org/postgresql/core/v3/SimpleParameterList.java:56
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2845
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java:419
-#, java-format
-msgid "The column index is out of range: {0}, number of columns: {1}."
-msgstr "Sütun gçstergesi kapsam dışıdır: {0}, sütun sayısı: {1}."
-
-#: org/postgresql/core/v2/FastpathParameterList.java:142
-#: org/postgresql/core/v2/SimpleParameterList.java:155
-#: org/postgresql/core/v3/SimpleParameterList.java:216
-#, java-format
-msgid "No value specified for parameter {0}."
-msgstr "{0} parametresi için hiç bir değer belirtilmedi."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:72
-#: org/postgresql/core/v2/QueryExecutorImpl.java:337
-#: org/postgresql/core/v3/QueryExecutorImpl.java:443
-#: org/postgresql/core/v3/QueryExecutorImpl.java:507
-#, java-format
-msgid "Expected command status BEGIN, got {0}."
-msgstr "BEGIN komut durumunu beklenirken {0} alındı."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:78
-#: org/postgresql/core/v3/QueryExecutorImpl.java:513
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1828
-#, java-format
-msgid "Unexpected command status: {0}."
-msgstr "Beklenmeyen komut durumu: {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:118
-#: org/postgresql/core/v2/QueryExecutorImpl.java:129
-#: org/postgresql/core/v2/QueryExecutorImpl.java:174
-#: org/postgresql/core/v2/QueryExecutorImpl.java:369
-#: org/postgresql/core/v3/QueryExecutorImpl.java:281
-#: org/postgresql/core/v3/QueryExecutorImpl.java:411
-#: org/postgresql/core/v3/QueryExecutorImpl.java:485
-#: org/postgresql/core/v3/QueryExecutorImpl.java:551
-#: org/postgresql/core/v3/QueryExecutorImpl.java:631
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2094
-#, fuzzy
-msgid "An I/O error occured while sending to the backend."
-msgstr "Backend''e gönderirken bir I/O hatası oluştu."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:170
-#: org/postgresql/core/v2/QueryExecutorImpl.java:225
-#: org/postgresql/core/v2/QueryExecutorImpl.java:236
-#: org/postgresql/core/v3/QueryExecutorImpl.java:627
-#: org/postgresql/core/v3/QueryExecutorImpl.java:685
-#, java-format
-msgid "Unknown Response Type {0}."
-msgstr "Bilinmeyen yanıt tipi {0}"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:430
-#: org/postgresql/core/v2/QueryExecutorImpl.java:475
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1857
-msgid "Ran out of memory retrieving query results."
-msgstr "Sorgu sonuçları alınırken bellek yetersiz."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:597
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2199
-#, java-format
-msgid "Unable to interpret the update count in command completion tag: {0}."
-msgstr "Komut tamamlama etiketinde update sayısı yorumlanamıyor: {0}."
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:610
-msgid "Copy not implemented for protocol version 2"
-msgstr ""
-
-#: org/postgresql/core/v3/CopyOperationImpl.java:56
-msgid "CommandComplete expected COPY but got: "
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:66
-msgid "Tried to obtain lock while already holding it"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:78
-msgid "Tried to break lock on database connection"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:93
-#, fuzzy
-msgid "Interrupted while waiting to obtain lock on database connection"
-msgstr "Bağlanırken kesildi."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:275
-msgid "Unable to bind parameter values for statement."
-msgstr "Komut için parametre değerlei bağlanamadı."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:726
-msgid "Database connection failed when starting copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:757
-msgid "Tried to cancel an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:794
-msgid "Database connection failed when canceling copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:799
-msgid "Missing expected error response to copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:801
-#, java-format
-msgid "Got {0} error responses to single copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:814
-msgid "Tried to end inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:827
-msgid "Database connection failed when ending copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:842
-#: org/postgresql/core/v3/QueryExecutorImpl.java:860
-msgid "Tried to write to an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:854
-#: org/postgresql/core/v3/QueryExecutorImpl.java:866
-msgid "Database connection failed when writing to copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:878
-msgid "Tried to read from inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:883
-msgid "Database connection failed when reading from copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:951
-#, java-format
-msgid "Received CommandComplete ''{0}'' without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:975
-#, java-format
-msgid "Got CopyInResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:988
-#, java-format
-msgid "Got CopyOutResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1003
-msgid "Got CopyData without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1005
-#, fuzzy, java-format
-msgid "Unexpected copydata from server for {0}"
-msgstr "Sunucudan EOF beklendi; ama {0} alındı."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1056
-#, java-format
-msgid "Unexpected packet type during copy: {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1310
-#, java-format
-msgid ""
-"Bind message length {0} too long. This can be caused by very large or "
-"incorrect length specifications on InputStream parameters."
-msgstr ""
-"Bind mesaj uzunluğu ({0}) fazla uzun. Bu durum InputStream yalnış uzunluk "
-"belirtimlerden kaynaklanabilir."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1925
-#, fuzzy, java-format
-msgid ""
-"The server''s client_encoding parameter was changed to {0}. The JDBC driver "
-"requires client_encoding to be UTF8 for correct operation."
-msgstr ""
-"İstemcinin client_encoding parametresi {0} değerine değiştirilmiştir. JDBC "
-"sürücüsünün doğru çalışması için client_encoding parameteresinin UNICODE "
-"olması gerekir."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1932
-#, java-format
-msgid ""
-"The server''s DateStyle parameter was changed to {0}. The JDBC driver "
-"requires DateStyle to begin with ISO for correct operation."
-msgstr ""
-"Sunucunun DateStyle parametresi {0} olarak değiştirildi. JDBC sürücüsü doğru "
-"işlemesi için DateStyle tanımının ISO işle başlamasını gerekir."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1945
-#, java-format
-msgid ""
-"The server''s standard_conforming_strings parameter was reported as {0}. The "
-"JDBC driver expected on or off."
-msgstr ""
-"İstemcinin client_standard_conforming_strings parametresi {0} olarak "
-"raporlandı. JDBC sürücüsü on ya da off olarak bekliyordu."
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2015
-msgid "The driver currently does not support COPY operations."
-msgstr "Bu sunucu şu aşamada COPY işlemleri desteklememktedir."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:112
-msgid "This PooledConnection has already been closed."
-msgstr "Geçerli PooledConnection zaten önceden kapatıldı."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid ""
-"Connection has been closed automatically because a new connection was opened "
-"for the same PooledConnection or the PooledConnection has been closed."
-msgstr ""
-"PooledConnection kapatıldığı için veya aynı PooledConnection için yeni bir "
-"bağlantı açıldığı için geçerli bağlantı otomatik kapatıldı."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid "Connection has been closed."
-msgstr "Bağlantı kapatıldı."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:442
-msgid "Statement has been closed."
-msgstr "Komut kapatıldı."
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:291
-msgid "Failed to setup DataSource."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:414
-msgid "DataSource has been closed."
-msgstr "DataSource kapatıldı."
-
-#: org/postgresql/fastpath/Fastpath.java:81
-#: org/postgresql/fastpath/Fastpath.java:128
-#, java-format
-msgid "Fastpath call {0} - No result was returned and we expected an integer."
-msgstr "Fastpath call {0} - Integer beklenirken hiçbir sonuç getirilmedi."
-
-#: org/postgresql/fastpath/Fastpath.java:237
-#, java-format
-msgid "The fastpath function {0} is unknown."
-msgstr "{0} fastpath fonksiyonu bilinmemektedir."
-
-#: org/postgresql/geometric/PGbox.java:83
-#: org/postgresql/geometric/PGcircle.java:82
-#: org/postgresql/geometric/PGcircle.java:91
-#: org/postgresql/geometric/PGline.java:80
-#: org/postgresql/geometric/PGlseg.java:77
-#: org/postgresql/geometric/PGpoint.java:85
-#, java-format
-msgid "Conversion to type {0} failed: {1}."
-msgstr "{0} veri tipine dönüştürme hatası: {1}."
-
-#: org/postgresql/geometric/PGpath.java:81
-#, java-format
-msgid "Cannot tell if path is open or closed: {0}."
-msgstr "Pathın açık mı kapalı olduğunu tespit edilemiyor: {0}."
-
-#: org/postgresql/gss/MakeGSS.java:47 org/postgresql/gss/MakeGSS.java:55
-#: org/postgresql/gss/MakeGSS.java:168
-msgid "GSS Authentication failed"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:153
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:790
-#, java-format
-msgid "The array index is out of range: {0}"
-msgstr "Dizi göstergesi kapsam dışıdır: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:168
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:807
-#, java-format
-msgid "The array index is out of range: {0}, number of elements: {1}."
-msgstr "Dizin göstergisi kapsam dışıdır: {0}, öğe sayısı: {1}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:196
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1982
-#: org/postgresql/util/HStoreConverter.java:34
-#: org/postgresql/util/HStoreConverter.java:61
-msgid ""
-"Invalid character data was found. This is most likely caused by stored data "
-"containing characters that are invalid for the character set the database "
-"was created in. The most common example of this is storing 8bit data in a "
-"SQL_ASCII database."
-msgstr ""
-"Geçersiz karakterler bulunmuştur. Bunun sebebi, verilerde veritabanın "
-"desteklediği dil kodlamadaki karakterlerin dışında bir karaktere "
-"rastlamasıdır. Bunun en yaygın örneği 8 bitlik veriyi SQL_ASCII "
-"veritabanında saklamasıdır."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:73
-msgid ""
-"Truncation of large objects is only implemented in 8.3 and later servers."
-msgstr "Large objectlerin temizlenmesi 8.3 ve sonraki sürümlerde kodlanmıştır."
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:77
-msgid "Cannot truncate LOB to a negative length."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:81
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:235
-#, java-format
-msgid "PostgreSQL LOBs can only index to: {0}"
-msgstr "PostgreSQL LOB göstergeleri sadece {0} referans edebilir"
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:231
-msgid "LOB positioning offsets start at 1."
-msgstr "LOB bağlangıç adresi 1Den başlıyor"
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:246
-msgid "free() was called on this LOB previously"
-msgstr "Bu LOB'da free() daha önce çağırıldı"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:225
-#, java-format
-msgid "Unsupported value for stringtype parameter: {0}"
-msgstr "strinftype parametresi için destekleneyen değer: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:245
-msgid "unknownLength parameter value must be an integer"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:353
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:284
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:303
-#: org/postgresql/jdbc2/TypeInfoCache.java:201
-#: org/postgresql/jdbc2/TypeInfoCache.java:249
-#: org/postgresql/jdbc2/TypeInfoCache.java:287
-#: org/postgresql/jdbc2/TypeInfoCache.java:344
-#: org/postgresql/jdbc2/TypeInfoCache.java:348
-#: org/postgresql/jdbc2/TypeInfoCache.java:384
-#: org/postgresql/jdbc2/TypeInfoCache.java:388
-msgid "No results were returned by the query."
-msgstr "Sorgudan hiç bir sonuç dönmedi."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:367
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:336
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:368
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2702
-msgid "A result was returned when none was expected."
-msgstr "Hiçbir sonuç kebklenimezken sonuç getirildi."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:519
-msgid "Custom type maps are not supported."
-msgstr "Özel tip eşleştirmeleri desteklenmiyor."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:567
-#, java-format
-msgid "Failed to create object for: {0}."
-msgstr "{0} için nesne oluşturma hatası."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:629
-#, java-format
-msgid "Unable to load the class {0} responsible for the datatype {1}"
-msgstr "{1} veri tipinden sorumlu {0} sınıfı yüklenemedi"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:725
-msgid ""
-"Cannot change transaction read-only property in the middle of a transaction."
-msgstr ""
-"Transaction ortasında geçerli transactionun read-only özellği değiştirilemez."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:813
-msgid "Cannot commit when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:822
-#, fuzzy
-msgid "This connection has been closed."
-msgstr "Bağlantı kapatıldı."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:842
-msgid "Cannot rollback when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:929
-msgid ""
-"Cannot change transaction isolation level in the middle of a transaction."
-msgstr ""
-"Transaction ortasında geçerli transactionun transaction isolation level "
-"özellği değiştirilemez."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:934
-#, java-format
-msgid "Transaction isolation level {0} not supported."
-msgstr "Transaction isolation level {0} desteklenmiyor."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1001
-msgid "Finalizing a Connection that was never closed:"
-msgstr "Kapatılmamış bağlantı sonlandırılıyor."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1103
-msgid "Unable to translate data into the desired encoding."
-msgstr "Veri, istenilen dil kodlamasına çevrilemiyor."
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:63
-msgid ""
-"Unable to determine a value for MaxIndexKeys due to missing system catalog "
-"data."
-msgstr ""
-"Sistem kataloğu olmadığından MaxIndexKeys değerini tespit edilememektedir."
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:86
-msgid "Unable to find name datatype in the system catalogs."
-msgstr "Sistem kataloglarında name veri tipi bulunamıyor."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:235
-msgid ""
-"Operation requires a scrollable ResultSet, but this ResultSet is "
-"FORWARD_ONLY."
-msgstr ""
-"İşlem, kaydırılabilen ResultSet gerektirir, ancak bu ResultSet "
-"FORWARD_ONLYdir."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:416
-msgid "Unexpected error while decoding character data from a large object."
-msgstr "Large-object nesnesinden karakter veriyi çözerken beklenmeyen hata."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:462
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:491
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:525
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3129
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3174
-#, fuzzy, java-format
-msgid "Cannot convert the column of type {0} to requested type {1}."
-msgstr "{0} instance, {1} tipine dönüştürülemiyor"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:744
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:768
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1892
-msgid "Can''t use relative move methods while on the insert row."
-msgstr "Insert kaydı üzerinde relative move method kullanılamaz."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:788
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2956
-#, java-format
-msgid "Invalid fetch direction constant: {0}."
-msgstr "Getirme yönü değişmezi geçersiz: {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:802
-msgid "Cannot call cancelRowUpdates() when on the insert row."
-msgstr "Insert edilmiş kaydın üzerindeyken cancelRowUpdates() çağırılamaz."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:822
-msgid "Cannot call deleteRow() when on the insert row."
-msgstr "Insert kaydı üzerinde deleteRow() çağırılamaz."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:828
-msgid ""
-"Currently positioned before the start of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"Şu an ResultSet başlangcıından önce konumlandı. deleteRow() burada "
-"çağırabilirsiniz."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:833
-msgid ""
-"Currently positioned after the end of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr ""
-"Şu an ResultSet sonucundan sonra konumlandı. deleteRow() burada "
-"çağırabilirsiniz."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:838
-msgid "There are no rows in this ResultSet."
-msgstr "Bu ResultSet içinde kayıt bulunamadı."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:885
-msgid "Not on the insert row."
-msgstr "Insert kaydı değil."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:889
-msgid "You must specify at least one column value to insert a row."
-msgstr "Bir satır eklemek için en az bir sütun değerini belirtmelisiniz."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1074
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1805
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2494
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2524
-#, java-format
-msgid "The JVM claims not to support the encoding: {0}"
-msgstr "JVM, {0} dil kodlamasını desteklememektedir."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1078
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1121
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1534
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1663
-msgid "Provided InputStream failed."
-msgstr "Sağlanmış InputStream başarısız."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1191
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3137
-msgid "Provided Reader failed."
-msgstr "Sağlanmış InputStream başarısız."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1259
-msgid "Can''t refresh the insert row."
-msgstr "Inser satırı yenilenemiyor."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1327
-msgid "Cannot call updateRow() when on the insert row."
-msgstr "Insert kaydı üzerinde updateRow() çağırılamaz."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1333
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3190
-msgid ""
-"Cannot update the ResultSet because it is either before the start or after "
-"the end of the results."
-msgstr ""
-"ResultSet, sonuçların ilk kaydından önce veya son kaydından sonra olduğu "
-"için güncelleme yapılamamaktadır."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1582
-msgid "ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."
-msgstr "Eş zamanlama CONCUR_READ_ONLY olan ResultSet''ler değiştirilemez"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1650
-#, java-format
-msgid "No primary key found for table {0}."
-msgstr "{0} tablosunda primary key yok."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1876
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2965
-msgid "Fetch size must be a value greater to or equal to 0."
-msgstr "Fetch boyutu sıfır veya daha büyük bir değer olmalıdır."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2044
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2051
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2098
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2106
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2926
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2934
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2964
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2971
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2991
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3002
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3020
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3038
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3179
-#: org/postgresql/jdbc2/TimestampUtils.java:258
-#, java-format
-msgid "Bad value for type {0} : {1}"
-msgstr "{0} veri tipi için geçersiz değer : {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2727
-#, java-format
-msgid "The column name {0} was not found in this ResultSet."
-msgstr "Bu ResultSet içinde {0} sütun adı bulunamadı."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2827
-msgid ""
-"ResultSet is not updateable. The query that generated this result set must "
-"select only one table, and must select all primary keys from that table. See "
-"the JDBC 2.1 API Specification, section 5.6 for more details."
-msgstr ""
-"ResultSet değiştirilemez. Bu sonucu üreten sorgu tek bir tablodan "
-"sorgulamalı ve tablonun tüm primary key alanları belirtmelidir. Daha fazla "
-"bilgi için bk. JDBC 2.1 API Specification, section 5.6."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2839
-msgid "This ResultSet is closed."
-msgstr "ResultSet kapalıdır."
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2860
-msgid "ResultSet not positioned properly, perhaps you need to call next."
-msgstr "ResultSet doğru konumlanmamıştır, next işlemi çağırmanız gerekir."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:259
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:323
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:392
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2655
-msgid ""
-"Can''t use query methods that take a query string on a PreparedStatement."
-msgstr "PreparedStatement ile sorgu satırı alan sorgu yöntemleri kullanılamaz."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:287
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:306
-msgid "Multiple ResultSets were returned by the query."
-msgstr "Sorgu tarafından birden fazla ResultSet getirildi."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:425
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:429
-msgid "A CallableStatement was executed with nothing returned."
-msgstr "CallableStatement çalıştırma sonucunda veri getirilmedi."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:437
-msgid "A CallableStatement was executed with an invalid number of parameters"
-msgstr "CallableStatement geçersiz sayıda parametre ile çalıştırıldı."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:468
-#, java-format
-msgid ""
-"A CallableStatement function was executed and the out parameter {0} was of "
-"type {1} however type {2} was registered."
-msgstr ""
-"CallableStatement çalıştırıldı, ancak {2} tipi kaydedilmesine rağmen "
-"döndürme parametresi {0} ve tipi {1} idi."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:674
-msgid "Maximum number of rows must be a value grater than or equal to 0."
-msgstr "En büyük getirilecek satır sayısı sıfırdan büyük olmalıdır."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:717
-msgid "Query timeout must be a value greater than or equals to 0."
-msgstr "Sorgu zaman aşımı değer sıfır veya sıfırdan büyük bir sayı olmalıdır."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:809
-msgid "The maximum field size must be a value greater than or equal to 0."
-msgstr "En büyük alan boyutu sıfır ya da sıfırdan büyük bir değer olmalı."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1226
-msgid "Unknown Types value."
-msgstr "Geçersiz Types değeri."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1499
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1624
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3108
-#, java-format
-msgid "Invalid stream length {0}."
-msgstr "Geçersiz akım uzunluğu {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1530
-#, java-format
-msgid "The JVM claims not to support the {0} encoding."
-msgstr "JVM, {0} dil kodlamasını desteklememektedir."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1705
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3030
-#, java-format
-msgid "Unknown type {0}."
-msgstr "Bilinmeyen tip {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1720
-msgid "No hstore extension installed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1845
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1851
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1857
-#, java-format
-msgid "Cannot cast an instance of {0} to type {1}"
-msgstr "{0} tipi {1} tipine dönüştürülemiyor"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1869
-#, java-format
-msgid "Unsupported Types value: {0}"
-msgstr "Geçersiz Types değeri: {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1927
-#, java-format
-msgid ""
-"Can''t infer the SQL type to use for an instance of {0}. Use setObject() "
-"with an explicit Types value to specify the type to use."
-msgstr ""
-"{0}''nin örneği ile kullanılacak SQL tip bulunamadı. Kullanılacak tip "
-"belirtmek için kesin Types değerleri ile setObject() kullanın."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1975
-msgid ""
-"This statement does not declare an OUT parameter. Use '{' ?= call ... '}' "
-"to declare one."
-msgstr ""
-"Bu komut OUT parametresi bildirmemektedir. Bildirmek için '{' ?= call ... "
-"'}' kullanın."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2025
-msgid "wasNull cannot be call before fetching a result."
-msgstr "wasNull sonuç çekmeden önce çağırılamaz."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2521
-#, java-format
-msgid "Malformed function or procedure escape syntax at offset {0}."
-msgstr "{0} adresinde fonksiyon veya yordamda kaçış söz dizimi geçersiz."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2571
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2585
-#, java-format
-msgid ""
-"Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was "
-"made."
-msgstr ""
-"{0} tipinde parametre tanıtıldı, ancak {1} (sqltype={2}) tipinde geri "
-"getirmek için çağrı yapıldı."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2604
-msgid ""
-"A CallableStatement was declared, but no call to registerOutParameter(1, "
-"<some type>) was made."
-msgstr ""
-"CallableStatement bildirildi ancak registerOutParameter(1, < bir tip>) "
-"tanıtımı yapılmadı."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2608
-msgid "No function outputs were registered."
-msgstr "Hiçbir fonksiyon çıktısı kaydedilmedi."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2611
-msgid ""
-"Results cannot be retrieved from a CallableStatement before it is executed."
-msgstr "CallableStatement çalıştırılmadan sonuçlar ondan alınamaz."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2644
-msgid "This statement has been closed."
-msgstr "Bu komut kapatıldı."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2724
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2794
-msgid "Too many update results were returned."
-msgstr "Çok fazla güncelleme sonucu döndürüldü."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2753
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2823
-#, java-format
-msgid ""
-"Batch entry {0} {1} was aborted. Call getNextException to see the cause."
-msgstr ""
-"Tpilı iş girişi {0} {1} durduruldu. Nedenini görmek için getNextException "
-"fonksiyonu çağırın."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3078
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3167
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3207
-msgid "Unexpected error writing large object to database."
-msgstr "Large object veritabanına yazılırken beklenmeyan hata."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:145
-#: org/postgresql/jdbc2/EscapedFunctions.java:157
-#: org/postgresql/jdbc2/EscapedFunctions.java:169
-#: org/postgresql/jdbc2/EscapedFunctions.java:206
-#: org/postgresql/jdbc2/EscapedFunctions.java:243
-#: org/postgresql/jdbc2/EscapedFunctions.java:267
-#: org/postgresql/jdbc2/EscapedFunctions.java:292
-#: org/postgresql/jdbc2/EscapedFunctions.java:316
-#: org/postgresql/jdbc2/EscapedFunctions.java:328
-#: org/postgresql/jdbc2/EscapedFunctions.java:352
-#: org/postgresql/jdbc2/EscapedFunctions.java:380
-#: org/postgresql/jdbc2/EscapedFunctions.java:389
-#: org/postgresql/jdbc2/EscapedFunctions.java:399
-#: org/postgresql/jdbc2/EscapedFunctions.java:408
-#: org/postgresql/jdbc2/EscapedFunctions.java:417
-#: org/postgresql/jdbc2/EscapedFunctions.java:426
-#: org/postgresql/jdbc2/EscapedFunctions.java:435
-#: org/postgresql/jdbc2/EscapedFunctions.java:444
-#: org/postgresql/jdbc2/EscapedFunctions.java:453
-#: org/postgresql/jdbc2/EscapedFunctions.java:462
-#: org/postgresql/jdbc2/EscapedFunctions.java:471
-#: org/postgresql/jdbc2/EscapedFunctions.java:480
-#, java-format
-msgid "{0} function takes one and only one argument."
-msgstr "{0} fonksiyonunu yalnız tek bir parametre alabilir."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:181
-#: org/postgresql/jdbc2/EscapedFunctions.java:193
-#: org/postgresql/jdbc2/EscapedFunctions.java:255
-#: org/postgresql/jdbc2/EscapedFunctions.java:304
-#: org/postgresql/jdbc2/EscapedFunctions.java:582
-#, java-format
-msgid "{0} function takes two and only two arguments."
-msgstr "{0} fonksiyonunu sadece iki parametre alabilir."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:230
-#, java-format
-msgid "{0} function takes four and only four argument."
-msgstr "{0} fonksiyonunu yalnız dört parametre alabilir."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:282
-#: org/postgresql/jdbc2/EscapedFunctions.java:342
-#, java-format
-msgid "{0} function takes two or three arguments."
-msgstr "{0} fonksiyonu yalnız iki veya üç argüman alabilir."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:362
-#: org/postgresql/jdbc2/EscapedFunctions.java:371
-#: org/postgresql/jdbc2/EscapedFunctions.java:573
-#: org/postgresql/jdbc2/EscapedFunctions.java:591
-#, java-format
-msgid "{0} function doesn''t take any argument."
-msgstr "{0} fonksiyonu parametre almaz."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:489
-#: org/postgresql/jdbc2/EscapedFunctions.java:531
-#, java-format
-msgid "{0} function takes three and only three arguments."
-msgstr "{0} fonksiyonunu sadece üç parametre alabilir."
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:501
-#: org/postgresql/jdbc2/EscapedFunctions.java:521
-#: org/postgresql/jdbc2/EscapedFunctions.java:523
-#: org/postgresql/jdbc2/EscapedFunctions.java:543
-#: org/postgresql/jdbc2/EscapedFunctions.java:564
-#: org/postgresql/jdbc2/EscapedFunctions.java:566
-#, java-format
-msgid "Interval {0} not yet implemented"
-msgstr "{0} aralığı henüz kodlanmadı."
-
-#: org/postgresql/jdbc2/TimestampUtils.java:360
-msgid ""
-"Infinite value found for timestamp/date. This cannot be represented as time."
-msgstr ""
-"Timestamp veri tipinde sonsuz değer bulunmuştur. Buna uygun bir gösterim "
-"yoktur."
-
-#: org/postgresql/jdbc2/TimestampUtils.java:648
-#: org/postgresql/jdbc2/TimestampUtils.java:680
-#: org/postgresql/jdbc2/TimestampUtils.java:727
-#, fuzzy, java-format
-msgid "Unsupported binary encoding of {0}."
-msgstr "Geçersiz Types değeri: {0}"
-
-#: org/postgresql/jdbc2/TypeInfoCache.java:161
-#, java-format
-msgid "The class {0} does not implement org.postgresql.util.PGobject."
-msgstr "{0} sınıfı org.postgresql.util.PGobject implemente etmiyor."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:60
-#, java-format
-msgid "Unknown ResultSet holdability setting: {0}."
-msgstr "ResultSet tutabilme ayarı geçersiz: {0}."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:98
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:130
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:165
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:187
-msgid "Server versions prior to 8.0 do not support savepoints."
-msgstr "Sunucunun 8.0''dan önceki sürümler savepoint desteklememektedir."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:100
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:132
-msgid "Cannot establish a savepoint in auto-commit mode."
-msgstr "Auto-commit biçimde savepoint oluşturulamıyor."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:419
-msgid "Returning autogenerated keys is not supported."
-msgstr "Otomatik üretilen değerlerin getirilmesi desteklenememktedir."
-
-#: org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java:81
-#, java-format
-msgid "The parameter index is out of range: {0}, number of parameters: {1}."
-msgstr "Dizin göstergisi kapsam dışıdır: {0}, öğe sayısı: {1}."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:151
-msgid ""
-"Returning autogenerated keys is only supported for 8.2 and later servers."
-msgstr ""
-"Otomatik üretilen anahtarların döndürülmesi sadece 8.2 ve üzerindeki "
-"sürümlerdeki sunucularda desteklenmektedir."
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:199
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:317
-msgid "Returning autogenerated keys by column index is not supported."
-msgstr ""
-"Kolonların indexlenmesi ile otomatik olarak oluşturulan anahtarların "
-"döndürülmesi desteklenmiyor."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:38
-#: org/postgresql/jdbc3/PSQLSavepoint.java:50
-#: org/postgresql/jdbc3/PSQLSavepoint.java:66
-msgid "Cannot reference a savepoint after it has been released."
-msgstr "Bırakıldıktan sonra savepoint referans edilemez."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:42
-msgid "Cannot retrieve the id of a named savepoint."
-msgstr "Adlandırılmış savepointin id değerine erişilemiyor."
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:54
-msgid "Cannot retrieve the name of an unnamed savepoint."
-msgstr "Adı verilmemiş savepointin id değerine erişilemiyor."
-
-#: org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java:37
-msgid "Invalid UUID data."
-msgstr "Geçersiz UUID verisi."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:83
-#, java-format
-msgid "Unable to find server array type for provided name {0}."
-msgstr "Belirtilen {0} adı için sunucu array tipi bulunamadı."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:121
-#, fuzzy, java-format
-msgid "Invalid timeout ({0}<0)."
-msgstr "Geçersiz akım uzunluğu {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:134
-msgid "Validating connection."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:157
-#, fuzzy, java-format
-msgid "Failed to set ClientInfo property: {0}"
-msgstr "{0} için nesne oluşturma hatası."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:166
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:188
-msgid "ClientInfo property not supported."
-msgstr "Clientinfo property'si desteklenememktedir."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Statement.java:127
-msgid "Object is too large to send over the protocol."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:147
-msgid "Unable to decode xml data."
-msgstr "XML verisinin kodu çözülemedi."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:150
-#, java-format
-msgid "Unknown XML Source class: {0}"
-msgstr "Bilinmeyen XML Kaynak Sınıfı: {0}"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:195
-msgid "Unable to create SAXResult for SQLXML."
-msgstr "SQLXML için SAXResult yaratılamadı."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:209
-msgid "Unable to create StAXResult for SQLXML"
-msgstr "SQLXML için StAXResult yaratılamadı"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:213
-#, java-format
-msgid "Unknown XML Result class: {0}"
-msgstr "Bilinmeyen XML Sonuç sınıfı: {0}."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:226
-msgid "This SQLXML object has already been freed."
-msgstr "Bu SQLXML nesnesi zaten boşaltılmış."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:233
-msgid ""
-"This SQLXML object has not been initialized, so you cannot retrieve data "
-"from it."
-msgstr "Bu SQLXML nesnesi ilklendirilmemiş; o yüzden ondan veri alamazsınız."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:244
-#, java-format
-msgid "Failed to convert binary xml data to encoding: {0}."
-msgstr "xml verisinin şu dil kodlamasına çevirilmesi başarısız oldu: {0}"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:269
-msgid "Unable to convert DOMResult SQLXML data to a string."
-msgstr "DOMResult SQLXML verisini diziye dönüştürülemedi."
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:282
-msgid ""
-"This SQLXML object has already been initialized, so you cannot manipulate it "
-"further."
-msgstr ""
-"Bu SQLXML nesnesi daha önceden ilklendirilmiştir; o yüzden daha fazla "
-"müdahale edilemez."
-
-#: org/postgresql/largeobject/LargeObjectManager.java:138
-msgid "Failed to initialize LargeObject API"
-msgstr "LArgeObject API ilklendirme hatası"
-
-#: org/postgresql/largeobject/LargeObjectManager.java:257
-#: org/postgresql/largeobject/LargeObjectManager.java:298
-msgid "Large Objects may not be used in auto-commit mode."
-msgstr "Auto-commit biçimde large object kullanılamaz."
-
-#: org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java:58
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:110
-#, java-format
-msgid "The SSLSocketFactory class provided {0} could not be instantiated."
-msgstr "SSLSocketFactory {0} ile örneklenmedi."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:125
-#, java-format
-msgid "SSL error: {0}"
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:138
-#, fuzzy, java-format
-msgid "The HostnameVerifier class provided {0} could not be instantiated."
-msgstr "SSLSocketFactory {0} ile örneklenmedi."
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:142
-#, java-format
-msgid "The hostname {0} could not be verified by hostnameverifier {1}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:149
-#, fuzzy, java-format
-msgid "The hostname {0} could not be verified."
-msgstr "SSLSocketFactory {0} ile örneklenmedi."
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:121
-msgid ""
-"Could not find a java cryptographic algorithm: X.509 CertificateFactory not "
-"available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:132
-#, java-format
-msgid "Could not open SSL certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:137
-#, java-format
-msgid "Loading the SSL certificate {0} into a KeyManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:194
-msgid "Enter SSL password: "
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:202
-msgid "Could not read password for SSL key file, console is not available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:204
-#, java-format
-msgid "Could not read password for SSL key file by callbackhandler {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:223
-#, java-format
-msgid "Could not decrypt SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:231
-#, java-format
-msgid "Could not read SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:235
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:173
-#, java-format
-msgid "Could not find a java cryptographic algorithm: {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:99
-#, fuzzy, java-format
-msgid "The password callback class provided {0} could not be instantiated."
-msgstr "SSLSocketFactory {0} ile örneklenmedi."
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:133
-#, java-format
-msgid "Could not open SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:150
-#, java-format
-msgid "Could not read SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:153
-#, java-format
-msgid "Loading the SSL root certificate {0} into a TrustManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:166
-msgid "Could not initialize SSL context."
-msgstr ""
-
-#: org/postgresql/util/PGInterval.java:164
-msgid "Conversion of interval failed"
-msgstr "Interval dönüştürmesi başarısız."
-
-#: org/postgresql/util/PGmoney.java:73
-msgid "Conversion of money failed."
-msgstr "Money dönüştürmesi başarısız."
-
-#: org/postgresql/util/ServerErrorMessage.java:155
-#, java-format
-msgid "Detail: {0}"
-msgstr "Ayrıntı: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:159
-#, java-format
-msgid "Hint: {0}"
-msgstr "İpucu: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:162
-#, java-format
-msgid "Position: {0}"
-msgstr "Position: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:165
-#, java-format
-msgid "Where: {0}"
-msgstr "Where: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:171
-#, java-format
-msgid "Internal Query: {0}"
-msgstr "Internal Query: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:174
-#, java-format
-msgid "Internal Position: {0}"
-msgstr "Internal Position: {0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:180
-#, java-format
-msgid "Location: File: {0}, Routine: {1}, Line: {2}"
-msgstr "Yer: Dosya: {0}, Yordam: {1}, Satır: {2}"
-
-#: org/postgresql/util/ServerErrorMessage.java:183
-#, java-format
-msgid "Server SQLState: {0}"
-msgstr "Sunucu SQLState: {0}"
-
-#: org/postgresql/xa/PGXAConnection.java:148
-msgid ""
-"Transaction control methods setAutoCommit(true), commit, rollback and "
-"setSavePoint not allowed while an XA transaction is active."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:186
-#: org/postgresql/xa/PGXAConnection.java:245
-msgid "Invalid flags"
-msgstr "Geçersiz seçenekler"
-
-#: org/postgresql/xa/PGXAConnection.java:189
-#: org/postgresql/xa/PGXAConnection.java:248
-#: org/postgresql/xa/PGXAConnection.java:425
-msgid "xid must not be null"
-msgstr "xid null olamaz"
-
-#: org/postgresql/xa/PGXAConnection.java:192
-msgid "Connection is busy with another transaction"
-msgstr "Bağlantı, başka bir transaction tarafından meşgul ediliyor"
-
-#: org/postgresql/xa/PGXAConnection.java:198
-#: org/postgresql/xa/PGXAConnection.java:255
-msgid "suspend/resume not implemented"
-msgstr "suspend/resume desteklenmiyor"
-
-#: org/postgresql/xa/PGXAConnection.java:204
-#: org/postgresql/xa/PGXAConnection.java:207
-#: org/postgresql/xa/PGXAConnection.java:209
-msgid "Transaction interleaving not implemented"
-msgstr "Transaction interleaving desteklenmiyor."
-
-#: org/postgresql/xa/PGXAConnection.java:218
-msgid "Error disabling autocommit"
-msgstr "autocommit'i devre dışı bırakma sırasında hata"
-
-#: org/postgresql/xa/PGXAConnection.java:251
-msgid "tried to call end without corresponding start call"
-msgstr "start çağırımı olmadan end çağırılmıştır"
-
-#: org/postgresql/xa/PGXAConnection.java:282
-msgid ""
-"Not implemented: Prepare must be issued using the same connection that "
-"started the transaction"
-msgstr ""
-"Desteklenmiyor: Prepare, transaction başlatran bağlantı tarafından "
-"çağırmalıdır"
-
-#: org/postgresql/xa/PGXAConnection.java:286
-msgid "Prepare called before end"
-msgstr "Sondan önce prepare çağırılmış"
-
-#: org/postgresql/xa/PGXAConnection.java:292
-msgid "Server versions prior to 8.1 do not support two-phase commit."
-msgstr ""
-"Sunucunun 8.1''den önceki sürümler two-phase commit desteklememektedir."
-
-#: org/postgresql/xa/PGXAConnection.java:313
-msgid "Error preparing transaction"
-msgstr "Transaction hazırlama hatası"
-
-#: org/postgresql/xa/PGXAConnection.java:328
-msgid "Invalid flag"
-msgstr "Geçersiz seçenek"
-
-#: org/postgresql/xa/PGXAConnection.java:368
-msgid "Error during recover"
-msgstr "Kurtarma sırasında hata"
-
-#: org/postgresql/xa/PGXAConnection.java:416
-msgid "Error rolling back prepared transaction"
-msgstr "Hazırlanmış transaction rollback hatası"
-
-#: org/postgresql/xa/PGXAConnection.java:451
-msgid ""
-"Not implemented: one-phase commit must be issued using the same connection "
-"that was used to start it"
-msgstr ""
-"Desteklenmiyor: one-phase commit, işlevinde başlatan ve bitiren bağlantı "
-"aynı olmalıdır"
-
-#: org/postgresql/xa/PGXAConnection.java:455
-msgid "commit called before end"
-msgstr "commit, sondan önce çağırıldı"
-
-#: org/postgresql/xa/PGXAConnection.java:466
-msgid "Error during one-phase commit"
-msgstr "One-phase commit sırasında hata"
-
-#: org/postgresql/xa/PGXAConnection.java:487
-msgid ""
-"Not implemented: 2nd phase commit must be issued using an idle connection"
-msgstr "Desteklenmiyor: 2nd phase commit, atıl bir bağlantıdan başlatılmalıdır"
-
-#: org/postgresql/xa/PGXAConnection.java:507
-#, fuzzy
-msgid "Error committing prepared transaction"
-msgstr "Hazırlanmış transaction rollback hatası"
-
-#: org/postgresql/xa/PGXAConnection.java:522
-msgid "Heuristic commit/rollback not supported"
-msgstr "Heuristic commit/rollback desteklenmiyor"
-
-#~ msgid "Query returning autogenerated keys didn't return anything."
-#~ msgstr "Otomatik üretilen anahtarları döndüren sorgu birşey döndürmedi."
-
-#~ msgid "The driver does not support SSL."
-#~ msgstr "Sürücü SSL desteklememktedir."
-
-#~ msgid "Exception: {0}"
-#~ msgstr "İstisna: {0}"
-
-#~ msgid "Stack Trace:"
-#~ msgstr "Stack Trace:"
-
-#~ msgid "End of Stack Trace"
-#~ msgstr "Stack Trace Sonu"
-
-#~ msgid "Exception generating stacktrace for: {0} encountered: {1}"
-#~ msgstr "Exception generating stacktrace for: {0} encountered: {1}"
-
-#~ msgid "Multi-dimensional arrays are currently not supported."
-#~ msgstr "Çok boyutlu matrisler şu aşamada seteklenmemektedir."
-
-#~ msgid "rand function only takes zero or one argument(the seed)."
-#~ msgstr "rand fonksiyonu yalnız sıfır veya bir (seed) argüman alabilir."
-
-#~ msgid "suspend/resume and join not implemented"
-#~ msgstr "suspend/resume ve join desteklenmemektedir"
diff --git a/org/postgresql/translation/zh_CN.po b/org/postgresql/translation/zh_CN.po
deleted file mode 100644
index 3305cc2..0000000
--- a/org/postgresql/translation/zh_CN.po
+++ /dev/null
@@ -1,1424 +0,0 @@
-# Simplified Chinese message translation for the PostgreSQL JDBC driver
-# This file is distributed under the same license as the package.
-#
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PostgreSQL JDBC Driver 8.3\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-10-31 13:37+0000\n"
-"PO-Revision-Date: 2008-01-31 14:34+0800\n"
-"Last-Translator: 郭朝益(ChaoYi, Kuo) <Kuo.ChaoYi at gmail.com>\n"
-"Language-Team: The PostgreSQL Development Team <Kuo.ChaoYi at gmail.com>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Poedit-Language: Chinese\n"
-"X-Poedit-Country: CHINA\n"
-"X-Poedit-SourceCharset: utf-8\n"
-
-#: org/postgresql/Driver.java.in:235
-msgid "Error loading default settings from driverconfig.properties"
-msgstr ""
-
-#: org/postgresql/Driver.java.in:282
-msgid ""
-"Your security policy has prevented the connection from being attempted. You "
-"probably need to grant the connect java.net.SocketPermission to the database "
-"server host and port that you wish to connect to."
-msgstr ""
-
-#: org/postgresql/Driver.java.in:287 org/postgresql/Driver.java.in:351
-msgid ""
-"Something unusual has occurred to cause the driver to fail. Please report "
-"this exception."
-msgstr "不明的原因导致驱动程序造成失败,请回报这个例外。"
-
-#: org/postgresql/Driver.java.in:359
-msgid "Connection attempt timed out."
-msgstr "Connection 尝试逾时。"
-
-#: org/postgresql/Driver.java.in:372
-msgid "Interrupted while attempting to connect."
-msgstr ""
-
-#: org/postgresql/Driver.java.in:714
-#, java-format
-msgid "Method {0} is not yet implemented."
-msgstr "这个 {0} 方法尚未被实作。"
-
-#: org/postgresql/copy/CopyManager.java:56
-#, java-format
-msgid "Requested CopyIn but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/CopyManager.java:67
-#, java-format
-msgid "Requested CopyOut but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:51
-#, java-format
-msgid "Copying from database failed: {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:67
-#: org/postgresql/copy/PGCopyOutputStream.java:90
-#, fuzzy
-msgid "This copy stream is closed."
-msgstr "这个 ResultSet 已经被关闭。"
-
-#: org/postgresql/copy/PGCopyInputStream.java:108
-msgid "Read from copy failed."
-msgstr ""
-
-#: org/postgresql/copy/PGCopyOutputStream.java:68
-#, java-format
-msgid "Cannot write to copy a byte of value {0}"
-msgstr ""
-
-#: org/postgresql/core/ConnectionFactory.java:69
-#, java-format
-msgid "A connection could not be made using the requested protocol {0}."
-msgstr "无法以要求的通讯协定 {0} 建立连线。"
-
-#: org/postgresql/core/Oid.java:113
-#, java-format
-msgid "oid type {0} not known and not a number"
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:490
-#, java-format
-msgid "Premature end of input stream, expected {0} bytes, but only read {1}."
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:530
-#, java-format
-msgid "Expected an EOF from server, got: {0}"
-msgstr ""
-
-#: org/postgresql/core/SetupQueryRunner.java:86
-msgid "An unexpected result was returned by a query."
-msgstr "传回非预期的查询结果。"
-
-#: org/postgresql/core/UTF8Encoding.java:28
-#, java-format
-msgid ""
-"Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:61
-#, java-format
-msgid "Illegal UTF-8 sequence: {0} bytes used to encode a {1} byte value: {2}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:98
-#: org/postgresql/core/UTF8Encoding.java:125
-#, java-format
-msgid "Illegal UTF-8 sequence: initial byte is {0}: {1}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:130
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is out of range: {0}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:145
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is a surrogate value: {0}"
-msgstr ""
-
-#: org/postgresql/core/Utils.java:95 org/postgresql/core/Utils.java:112
-msgid "Zero bytes may not occur in string parameters."
-msgstr "字符参数不能有 0 个位元组。"
-
-#: org/postgresql/core/Utils.java:145
-msgid "Zero bytes may not occur in identifiers."
-msgstr "在标识识别符中不存在零位元组。"
-
-#: org/postgresql/core/types/PGBigDecimal.java:63
-#: org/postgresql/core/types/PGBoolean.java:62
-#: org/postgresql/core/types/PGByte.java:63
-#: org/postgresql/core/types/PGDouble.java:64
-#: org/postgresql/core/types/PGFloat.java:64
-#: org/postgresql/core/types/PGInteger.java:61
-#: org/postgresql/core/types/PGLong.java:62
-#: org/postgresql/core/types/PGNumber.java:62
-#: org/postgresql/core/types/PGShort.java:58
-#: org/postgresql/core/types/PGString.java:73
-#, java-format
-msgid "Cannot convert an instance of {0} to type {1}"
-msgstr "无法转换 {0} 到类型 {1} 的实例"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:66
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:74
-#, fuzzy, java-format
-msgid "Invalid sslmode value: {0}"
-msgstr "无效的串流长度 {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:134
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:207
-msgid ""
-"Connection refused. Check that the hostname and port are correct and that "
-"the postmaster is accepting TCP/IP connections."
-msgstr ""
-"连线被拒,请检查主机名称和埠号,并确定 postmaster 可以接受 TCP/IP 连线。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:153
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:225
-msgid "The connection attempt failed."
-msgstr "尝试连线已失败。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:175
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:246
-#, fuzzy
-msgid "The connection url is invalid."
-msgstr "尝试连线已失败。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:198
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:210
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:295
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:307
-msgid "The server does not support SSL."
-msgstr "服务器不支援 SSL 连线。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:223
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:320
-msgid "An error occurred while setting up the SSL connection."
-msgstr "进行 SSL 连线时发生错误。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:272
-#, java-format
-msgid "Connection rejected: {0}."
-msgstr "连线已被拒绝:{0}。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:290
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:312
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:332
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:419
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:444
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:471
-msgid ""
-"The server requested password-based authentication, but no password was "
-"provided."
-msgstr "服务器要求使用密码验证,但是密码并未提供。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:356
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:504
-#, java-format
-msgid ""
-"The authentication type {0} is not supported. Check that you have configured "
-"the pg_hba.conf file to include the client''s IP address or subnet, and that "
-"it is using an authentication scheme supported by the driver."
-msgstr ""
-"不支援 {0} 验证类型。请核对您已经组态 pg_hba.conf 文件包含客户端的IP位址或网"
-"路区段,以及驱动程序所支援的验证架构模式已被支援。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:362
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:400
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:510
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:553
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:599
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:609
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:618
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:626
-#: org/postgresql/gss/MakeGSS.java:158
-msgid "Protocol error. Session setup failed."
-msgstr "通讯协定错误,Session 初始化失败。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:390
-#, java-format
-msgid "Backend start-up failed: {0}."
-msgstr "后端启动失败:{0}。"
-
-#: org/postgresql/core/v2/FastpathParameterList.java:55
-#: org/postgresql/core/v2/FastpathParameterList.java:77
-#: org/postgresql/core/v2/FastpathParameterList.java:84
-#: org/postgresql/core/v2/SimpleParameterList.java:57
-#: org/postgresql/core/v2/SimpleParameterList.java:76
-#: org/postgresql/core/v2/SimpleParameterList.java:83
-#: org/postgresql/core/v2/SimpleParameterList.java:90
-#: org/postgresql/core/v3/CompositeParameterList.java:35
-#: org/postgresql/core/v3/SimpleParameterList.java:49
-#: org/postgresql/core/v3/SimpleParameterList.java:56
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2845
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java:419
-#, java-format
-msgid "The column index is out of range: {0}, number of columns: {1}."
-msgstr "栏位索引超过许可范围:{0},栏位数:{1}。"
-
-#: org/postgresql/core/v2/FastpathParameterList.java:142
-#: org/postgresql/core/v2/SimpleParameterList.java:155
-#: org/postgresql/core/v3/SimpleParameterList.java:216
-#, java-format
-msgid "No value specified for parameter {0}."
-msgstr "未设定参数值 {0} 的内容。"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:72
-#: org/postgresql/core/v2/QueryExecutorImpl.java:337
-#: org/postgresql/core/v3/QueryExecutorImpl.java:443
-#: org/postgresql/core/v3/QueryExecutorImpl.java:507
-#, java-format
-msgid "Expected command status BEGIN, got {0}."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:78
-#: org/postgresql/core/v3/QueryExecutorImpl.java:513
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1828
-#, java-format
-msgid "Unexpected command status: {0}."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:118
-#: org/postgresql/core/v2/QueryExecutorImpl.java:129
-#: org/postgresql/core/v2/QueryExecutorImpl.java:174
-#: org/postgresql/core/v2/QueryExecutorImpl.java:369
-#: org/postgresql/core/v3/QueryExecutorImpl.java:281
-#: org/postgresql/core/v3/QueryExecutorImpl.java:411
-#: org/postgresql/core/v3/QueryExecutorImpl.java:485
-#: org/postgresql/core/v3/QueryExecutorImpl.java:551
-#: org/postgresql/core/v3/QueryExecutorImpl.java:631
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2094
-#, fuzzy
-msgid "An I/O error occured while sending to the backend."
-msgstr "传送数据至后端时发生 I/O 错误。"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:170
-#: org/postgresql/core/v2/QueryExecutorImpl.java:225
-#: org/postgresql/core/v2/QueryExecutorImpl.java:236
-#: org/postgresql/core/v3/QueryExecutorImpl.java:627
-#: org/postgresql/core/v3/QueryExecutorImpl.java:685
-#, java-format
-msgid "Unknown Response Type {0}."
-msgstr "不明的回应类型 {0}。"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:430
-#: org/postgresql/core/v2/QueryExecutorImpl.java:475
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1857
-msgid "Ran out of memory retrieving query results."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:597
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2199
-#, java-format
-msgid "Unable to interpret the update count in command completion tag: {0}."
-msgstr "无法解读命令完成标签中的更新计数:{0}。"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:610
-msgid "Copy not implemented for protocol version 2"
-msgstr ""
-
-#: org/postgresql/core/v3/CopyOperationImpl.java:56
-msgid "CommandComplete expected COPY but got: "
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:66
-msgid "Tried to obtain lock while already holding it"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:78
-msgid "Tried to break lock on database connection"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:93
-msgid "Interrupted while waiting to obtain lock on database connection"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:275
-msgid "Unable to bind parameter values for statement."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:726
-msgid "Database connection failed when starting copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:757
-msgid "Tried to cancel an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:794
-msgid "Database connection failed when canceling copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:799
-msgid "Missing expected error response to copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:801
-#, java-format
-msgid "Got {0} error responses to single copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:814
-msgid "Tried to end inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:827
-msgid "Database connection failed when ending copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:842
-#: org/postgresql/core/v3/QueryExecutorImpl.java:860
-msgid "Tried to write to an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:854
-#: org/postgresql/core/v3/QueryExecutorImpl.java:866
-msgid "Database connection failed when writing to copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:878
-msgid "Tried to read from inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:883
-msgid "Database connection failed when reading from copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:951
-#, java-format
-msgid "Received CommandComplete ''{0}'' without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:975
-#, java-format
-msgid "Got CopyInResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:988
-#, java-format
-msgid "Got CopyOutResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1003
-msgid "Got CopyData without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1005
-#, java-format
-msgid "Unexpected copydata from server for {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1056
-#, java-format
-msgid "Unexpected packet type during copy: {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1310
-#, java-format
-msgid ""
-"Bind message length {0} too long. This can be caused by very large or "
-"incorrect length specifications on InputStream parameters."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1925
-#, fuzzy, java-format
-msgid ""
-"The server''s client_encoding parameter was changed to {0}. The JDBC driver "
-"requires client_encoding to be UTF8 for correct operation."
-msgstr ""
-"这服务器的 client_encoding 参数被改成 {0},JDBC 驱动程序请求需要 "
-"client_encoding 为 UNICODE 以正确工作。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1932
-#, java-format
-msgid ""
-"The server''s DateStyle parameter was changed to {0}. The JDBC driver "
-"requires DateStyle to begin with ISO for correct operation."
-msgstr ""
-"这服务器的 DateStyle 参数被更改成 {0},JDBC 驱动程序请求需要 DateStyle 以 "
-"ISO 开头以正确工作。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1945
-#, java-format
-msgid ""
-"The server''s standard_conforming_strings parameter was reported as {0}. The "
-"JDBC driver expected on or off."
-msgstr ""
-"这服务器的 standard_conforming_strings 参数已回报为 {0},JDBC 驱动程序已预期"
-"开启或是关闭。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2015
-msgid "The driver currently does not support COPY operations."
-msgstr "驱动程序目前不支援 COPY 操作。"
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:112
-msgid "This PooledConnection has already been closed."
-msgstr "这个 PooledConnection 已经被关闭。"
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid ""
-"Connection has been closed automatically because a new connection was opened "
-"for the same PooledConnection or the PooledConnection has been closed."
-msgstr ""
-"Connection 已自动结束,因为一个新的 PooledConnection 连线被开启或者或 "
-"PooledConnection 已被关闭。"
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid "Connection has been closed."
-msgstr "Connection 已经被关闭。"
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:442
-msgid "Statement has been closed."
-msgstr "Sstatement 已经被关闭。"
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:291
-msgid "Failed to setup DataSource."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:414
-msgid "DataSource has been closed."
-msgstr "DataSource 已经被关闭。"
-
-#: org/postgresql/fastpath/Fastpath.java:81
-#: org/postgresql/fastpath/Fastpath.java:128
-#, java-format
-msgid "Fastpath call {0} - No result was returned and we expected an integer."
-msgstr "Fastpath 呼叫 {0} - 没有传回值,且应该传回一个整数。"
-
-#: org/postgresql/fastpath/Fastpath.java:237
-#, java-format
-msgid "The fastpath function {0} is unknown."
-msgstr "不明的 fastpath 函式 {0}。"
-
-#: org/postgresql/geometric/PGbox.java:83
-#: org/postgresql/geometric/PGcircle.java:82
-#: org/postgresql/geometric/PGcircle.java:91
-#: org/postgresql/geometric/PGline.java:80
-#: org/postgresql/geometric/PGlseg.java:77
-#: org/postgresql/geometric/PGpoint.java:85
-#, java-format
-msgid "Conversion to type {0} failed: {1}."
-msgstr "转换类型 {0} 失败:{1}。"
-
-#: org/postgresql/geometric/PGpath.java:81
-#, java-format
-msgid "Cannot tell if path is open or closed: {0}."
-msgstr "无法得知 path 是开启或关闭:{0}。"
-
-#: org/postgresql/gss/MakeGSS.java:47 org/postgresql/gss/MakeGSS.java:55
-#: org/postgresql/gss/MakeGSS.java:168
-msgid "GSS Authentication failed"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:153
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:790
-#, java-format
-msgid "The array index is out of range: {0}"
-msgstr "阵列索引超过许可范围:{0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:168
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:807
-#, java-format
-msgid "The array index is out of range: {0}, number of elements: {1}."
-msgstr "阵列索引超过许可范围:{0},元素数量:{1}。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:196
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1982
-#: org/postgresql/util/HStoreConverter.java:34
-#: org/postgresql/util/HStoreConverter.java:61
-msgid ""
-"Invalid character data was found. This is most likely caused by stored data "
-"containing characters that are invalid for the character set the database "
-"was created in. The most common example of this is storing 8bit data in a "
-"SQL_ASCII database."
-msgstr ""
-"发现不合法的字元,可能的原因是欲储存的数据中包含数据库的字元集不支援的字码,"
-"其中最常见例子的就是将 8 位元数据存入使用 SQL_ASCII 编码的数据库中。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:73
-msgid ""
-"Truncation of large objects is only implemented in 8.3 and later servers."
-msgstr "大型对象的截断(Truncation)仅被实作执行在 8.3 和后来的服务器。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:77
-msgid "Cannot truncate LOB to a negative length."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:81
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:235
-#, java-format
-msgid "PostgreSQL LOBs can only index to: {0}"
-msgstr "PostgreSQL LOBs 仅能索引到:{0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:231
-msgid "LOB positioning offsets start at 1."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:246
-msgid "free() was called on this LOB previously"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:225
-#, java-format
-msgid "Unsupported value for stringtype parameter: {0}"
-msgstr "字符类型参数值未被支持:{0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:245
-msgid "unknownLength parameter value must be an integer"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:353
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:284
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:303
-#: org/postgresql/jdbc2/TypeInfoCache.java:201
-#: org/postgresql/jdbc2/TypeInfoCache.java:249
-#: org/postgresql/jdbc2/TypeInfoCache.java:287
-#: org/postgresql/jdbc2/TypeInfoCache.java:344
-#: org/postgresql/jdbc2/TypeInfoCache.java:348
-#: org/postgresql/jdbc2/TypeInfoCache.java:384
-#: org/postgresql/jdbc2/TypeInfoCache.java:388
-msgid "No results were returned by the query."
-msgstr "查询没有传回任何结果。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:367
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:336
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:368
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2702
-msgid "A result was returned when none was expected."
-msgstr "传回预期之外的结果。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:519
-msgid "Custom type maps are not supported."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:567
-#, java-format
-msgid "Failed to create object for: {0}."
-msgstr "为 {0} 建立对象失败。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:629
-#, java-format
-msgid "Unable to load the class {0} responsible for the datatype {1}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:725
-msgid ""
-"Cannot change transaction read-only property in the middle of a transaction."
-msgstr "不能在事物交易过程中改变事物交易唯读属性。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:813
-msgid "Cannot commit when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:822
-#, fuzzy
-msgid "This connection has been closed."
-msgstr "Connection 已经被关闭。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:842
-msgid "Cannot rollback when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:929
-msgid ""
-"Cannot change transaction isolation level in the middle of a transaction."
-msgstr "不能在事务交易过程中改变事物交易隔绝等级。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:934
-#, java-format
-msgid "Transaction isolation level {0} not supported."
-msgstr "不支援交易隔绝等级 {0} 。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1001
-msgid "Finalizing a Connection that was never closed:"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1103
-msgid "Unable to translate data into the desired encoding."
-msgstr "无法将数据转成目标编码。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:63
-msgid ""
-"Unable to determine a value for MaxIndexKeys due to missing system catalog "
-"data."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:86
-msgid "Unable to find name datatype in the system catalogs."
-msgstr "在系统 catalog 中找不到名称数据类型(datatype)。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:235
-msgid ""
-"Operation requires a scrollable ResultSet, but this ResultSet is "
-"FORWARD_ONLY."
-msgstr "操作要求可卷动的 ResultSet,但此 ResultSet 是 FORWARD_ONLY。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:416
-msgid "Unexpected error while decoding character data from a large object."
-msgstr "从大型对象(large object)解码字元数据时发生错误。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:462
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:491
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:525
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3129
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3174
-#, fuzzy, java-format
-msgid "Cannot convert the column of type {0} to requested type {1}."
-msgstr "无法转换 {0} 到类型 {1} 的实例"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:744
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:768
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1892
-msgid "Can''t use relative move methods while on the insert row."
-msgstr "不能在新增的数据列上使用相对位置 move 方法。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:788
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2956
-#, java-format
-msgid "Invalid fetch direction constant: {0}."
-msgstr "无效的 fetch 方向常数:{0}。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:802
-msgid "Cannot call cancelRowUpdates() when on the insert row."
-msgstr "不能在新增的数据列上呼叫 cancelRowUpdates()。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:822
-msgid "Cannot call deleteRow() when on the insert row."
-msgstr "不能在新增的数据上呼叫 deleteRow()。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:828
-msgid ""
-"Currently positioned before the start of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr "不能在 ResultSet 的第一笔数据之前呼叫 deleteRow()。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:833
-msgid ""
-"Currently positioned after the end of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr "不能在 ResultSet 的最后一笔数据之后呼叫 deleteRow()。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:838
-msgid "There are no rows in this ResultSet."
-msgstr "ResultSet 中找不到数据列。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:885
-msgid "Not on the insert row."
-msgstr "不在新增的数据列上。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:889
-msgid "You must specify at least one column value to insert a row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1074
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1805
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2494
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2524
-#, java-format
-msgid "The JVM claims not to support the encoding: {0}"
-msgstr "JVM 声明并不支援编码:{0} 。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1078
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1121
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1534
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1663
-msgid "Provided InputStream failed."
-msgstr "提供的 InputStream 已失败。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1191
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3137
-msgid "Provided Reader failed."
-msgstr "提供的 Reader 已失败。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1259
-msgid "Can''t refresh the insert row."
-msgstr "无法重读新增的数据列。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1327
-msgid "Cannot call updateRow() when on the insert row."
-msgstr "不能在新增的数据列上呼叫 deleteRow()。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1333
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3190
-msgid ""
-"Cannot update the ResultSet because it is either before the start or after "
-"the end of the results."
-msgstr "无法更新 ResultSet,可能在第一笔数据之前或最未笔数据之后。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1582
-msgid "ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."
-msgstr "ResultSets 与并发同作(Concurrency) CONCUR_READ_ONLY 不能被更新。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1650
-#, java-format
-msgid "No primary key found for table {0}."
-msgstr "{0} 数据表中未找到主键(Primary key)。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1876
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2965
-msgid "Fetch size must be a value greater to or equal to 0."
-msgstr "数据读取笔数(fetch size)必须大于或等于 0。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2044
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2051
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2098
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2106
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2926
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2934
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2964
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2971
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2991
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3002
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3020
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3038
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3179
-#: org/postgresql/jdbc2/TimestampUtils.java:258
-#, java-format
-msgid "Bad value for type {0} : {1}"
-msgstr "不良的类型值 {0} : {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2727
-#, java-format
-msgid "The column name {0} was not found in this ResultSet."
-msgstr "ResultSet 中找不到栏位名称 {0}。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2827
-msgid ""
-"ResultSet is not updateable. The query that generated this result set must "
-"select only one table, and must select all primary keys from that table. See "
-"the JDBC 2.1 API Specification, section 5.6 for more details."
-msgstr ""
-"不可更新的 ResultSet。用来产生这个 ResultSet 的 SQL 命令只能操作一个数据表,"
-"并且必需选择所有主键栏位,详细请参阅 JDBC 2.1 API 规格书 5.6 节。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2839
-msgid "This ResultSet is closed."
-msgstr "这个 ResultSet 已经被关闭。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2860
-msgid "ResultSet not positioned properly, perhaps you need to call next."
-msgstr "查询结果指标位置不正确,您也许需要呼叫 ResultSet 的 next() 方法。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:259
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:323
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:392
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2655
-msgid ""
-"Can''t use query methods that take a query string on a PreparedStatement."
-msgstr "在 PreparedStatement 上不能使用获取查询字符的查询方法。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:287
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:306
-msgid "Multiple ResultSets were returned by the query."
-msgstr "查询传回多个 ResultSet。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:425
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:429
-msgid "A CallableStatement was executed with nothing returned."
-msgstr "一个 CallableStatement 执行函式后没有传回值。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:437
-#, fuzzy
-msgid "A CallableStatement was executed with an invalid number of parameters"
-msgstr "一个 CallableStatement 已执行包括一个无效的参数数值"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:468
-#, java-format
-msgid ""
-"A CallableStatement function was executed and the out parameter {0} was of "
-"type {1} however type {2} was registered."
-msgstr ""
-"一个 CallableStatement 执行函式后输出的参数类型为 {1} 值为 {0},但是已注册的"
-"类型是 {2}。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:674
-msgid "Maximum number of rows must be a value grater than or equal to 0."
-msgstr "最大数据读取笔数必须大于或等于 0。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:717
-msgid "Query timeout must be a value greater than or equals to 0."
-msgstr "查询逾时等候时间必须大于或等于 0。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:809
-msgid "The maximum field size must be a value greater than or equal to 0."
-msgstr "最大栏位容量必须大于或等于 0。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1226
-msgid "Unknown Types value."
-msgstr "不明的类型值。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1499
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1624
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3108
-#, java-format
-msgid "Invalid stream length {0}."
-msgstr "无效的串流长度 {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1530
-#, java-format
-msgid "The JVM claims not to support the {0} encoding."
-msgstr "JVM 声明并不支援 {0} 编码。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1705
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3030
-#, java-format
-msgid "Unknown type {0}."
-msgstr "不明的类型 {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1720
-msgid "No hstore extension installed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1845
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1851
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1857
-#, java-format
-msgid "Cannot cast an instance of {0} to type {1}"
-msgstr "不能转换一个 {0} 实例到类型 {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1869
-#, java-format
-msgid "Unsupported Types value: {0}"
-msgstr "未被支持的类型值:{0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1927
-#, java-format
-msgid ""
-"Can''t infer the SQL type to use for an instance of {0}. Use setObject() "
-"with an explicit Types value to specify the type to use."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1975
-msgid ""
-"This statement does not declare an OUT parameter. Use '{' ?= call ... '}' "
-"to declare one."
-msgstr "这个 statement 未宣告 OUT 参数,使用 '{' ?= call ... '}' 宣告一个。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2025
-msgid "wasNull cannot be call before fetching a result."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2521
-#, java-format
-msgid "Malformed function or procedure escape syntax at offset {0}."
-msgstr "不正确的函式或程序 escape 语法于 {0}。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2571
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2585
-#, java-format
-msgid ""
-"Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was "
-"made."
-msgstr "已注册参数类型 {0},但是又呼叫了get{1}(sqltype={2})。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2604
-msgid ""
-"A CallableStatement was declared, but no call to registerOutParameter(1, "
-"<some type>) was made."
-msgstr ""
-"已经宣告 CallableStatement 函式,但是尚未呼叫 registerOutParameter (1, "
-"<some_type>) 。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2608
-msgid "No function outputs were registered."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2611
-msgid ""
-"Results cannot be retrieved from a CallableStatement before it is executed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2644
-msgid "This statement has been closed."
-msgstr "这个 statement 已经被关闭。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2724
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2794
-msgid "Too many update results were returned."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2753
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2823
-#, java-format
-msgid ""
-"Batch entry {0} {1} was aborted. Call getNextException to see the cause."
-msgstr "批次处理 {0} {1} 被中止,呼叫 getNextException 以取得原因。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3078
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3167
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3207
-msgid "Unexpected error writing large object to database."
-msgstr "将大型对象(large object)写入数据库时发生不明错误。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:145
-#: org/postgresql/jdbc2/EscapedFunctions.java:157
-#: org/postgresql/jdbc2/EscapedFunctions.java:169
-#: org/postgresql/jdbc2/EscapedFunctions.java:206
-#: org/postgresql/jdbc2/EscapedFunctions.java:243
-#: org/postgresql/jdbc2/EscapedFunctions.java:267
-#: org/postgresql/jdbc2/EscapedFunctions.java:292
-#: org/postgresql/jdbc2/EscapedFunctions.java:316
-#: org/postgresql/jdbc2/EscapedFunctions.java:328
-#: org/postgresql/jdbc2/EscapedFunctions.java:352
-#: org/postgresql/jdbc2/EscapedFunctions.java:380
-#: org/postgresql/jdbc2/EscapedFunctions.java:389
-#: org/postgresql/jdbc2/EscapedFunctions.java:399
-#: org/postgresql/jdbc2/EscapedFunctions.java:408
-#: org/postgresql/jdbc2/EscapedFunctions.java:417
-#: org/postgresql/jdbc2/EscapedFunctions.java:426
-#: org/postgresql/jdbc2/EscapedFunctions.java:435
-#: org/postgresql/jdbc2/EscapedFunctions.java:444
-#: org/postgresql/jdbc2/EscapedFunctions.java:453
-#: org/postgresql/jdbc2/EscapedFunctions.java:462
-#: org/postgresql/jdbc2/EscapedFunctions.java:471
-#: org/postgresql/jdbc2/EscapedFunctions.java:480
-#, java-format
-msgid "{0} function takes one and only one argument."
-msgstr "{0} 函式取得一个且仅有一个引数。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:181
-#: org/postgresql/jdbc2/EscapedFunctions.java:193
-#: org/postgresql/jdbc2/EscapedFunctions.java:255
-#: org/postgresql/jdbc2/EscapedFunctions.java:304
-#: org/postgresql/jdbc2/EscapedFunctions.java:582
-#, java-format
-msgid "{0} function takes two and only two arguments."
-msgstr "{0} 函式取得二个且仅有二个引数。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:230
-#, java-format
-msgid "{0} function takes four and only four argument."
-msgstr "{0} 函式取得四个且仅有四个引数。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:282
-#: org/postgresql/jdbc2/EscapedFunctions.java:342
-#, java-format
-msgid "{0} function takes two or three arguments."
-msgstr "{0} 函式取得二个或三个引数。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:362
-#: org/postgresql/jdbc2/EscapedFunctions.java:371
-#: org/postgresql/jdbc2/EscapedFunctions.java:573
-#: org/postgresql/jdbc2/EscapedFunctions.java:591
-#, java-format
-msgid "{0} function doesn''t take any argument."
-msgstr "{0} 函式无法取得任何的引数。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:489
-#: org/postgresql/jdbc2/EscapedFunctions.java:531
-#, java-format
-msgid "{0} function takes three and only three arguments."
-msgstr "{0} 函式取得三个且仅有三个引数。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:501
-#: org/postgresql/jdbc2/EscapedFunctions.java:521
-#: org/postgresql/jdbc2/EscapedFunctions.java:523
-#: org/postgresql/jdbc2/EscapedFunctions.java:543
-#: org/postgresql/jdbc2/EscapedFunctions.java:564
-#: org/postgresql/jdbc2/EscapedFunctions.java:566
-#, java-format
-msgid "Interval {0} not yet implemented"
-msgstr "隔绝 {0} 尚未被实作。"
-
-#: org/postgresql/jdbc2/TimestampUtils.java:360
-msgid ""
-"Infinite value found for timestamp/date. This cannot be represented as time."
-msgstr ""
-
-#: org/postgresql/jdbc2/TimestampUtils.java:648
-#: org/postgresql/jdbc2/TimestampUtils.java:680
-#: org/postgresql/jdbc2/TimestampUtils.java:727
-#, fuzzy, java-format
-msgid "Unsupported binary encoding of {0}."
-msgstr "未被支持的类型值:{0}"
-
-#: org/postgresql/jdbc2/TypeInfoCache.java:161
-#, java-format
-msgid "The class {0} does not implement org.postgresql.util.PGobject."
-msgstr "类别 {0} 未实做 org.postgresql.util.PGobject。"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:60
-#, java-format
-msgid "Unknown ResultSet holdability setting: {0}."
-msgstr "未知的 ResultSet 可适用的设置:{0}。"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:98
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:130
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:165
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:187
-msgid "Server versions prior to 8.0 do not support savepoints."
-msgstr "8.0 版之前的服务器不支援储存点(SavePints)。"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:100
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:132
-msgid "Cannot establish a savepoint in auto-commit mode."
-msgstr "在自动确认事物交易模式无法建立储存点(Savepoint)。"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:419
-msgid "Returning autogenerated keys is not supported."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java:81
-#, java-format
-msgid "The parameter index is out of range: {0}, number of parameters: {1}."
-msgstr "参数索引超出许可范围:{0},参数总数:{1}。"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:151
-#, fuzzy
-msgid ""
-"Returning autogenerated keys is only supported for 8.2 and later servers."
-msgstr "大型对象的截断(Truncation)仅被实作执行在 8.3 和后来的服务器。"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:199
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:317
-msgid "Returning autogenerated keys by column index is not supported."
-msgstr ""
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:38
-#: org/postgresql/jdbc3/PSQLSavepoint.java:50
-#: org/postgresql/jdbc3/PSQLSavepoint.java:66
-msgid "Cannot reference a savepoint after it has been released."
-msgstr "无法参照已经被释放的储存点。"
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:42
-msgid "Cannot retrieve the id of a named savepoint."
-msgstr "无法取得已命名储存点的 id。"
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:54
-msgid "Cannot retrieve the name of an unnamed savepoint."
-msgstr "无法取得未命名储存点(Savepoint)的名称。"
-
-#: org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java:37
-#, fuzzy
-msgid "Invalid UUID data."
-msgstr "无效的旗标"
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:83
-#, java-format
-msgid "Unable to find server array type for provided name {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:121
-#, fuzzy, java-format
-msgid "Invalid timeout ({0}<0)."
-msgstr "无效的串流长度 {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:134
-msgid "Validating connection."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:157
-#, fuzzy, java-format
-msgid "Failed to set ClientInfo property: {0}"
-msgstr "为 {0} 建立对象失败。"
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:166
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:188
-msgid "ClientInfo property not supported."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Statement.java:127
-msgid "Object is too large to send over the protocol."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:147
-msgid "Unable to decode xml data."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:150
-#, java-format
-msgid "Unknown XML Source class: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:195
-#, fuzzy
-msgid "Unable to create SAXResult for SQLXML."
-msgstr "为 {0} 建立对象失败。"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:209
-msgid "Unable to create StAXResult for SQLXML"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:213
-#, fuzzy, java-format
-msgid "Unknown XML Result class: {0}"
-msgstr "未知的 ResultSet 可适用的设置:{0}。"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:226
-#, fuzzy
-msgid "This SQLXML object has already been freed."
-msgstr "这个 PooledConnection 已经被关闭。"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:233
-msgid ""
-"This SQLXML object has not been initialized, so you cannot retrieve data "
-"from it."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:244
-#, java-format
-msgid "Failed to convert binary xml data to encoding: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:269
-msgid "Unable to convert DOMResult SQLXML data to a string."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:282
-msgid ""
-"This SQLXML object has already been initialized, so you cannot manipulate it "
-"further."
-msgstr ""
-
-#: org/postgresql/largeobject/LargeObjectManager.java:138
-msgid "Failed to initialize LargeObject API"
-msgstr "初始化 LargeObject API 失败"
-
-#: org/postgresql/largeobject/LargeObjectManager.java:257
-#: org/postgresql/largeobject/LargeObjectManager.java:298
-msgid "Large Objects may not be used in auto-commit mode."
-msgstr "大型对象无法被使用在自动确认事物交易模式。"
-
-#: org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java:58
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:110
-#, java-format
-msgid "The SSLSocketFactory class provided {0} could not be instantiated."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:125
-#, java-format
-msgid "SSL error: {0}"
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:138
-#, java-format
-msgid "The HostnameVerifier class provided {0} could not be instantiated."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:142
-#, java-format
-msgid "The hostname {0} could not be verified by hostnameverifier {1}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:149
-#, java-format
-msgid "The hostname {0} could not be verified."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:121
-msgid ""
-"Could not find a java cryptographic algorithm: X.509 CertificateFactory not "
-"available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:132
-#, java-format
-msgid "Could not open SSL certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:137
-#, java-format
-msgid "Loading the SSL certificate {0} into a KeyManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:194
-msgid "Enter SSL password: "
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:202
-msgid "Could not read password for SSL key file, console is not available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:204
-#, java-format
-msgid "Could not read password for SSL key file by callbackhandler {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:223
-#, java-format
-msgid "Could not decrypt SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:231
-#, java-format
-msgid "Could not read SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:235
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:173
-#, java-format
-msgid "Could not find a java cryptographic algorithm: {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:99
-#, java-format
-msgid "The password callback class provided {0} could not be instantiated."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:133
-#, java-format
-msgid "Could not open SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:150
-#, java-format
-msgid "Could not read SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:153
-#, java-format
-msgid "Loading the SSL root certificate {0} into a TrustManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:166
-msgid "Could not initialize SSL context."
-msgstr ""
-
-#: org/postgresql/util/PGInterval.java:164
-msgid "Conversion of interval failed"
-msgstr "隔绝(Interval)转换失败。"
-
-#: org/postgresql/util/PGmoney.java:73
-msgid "Conversion of money failed."
-msgstr "money 转换失败。"
-
-#: org/postgresql/util/ServerErrorMessage.java:155
-#, java-format
-msgid "Detail: {0}"
-msgstr "详细:{0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:159
-#, java-format
-msgid "Hint: {0}"
-msgstr "建议:{0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:162
-#, java-format
-msgid "Position: {0}"
-msgstr "位置:{0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:165
-#, java-format
-msgid "Where: {0}"
-msgstr "在位置:{0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:171
-#, java-format
-msgid "Internal Query: {0}"
-msgstr "内部查询:{0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:174
-#, java-format
-msgid "Internal Position: {0}"
-msgstr "内部位置:{0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:180
-#, java-format
-msgid "Location: File: {0}, Routine: {1}, Line: {2}"
-msgstr "位置:文件:{0},常式:{1},行:{2}"
-
-#: org/postgresql/util/ServerErrorMessage.java:183
-#, java-format
-msgid "Server SQLState: {0}"
-msgstr "服务器 SQLState:{0}"
-
-#: org/postgresql/xa/PGXAConnection.java:148
-msgid ""
-"Transaction control methods setAutoCommit(true), commit, rollback and "
-"setSavePoint not allowed while an XA transaction is active."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:186
-#: org/postgresql/xa/PGXAConnection.java:245
-msgid "Invalid flags"
-msgstr "无效的旗标"
-
-#: org/postgresql/xa/PGXAConnection.java:189
-#: org/postgresql/xa/PGXAConnection.java:248
-#: org/postgresql/xa/PGXAConnection.java:425
-msgid "xid must not be null"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:192
-msgid "Connection is busy with another transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:198
-#: org/postgresql/xa/PGXAConnection.java:255
-msgid "suspend/resume not implemented"
-msgstr "暂停(suspend)/再继续(resume)尚未被实作。"
-
-#: org/postgresql/xa/PGXAConnection.java:204
-#: org/postgresql/xa/PGXAConnection.java:207
-#: org/postgresql/xa/PGXAConnection.java:209
-msgid "Transaction interleaving not implemented"
-msgstr "事物交易隔绝(Transaction interleaving)未被实作。"
-
-#: org/postgresql/xa/PGXAConnection.java:218
-msgid "Error disabling autocommit"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:251
-msgid "tried to call end without corresponding start call"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:282
-msgid ""
-"Not implemented: Prepare must be issued using the same connection that "
-"started the transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:286
-msgid "Prepare called before end"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:292
-msgid "Server versions prior to 8.1 do not support two-phase commit."
-msgstr "8.1 版之前的服务器不支援二段式提交(Two-Phase Commit)。"
-
-#: org/postgresql/xa/PGXAConnection.java:313
-msgid "Error preparing transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:328
-msgid "Invalid flag"
-msgstr "无效的旗标"
-
-#: org/postgresql/xa/PGXAConnection.java:368
-msgid "Error during recover"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:416
-msgid "Error rolling back prepared transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:451
-msgid ""
-"Not implemented: one-phase commit must be issued using the same connection "
-"that was used to start it"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:455
-msgid "commit called before end"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:466
-msgid "Error during one-phase commit"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:487
-msgid ""
-"Not implemented: 2nd phase commit must be issued using an idle connection"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:507
-msgid "Error committing prepared transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:522
-msgid "Heuristic commit/rollback not supported"
-msgstr ""
-
-#~ msgid "The driver does not support SSL."
-#~ msgstr "驱动程序不支援 SSL 连线。"
-
-#~ msgid "Exception: {0}"
-#~ msgstr "例外:{0}"
-
-#~ msgid "Stack Trace:"
-#~ msgstr "堆叠追纵:"
-
-#~ msgid "End of Stack Trace"
-#~ msgstr "堆叠追纵结束"
diff --git a/org/postgresql/translation/zh_TW.po b/org/postgresql/translation/zh_TW.po
deleted file mode 100644
index c285030..0000000
--- a/org/postgresql/translation/zh_TW.po
+++ /dev/null
@@ -1,1424 +0,0 @@
-# Traditional Chinese message translation for the PostgreSQL JDBC driver
-# This file is distributed under the same license as the package.
-#
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PostgreSQL JDBC Driver 8.3\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-10-31 13:37+0000\n"
-"PO-Revision-Date: 2008-01-21 16:50+0800\n"
-"Last-Translator: 郭朝益(ChaoYi, Kuo) <Kuo.ChaoYi at gmail.com>\n"
-"Language-Team: The PostgreSQL Development Team <Kuo.ChaoYi at gmail.com>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Poedit-Language: Chinese\n"
-"X-Poedit-Country: TAIWAN\n"
-"X-Poedit-SourceCharset: utf-8\n"
-
-#: org/postgresql/Driver.java.in:235
-msgid "Error loading default settings from driverconfig.properties"
-msgstr ""
-
-#: org/postgresql/Driver.java.in:282
-msgid ""
-"Your security policy has prevented the connection from being attempted. You "
-"probably need to grant the connect java.net.SocketPermission to the database "
-"server host and port that you wish to connect to."
-msgstr ""
-
-#: org/postgresql/Driver.java.in:287 org/postgresql/Driver.java.in:351
-msgid ""
-"Something unusual has occurred to cause the driver to fail. Please report "
-"this exception."
-msgstr "不明的原因導致驅動程式造成失敗,請回報這個例外。"
-
-#: org/postgresql/Driver.java.in:359
-msgid "Connection attempt timed out."
-msgstr "Connection 嘗試逾時。"
-
-#: org/postgresql/Driver.java.in:372
-msgid "Interrupted while attempting to connect."
-msgstr ""
-
-#: org/postgresql/Driver.java.in:714
-#, java-format
-msgid "Method {0} is not yet implemented."
-msgstr "這個 {0} 方法尚未被實作。"
-
-#: org/postgresql/copy/CopyManager.java:56
-#, java-format
-msgid "Requested CopyIn but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/CopyManager.java:67
-#, java-format
-msgid "Requested CopyOut but got {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:51
-#, java-format
-msgid "Copying from database failed: {0}"
-msgstr ""
-
-#: org/postgresql/copy/PGCopyInputStream.java:67
-#: org/postgresql/copy/PGCopyOutputStream.java:90
-#, fuzzy
-msgid "This copy stream is closed."
-msgstr "這個 ResultSet 已經被關閉。"
-
-#: org/postgresql/copy/PGCopyInputStream.java:108
-msgid "Read from copy failed."
-msgstr ""
-
-#: org/postgresql/copy/PGCopyOutputStream.java:68
-#, java-format
-msgid "Cannot write to copy a byte of value {0}"
-msgstr ""
-
-#: org/postgresql/core/ConnectionFactory.java:69
-#, java-format
-msgid "A connection could not be made using the requested protocol {0}."
-msgstr "無法以要求的通訊協定 {0} 建立連線。"
-
-#: org/postgresql/core/Oid.java:113
-#, java-format
-msgid "oid type {0} not known and not a number"
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:490
-#, java-format
-msgid "Premature end of input stream, expected {0} bytes, but only read {1}."
-msgstr ""
-
-#: org/postgresql/core/PGStream.java:530
-#, java-format
-msgid "Expected an EOF from server, got: {0}"
-msgstr ""
-
-#: org/postgresql/core/SetupQueryRunner.java:86
-msgid "An unexpected result was returned by a query."
-msgstr "傳回非預期的查詢結果。"
-
-#: org/postgresql/core/UTF8Encoding.java:28
-#, java-format
-msgid ""
-"Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:61
-#, java-format
-msgid "Illegal UTF-8 sequence: {0} bytes used to encode a {1} byte value: {2}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:98
-#: org/postgresql/core/UTF8Encoding.java:125
-#, java-format
-msgid "Illegal UTF-8 sequence: initial byte is {0}: {1}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:130
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is out of range: {0}"
-msgstr ""
-
-#: org/postgresql/core/UTF8Encoding.java:145
-#, java-format
-msgid "Illegal UTF-8 sequence: final value is a surrogate value: {0}"
-msgstr ""
-
-#: org/postgresql/core/Utils.java:95 org/postgresql/core/Utils.java:112
-msgid "Zero bytes may not occur in string parameters."
-msgstr "字串參數不能有 0 個位元組。"
-
-#: org/postgresql/core/Utils.java:145
-msgid "Zero bytes may not occur in identifiers."
-msgstr "在標識識別符中不存在零位元組。"
-
-#: org/postgresql/core/types/PGBigDecimal.java:63
-#: org/postgresql/core/types/PGBoolean.java:62
-#: org/postgresql/core/types/PGByte.java:63
-#: org/postgresql/core/types/PGDouble.java:64
-#: org/postgresql/core/types/PGFloat.java:64
-#: org/postgresql/core/types/PGInteger.java:61
-#: org/postgresql/core/types/PGLong.java:62
-#: org/postgresql/core/types/PGNumber.java:62
-#: org/postgresql/core/types/PGShort.java:58
-#: org/postgresql/core/types/PGString.java:73
-#, java-format
-msgid "Cannot convert an instance of {0} to type {1}"
-msgstr "無法轉換 {0} 到類型 {1} 的實例"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:66
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:74
-#, fuzzy, java-format
-msgid "Invalid sslmode value: {0}"
-msgstr "無效的串流長度 {0}."
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:134
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:207
-msgid ""
-"Connection refused. Check that the hostname and port are correct and that "
-"the postmaster is accepting TCP/IP connections."
-msgstr ""
-"連線被拒,請檢查主機名稱和埠號,並確定 postmaster 可以接受 TCP/IP 連線。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:153
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:225
-msgid "The connection attempt failed."
-msgstr "嘗試連線已失敗。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:175
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:246
-#, fuzzy
-msgid "The connection url is invalid."
-msgstr "嘗試連線已失敗。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:198
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:210
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:295
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:307
-msgid "The server does not support SSL."
-msgstr "伺服器不支援 SSL 連線。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:223
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:320
-msgid "An error occurred while setting up the SSL connection."
-msgstr "進行 SSL 連線時發生錯誤。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:272
-#, java-format
-msgid "Connection rejected: {0}."
-msgstr "連線已被拒絕:{0}。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:290
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:312
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:332
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:419
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:444
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:471
-msgid ""
-"The server requested password-based authentication, but no password was "
-"provided."
-msgstr "伺服器要求使用密碼驗證,但是密碼並未提供。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:356
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:504
-#, java-format
-msgid ""
-"The authentication type {0} is not supported. Check that you have configured "
-"the pg_hba.conf file to include the client''s IP address or subnet, and that "
-"it is using an authentication scheme supported by the driver."
-msgstr ""
-"不支援 {0} 驗證型別。請核對您已經組態 pg_hba.conf 檔案包含客戶端的IP位址或網"
-"路區段,以及驅動程式所支援的驗證架構模式已被支援。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:362
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:400
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:510
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:553
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:599
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:609
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:618
-#: org/postgresql/core/v3/ConnectionFactoryImpl.java:626
-#: org/postgresql/gss/MakeGSS.java:158
-msgid "Protocol error. Session setup failed."
-msgstr "通訊協定錯誤,Session 初始化失敗。"
-
-#: org/postgresql/core/v2/ConnectionFactoryImpl.java:390
-#, java-format
-msgid "Backend start-up failed: {0}."
-msgstr "後端啟動失敗:{0}。"
-
-#: org/postgresql/core/v2/FastpathParameterList.java:55
-#: org/postgresql/core/v2/FastpathParameterList.java:77
-#: org/postgresql/core/v2/FastpathParameterList.java:84
-#: org/postgresql/core/v2/SimpleParameterList.java:57
-#: org/postgresql/core/v2/SimpleParameterList.java:76
-#: org/postgresql/core/v2/SimpleParameterList.java:83
-#: org/postgresql/core/v2/SimpleParameterList.java:90
-#: org/postgresql/core/v3/CompositeParameterList.java:35
-#: org/postgresql/core/v3/SimpleParameterList.java:49
-#: org/postgresql/core/v3/SimpleParameterList.java:56
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2845
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java:419
-#, java-format
-msgid "The column index is out of range: {0}, number of columns: {1}."
-msgstr "欄位索引超過許可範圍:{0},欄位數:{1}。"
-
-#: org/postgresql/core/v2/FastpathParameterList.java:142
-#: org/postgresql/core/v2/SimpleParameterList.java:155
-#: org/postgresql/core/v3/SimpleParameterList.java:216
-#, java-format
-msgid "No value specified for parameter {0}."
-msgstr "未設定參數值 {0} 的內容。"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:72
-#: org/postgresql/core/v2/QueryExecutorImpl.java:337
-#: org/postgresql/core/v3/QueryExecutorImpl.java:443
-#: org/postgresql/core/v3/QueryExecutorImpl.java:507
-#, java-format
-msgid "Expected command status BEGIN, got {0}."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:78
-#: org/postgresql/core/v3/QueryExecutorImpl.java:513
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1828
-#, java-format
-msgid "Unexpected command status: {0}."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:118
-#: org/postgresql/core/v2/QueryExecutorImpl.java:129
-#: org/postgresql/core/v2/QueryExecutorImpl.java:174
-#: org/postgresql/core/v2/QueryExecutorImpl.java:369
-#: org/postgresql/core/v3/QueryExecutorImpl.java:281
-#: org/postgresql/core/v3/QueryExecutorImpl.java:411
-#: org/postgresql/core/v3/QueryExecutorImpl.java:485
-#: org/postgresql/core/v3/QueryExecutorImpl.java:551
-#: org/postgresql/core/v3/QueryExecutorImpl.java:631
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2094
-#, fuzzy
-msgid "An I/O error occured while sending to the backend."
-msgstr "傳送資料至後端時發生 I/O 錯誤。"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:170
-#: org/postgresql/core/v2/QueryExecutorImpl.java:225
-#: org/postgresql/core/v2/QueryExecutorImpl.java:236
-#: org/postgresql/core/v3/QueryExecutorImpl.java:627
-#: org/postgresql/core/v3/QueryExecutorImpl.java:685
-#, java-format
-msgid "Unknown Response Type {0}."
-msgstr "不明的回應類型 {0}。"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:430
-#: org/postgresql/core/v2/QueryExecutorImpl.java:475
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1857
-msgid "Ran out of memory retrieving query results."
-msgstr ""
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:597
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2199
-#, java-format
-msgid "Unable to interpret the update count in command completion tag: {0}."
-msgstr "無法解讀命令完成標籤中的更新計數:{0}。"
-
-#: org/postgresql/core/v2/QueryExecutorImpl.java:610
-msgid "Copy not implemented for protocol version 2"
-msgstr ""
-
-#: org/postgresql/core/v3/CopyOperationImpl.java:56
-msgid "CommandComplete expected COPY but got: "
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:66
-msgid "Tried to obtain lock while already holding it"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:78
-msgid "Tried to break lock on database connection"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:93
-msgid "Interrupted while waiting to obtain lock on database connection"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:275
-msgid "Unable to bind parameter values for statement."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:726
-msgid "Database connection failed when starting copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:757
-msgid "Tried to cancel an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:794
-msgid "Database connection failed when canceling copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:799
-msgid "Missing expected error response to copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:801
-#, java-format
-msgid "Got {0} error responses to single copy cancel request"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:814
-msgid "Tried to end inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:827
-msgid "Database connection failed when ending copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:842
-#: org/postgresql/core/v3/QueryExecutorImpl.java:860
-msgid "Tried to write to an inactive copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:854
-#: org/postgresql/core/v3/QueryExecutorImpl.java:866
-msgid "Database connection failed when writing to copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:878
-msgid "Tried to read from inactive copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:883
-msgid "Database connection failed when reading from copy"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:951
-#, java-format
-msgid "Received CommandComplete ''{0}'' without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:975
-#, java-format
-msgid "Got CopyInResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:988
-#, java-format
-msgid "Got CopyOutResponse from server during an active {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1003
-msgid "Got CopyData without an active copy operation"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1005
-#, java-format
-msgid "Unexpected copydata from server for {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1056
-#, java-format
-msgid "Unexpected packet type during copy: {0}"
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1310
-#, java-format
-msgid ""
-"Bind message length {0} too long. This can be caused by very large or "
-"incorrect length specifications on InputStream parameters."
-msgstr ""
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1925
-#, fuzzy, java-format
-msgid ""
-"The server''s client_encoding parameter was changed to {0}. The JDBC driver "
-"requires client_encoding to be UTF8 for correct operation."
-msgstr ""
-"這伺服器的 client_encoding 參數被改成 {0},JDBC 驅動程式請求需要 "
-"client_encoding 為 UNICODE 以正確工作。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1932
-#, java-format
-msgid ""
-"The server''s DateStyle parameter was changed to {0}. The JDBC driver "
-"requires DateStyle to begin with ISO for correct operation."
-msgstr ""
-"這伺服器的 DateStyle 參數被更改成 {0},JDBC 驅動程式請求需要 DateStyle 以 "
-"ISO 開頭以正確工作。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:1945
-#, java-format
-msgid ""
-"The server''s standard_conforming_strings parameter was reported as {0}. The "
-"JDBC driver expected on or off."
-msgstr ""
-"這伺服器的 standard_conforming_strings 參數已回報為 {0},JDBC 驅動程式已預期"
-"開啟或是關閉。"
-
-#: org/postgresql/core/v3/QueryExecutorImpl.java:2015
-msgid "The driver currently does not support COPY operations."
-msgstr "驅動程式目前不支援 COPY 操作。"
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:112
-msgid "This PooledConnection has already been closed."
-msgstr "這個 PooledConnection 已經被關閉。"
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid ""
-"Connection has been closed automatically because a new connection was opened "
-"for the same PooledConnection or the PooledConnection has been closed."
-msgstr ""
-"Connection 已自動結束,因為一個新的 PooledConnection 連線被開啟或者或 "
-"PooledConnection 已被關閉。"
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:295
-msgid "Connection has been closed."
-msgstr "Connection 已經被關閉。"
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.java:442
-msgid "Statement has been closed."
-msgstr "Sstatement 已經被關閉。"
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:291
-msgid "Failed to setup DataSource."
-msgstr ""
-
-#: org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.java:414
-msgid "DataSource has been closed."
-msgstr "DataSource 已經被關閉。"
-
-#: org/postgresql/fastpath/Fastpath.java:81
-#: org/postgresql/fastpath/Fastpath.java:128
-#, java-format
-msgid "Fastpath call {0} - No result was returned and we expected an integer."
-msgstr "Fastpath 呼叫 {0} - 沒有傳回值,且應該傳回一個整數。"
-
-#: org/postgresql/fastpath/Fastpath.java:237
-#, java-format
-msgid "The fastpath function {0} is unknown."
-msgstr "不明的 fastpath 函式 {0}。"
-
-#: org/postgresql/geometric/PGbox.java:83
-#: org/postgresql/geometric/PGcircle.java:82
-#: org/postgresql/geometric/PGcircle.java:91
-#: org/postgresql/geometric/PGline.java:80
-#: org/postgresql/geometric/PGlseg.java:77
-#: org/postgresql/geometric/PGpoint.java:85
-#, java-format
-msgid "Conversion to type {0} failed: {1}."
-msgstr "轉換型別 {0} 失敗:{1}。"
-
-#: org/postgresql/geometric/PGpath.java:81
-#, java-format
-msgid "Cannot tell if path is open or closed: {0}."
-msgstr "無法得知 path 是開啟或關閉:{0}。"
-
-#: org/postgresql/gss/MakeGSS.java:47 org/postgresql/gss/MakeGSS.java:55
-#: org/postgresql/gss/MakeGSS.java:168
-msgid "GSS Authentication failed"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:153
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:790
-#, java-format
-msgid "The array index is out of range: {0}"
-msgstr "陣列索引超過許可範圍:{0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:168
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:807
-#, java-format
-msgid "The array index is out of range: {0}, number of elements: {1}."
-msgstr "陣列索引超過許可範圍:{0},元素數量:{1}。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Array.java:196
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1982
-#: org/postgresql/util/HStoreConverter.java:34
-#: org/postgresql/util/HStoreConverter.java:61
-msgid ""
-"Invalid character data was found. This is most likely caused by stored data "
-"containing characters that are invalid for the character set the database "
-"was created in. The most common example of this is storing 8bit data in a "
-"SQL_ASCII database."
-msgstr ""
-"發現不合法的字元,可能的原因是欲儲存的資料中包含資料庫的字元集不支援的字碼,"
-"其中最常見例子的就是將 8 位元資料存入使用 SQL_ASCII 編碼的資料庫中。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:73
-msgid ""
-"Truncation of large objects is only implemented in 8.3 and later servers."
-msgstr "大型物件的截斷(Truncation)僅被實作執行在 8.3 和後來的伺服器。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:77
-msgid "Cannot truncate LOB to a negative length."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:81
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:235
-#, java-format
-msgid "PostgreSQL LOBs can only index to: {0}"
-msgstr "PostgreSQL LOBs 僅能索引到:{0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:231
-msgid "LOB positioning offsets start at 1."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2BlobClob.java:246
-msgid "free() was called on this LOB previously"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:225
-#, java-format
-msgid "Unsupported value for stringtype parameter: {0}"
-msgstr "字串型別參數值未被支持:{0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:245
-msgid "unknownLength parameter value must be an integer"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:353
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:284
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:303
-#: org/postgresql/jdbc2/TypeInfoCache.java:201
-#: org/postgresql/jdbc2/TypeInfoCache.java:249
-#: org/postgresql/jdbc2/TypeInfoCache.java:287
-#: org/postgresql/jdbc2/TypeInfoCache.java:344
-#: org/postgresql/jdbc2/TypeInfoCache.java:348
-#: org/postgresql/jdbc2/TypeInfoCache.java:384
-#: org/postgresql/jdbc2/TypeInfoCache.java:388
-msgid "No results were returned by the query."
-msgstr "查詢沒有傳回任何結果。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:367
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:336
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:368
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2702
-msgid "A result was returned when none was expected."
-msgstr "傳回預期之外的結果。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:519
-msgid "Custom type maps are not supported."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:567
-#, java-format
-msgid "Failed to create object for: {0}."
-msgstr "為 {0} 建立物件失敗。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:629
-#, java-format
-msgid "Unable to load the class {0} responsible for the datatype {1}"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:725
-msgid ""
-"Cannot change transaction read-only property in the middle of a transaction."
-msgstr "不能在事物交易過程中改變事物交易唯讀屬性。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:813
-msgid "Cannot commit when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:822
-#, fuzzy
-msgid "This connection has been closed."
-msgstr "Connection 已經被關閉。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:842
-msgid "Cannot rollback when autoCommit is enabled."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:929
-msgid ""
-"Cannot change transaction isolation level in the middle of a transaction."
-msgstr "不能在事務交易過程中改變事物交易隔絕等級。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:934
-#, java-format
-msgid "Transaction isolation level {0} not supported."
-msgstr "不支援交易隔絕等級 {0} 。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1001
-msgid "Finalizing a Connection that was never closed:"
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Connection.java:1103
-msgid "Unable to translate data into the desired encoding."
-msgstr "無法將資料轉成目標編碼。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:63
-msgid ""
-"Unable to determine a value for MaxIndexKeys due to missing system catalog "
-"data."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java:86
-msgid "Unable to find name datatype in the system catalogs."
-msgstr "在系統 catalog 中找不到名稱資料類型(datatype)。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:235
-msgid ""
-"Operation requires a scrollable ResultSet, but this ResultSet is "
-"FORWARD_ONLY."
-msgstr "操作要求可捲動的 ResultSet,但此 ResultSet 是 FORWARD_ONLY。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:416
-msgid "Unexpected error while decoding character data from a large object."
-msgstr "從大型物件(large object)解碼字元資料時發生錯誤。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:462
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:491
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:525
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3129
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3174
-#, fuzzy, java-format
-msgid "Cannot convert the column of type {0} to requested type {1}."
-msgstr "無法轉換 {0} 到類型 {1} 的實例"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:744
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:768
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1892
-msgid "Can''t use relative move methods while on the insert row."
-msgstr "不能在新增的資料列上使用相對位置 move 方法。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:788
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2956
-#, java-format
-msgid "Invalid fetch direction constant: {0}."
-msgstr "無效的 fetch 方向常數:{0}。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:802
-msgid "Cannot call cancelRowUpdates() when on the insert row."
-msgstr "不能在新增的資料列上呼叫 cancelRowUpdates()。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:822
-msgid "Cannot call deleteRow() when on the insert row."
-msgstr "不能在新增的資料上呼叫 deleteRow()。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:828
-msgid ""
-"Currently positioned before the start of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr "不能在 ResultSet 的第一筆資料之前呼叫 deleteRow()。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:833
-msgid ""
-"Currently positioned after the end of the ResultSet. You cannot call "
-"deleteRow() here."
-msgstr "不能在 ResultSet 的最後一筆資料之後呼叫 deleteRow()。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:838
-msgid "There are no rows in this ResultSet."
-msgstr "ResultSet 中找不到資料列。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:885
-msgid "Not on the insert row."
-msgstr "不在新增的資料列上。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:889
-msgid "You must specify at least one column value to insert a row."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1074
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1805
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2494
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2524
-#, java-format
-msgid "The JVM claims not to support the encoding: {0}"
-msgstr "JVM 聲明並不支援編碼:{0} 。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1078
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1121
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1534
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1663
-msgid "Provided InputStream failed."
-msgstr "提供的 InputStream 已失敗。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1191
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3137
-msgid "Provided Reader failed."
-msgstr "提供的 Reader 已失敗。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1259
-msgid "Can''t refresh the insert row."
-msgstr "無法重讀新增的資料列。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1327
-msgid "Cannot call updateRow() when on the insert row."
-msgstr "不能在新增的資料列上呼叫 deleteRow()。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1333
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3190
-msgid ""
-"Cannot update the ResultSet because it is either before the start or after "
-"the end of the results."
-msgstr "無法更新 ResultSet,可能在第一筆資料之前或最未筆資料之後。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1582
-msgid "ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."
-msgstr "ResultSets 與並發同作(Concurrency) CONCUR_READ_ONLY 不能被更新。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1650
-#, java-format
-msgid "No primary key found for table {0}."
-msgstr "{0} 資料表中未找到主鍵(Primary key)。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1876
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2965
-msgid "Fetch size must be a value greater to or equal to 0."
-msgstr "資料讀取筆數(fetch size)必須大於或等於 0。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2044
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2051
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2098
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2106
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2926
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2934
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2964
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2971
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2991
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3002
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3020
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3038
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:3179
-#: org/postgresql/jdbc2/TimestampUtils.java:258
-#, java-format
-msgid "Bad value for type {0} : {1}"
-msgstr "不良的型別值 {0} : {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2727
-#, java-format
-msgid "The column name {0} was not found in this ResultSet."
-msgstr "ResultSet 中找不到欄位名稱 {0}。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2827
-msgid ""
-"ResultSet is not updateable. The query that generated this result set must "
-"select only one table, and must select all primary keys from that table. See "
-"the JDBC 2.1 API Specification, section 5.6 for more details."
-msgstr ""
-"不可更新的 ResultSet。用來產生這個 ResultSet 的 SQL 命令只能操作一個資料表,"
-"並且必需選擇所有主鍵欄位,詳細請參閱 JDBC 2.1 API 規格書 5.6 節。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2839
-msgid "This ResultSet is closed."
-msgstr "這個 ResultSet 已經被關閉。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:2860
-msgid "ResultSet not positioned properly, perhaps you need to call next."
-msgstr "查詢結果指標位置不正確,您也許需要呼叫 ResultSet 的 next() 方法。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:259
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:323
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:392
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2655
-msgid ""
-"Can''t use query methods that take a query string on a PreparedStatement."
-msgstr "在 PreparedStatement 上不能使用獲取查詢字串的查詢方法。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:287
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:306
-msgid "Multiple ResultSets were returned by the query."
-msgstr "查詢傳回多個 ResultSet。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:425
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:429
-msgid "A CallableStatement was executed with nothing returned."
-msgstr "一個 CallableStatement 執行函式後沒有傳回值。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:437
-#, fuzzy
-msgid "A CallableStatement was executed with an invalid number of parameters"
-msgstr "一個 CallableStatement 已執行包括一個無效的參數數值"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:468
-#, java-format
-msgid ""
-"A CallableStatement function was executed and the out parameter {0} was of "
-"type {1} however type {2} was registered."
-msgstr ""
-"一個 CallableStatement 執行函式後輸出的參數型別為 {1} 值為 {0},但是已註冊的"
-"型別是 {2}。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:674
-msgid "Maximum number of rows must be a value grater than or equal to 0."
-msgstr "最大資料讀取筆數必須大於或等於 0。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:717
-msgid "Query timeout must be a value greater than or equals to 0."
-msgstr "查詢逾時等候時間必須大於或等於 0。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:809
-msgid "The maximum field size must be a value greater than or equal to 0."
-msgstr "最大欄位容量必須大於或等於 0。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1226
-msgid "Unknown Types value."
-msgstr "不明的型別值。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1499
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1624
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3108
-#, java-format
-msgid "Invalid stream length {0}."
-msgstr "無效的串流長度 {0}."
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1530
-#, java-format
-msgid "The JVM claims not to support the {0} encoding."
-msgstr "JVM 聲明並不支援 {0} 編碼。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1705
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3030
-#, java-format
-msgid "Unknown type {0}."
-msgstr "不明的型別 {0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1720
-msgid "No hstore extension installed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1845
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1851
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1857
-#, java-format
-msgid "Cannot cast an instance of {0} to type {1}"
-msgstr "不能轉換一個 {0} 實例到型別 {1}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1869
-#, java-format
-msgid "Unsupported Types value: {0}"
-msgstr "未被支持的型別值:{0}"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1927
-#, java-format
-msgid ""
-"Can''t infer the SQL type to use for an instance of {0}. Use setObject() "
-"with an explicit Types value to specify the type to use."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:1975
-msgid ""
-"This statement does not declare an OUT parameter. Use '{' ?= call ... '}' "
-"to declare one."
-msgstr "這個 statement 未宣告 OUT 參數,使用 '{' ?= call ... '}' 宣告一個。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2025
-msgid "wasNull cannot be call before fetching a result."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2521
-#, java-format
-msgid "Malformed function or procedure escape syntax at offset {0}."
-msgstr "不正確的函式或程序 escape 語法於 {0}。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2571
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2585
-#, java-format
-msgid ""
-"Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was "
-"made."
-msgstr "已註冊參數型別 {0},但是又呼叫了get{1}(sqltype={2})。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2604
-msgid ""
-"A CallableStatement was declared, but no call to registerOutParameter(1, "
-"<some type>) was made."
-msgstr ""
-"已經宣告 CallableStatement 函式,但是尚未呼叫 registerOutParameter (1, "
-"<some_type>) 。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2608
-msgid "No function outputs were registered."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2611
-msgid ""
-"Results cannot be retrieved from a CallableStatement before it is executed."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2644
-msgid "This statement has been closed."
-msgstr "這個 statement 已經被關閉。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2724
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2794
-msgid "Too many update results were returned."
-msgstr ""
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2753
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:2823
-#, java-format
-msgid ""
-"Batch entry {0} {1} was aborted. Call getNextException to see the cause."
-msgstr "批次處理 {0} {1} 被中止,呼叫 getNextException 以取得原因。"
-
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3078
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3167
-#: org/postgresql/jdbc2/AbstractJdbc2Statement.java:3207
-msgid "Unexpected error writing large object to database."
-msgstr "將大型物件(large object)寫入資料庫時發生不明錯誤。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:145
-#: org/postgresql/jdbc2/EscapedFunctions.java:157
-#: org/postgresql/jdbc2/EscapedFunctions.java:169
-#: org/postgresql/jdbc2/EscapedFunctions.java:206
-#: org/postgresql/jdbc2/EscapedFunctions.java:243
-#: org/postgresql/jdbc2/EscapedFunctions.java:267
-#: org/postgresql/jdbc2/EscapedFunctions.java:292
-#: org/postgresql/jdbc2/EscapedFunctions.java:316
-#: org/postgresql/jdbc2/EscapedFunctions.java:328
-#: org/postgresql/jdbc2/EscapedFunctions.java:352
-#: org/postgresql/jdbc2/EscapedFunctions.java:380
-#: org/postgresql/jdbc2/EscapedFunctions.java:389
-#: org/postgresql/jdbc2/EscapedFunctions.java:399
-#: org/postgresql/jdbc2/EscapedFunctions.java:408
-#: org/postgresql/jdbc2/EscapedFunctions.java:417
-#: org/postgresql/jdbc2/EscapedFunctions.java:426
-#: org/postgresql/jdbc2/EscapedFunctions.java:435
-#: org/postgresql/jdbc2/EscapedFunctions.java:444
-#: org/postgresql/jdbc2/EscapedFunctions.java:453
-#: org/postgresql/jdbc2/EscapedFunctions.java:462
-#: org/postgresql/jdbc2/EscapedFunctions.java:471
-#: org/postgresql/jdbc2/EscapedFunctions.java:480
-#, java-format
-msgid "{0} function takes one and only one argument."
-msgstr "{0} 函式取得一個且僅有一個引數。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:181
-#: org/postgresql/jdbc2/EscapedFunctions.java:193
-#: org/postgresql/jdbc2/EscapedFunctions.java:255
-#: org/postgresql/jdbc2/EscapedFunctions.java:304
-#: org/postgresql/jdbc2/EscapedFunctions.java:582
-#, java-format
-msgid "{0} function takes two and only two arguments."
-msgstr "{0} 函式取得二個且僅有二個引數。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:230
-#, java-format
-msgid "{0} function takes four and only four argument."
-msgstr "{0} 函式取得四個且僅有四個引數。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:282
-#: org/postgresql/jdbc2/EscapedFunctions.java:342
-#, java-format
-msgid "{0} function takes two or three arguments."
-msgstr "{0} 函式取得二個或三個引數。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:362
-#: org/postgresql/jdbc2/EscapedFunctions.java:371
-#: org/postgresql/jdbc2/EscapedFunctions.java:573
-#: org/postgresql/jdbc2/EscapedFunctions.java:591
-#, java-format
-msgid "{0} function doesn''t take any argument."
-msgstr "{0} 函式無法取得任何的引數。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:489
-#: org/postgresql/jdbc2/EscapedFunctions.java:531
-#, java-format
-msgid "{0} function takes three and only three arguments."
-msgstr "{0} 函式取得三個且僅有三個引數。"
-
-#: org/postgresql/jdbc2/EscapedFunctions.java:501
-#: org/postgresql/jdbc2/EscapedFunctions.java:521
-#: org/postgresql/jdbc2/EscapedFunctions.java:523
-#: org/postgresql/jdbc2/EscapedFunctions.java:543
-#: org/postgresql/jdbc2/EscapedFunctions.java:564
-#: org/postgresql/jdbc2/EscapedFunctions.java:566
-#, java-format
-msgid "Interval {0} not yet implemented"
-msgstr "隔絕 {0} 尚未被實作。"
-
-#: org/postgresql/jdbc2/TimestampUtils.java:360
-msgid ""
-"Infinite value found for timestamp/date. This cannot be represented as time."
-msgstr ""
-
-#: org/postgresql/jdbc2/TimestampUtils.java:648
-#: org/postgresql/jdbc2/TimestampUtils.java:680
-#: org/postgresql/jdbc2/TimestampUtils.java:727
-#, fuzzy, java-format
-msgid "Unsupported binary encoding of {0}."
-msgstr "未被支持的型別值:{0}"
-
-#: org/postgresql/jdbc2/TypeInfoCache.java:161
-#, java-format
-msgid "The class {0} does not implement org.postgresql.util.PGobject."
-msgstr "類別 {0} 未實做 org.postgresql.util.PGobject。"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:60
-#, java-format
-msgid "Unknown ResultSet holdability setting: {0}."
-msgstr "未知的 ResultSet 可適用的設置:{0}。"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:98
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:130
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:165
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:187
-msgid "Server versions prior to 8.0 do not support savepoints."
-msgstr "8.0 版之前的伺服器不支援儲存點(SavePints)。"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:100
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:132
-msgid "Cannot establish a savepoint in auto-commit mode."
-msgstr "在自動確認事物交易模式無法建立儲存點(Savepoint)。"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Connection.java:419
-msgid "Returning autogenerated keys is not supported."
-msgstr ""
-
-#: org/postgresql/jdbc3/AbstractJdbc3ParameterMetaData.java:81
-#, java-format
-msgid "The parameter index is out of range: {0}, number of parameters: {1}."
-msgstr "參數索引超出許可範圍:{0},參數總數:{1}。"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:151
-#, fuzzy
-msgid ""
-"Returning autogenerated keys is only supported for 8.2 and later servers."
-msgstr "大型物件的截斷(Truncation)僅被實作執行在 8.3 和後來的伺服器。"
-
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:199
-#: org/postgresql/jdbc3/AbstractJdbc3Statement.java:317
-msgid "Returning autogenerated keys by column index is not supported."
-msgstr ""
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:38
-#: org/postgresql/jdbc3/PSQLSavepoint.java:50
-#: org/postgresql/jdbc3/PSQLSavepoint.java:66
-msgid "Cannot reference a savepoint after it has been released."
-msgstr "無法參照已經被釋放的儲存點。"
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:42
-msgid "Cannot retrieve the id of a named savepoint."
-msgstr "無法取得已命名儲存點的 id。"
-
-#: org/postgresql/jdbc3/PSQLSavepoint.java:54
-msgid "Cannot retrieve the name of an unnamed savepoint."
-msgstr "無法取得未命名儲存點(Savepoint)的名稱。"
-
-#: org/postgresql/jdbc3g/AbstractJdbc3gResultSet.java:37
-#, fuzzy
-msgid "Invalid UUID data."
-msgstr "無效的旗標"
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:83
-#, java-format
-msgid "Unable to find server array type for provided name {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:121
-#, fuzzy, java-format
-msgid "Invalid timeout ({0}<0)."
-msgstr "無效的串流長度 {0}."
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:134
-msgid "Validating connection."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:157
-#, fuzzy, java-format
-msgid "Failed to set ClientInfo property: {0}"
-msgstr "為 {0} 建立物件失敗。"
-
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:166
-#: org/postgresql/jdbc4/AbstractJdbc4Connection.java:188
-msgid "ClientInfo property not supported."
-msgstr ""
-
-#: org/postgresql/jdbc4/AbstractJdbc4Statement.java:127
-msgid "Object is too large to send over the protocol."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:147
-msgid "Unable to decode xml data."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:150
-#, java-format
-msgid "Unknown XML Source class: {0}"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:195
-#, fuzzy
-msgid "Unable to create SAXResult for SQLXML."
-msgstr "為 {0} 建立物件失敗。"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:209
-msgid "Unable to create StAXResult for SQLXML"
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:213
-#, fuzzy, java-format
-msgid "Unknown XML Result class: {0}"
-msgstr "未知的 ResultSet 可適用的設置:{0}。"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:226
-#, fuzzy
-msgid "This SQLXML object has already been freed."
-msgstr "這個 PooledConnection 已經被關閉。"
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:233
-msgid ""
-"This SQLXML object has not been initialized, so you cannot retrieve data "
-"from it."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:244
-#, java-format
-msgid "Failed to convert binary xml data to encoding: {0}."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:269
-msgid "Unable to convert DOMResult SQLXML data to a string."
-msgstr ""
-
-#: org/postgresql/jdbc4/Jdbc4SQLXML.java:282
-msgid ""
-"This SQLXML object has already been initialized, so you cannot manipulate it "
-"further."
-msgstr ""
-
-#: org/postgresql/largeobject/LargeObjectManager.java:138
-msgid "Failed to initialize LargeObject API"
-msgstr "初始化 LargeObject API 失敗"
-
-#: org/postgresql/largeobject/LargeObjectManager.java:257
-#: org/postgresql/largeobject/LargeObjectManager.java:298
-msgid "Large Objects may not be used in auto-commit mode."
-msgstr "大型物件無法被使用在自動確認事物交易模式。"
-
-#: org/postgresql/ssl/jdbc3/AbstractJdbc3MakeSSL.java:58
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:110
-#, java-format
-msgid "The SSLSocketFactory class provided {0} could not be instantiated."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:125
-#, java-format
-msgid "SSL error: {0}"
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:138
-#, java-format
-msgid "The HostnameVerifier class provided {0} could not be instantiated."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:142
-#, java-format
-msgid "The hostname {0} could not be verified by hostnameverifier {1}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/AbstractJdbc4MakeSSL.java:149
-#, java-format
-msgid "The hostname {0} could not be verified."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:121
-msgid ""
-"Could not find a java cryptographic algorithm: X.509 CertificateFactory not "
-"available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:132
-#, java-format
-msgid "Could not open SSL certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:137
-#, java-format
-msgid "Loading the SSL certificate {0} into a KeyManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:194
-msgid "Enter SSL password: "
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:202
-msgid "Could not read password for SSL key file, console is not available."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:204
-#, java-format
-msgid "Could not read password for SSL key file by callbackhandler {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:223
-#, java-format
-msgid "Could not decrypt SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:231
-#, java-format
-msgid "Could not read SSL key file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LazyKeyManager.java:235
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:173
-#, java-format
-msgid "Could not find a java cryptographic algorithm: {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:99
-#, java-format
-msgid "The password callback class provided {0} could not be instantiated."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:133
-#, java-format
-msgid "Could not open SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:150
-#, java-format
-msgid "Could not read SSL root certificate file {0}."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:153
-#, java-format
-msgid "Loading the SSL root certificate {0} into a TrustManager failed."
-msgstr ""
-
-#: org/postgresql/ssl/jdbc4/LibPQFactory.java:166
-msgid "Could not initialize SSL context."
-msgstr ""
-
-#: org/postgresql/util/PGInterval.java:164
-msgid "Conversion of interval failed"
-msgstr "隔絕(Interval)轉換失敗。"
-
-#: org/postgresql/util/PGmoney.java:73
-msgid "Conversion of money failed."
-msgstr "money 轉換失敗。"
-
-#: org/postgresql/util/ServerErrorMessage.java:155
-#, java-format
-msgid "Detail: {0}"
-msgstr "詳細:{0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:159
-#, java-format
-msgid "Hint: {0}"
-msgstr "建議:{0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:162
-#, java-format
-msgid "Position: {0}"
-msgstr "位置:{0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:165
-#, java-format
-msgid "Where: {0}"
-msgstr "在位置:{0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:171
-#, java-format
-msgid "Internal Query: {0}"
-msgstr "內部查詢:{0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:174
-#, java-format
-msgid "Internal Position: {0}"
-msgstr "內部位置:{0}"
-
-#: org/postgresql/util/ServerErrorMessage.java:180
-#, java-format
-msgid "Location: File: {0}, Routine: {1}, Line: {2}"
-msgstr "位置:檔案:{0},常式:{1},行:{2}"
-
-#: org/postgresql/util/ServerErrorMessage.java:183
-#, java-format
-msgid "Server SQLState: {0}"
-msgstr "伺服器 SQLState:{0}"
-
-#: org/postgresql/xa/PGXAConnection.java:148
-msgid ""
-"Transaction control methods setAutoCommit(true), commit, rollback and "
-"setSavePoint not allowed while an XA transaction is active."
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:186
-#: org/postgresql/xa/PGXAConnection.java:245
-msgid "Invalid flags"
-msgstr "無效的旗標"
-
-#: org/postgresql/xa/PGXAConnection.java:189
-#: org/postgresql/xa/PGXAConnection.java:248
-#: org/postgresql/xa/PGXAConnection.java:425
-msgid "xid must not be null"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:192
-msgid "Connection is busy with another transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:198
-#: org/postgresql/xa/PGXAConnection.java:255
-msgid "suspend/resume not implemented"
-msgstr "暫停(suspend)/再繼續(resume)尚未被實作。"
-
-#: org/postgresql/xa/PGXAConnection.java:204
-#: org/postgresql/xa/PGXAConnection.java:207
-#: org/postgresql/xa/PGXAConnection.java:209
-msgid "Transaction interleaving not implemented"
-msgstr "事物交易隔絕(Transaction interleaving)未被實作。"
-
-#: org/postgresql/xa/PGXAConnection.java:218
-msgid "Error disabling autocommit"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:251
-msgid "tried to call end without corresponding start call"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:282
-msgid ""
-"Not implemented: Prepare must be issued using the same connection that "
-"started the transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:286
-msgid "Prepare called before end"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:292
-msgid "Server versions prior to 8.1 do not support two-phase commit."
-msgstr "8.1 版之前的伺服器不支援二段式提交(Two-Phase Commit)。"
-
-#: org/postgresql/xa/PGXAConnection.java:313
-msgid "Error preparing transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:328
-msgid "Invalid flag"
-msgstr "無效的旗標"
-
-#: org/postgresql/xa/PGXAConnection.java:368
-msgid "Error during recover"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:416
-msgid "Error rolling back prepared transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:451
-msgid ""
-"Not implemented: one-phase commit must be issued using the same connection "
-"that was used to start it"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:455
-msgid "commit called before end"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:466
-msgid "Error during one-phase commit"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:487
-msgid ""
-"Not implemented: 2nd phase commit must be issued using an idle connection"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:507
-msgid "Error committing prepared transaction"
-msgstr ""
-
-#: org/postgresql/xa/PGXAConnection.java:522
-msgid "Heuristic commit/rollback not supported"
-msgstr ""
-
-#~ msgid "The driver does not support SSL."
-#~ msgstr "驅動程式不支援 SSL 連線。"
-
-#~ msgid "Exception: {0}"
-#~ msgstr "例外:{0}"
-
-#~ msgid "Stack Trace:"
-#~ msgstr "堆疊追縱:"
-
-#~ msgid "End of Stack Trace"
-#~ msgstr "堆疊追縱結束"
diff --git a/org/postgresql/util/Base64.java b/org/postgresql/util/Base64.java
deleted file mode 100644
index ebf23a7..0000000
--- a/org/postgresql/util/Base64.java
+++ /dev/null
@@ -1,577 +0,0 @@
-package org.postgresql.util;
-
-/**
- * This code is a stripped down version of Robert Harder's Public Domain
- * Base64 implementation. GZIP support, InputStream and OutputStream stuff
- * and some unneeded encode/decode methods have been removed.
- *
- * -- Original comments follow --
- *
- * Encodes and decodes to and from Base64 notation.
- *
- * <p>
- * Change Log:
- * </p>
- * <ul>
- * <li>v2.1 - Cleaned up javadoc comments and unused variables and methods. Added
- * some convenience methods for reading and writing to and from files.</li>
- * <li>v2.0.2 - Now specifies UTF-8 encoding in places where the code fails on systems
- * with other encodings (like EBCDIC).</li>
- * <li>v2.0.1 - Fixed an error when decoding a single byte, that is, when the
- * encoded data was a single byte.</li>
- * <li>v2.0 - I got rid of methods that used booleans to set options.
- * Now everything is more consolidated and cleaner. The code now detects
- * when data that's being decoded is gzip-compressed and will decompress it
- * automatically. Generally things are cleaner. You'll probably have to
- * change some method calls that you were making to support the new
- * options format (<tt>int</tt>s that you "OR" together).</li>
- * <li>v1.5.1 - Fixed bug when decompressing and decoding to a
- * byte[] using <tt>decode( String s, boolean gzipCompressed )</tt>.
- * Added the ability to "suspend" encoding in the Output Stream so
- * you can turn on and off the encoding if you need to embed base64
- * data in an otherwise "normal" stream (like an XML file).</li>
- * <li>v1.5 - Output stream pases on flush() command but doesn't do anything itself.
- * This helps when using GZIP streams.
- * Added the ability to GZip-compress objects before encoding them.</li>
- * <li>v1.4 - Added helper methods to read/write files.</li>
- * <li>v1.3.6 - Fixed OutputStream.flush() so that 'position' is reset.</li>
- * <li>v1.3.5 - Added flag to turn on and off line breaks. Fixed bug in input stream
- * where last buffer being read, if not completely full, was not returned.</li>
- * <li>v1.3.4 - Fixed when "improperly padded stream" error was thrown at the wrong time.</li>
- * <li>v1.3.3 - Fixed I/O streams which were totally messed up.</li>
- * </ul>
- *
- * <p>
- * I am placing this code in the Public Domain. Do with it as you will.
- * This software comes with no guarantees or warranties but with
- * plenty of well-wishing instead!
- * Please visit <a href="http://iharder.net/base64">http://iharder.net/base64</a>
- * periodically to check for updates or to contribute improvements.
- * </p>
- *
- * @author Robert Harder
- * @author rob at iharder.net
- * @version 2.1
- */
-public class Base64
-{
-
-/* ******** P U B L I C F I E L D S ******** */
-
-
- /** No options specified. Value is zero. */
- public final static int NO_OPTIONS = 0;
-
- /** Specify encoding. */
- public final static int ENCODE = 1;
-
-
- /** Specify decoding. */
- public final static int DECODE = 0;
-
-
- /** Don't break lines when encoding (violates strict Base64 specification) */
- public final static int DONT_BREAK_LINES = 8;
-
-
-/* ******** P R I V A T E F I E L D S ******** */
-
-
- /** Maximum line length (76) of Base64 output. */
- private final static int MAX_LINE_LENGTH = 76;
-
-
- /** The equals sign (=) as a byte. */
- private final static byte EQUALS_SIGN = (byte)'=';
-
-
- /** The new line character (\n) as a byte. */
- private final static byte NEW_LINE = (byte)'\n';
-
-
- /** Preferred encoding. */
- private final static String PREFERRED_ENCODING = "UTF-8";
-
-
- /** The 64 valid Base64 values. */
- private final static byte[] ALPHABET;
- private final static byte[] _NATIVE_ALPHABET = /* May be something funny like EBCDIC */
- {
- (byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F', (byte)'G',
- (byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L', (byte)'M', (byte)'N',
- (byte)'O', (byte)'P', (byte)'Q', (byte)'R', (byte)'S', (byte)'T', (byte)'U',
- (byte)'V', (byte)'W', (byte)'X', (byte)'Y', (byte)'Z',
- (byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f', (byte)'g',
- (byte)'h', (byte)'i', (byte)'j', (byte)'k', (byte)'l', (byte)'m', (byte)'n',
- (byte)'o', (byte)'p', (byte)'q', (byte)'r', (byte)'s', (byte)'t', (byte)'u',
- (byte)'v', (byte)'w', (byte)'x', (byte)'y', (byte)'z',
- (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5',
- (byte)'6', (byte)'7', (byte)'8', (byte)'9', (byte)'+', (byte)'/'
- };
-
- /** Determine which ALPHABET to use. */
- static
- {
- byte[] __bytes;
- try
- {
- __bytes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".getBytes( PREFERRED_ENCODING );
- } // end try
- catch (java.io.UnsupportedEncodingException use)
- {
- __bytes = _NATIVE_ALPHABET; // Fall back to native encoding
- } // end catch
- ALPHABET = __bytes;
- } // end static
-
-
- /**
- * Translates a Base64 value to either its 6-bit reconstruction value
- * or a negative number indicating some other meaning.
- **/
- private final static byte[] DECODABET =
- {
- -9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 0 - 8
- -5,-5, // Whitespace: Tab and Linefeed
- -9,-9, // Decimal 11 - 12
- -5, // Whitespace: Carriage Return
- -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 14 - 26
- -9,-9,-9,-9,-9, // Decimal 27 - 31
- -5, // Whitespace: Space
- -9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 33 - 42
- 62, // Plus sign at decimal 43
- -9,-9,-9, // Decimal 44 - 46
- 63, // Slash at decimal 47
- 52,53,54,55,56,57,58,59,60,61, // Numbers zero through nine
- -9,-9,-9, // Decimal 58 - 60
- -1, // Equals sign at decimal 61
- -9,-9,-9, // Decimal 62 - 64
- 0,1,2,3,4,5,6,7,8,9,10,11,12,13, // Letters 'A' through 'N'
- 14,15,16,17,18,19,20,21,22,23,24,25, // Letters 'O' through 'Z'
- -9,-9,-9,-9,-9,-9, // Decimal 91 - 96
- 26,27,28,29,30,31,32,33,34,35,36,37,38, // Letters 'a' through 'm'
- 39,40,41,42,43,44,45,46,47,48,49,50,51, // Letters 'n' through 'z'
- -9,-9,-9,-9 // Decimal 123 - 126
- /*,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 127 - 139
- -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 140 - 152
- -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 153 - 165
- -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 166 - 178
- -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 179 - 191
- -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 192 - 204
- -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 205 - 217
- -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 218 - 230
- -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 231 - 243
- -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9 // Decimal 244 - 255 */
- };
-
- // I think I end up not using the BAD_ENCODING indicator.
- //private final static byte BAD_ENCODING = -9; // Indicates error in encoding
- private final static byte WHITE_SPACE_ENC = -5; // Indicates white space in encoding
- private final static byte EQUALS_SIGN_ENC = -1; // Indicates equals sign in encoding
-
-
- /** Defeats instantiation. */
- private Base64(){}
-
-
-
-/* ******** E N C O D I N G M E T H O D S ******** */
-
-
- /**
- * Encodes up to the first three bytes of array <var>threeBytes</var>
- * and returns a four-byte array in Base64 notation.
- * The actual number of significant bytes in your array is
- * given by <var>numSigBytes</var>.
- * The array <var>threeBytes</var> needs only be as big as
- * <var>numSigBytes</var>.
- * Code can reuse a byte array by passing a four-byte array as <var>b4</var>.
- *
- * @param b4 A reusable byte array to reduce array instantiation
- * @param threeBytes the array to convert
- * @param numSigBytes the number of significant bytes in your array
- * @return four byte array in Base64 notation.
- * @since 1.5.1
- */
- private static byte[] encode3to4( byte[] b4, byte[] threeBytes, int numSigBytes )
- {
- encode3to4( threeBytes, 0, numSigBytes, b4, 0 );
- return b4;
- } // end encode3to4
-
-
- /**
- * Encodes up to three bytes of the array <var>source</var>
- * and writes the resulting four Base64 bytes to <var>destination</var>.
- * The source and destination arrays can be manipulated
- * anywhere along their length by specifying
- * <var>srcOffset</var> and <var>destOffset</var>.
- * This method does not check to make sure your arrays
- * are large enough to accomodate <var>srcOffset</var> + 3 for
- * the <var>source</var> array or <var>destOffset</var> + 4 for
- * the <var>destination</var> array.
- * The actual number of significant bytes in your array is
- * given by <var>numSigBytes</var>.
- *
- * @param source the array to convert
- * @param srcOffset the index where conversion begins
- * @param numSigBytes the number of significant bytes in your array
- * @param destination the array to hold the conversion
- * @param destOffset the index where output will be put
- * @return the <var>destination</var> array
- * @since 1.3
- */
- private static byte[] encode3to4(
- byte[] source, int srcOffset, int numSigBytes,
- byte[] destination, int destOffset )
- {
- // 1 2 3
- // 01234567890123456789012345678901 Bit position
- // --------000000001111111122222222 Array position from threeBytes
- // --------| || || || | Six bit groups to index ALPHABET
- // >>18 >>12 >> 6 >> 0 Right shift necessary
- // 0x3f 0x3f 0x3f Additional AND
-
- // Create buffer with zero-padding if there are only one or two
- // significant bytes passed in the array.
- // We have to shift left 24 in order to flush out the 1's that appear
- // when Java treats a value as negative that is cast from a byte to an int.
- int inBuff = ( numSigBytes > 0 ? ((source[ srcOffset ] << 24) >>> 8) : 0 )
- | ( numSigBytes > 1 ? ((source[ srcOffset + 1 ] << 24) >>> 16) : 0 )
- | ( numSigBytes > 2 ? ((source[ srcOffset + 2 ] << 24) >>> 24) : 0 );
-
- switch( numSigBytes )
- {
- case 3:
- destination[ destOffset ] = ALPHABET[ (inBuff >>> 18) ];
- destination[ destOffset + 1 ] = ALPHABET[ (inBuff >>> 12) & 0x3f ];
- destination[ destOffset + 2 ] = ALPHABET[ (inBuff >>> 6) & 0x3f ];
- destination[ destOffset + 3 ] = ALPHABET[ (inBuff ) & 0x3f ];
- return destination;
-
- case 2:
- destination[ destOffset ] = ALPHABET[ (inBuff >>> 18) ];
- destination[ destOffset + 1 ] = ALPHABET[ (inBuff >>> 12) & 0x3f ];
- destination[ destOffset + 2 ] = ALPHABET[ (inBuff >>> 6) & 0x3f ];
- destination[ destOffset + 3 ] = EQUALS_SIGN;
- return destination;
-
- case 1:
- destination[ destOffset ] = ALPHABET[ (inBuff >>> 18) ];
- destination[ destOffset + 1 ] = ALPHABET[ (inBuff >>> 12) & 0x3f ];
- destination[ destOffset + 2 ] = EQUALS_SIGN;
- destination[ destOffset + 3 ] = EQUALS_SIGN;
- return destination;
-
- default:
- return destination;
- } // end switch
- } // end encode3to4
-
- /**
- * Encodes a byte array into Base64 notation.
- * Does not GZip-compress data.
- *
- * @param source The data to convert
- * @since 1.4
- */
- public static String encodeBytes( byte[] source )
- {
- return encodeBytes( source, 0, source.length, NO_OPTIONS );
- } // end encodeBytes
-
-
-
- /**
- * Encodes a byte array into Base64 notation.
- * <p>
- * Valid options:<pre>
- * GZIP: gzip-compresses object before encoding it.
- * DONT_BREAK_LINES: don't break lines at 76 characters
- * <i>Note: Technically, this makes your encoding non-compliant.</i>
- * </pre>
- * <p>
- * Example: <code>encodeBytes( myData, Base64.GZIP )</code> or
- * <p>
- * Example: <code>encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES )</code>
- *
- *
- * @param source The data to convert
- * @param options Specified options
- * @see Base64#DONT_BREAK_LINES
- * @since 2.0
- */
- public static String encodeBytes( byte[] source, int options )
- {
- return encodeBytes( source, 0, source.length, options );
- } // end encodeBytes
-
-
- /**
- * Encodes a byte array into Base64 notation.
- * Does not GZip-compress data.
- *
- * @param source The data to convert
- * @param off Offset in array where conversion should begin
- * @param len Length of data to convert
- * @since 1.4
- */
- public static String encodeBytes( byte[] source, int off, int len )
- {
- return encodeBytes( source, off, len, NO_OPTIONS );
- } // end encodeBytes
-
-
-
- /**
- * Encodes a byte array into Base64 notation.
- * <p>
- * Valid options:<pre>
- * GZIP: gzip-compresses object before encoding it.
- * DONT_BREAK_LINES: don't break lines at 76 characters
- * <i>Note: Technically, this makes your encoding non-compliant.</i>
- * </pre>
- * <p>
- * Example: <code>encodeBytes( myData, Base64.GZIP )</code> or
- * <p>
- * Example: <code>encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES )</code>
- *
- *
- * @param source The data to convert
- * @param off Offset in array where conversion should begin
- * @param len Length of data to convert
- * @param options Specified options
- * @see Base64#DONT_BREAK_LINES
- * @since 2.0
- */
- public static String encodeBytes( byte[] source, int off, int len, int options )
- {
- // Isolate options
- int dontBreakLines = ( options & DONT_BREAK_LINES );
-
- // Else, don't compress. Better not to use streams at all then.
- {
- // Convert option to boolean in way that code likes it.
- boolean breakLines = dontBreakLines == 0;
-
- int len43 = len * 4 / 3;
- byte[] outBuff = new byte[ ( len43 ) // Main 4:3
- + ( (len % 3) > 0 ? 4 : 0 ) // Account for padding
- + (breakLines ? ( len43 / MAX_LINE_LENGTH ) : 0) ]; // New lines
- int d = 0;
- int e = 0;
- int len2 = len - 2;
- int lineLength = 0;
- for( ; d < len2; d+=3, e+=4 )
- {
- encode3to4( source, d+off, 3, outBuff, e );
-
- lineLength += 4;
- if( breakLines && lineLength == MAX_LINE_LENGTH )
- {
- outBuff[e+4] = NEW_LINE;
- e++;
- lineLength = 0;
- } // end if: end of line
- } // en dfor: each piece of array
-
- if( d < len )
- {
- encode3to4( source, d+off, len - d, outBuff, e );
- e += 4;
- } // end if: some padding needed
-
-
- // Return value according to relevant encoding.
- try
- {
- return new String( outBuff, 0, e, PREFERRED_ENCODING );
- } // end try
- catch (java.io.UnsupportedEncodingException uue)
- {
- return new String( outBuff, 0, e );
- } // end catch
-
- } // end else: don't compress
-
- } // end encodeBytes
-
-
-
-
-
-/* ******** D E C O D I N G M E T H O D S ******** */
-
-
- /**
- * Decodes four bytes from array <var>source</var>
- * and writes the resulting bytes (up to three of them)
- * to <var>destination</var>.
- * The source and destination arrays can be manipulated
- * anywhere along their length by specifying
- * <var>srcOffset</var> and <var>destOffset</var>.
- * This method does not check to make sure your arrays
- * are large enough to accomodate <var>srcOffset</var> + 4 for
- * the <var>source</var> array or <var>destOffset</var> + 3 for
- * the <var>destination</var> array.
- * This method returns the actual number of bytes that
- * were converted from the Base64 encoding.
- *
- *
- * @param source the array to convert
- * @param srcOffset the index where conversion begins
- * @param destination the array to hold the conversion
- * @param destOffset the index where output will be put
- * @return the number of decoded bytes converted
- * @since 1.3
- */
- private static int decode4to3( byte[] source, int srcOffset, byte[] destination, int destOffset )
- {
- // Example: Dk==
- if( source[ srcOffset + 2] == EQUALS_SIGN )
- {
- // Two ways to do the same thing. Don't know which way I like best.
- //int outBuff = ( ( DECODABET[ source[ srcOffset ] ] << 24 ) >>> 6 )
- // | ( ( DECODABET[ source[ srcOffset + 1] ] << 24 ) >>> 12 );
- int outBuff = ( ( DECODABET[ source[ srcOffset ] ] & 0xFF ) << 18 )
- | ( ( DECODABET[ source[ srcOffset + 1] ] & 0xFF ) << 12 );
-
- destination[ destOffset ] = (byte)( outBuff >>> 16 );
- return 1;
- }
-
- // Example: DkL=
- else if( source[ srcOffset + 3 ] == EQUALS_SIGN )
- {
- // Two ways to do the same thing. Don't know which way I like best.
- //int outBuff = ( ( DECODABET[ source[ srcOffset ] ] << 24 ) >>> 6 )
- // | ( ( DECODABET[ source[ srcOffset + 1 ] ] << 24 ) >>> 12 )
- // | ( ( DECODABET[ source[ srcOffset + 2 ] ] << 24 ) >>> 18 );
- int outBuff = ( ( DECODABET[ source[ srcOffset ] ] & 0xFF ) << 18 )
- | ( ( DECODABET[ source[ srcOffset + 1 ] ] & 0xFF ) << 12 )
- | ( ( DECODABET[ source[ srcOffset + 2 ] ] & 0xFF ) << 6 );
-
- destination[ destOffset ] = (byte)( outBuff >>> 16 );
- destination[ destOffset + 1 ] = (byte)( outBuff >>> 8 );
- return 2;
- }
-
- // Example: DkLE
- else
- {
- try{
- // Two ways to do the same thing. Don't know which way I like best.
- //int outBuff = ( ( DECODABET[ source[ srcOffset ] ] << 24 ) >>> 6 )
- // | ( ( DECODABET[ source[ srcOffset + 1 ] ] << 24 ) >>> 12 )
- // | ( ( DECODABET[ source[ srcOffset + 2 ] ] << 24 ) >>> 18 )
- // | ( ( DECODABET[ source[ srcOffset + 3 ] ] << 24 ) >>> 24 );
- int outBuff = ( ( DECODABET[ source[ srcOffset ] ] & 0xFF ) << 18 )
- | ( ( DECODABET[ source[ srcOffset + 1 ] ] & 0xFF ) << 12 )
- | ( ( DECODABET[ source[ srcOffset + 2 ] ] & 0xFF ) << 6)
- | ( ( DECODABET[ source[ srcOffset + 3 ] ] & 0xFF ) );
-
-
- destination[ destOffset ] = (byte)( outBuff >> 16 );
- destination[ destOffset + 1 ] = (byte)( outBuff >> 8 );
- destination[ destOffset + 2 ] = (byte)( outBuff );
-
- return 3;
- }catch( Exception e){
- System.out.println(""+source[srcOffset]+ ": " + ( DECODABET[ source[ srcOffset ] ] ) );
- System.out.println(""+source[srcOffset+1]+ ": " + ( DECODABET[ source[ srcOffset + 1 ] ] ) );
- System.out.println(""+source[srcOffset+2]+ ": " + ( DECODABET[ source[ srcOffset + 2 ] ] ) );
- System.out.println(""+source[srcOffset+3]+ ": " + ( DECODABET[ source[ srcOffset + 3 ] ] ) );
- return -1;
- } //e nd catch
- }
- } // end decodeToBytes
-
-
-
-
- /**
- * Very low-level access to decoding ASCII characters in
- * the form of a byte array. Does not support automatically
- * gunzipping or any other "fancy" features.
- *
- * @param source The Base64 encoded data
- * @param off The offset of where to begin decoding
- * @param len The length of characters to decode
- * @return decoded data
- * @since 1.3
- */
- public static byte[] decode( byte[] source, int off, int len )
- {
- int len34 = len * 3 / 4;
- byte[] outBuff = new byte[ len34 ]; // Upper limit on size of output
- int outBuffPosn = 0;
-
- byte[] b4 = new byte[4];
- int b4Posn = 0;
- int i = 0;
- byte sbiCrop = 0;
- byte sbiDecode = 0;
- for( i = off; i < off+len; i++ )
- {
- sbiCrop = (byte)(source[i] & 0x7f); // Only the low seven bits
- sbiDecode = DECODABET[ sbiCrop ];
-
- if( sbiDecode >= WHITE_SPACE_ENC ) // White space, Equals sign or better
- {
- if( sbiDecode >= EQUALS_SIGN_ENC )
- {
- b4[ b4Posn++ ] = sbiCrop;
- if( b4Posn > 3 )
- {
- outBuffPosn += decode4to3( b4, 0, outBuff, outBuffPosn );
- b4Posn = 0;
-
- // If that was the equals sign, break out of 'for' loop
- if( sbiCrop == EQUALS_SIGN )
- break;
- } // end if: quartet built
-
- } // end if: equals sign or better
-
- } // end if: white space, equals sign or better
- else
- {
- System.err.println( "Bad Base64 input character at " + i + ": " + source[i] + "(decimal)" );
- return null;
- } // end else:
- } // each input character
-
- byte[] out = new byte[ outBuffPosn ];
- System.arraycopy( outBuff, 0, out, 0, outBuffPosn );
- return out;
- } // end decode
-
-
- /**
- * Decodes data from Base64 notation, automatically
- * detecting gzip-compressed data and decompressing it.
- *
- * @param s the string to decode
- * @return the decoded data
- * @since 1.4
- */
- public static byte[] decode( String s )
- {
- byte[] bytes;
- try
- {
- bytes = s.getBytes( PREFERRED_ENCODING );
- } // end try
- catch( java.io.UnsupportedEncodingException uee )
- {
- bytes = s.getBytes();
- } // end catch
- //</change>
-
- // Decode
- bytes = decode( bytes, 0, bytes.length );
-
- return bytes;
- } // end decode
-
-} // end class Base64
diff --git a/org/postgresql/util/ByteConverter.java b/org/postgresql/util/ByteConverter.java
deleted file mode 100644
index 76c864f..0000000
--- a/org/postgresql/util/ByteConverter.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * Copyright (c) 2011, PostgreSQL Global Development Group
- *
- *
- *-------------------------------------------------------------------------
- */
-package org.postgresql.util;
-
-/**
- * Helper methods to parse java base types from byte arrays.
- *
- * @author Mikko Tiihonen
- */
-public class ByteConverter {
-
- private ByteConverter() {
- // prevent instantiation of static helper class
- }
-
- /**
- * Parses a long value from the byte array.
- *
- * @param bytes The byte array to parse.
- * @param idx The starting index of the parse in the byte array.
- * @return parsed long value.
- */
- public static long int8(byte[] bytes, int idx) {
- return
- ((long)(bytes[idx+0] & 255) << 56) +
- ((long)(bytes[idx+1] & 255) << 48) +
- ((long)(bytes[idx+2] & 255) << 40) +
- ((long)(bytes[idx+3] & 255) << 32) +
- ((long)(bytes[idx+4] & 255) << 24) +
- ((long)(bytes[idx+5] & 255) << 16) +
- ((long)(bytes[idx+6] & 255) << 8) +
- (bytes[idx+7] & 255);
- }
-
- /**
- * Parses an int value from the byte array.
- *
- * @param bytes The byte array to parse.
- * @param idx The starting index of the parse in the byte array.
- * @return parsed int value.
- */
- public static int int4(byte[] bytes, int idx) {
- return
- ((bytes[idx ] & 255) << 24) +
- ((bytes[idx+1] & 255) << 16) +
- ((bytes[idx+2] & 255) << 8) +
- ((bytes[idx+3] & 255) );
- }
-
- /**
- * Parses a short value from the byte array.
- *
- * @param bytes The byte array to parse.
- * @param idx The starting index of the parse in the byte array.
- * @return parsed short value.
- */
- public static short int2(byte[] bytes, int idx) {
- return (short)
- (((bytes[idx ] & 255) << 8) +
- ((bytes[idx+1] & 255) ));
- }
-
- /**
- * Parses a float value from the byte array.
- *
- * @param bytes The byte array to parse.
- * @param idx The starting index of the parse in the byte array.
- * @return parsed float value.
- */
- public static float float4(byte[] bytes, int idx) {
- return Float.intBitsToFloat(int4(bytes, idx));
- }
-
- /**
- * Parses a double value from the byte array.
- *
- * @param bytes The byte array to parse.
- * @param idx The starting index of the parse in the byte array.
- * @return parsed double value.
- */
- public static double float8(byte[] bytes, int idx) {
- return Double.longBitsToDouble(int8(bytes, idx));
- }
-
- /**
- * Encodes a long value to the byte array.
- *
- * @param target The byte array to encode to.
- * @param idx The starting index in the byte array.
- * @param value The value to encode.
- */
- public static void int8(byte[] target, int idx, long value) {
- target[idx+0] = (byte) (value >>> 56);
- target[idx+1] = (byte) (value >>> 48);
- target[idx+2] = (byte) (value >>> 40);
- target[idx+3] = (byte) (value >>> 32);
- target[idx+4] = (byte) (value >>> 24);
- target[idx+5] = (byte) (value >>> 16);
- target[idx+6] = (byte) (value >>> 8);
- target[idx+7] = (byte) value;
- }
-
- /**
- * Encodes a int value to the byte array.
- *
- * @param target The byte array to encode to.
- * @param idx The starting index in the byte array.
- * @param value The value to encode.
- */
- public static void int4(byte[] target, int idx, int value) {
- target[idx+0] = (byte) (value >>> 24);
- target[idx+1] = (byte) (value >>> 16);
- target[idx+2] = (byte) (value >>> 8);
- target[idx+3] = (byte) value;
- }
-
- /**
- * Encodes a int value to the byte array.
- *
- * @param target The byte array to encode to.
- * @param idx The starting index in the byte array.
- * @param value The value to encode.
- */
- public static void int2(byte[] target, int idx, int value) {
- target[idx+0] = (byte) (value >>> 8);
- target[idx+1] = (byte) value;
- }
-
- /**
- * Encodes a int value to the byte array.
- *
- * @param target The byte array to encode to.
- * @param idx The starting index in the byte array.
- * @param value The value to encode.
- */
- public static void float4(byte[] target, int idx, float value) {
- int4(target, idx, Float.floatToRawIntBits(value));
- }
-
- /**
- * Encodes a int value to the byte array.
- *
- * @param target The byte array to encode to.
- * @param idx The starting index in the byte array.
- * @param value The value to encode.
- */
- public static void float8(byte[] target, int idx, double value) {
- int8(target, idx, Double.doubleToRawLongBits(value));
- }
-}
diff --git a/org/postgresql/util/GT.java b/org/postgresql/util/GT.java
deleted file mode 100644
index fbda0ae..0000000
--- a/org/postgresql/util/GT.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.util;
-
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
-import java.util.MissingResourceException;
-
-/**
- * This class provides a wrapper around a gettext message catalog that
- * can provide a localized version of error messages. The caller provides
- * a message String in the standard java.text.MessageFormat syntax and any
- * arguments it may need. The returned String is the localized version if
- * available or the original if not.
- */
-
-public class GT {
-
- private final static GT _gt = new GT();
- private final static Object noargs[] = new Object[0];
-
- public final static String tr(String message) {
- return _gt.translate(message, null);
- }
-
- public final static String tr(String message, Object arg) {
- return _gt.translate(message, new Object[]{arg});
- }
-
- public final static String tr(String message, Object args[]) {
- return _gt.translate(message, args);
- }
-
-
- private ResourceBundle _bundle;
-
- private GT() {
- try
- {
- _bundle = ResourceBundle.getBundle("org.postgresql.translation.messages");
- }
- catch (MissingResourceException mre)
- {
- // translation files have not been installed
- _bundle = null;
- }
- }
-
- private final String translate(String message, Object args[])
- {
- if (_bundle != null && message != null)
- {
- try
- {
- message = _bundle.getString(message);
- }
- catch (MissingResourceException mre)
- {
- // If we can't find a translation, just
- // use the untranslated message.
- }
- }
-
- // If we don't have any parameters we still need to run
- // this through the MessageFormat(ter) to allow the same
- // quoting and escaping rules to be used for all messages.
- //
- if (args == null) {
- args = noargs;
- }
-
- // Replace placeholders with arguments
- //
- if (message != null)
- {
- message = MessageFormat.format(message, args);
- }
-
- return message;
- }
-
-}
-
diff --git a/org/postgresql/util/HStoreConverter.java b/org/postgresql/util/HStoreConverter.java
deleted file mode 100644
index 099d871..0000000
--- a/org/postgresql/util/HStoreConverter.java
+++ /dev/null
@@ -1,140 +0,0 @@
-package org.postgresql.util;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.postgresql.core.Encoding;
-
-public class HStoreConverter {
- public static Map fromBytes(byte[] b, Encoding encoding) throws SQLException {
- Map m = new HashMap();
- int pos = 0;
- int numElements = ByteConverter.int4(b, pos); pos+=4;
- try {
- for (int i = 0; i < numElements; ++i) {
- int keyLen = ByteConverter.int4(b, pos); pos += 4;
- String key = encoding.decode(b, pos, keyLen); pos += keyLen;
- int valLen = ByteConverter.int4(b, pos); pos += 4;
- String val;
- if (valLen == -1) {
- val = null;
- } else {
- val = encoding.decode(b, pos, valLen); pos += valLen;
- }
- m.put(key, val);
- }
- }
- catch (IOException ioe)
- {
- throw new PSQLException(GT.tr("Invalid character data was found. This is most likely caused by stored data containing characters that are invalid for the character set the database was created in. The most common example of this is storing 8bit data in a SQL_ASCII database."), PSQLState.DATA_ERROR, ioe);
- }
- return m;
- }
-
- public static byte[] toBytes(Map m, Encoding encoding) throws SQLException {
- ByteArrayOutputStream baos = new ByteArrayOutputStream(4 + 10 * m.size());
- byte[] lenBuf = new byte[4];
- try {
- ByteConverter.int4(lenBuf, 0, m.size()); baos.write(lenBuf);
- for (Iterator i = m.entrySet().iterator(); i.hasNext(); ) {
- Entry e = (Entry) i.next();
- byte[] key = encoding.encode(e.getKey().toString());
- ByteConverter.int4(lenBuf, 0, key.length); baos.write(lenBuf);
- baos.write(key);
-
- if (e.getValue() == null) {
- ByteConverter.int4(lenBuf, 0, -1); baos.write(lenBuf);
- } else {
- byte[] val = encoding.encode(e.getValue().toString());
- ByteConverter.int4(lenBuf, 0, val.length); baos.write(lenBuf);
- baos.write(val);
- }
- }
- }
- catch (IOException ioe)
- {
- throw new PSQLException(GT.tr("Invalid character data was found. This is most likely caused by stored data containing characters that are invalid for the character set the database was created in. The most common example of this is storing 8bit data in a SQL_ASCII database."), PSQLState.DATA_ERROR, ioe);
- }
- return baos.toByteArray();
- }
-
- public static String toString(Map map) throws SQLException {
- if (map.isEmpty()) {
- return "";
- }
- StringBuffer sb = new StringBuffer(map.size() * 8);
- for (Iterator i = map.entrySet().iterator(); i.hasNext(); ) {
- Entry e = (Entry) i.next();
- appendEscaped(sb, e.getKey());
- sb.append("=>");
- appendEscaped(sb, e.getValue());
- sb.append(", ");
- }
- sb.setLength(sb.length() - 2);
- return sb.toString();
- }
-
- private static void appendEscaped(StringBuffer sb, Object val) throws SQLException {
- if (val != null) {
- sb.append('"');
- String s = val.toString();
- for (int pos = 0; pos < s.length(); pos++) {
- char ch = s.charAt(pos);
- if (ch == '"' || ch == '\\') {
- sb.append('\\');
- }
- sb.append(ch);
- }
- sb.append('"');
- } else {
- sb.append("NULL");
- }
- }
-
- public static Map fromString(String s) {
- Map m = new HashMap();
- int pos = 0;
- StringBuffer sb = new StringBuffer();
- while (pos < s.length()) {
- sb.setLength(0);
- int start = s.indexOf('"', pos);
- int end = appendUntilQuote(sb, s, start);
- String key = sb.toString();
- pos = end + 3;
-
- String val;
- if (s.charAt(pos) == 'N') {
- val = null;
- pos += 4;
- } else {
- sb.setLength(0);
- end = appendUntilQuote(sb, s, pos);
- val = sb.toString();
- pos = end;
- }
- pos++;
- m.put(key, val);
- }
- return m;
- }
-
- private static int appendUntilQuote(StringBuffer sb, String s, int pos) {
- for (pos += 1; pos < s.length(); pos++) {
- char ch = s.charAt(pos);
- if (ch == '"') {
- break;
- }
- if (ch == '\\') {
- pos++;
- ch = s.charAt(pos);
- }
- sb.append(ch);
- }
- return pos;
- }
-}
\ No newline at end of file
diff --git a/org/postgresql/util/HostSpec.java b/org/postgresql/util/HostSpec.java
deleted file mode 100644
index 42ce462..0000000
--- a/org/postgresql/util/HostSpec.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2012, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.util;
-
-/**
- * Simple container for host and port.
- */
-public class HostSpec {
- protected final String host;
- protected final int port;
-
- public HostSpec(String host, int port)
- {
- this.host = host;
- this.port = port;
- }
-
- public String getHost() {
- return host;
- }
-
- public int getPort() {
- return port;
- }
-
- public String toString() {
- return host + ":" + port;
- }
-}
diff --git a/org/postgresql/util/MD5Digest.java b/org/postgresql/util/MD5Digest.java
deleted file mode 100644
index 7af4566..0000000
--- a/org/postgresql/util/MD5Digest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.util;
-
-/**
- * MD5-based utility function to obfuscate passwords before network
- * transmission.
- *
- * @author Jeremy Wohl
- */
-
-import java.security.*;
-
-public class MD5Digest
-{
- private MD5Digest()
- {
- }
-
-
- /*
- * Encodes user/password/salt information in the following way:
- * MD5(MD5(password + user) + salt)
- *
- * @param user The connecting user.
- * @param password The connecting user's password.
- * @param salt A four-salt sent by the server.
- *
- * @return A 35-byte array, comprising the string "md5" and an MD5 digest.
- */
- public static byte[] encode(byte user[], byte password[], byte salt[])
- {
- MessageDigest md;
- byte[] temp_digest, pass_digest;
- byte[] hex_digest = new byte[35];
-
- try
- {
- md = MessageDigest.getInstance("MD5");
-
- md.update(password);
- md.update(user);
- temp_digest = md.digest();
-
- bytesToHex(temp_digest, hex_digest, 0);
- md.update(hex_digest, 0, 32);
- md.update(salt);
- pass_digest = md.digest();
-
- bytesToHex(pass_digest, hex_digest, 3);
- hex_digest[0] = (byte) 'm';
- hex_digest[1] = (byte) 'd';
- hex_digest[2] = (byte) '5';
- }
- catch (Exception e)
- {
- ; // "MessageDigest failure; " + e
- }
-
- return hex_digest;
- }
-
-
- /*
- * Turn 16-byte stream into a human-readable 32-byte hex string
- */
- private static void bytesToHex(byte[] bytes, byte[] hex, int offset)
- {
- final char lookup[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
- 'a', 'b', 'c', 'd', 'e', 'f' };
-
- int i, c, j, pos = offset;
-
- for (i = 0; i < 16; i++)
- {
- c = bytes[i] & 0xFF;
- j = c >> 4;
- hex[pos++] = (byte) lookup[j];
- j = (c & 0xF);
- hex[pos++] = (byte) lookup[j];
- }
- }
-}
diff --git a/org/postgresql/util/PGBinaryObject.java b/org/postgresql/util/PGBinaryObject.java
deleted file mode 100644
index 6a6b2d1..0000000
--- a/org/postgresql/util/PGBinaryObject.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/package org.postgresql.util;
-
-import java.sql.SQLException;
-
-/**
- * PGBinaryObject is a inteface that classes extending {@link PGobject} can use to
- * take advantage of more optimal binary encoding of the data type.
- */
-public interface PGBinaryObject {
- /**
- * This method is called to set the value of this object.
- *
- * @param value data containing the binary representation of the value of the object
- * @param offset the offset in the byte array where object data starts
- * @exception SQLException thrown if value is invalid for this type
- */
- public void setByteValue(byte[] value, int offset) throws SQLException;
-
- /**
- * This method is called to return the number of bytes needed to store
- * this object in the binary form required by org.postgresql.
- *
- * @return the number of bytes needed to store this object
- */
- public int lengthInBytes();
-
- /**
- * This method is called the to store the value of the object, in the
- * binary form required by org.postgresql.
- *
- * @param bytes the array to store the value, it is guaranteed to be at
- * lest {@link #lengthInBytes} in size.
- * @param offset the offset in the byte array where object must be stored
- */
- public void toBytes(byte[] bytes, int offset);
-}
diff --git a/org/postgresql/util/PGInterval.java b/org/postgresql/util/PGInterval.java
deleted file mode 100644
index c5f0458..0000000
--- a/org/postgresql/util/PGInterval.java
+++ /dev/null
@@ -1,438 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.util;
-
-import java.io.Serializable;
-import java.sql.SQLException;
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.StringTokenizer;
-
-/**
- * This implements a class that handles the PostgreSQL interval type
- */
-public class PGInterval extends PGobject implements Serializable, Cloneable
-{
-
- private int years;
- private int months;
- private int days;
- private int hours;
- private int minutes;
- private double seconds;
-
- private final static DecimalFormat secondsFormat;
- static {
- secondsFormat = new DecimalFormat("0.00####");
- DecimalFormatSymbols dfs = secondsFormat.getDecimalFormatSymbols();
- dfs.setDecimalSeparator('.');
- secondsFormat.setDecimalFormatSymbols(dfs);
- }
-
-
- /**
- * required by the driver
- */
- public PGInterval()
- {
- setType("interval");
- }
-
- /**
- * Initialize a interval with a given interval string representation
- *
- * @param value String representated interval (e.g. '3 years 2 mons')
- * @throws SQLException Is thrown if the string representation has an unknown format
- * @see #setValue(String)
- */
- public PGInterval(String value)
- throws SQLException
- {
- this();
- setValue(value);
- }
-
- /**
- * Initializes all values of this interval to the specified values
- *
- * @see #setValue(int, int, int, int, int, double)
- */
- public PGInterval(int years, int months, int days, int hours, int minutes, double seconds)
- {
- this();
- setValue(years, months, days, hours, minutes, seconds);
- }
-
- /**
- * Sets a interval string represented value to this instance.
- * This method only recognize the format, that Postgres returns -
- * not all input formats are supported (e.g. '1 yr 2 m 3 s')!
- *
- * @param value String representated interval (e.g. '3 years 2 mons')
- * @throws SQLException Is thrown if the string representation has an unknown format
- */
- public void setValue(String value)
- throws SQLException
- {
- final boolean ISOFormat = !value.startsWith("@");
-
- // Just a simple '0'
- if (!ISOFormat && value.length() == 3 && value.charAt(2) == '0')
- {
- setValue(0, 0, 0, 0, 0, 0.0);
- return;
- }
-
- int years = 0;
- int months = 0;
- int days = 0;
- int hours = 0;
- int minutes = 0;
- double seconds = 0;
-
- try
- {
- String valueToken = null;
-
- value = value.replace('+', ' ').replace('@', ' ');
- final StringTokenizer st = new StringTokenizer(value);
- for (int i = 1; st.hasMoreTokens(); i++)
- {
- String token = st.nextToken();
-
- if ((i & 1) == 1)
- {
- int endHours = token.indexOf(':');
- if (endHours == -1)
- {
- valueToken = token;
- continue;
- }
-
- // This handles hours, minutes, seconds and microseconds for
- // ISO intervals
- int offset = (token.charAt(0) == '-') ? 1 : 0;
-
- hours = nullSafeIntGet(token.substring(offset+0, endHours));
- minutes = nullSafeIntGet(token.substring(endHours+1, endHours+3));
-
- // Pre 7.4 servers do not put second information into the results
- // unless it is non-zero.
- int endMinutes = token.indexOf(':', endHours+1);
- if (endMinutes != -1)
- seconds = nullSafeDoubleGet(token.substring(endMinutes+1));
-
- if (offset == 1)
- {
- hours = -hours;
- minutes = -minutes;
- seconds = -seconds;
- }
-
- valueToken = null;
- }
- else
- {
- // This handles years, months, days for both, ISO and
- // Non-ISO intervals. Hours, minutes, seconds and microseconds
- // are handled for Non-ISO intervals here.
-
- if (token.startsWith("year"))
- years = nullSafeIntGet(valueToken);
- else if (token.startsWith("mon"))
- months = nullSafeIntGet(valueToken);
- else if (token.startsWith("day"))
- days = nullSafeIntGet(valueToken);
- else if (token.startsWith("hour"))
- hours = nullSafeIntGet(valueToken);
- else if (token.startsWith("min"))
- minutes = nullSafeIntGet(valueToken);
- else if (token.startsWith("sec"))
- seconds = nullSafeDoubleGet(valueToken);
- }
- }
- }
- catch (NumberFormatException e)
- {
- throw new PSQLException(GT.tr("Conversion of interval failed"), PSQLState.NUMERIC_CONSTANT_OUT_OF_RANGE, e);
- }
-
- if (!ISOFormat && value.endsWith("ago"))
- {
- // Inverse the leading sign
- setValue(-years, -months, -days, -hours, -minutes, -seconds);
- }
- else
- {
- setValue(years, months, days, hours, minutes, seconds);
- }
- }
-
- /**
- * Set all values of this interval to the specified values
- */
- public void setValue(int years, int months, int days, int hours, int minutes, double seconds)
- {
- setYears(years);
- setMonths(months);
- setDays(days);
- setHours(hours);
- setMinutes(minutes);
- setSeconds(seconds);
- }
-
- /**
- * Returns the stored interval information as a string
- *
- * @return String represented interval
- */
- public String getValue()
- {
- return years + " years " +
- months + " mons " +
- days + " days " +
- hours + " hours " +
- minutes + " mins " +
- secondsFormat.format(seconds) + " secs";
- }
-
- /**
- * Returns the years represented by this interval
- */
- public int getYears()
- {
- return years;
- }
-
- /**
- * Set the years of this interval to the specified value
- */
- public void setYears(int years)
- {
- this.years = years;
- }
-
- /**
- * Returns the months represented by this interval
- */
- public int getMonths()
- {
- return months;
- }
-
- /**
- * Set the months of this interval to the specified value
- */
- public void setMonths(int months)
- {
- this.months = months;
- }
-
- /**
- * Returns the days represented by this interval
- */
- public int getDays()
- {
- return days;
- }
-
- /**
- * Set the days of this interval to the specified value
- */
- public void setDays(int days)
- {
- this.days = days;
- }
-
- /**
- * Returns the hours represented by this interval
- */
- public int getHours()
- {
- return hours;
- }
-
- /**
- * Set the hours of this interval to the specified value
- */
- public void setHours(int hours)
- {
- this.hours = hours;
- }
-
- /**
- * Returns the minutes represented by this interval
- */
- public int getMinutes()
- {
- return minutes;
- }
-
- /**
- * Set the minutes of this interval to the specified value
- */
- public void setMinutes(int minutes)
- {
- this.minutes = minutes;
- }
-
- /**
- * Returns the seconds represented by this interval
- */
- public double getSeconds()
- {
- return seconds;
- }
-
- /**
- * Set the seconds of this interval to the specified value
- */
- public void setSeconds(double seconds)
- {
- this.seconds = seconds;
- }
-
- /**
- * Rolls this interval on a given calendar
- *
- * @param cal Calendar instance to add to
- */
- public void add(Calendar cal)
- {
- // Avoid precision loss
- // Be aware postgres doesn't return more than 60 seconds - no overflow can happen
- final int microseconds = (int)(getSeconds() * 1000000.0);
- final int milliseconds = (microseconds + ((microseconds < 0) ? -500 : 500)) / 1000;
-
- cal.add(Calendar.MILLISECOND, milliseconds);
- cal.add(Calendar.MINUTE, getMinutes());
- cal.add(Calendar.HOUR, getHours());
- cal.add(Calendar.DAY_OF_MONTH, getDays());
- cal.add(Calendar.MONTH, getMonths());
- cal.add(Calendar.YEAR, getYears());
- }
-
- /**
- * Rolls this interval on a given date
- *
- * @param date Date instance to add to
- */
- public void add(Date date)
- {
- final Calendar cal = Calendar.getInstance();
- cal.setTime(date);
- add(cal);
- date.setTime(cal.getTime().getTime());
- }
-
- /**
- * Add this interval's value to the passed interval.
- * This is backwards to what I would expect, but
- * this makes it match the other existing add methods.
- */
- public void add(PGInterval interval)
- {
- interval.setYears(interval.getYears() + getYears());
- interval.setMonths(interval.getMonths() + getMonths());
- interval.setDays(interval.getDays() + getDays());
- interval.setHours(interval.getHours() + getHours());
- interval.setMinutes(interval.getMinutes() + getMinutes());
- interval.setSeconds(interval.getSeconds() + getSeconds());
- }
-
- /**
- * Scale this interval by an integer factor. The server
- * can scale by arbitrary factors, but that would require
- * adjusting the call signatures for all the existing methods
- * like getDays() or providing our own justification of fractional
- * intervals. Neither of these seem like a good idea without a
- * strong use case.
- */
- public void scale(int factor)
- {
- setYears(factor * getYears());
- setMonths(factor * getMonths());
- setDays(factor * getDays());
- setHours(factor * getHours());
- setMinutes(factor * getMinutes());
- setSeconds(factor * getSeconds());
- }
-
- /**
- * Returns integer value of value or 0 if value is null
- *
- * @param value integer as string value
- * @return integer parsed from string value
- * @throws NumberFormatException if the string contains invalid chars
- */
- private int nullSafeIntGet(String value)
- throws NumberFormatException
- {
- return (value == null) ? 0 : Integer.parseInt(value);
- }
-
- /**
- * Returns double value of value or 0 if value is null
- *
- * @param value double as string value
- * @return double parsed from string value
- * @throws NumberFormatException if the string contains invalid chars
- */
- private double nullSafeDoubleGet(String value)
- throws NumberFormatException
- {
- return (value == null) ? 0 : Double.parseDouble(value);
- }
-
- /**
- * Returns whether an object is equal to this one or not
- *
- * @param obj Object to compare with
- * @return true if the two intervals are identical
- */
- public boolean equals(Object obj)
- {
- if (obj == null)
- return false;
-
- if (obj == this)
- return true;
-
- if (!(obj instanceof PGInterval))
- return false;
-
- final PGInterval pgi = (PGInterval)obj;
-
- return
- pgi.years == years &&
- pgi.months == months &&
- pgi.days == days &&
- pgi.hours == hours &&
- pgi.minutes == minutes &&
- Double.doubleToLongBits(pgi.seconds) == Double.doubleToLongBits(seconds);
- }
-
- /**
- * Returns a hashCode for this object
- *
- * @return hashCode
- */
- public int hashCode()
- {
- return ((((((7 * 31 +
- (int)Double.doubleToLongBits(seconds)) * 31 +
- minutes) * 31 +
- hours) * 31 +
- days) * 31 +
- months) * 31 +
- years) * 31;
- }
-
-}
diff --git a/org/postgresql/util/PGbytea.java b/org/postgresql/util/PGbytea.java
deleted file mode 100644
index 301324a..0000000
--- a/org/postgresql/util/PGbytea.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.util;
-
-import java.sql.*;
-
-/**
- * Converts to and from the postgresql bytea datatype used by the backend.
- */
-public class PGbytea
-{
- private static final int MAX_3_BUFF_SIZE = 2 * 1024 * 1024;
-
- /*
- * Converts a PG bytea raw value (i.e. the raw binary representation
- * of the bytea data type) into a java byte[]
- */
- public static byte[] toBytes(byte[] s) throws SQLException
- {
- if (s == null)
- return null;
-
- // Starting with PG 9.0, a new hex format is supported
- // that starts with "\x". Figure out which format we're
- // dealing with here.
- //
- if (s.length < 2 || s[0] != '\\' || s[1] != 'x') {
- return toBytesOctalEscaped(s);
- }
- return toBytesHexEscaped(s);
- }
-
- private static byte[] toBytesHexEscaped(byte[] s)
- {
- byte[] output = new byte[(s.length - 2) / 2];
- for (int i=0; i<output.length; i++) {
- byte b1 = gethex(s[2 + i*2]);
- byte b2 = gethex(s[2 + i*2 + 1]);
- output[i] = (byte)((b1 << 4) | b2);
- }
- return output;
- }
-
- private static byte gethex(byte b) {
- // 0-9 == 48-57
- if (b <= 57)
- return (byte)(b - 48);
-
- // a-f == 97-102
- if (b >= 97)
- return (byte)(b - 97 + 10);
-
- // A-F == 65-70
- return (byte)(b - 65 + 10);
- }
-
- private static byte[] toBytesOctalEscaped(byte[] s)
- {
- final int slength = s.length;
- byte[] buf = null;
- int correctSize = slength;
- if (slength > MAX_3_BUFF_SIZE)
- {
- // count backslash escapes, they will be either
- // backslashes or an octal escape \\ or \003
- //
- for (int i = 0; i < slength; ++i)
- {
- byte current = s[i];
- if (current == '\\')
- {
- byte next = s[ ++i ];
- if (next == '\\')
- {
- --correctSize;
- }
- else
- {
- correctSize -= 3;
- }
- }
- }
- buf = new byte[correctSize];
- }
- else
- {
- buf = new byte[slength];
- }
- int bufpos = 0;
- int thebyte;
- byte nextbyte;
- byte secondbyte;
- for (int i = 0; i < slength; i++)
- {
- nextbyte = s[i];
- if (nextbyte == (byte)'\\')
- {
- secondbyte = s[++i];
- if (secondbyte == (byte)'\\')
- {
- //escaped \
- buf[bufpos++] = (byte)'\\';
- }
- else
- {
- thebyte = (secondbyte - 48) * 64 + (s[++i] - 48) * 8 + (s[++i] - 48);
- if (thebyte > 127)
- thebyte -= 256;
- buf[bufpos++] = (byte)thebyte;
- }
- }
- else
- {
- buf[bufpos++] = nextbyte;
- }
- }
- if (bufpos == correctSize)
- {
- return buf;
- }
- byte[] l_return = new byte[bufpos];
- System.arraycopy(buf, 0, l_return, 0, bufpos);
- return l_return;
- }
-
- /*
- * Converts a java byte[] into a PG bytea string (i.e. the text
- * representation of the bytea data type)
- */
- public static String toPGString(byte[] p_buf) throws SQLException
- {
- if (p_buf == null)
- return null;
- StringBuffer l_strbuf = new StringBuffer(2 * p_buf.length);
- for (int i = 0; i < p_buf.length; i++)
- {
- int l_int = (int)p_buf[i];
- if (l_int < 0)
- {
- l_int = 256 + l_int;
- }
- //we escape the same non-printable characters as the backend
- //we must escape all 8bit characters otherwise when convering
- //from java unicode to the db character set we may end up with
- //question marks if the character set is SQL_ASCII
- if (l_int < 040 || l_int > 0176)
- {
- //escape charcter with the form \000, but need two \\ because of
- //the Java parser
- l_strbuf.append("\\");
- l_strbuf.append((char)(((l_int >> 6) & 0x3) + 48));
- l_strbuf.append((char)(((l_int >> 3) & 0x7) + 48));
- l_strbuf.append((char)((l_int & 0x07) + 48));
- }
- else if (p_buf[i] == (byte)'\\')
- {
- //escape the backslash character as \\, but need four \\\\ because
- //of the Java parser
- l_strbuf.append("\\\\");
- }
- else
- {
- //other characters are left alone
- l_strbuf.append((char)p_buf[i]);
- }
- }
- return l_strbuf.toString();
- }
-}
diff --git a/org/postgresql/util/PGmoney.java b/org/postgresql/util/PGmoney.java
deleted file mode 100644
index 4ef7ed5..0000000
--- a/org/postgresql/util/PGmoney.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.util;
-
-
-import java.io.Serializable;
-import java.sql.SQLException;
-
-/**
- * This implements a class that handles the PostgreSQL money and cash types
- */
-public class PGmoney extends PGobject implements Serializable, Cloneable
-{
- /*
- * The value of the field
- */
- public double val;
-
- /*
- * @param value of field
- */
- public PGmoney(double value)
- {
- this();
- val = value;
- }
-
- public PGmoney(String value) throws SQLException
- {
- this();
- setValue(value);
- }
-
- /*
- * Required by the driver
- */
- public PGmoney()
- {
- setType("money");
- }
-
- public void setValue(String s) throws SQLException
- {
- try
- {
- String s1;
- boolean negative;
-
- negative = (s.charAt(0) == '(') ;
-
- // Remove any () (for negative) & currency symbol
- s1 = PGtokenizer.removePara(s).substring(1);
-
- // Strip out any , in currency
- int pos = s1.indexOf(',');
- while (pos != -1)
- {
- s1 = s1.substring(0, pos) + s1.substring(pos + 1);
- pos = s1.indexOf(',');
- }
-
- val = Double.valueOf(s1).doubleValue();
- val = negative ? -val : val;
-
- }
- catch (NumberFormatException e)
- {
- throw new PSQLException(GT.tr("Conversion of money failed."), PSQLState.NUMERIC_CONSTANT_OUT_OF_RANGE, e);
- }
- }
-
- public boolean equals(Object obj)
- {
- if (obj instanceof PGmoney)
- {
- PGmoney p = (PGmoney)obj;
- return val == p.val;
- }
- return false;
- }
-
- public String getValue()
- {
- if (val < 0)
- {
- return "-$" + ( -val);
- }
- else
- {
- return "$" + val;
- }
- }
-}
diff --git a/org/postgresql/util/PGobject.java b/org/postgresql/util/PGobject.java
deleted file mode 100644
index a62c138..0000000
--- a/org/postgresql/util/PGobject.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.util;
-
-import java.io.Serializable;
-import java.sql.SQLException;
-
-/**
- * PGobject is a class used to describe unknown types
- * An unknown type is any type that is unknown by JDBC Standards
- */
-public class PGobject implements Serializable, Cloneable
-{
- protected String type;
- protected String value;
-
- /**
- * This is called by org.postgresql.Connection.getObject() to create the
- * object.
- */
- public PGobject()
- {
- }
-
- /**
- * This method sets the type of this object.
- *
- * <p>It should not be extended by subclasses, hence its final
- *
- * @param type a string describing the type of the object
- */
- public final void setType(String type)
- {
- this.type = type;
- }
-
- /**
- * This method sets the value of this object. It must be overidden.
- *
- * @param value a string representation of the value of the object
- * @exception SQLException thrown if value is invalid for this type
- */
- public void setValue(String value) throws SQLException
- {
- this.value = value;
- }
-
- /**
- * As this cannot change during the life of the object, it's final.
- * @return the type name of this object
- */
- public final String getType()
- {
- return type;
- }
-
- /**
- * This must be overidden, to return the value of the object, in the
- * form required by org.postgresql.
- * @return the value of this object
- */
- public String getValue()
- {
- return value;
- }
-
- /**
- * This must be overidden to allow comparisons of objects
- * @param obj Object to compare with
- * @return true if the two boxes are identical
- */
- public boolean equals(Object obj)
- {
- if (obj instanceof PGobject)
- {
- final Object otherValue = ((PGobject)obj).getValue();
-
- if (otherValue == null){
- return getValue() == null;
- }
- return otherValue.equals(getValue());
- }
- return false;
- }
-
- /**
- * This must be overidden to allow the object to be cloned
- */
- public Object clone() throws CloneNotSupportedException
- {
- return super.clone();
- }
-
- /**
- * This is defined here, so user code need not overide it.
- * @return the value of this object, in the syntax expected by org.postgresql
- */
- public String toString()
- {
- return getValue();
- }
-}
diff --git a/org/postgresql/util/PGtokenizer.java b/org/postgresql/util/PGtokenizer.java
deleted file mode 100644
index 284c37a..0000000
--- a/org/postgresql/util/PGtokenizer.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * This class is used to tokenize the text output of org.postgres.
- * It's mainly used by the geometric classes, but is useful in parsing any
- * output from custom data types output from org.postgresql.
- *
- * @see org.postgresql.geometric.PGbox
- * @see org.postgresql.geometric.PGcircle
- * @see org.postgresql.geometric.PGlseg
- * @see org.postgresql.geometric.PGpath
- * @see org.postgresql.geometric.PGpoint
- * @see org.postgresql.geometric.PGpolygon
- */
-public class PGtokenizer
-{
- // Our tokens
- protected List tokens;
-
- /*
- * Create a tokeniser.
- *
- * <p>We could have used StringTokenizer to do this, however, we needed to
- * handle nesting of '(' ')' '[' ']' '<' and '>' as these are used
- * by the geometric data types.
- *
- * @param string containing tokens
- * @param delim single character to split the tokens
- */
- public PGtokenizer(String string, char delim)
- {
- tokenize(string, delim);
- }
-
- /*
- * This resets this tokenizer with a new string and/or delimiter.
- *
- * @param string containing tokens
- * @param delim single character to split the tokens
- */
- public int tokenize(String string, char delim)
- {
- tokens = new ArrayList();
-
- // nest holds how many levels we are in the current token.
- // if this is > 0 then we don't split a token when delim is matched.
- //
- // The Geometric datatypes use this, because often a type may have others
- // (usualls PGpoint) imbedded within a token.
- //
- // Peter 1998 Jan 6 - Added < and > to the nesting rules
- int nest = 0, p, s;
-
- for (p = 0, s = 0;p < string.length();p++)
- {
- char c = string.charAt(p);
-
- // increase nesting if an open character is found
- if (c == '(' || c == '[' || c == '<')
- nest++;
-
- // decrease nesting if a close character is found
- if (c == ')' || c == ']' || c == '>')
- nest--;
-
- if (nest == 0 && c == delim)
- {
- tokens.add(string.substring(s, p));
- s = p + 1; // +1 to skip the delimiter
- }
-
- }
-
- // Don't forget the last token ;-)
-
-
-
- if (s < string.length())
- tokens.add(string.substring(s));
-
- return tokens.size();
- }
-
- /*
- * @return the number of tokens available
- */
- public int getSize()
- {
- return tokens.size();
- }
-
- /*
- * @param n Token number ( 0 ... getSize()-1 )
- * @return The token value
- */
- public String getToken(int n)
- {
- return (String)tokens.get(n);
- }
-
- /*
- * This returns a new tokenizer based on one of our tokens.
- *
- * The geometric datatypes use this to process nested tokens (usually
- * PGpoint).
- *
- * @param n Token number ( 0 ... getSize()-1 )
- * @param delim The delimiter to use
- * @return A new instance of PGtokenizer based on the token
- */
- public PGtokenizer tokenizeToken(int n, char delim)
- {
- return new PGtokenizer(getToken(n), delim);
- }
-
- /*
- * This removes the lead/trailing strings from a string
- * @param s Source string
- * @param l Leading string to remove
- * @param t Trailing string to remove
- * @return String without the lead/trailing strings
- */
- public static String remove
- (String s, String l, String t)
- {
- if (s.startsWith(l))
- s = s.substring(l.length());
- if (s.endsWith(t))
- s = s.substring(0, s.length() - t.length());
- return s;
- }
-
- /*
- * This removes the lead/trailing strings from all tokens
- * @param l Leading string to remove
- * @param t Trailing string to remove
- */
- public void remove
- (String l, String t)
- {
- for (int i = 0;i < tokens.size();i++)
- {
- tokens.set(i, remove
- ((String)tokens.get(i), l, t));
- }
- }
-
- /*
- * Removes ( and ) from the beginning and end of a string
- * @param s String to remove from
- * @return String without the ( or )
- */
- public static String removePara(String s)
- {
- return remove
- (s, "(", ")");
- }
-
- /*
- * Removes ( and ) from the beginning and end of all tokens
- * @return String without the ( or )
- */
- public void removePara()
- {
- remove
- ("(", ")");
- }
-
- /*
- * Removes [ and ] from the beginning and end of a string
- * @param s String to remove from
- * @return String without the [ or ]
- */
- public static String removeBox(String s)
- {
- return remove
- (s, "[", "]");
- }
-
- /*
- * Removes [ and ] from the beginning and end of all tokens
- * @return String without the [ or ]
- */
- public void removeBox()
- {
- remove
- ("[", "]");
- }
-
- /*
- * Removes < and > from the beginning and end of a string
- * @param s String to remove from
- * @return String without the < or >
- */
- public static String removeAngle(String s)
- {
- return remove
- (s, "<", ">");
- }
-
- /*
- * Removes < and > from the beginning and end of all tokens
- * @return String without the < or >
- */
- public void removeAngle()
- {
- remove
- ("<", ">");
- }
-}
diff --git a/org/postgresql/util/PSQLDriverVersion.java b/org/postgresql/util/PSQLDriverVersion.java
deleted file mode 100644
index ee71e88..0000000
--- a/org/postgresql/util/PSQLDriverVersion.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2012, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.util;
-
-import org.postgresql.Driver;
-
-/**
- * This class holds the current build number and a utility program to print
- * it and the file it came from. The primary purpose of this is to keep
- * from filling the cvs history of Driver.java.in with commits simply
- * changing the build number. The utility program can also be helpful for
- * people to determine what version they really have and resolve problems
- * with old and unknown versions located somewhere in the classpath.
- */
-public class PSQLDriverVersion {
-
- public final static int buildNumber = 1004;
-
- public static void main(String args[]) {
- java.net.URL url = Driver.class.getResource("/org/postgresql/Driver.class");
- System.out.println(Driver.getVersion());
- System.out.println("Found in: " + url);
- }
-
-}
diff --git a/org/postgresql/util/PSQLException.java b/org/postgresql/util/PSQLException.java
deleted file mode 100644
index b89caff..0000000
--- a/org/postgresql/util/PSQLException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.util;
-
-import java.sql.SQLException;
-
-public class PSQLException extends SQLException
-{
-
- private ServerErrorMessage _serverError;
-
- public PSQLException(String msg, PSQLState state, Throwable cause)
- {
- super(msg, state == null ? null : state.getState());
- initCause(cause);
- }
-
- public PSQLException(String msg, PSQLState state)
- {
- this(msg, state, null);
- }
-
- public PSQLException(ServerErrorMessage serverError)
- {
- this(serverError.toString(), new PSQLState(serverError.getSQLState()));
- _serverError = serverError;
- }
-
- public ServerErrorMessage getServerErrorMessage()
- {
- return _serverError;
- }
-
-}
diff --git a/org/postgresql/util/PSQLState.java b/org/postgresql/util/PSQLState.java
deleted file mode 100644
index 9713fff..0000000
--- a/org/postgresql/util/PSQLState.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-
-package org.postgresql.util;
-
-/**
- * This class is used for holding SQLState codes.
- */
-public class PSQLState implements java.io.Serializable
-{
- private String state;
-
- public String getState()
- {
- return this.state;
- }
-
- public PSQLState(String state)
- {
- this.state = state;
- }
-
-
- // begin constant state codes
- public final static PSQLState UNKNOWN_STATE = new PSQLState("");
-
- public final static PSQLState TOO_MANY_RESULTS = new PSQLState("0100E");
-
- public final static PSQLState NO_DATA = new PSQLState("02000");
-
- public final static PSQLState INVALID_PARAMETER_TYPE = new PSQLState("07006");
-
- /**
- * We could establish a connection with the server for unknown reasons.
- * Could be a network problem.
- */
- public final static PSQLState CONNECTION_UNABLE_TO_CONNECT = new PSQLState("08001");
-
- public final static PSQLState CONNECTION_DOES_NOT_EXIST = new PSQLState("08003");
-
- /**
- * The server rejected our connection attempt. Usually an authentication
- * failure, but could be a configuration error like asking for a SSL
- * connection with a server that wasn't built with SSL support.
- */
- public final static PSQLState CONNECTION_REJECTED = new PSQLState("08004");
-
- /**
- * After a connection has been established, it went bad.
- */
- public final static PSQLState CONNECTION_FAILURE = new PSQLState("08006");
- public final static PSQLState CONNECTION_FAILURE_DURING_TRANSACTION = new PSQLState("08007");
-
- /**
- * The server sent us a response the driver was not prepared for and
- * is either bizarre datastream corruption, a driver bug, or
- * a protocol violation on the server's part.
- */
- public final static PSQLState PROTOCOL_VIOLATION = new PSQLState("08P01");
-
- public final static PSQLState COMMUNICATION_ERROR = new PSQLState("08S01");
-
- public final static PSQLState NOT_IMPLEMENTED = new PSQLState("0A000");
-
- public final static PSQLState DATA_ERROR = new PSQLState("22000");
- public final static PSQLState NUMERIC_VALUE_OUT_OF_RANGE = new PSQLState("22003");
- public final static PSQLState BAD_DATETIME_FORMAT = new PSQLState("22007");
- public final static PSQLState DATETIME_OVERFLOW = new PSQLState("22008");
- public final static PSQLState MOST_SPECIFIC_TYPE_DOES_NOT_MATCH = new PSQLState("2200G");
- public final static PSQLState INVALID_PARAMETER_VALUE = new PSQLState("22023");
-
- public final static PSQLState INVALID_CURSOR_STATE = new PSQLState("24000");
-
- public final static PSQLState TRANSACTION_STATE_INVALID = new PSQLState("25000");
- public final static PSQLState ACTIVE_SQL_TRANSACTION = new PSQLState("25001");
- public final static PSQLState NO_ACTIVE_SQL_TRANSACTION = new PSQLState("25P01");
-
- public final static PSQLState STATEMENT_NOT_ALLOWED_IN_FUNCTION_CALL = new PSQLState("2F003");
-
- public final static PSQLState INVALID_SAVEPOINT_SPECIFICATION = new PSQLState("3B000");
-
- public final static PSQLState SYNTAX_ERROR = new PSQLState("42601");
- public final static PSQLState UNDEFINED_COLUMN = new PSQLState("42703");
- public final static PSQLState WRONG_OBJECT_TYPE = new PSQLState("42809");
- public final static PSQLState NUMERIC_CONSTANT_OUT_OF_RANGE = new PSQLState("42820");
- public final static PSQLState DATA_TYPE_MISMATCH = new PSQLState("42821");
- public final static PSQLState UNDEFINED_FUNCTION = new PSQLState("42883");
- public final static PSQLState INVALID_NAME = new PSQLState("42602");
-
- public final static PSQLState OUT_OF_MEMORY = new PSQLState("53200");
- public final static PSQLState OBJECT_NOT_IN_STATE = new PSQLState("55000");
-
- public final static PSQLState SYSTEM_ERROR = new PSQLState("60000");
-
- public final static PSQLState UNEXPECTED_ERROR = new PSQLState("99999");
-
-}
diff --git a/org/postgresql/util/PSQLWarning.java b/org/postgresql/util/PSQLWarning.java
deleted file mode 100644
index 3813ba0..0000000
--- a/org/postgresql/util/PSQLWarning.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.util;
-
-import java.sql.SQLWarning;
-
-public class PSQLWarning extends SQLWarning
-{
-
- private ServerErrorMessage serverError;
-
- public PSQLWarning(ServerErrorMessage err)
- {
- this.serverError = err;
- }
-
- public String toString()
- {
- return serverError.toString();
- }
-
- public String getSQLState()
- {
- return serverError.getSQLState();
- }
-
- public String getMessage()
- {
- return serverError.getMessage();
- }
-
- public ServerErrorMessage getServerErrorMessage()
- {
- return serverError;
- }
-}
diff --git a/org/postgresql/util/ServerErrorMessage.java b/org/postgresql/util/ServerErrorMessage.java
deleted file mode 100644
index ded3127..0000000
--- a/org/postgresql/util/ServerErrorMessage.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.util;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.io.Serializable;
-
-public class ServerErrorMessage implements Serializable
-{
-
- private static final Character SEVERITY = new Character('S');
- private static final Character MESSAGE = new Character('M');
- private static final Character DETAIL = new Character('D');
- private static final Character HINT = new Character('H');
- private static final Character POSITION = new Character('P');
- private static final Character WHERE = new Character('W');
- private static final Character FILE = new Character('F');
- private static final Character LINE = new Character('L');
- private static final Character ROUTINE = new Character('R');
- private static final Character SQLSTATE = new Character('C');
- private static final Character INTERNAL_POSITION = new Character('p');
- private static final Character INTERNAL_QUERY = new Character('q');
-
- private final Map m_mesgParts = new HashMap();
- private final int verbosity;
-
- public ServerErrorMessage(String p_serverError, int verbosity)
- {
- this.verbosity = verbosity;
-
- char[] l_chars = p_serverError.toCharArray();
- int l_pos = 0;
- int l_length = l_chars.length;
- while (l_pos < l_length)
- {
- char l_mesgType = l_chars[l_pos];
- if (l_mesgType != '\0')
- {
- l_pos++;
- int l_startString = l_pos;
- // order here is important position must be checked before accessing the array
- while ( l_pos < l_length && l_chars[l_pos] != '\0' )
- {
- l_pos++;
- }
- String l_mesgPart = new String(l_chars, l_startString, l_pos - l_startString);
- m_mesgParts.put(new Character(l_mesgType), l_mesgPart);
- }
- l_pos++;
- }
- }
-
- public String getSQLState()
- {
- return (String)m_mesgParts.get(SQLSTATE);
- }
-
- public String getMessage()
- {
- return (String)m_mesgParts.get(MESSAGE);
- }
-
- public String getSeverity()
- {
- return (String)m_mesgParts.get(SEVERITY);
- }
-
- public String getDetail()
- {
- return (String)m_mesgParts.get(DETAIL);
- }
-
- public String getHint()
- {
- return (String)m_mesgParts.get(HINT);
- }
-
- public int getPosition()
- {
- return getIntegerPart(POSITION);
- }
-
- public String getWhere()
- {
- return (String)m_mesgParts.get(WHERE);
- }
-
- public String getFile()
- {
- return (String)m_mesgParts.get(FILE);
- }
-
- public int getLine()
- {
- return getIntegerPart(LINE);
- }
-
- public String getRoutine()
- {
- return (String)m_mesgParts.get(ROUTINE);
- }
-
- public String getInternalQuery()
- {
- return (String)m_mesgParts.get(INTERNAL_QUERY);
- }
-
- public int getInternalPosition()
- {
- return getIntegerPart(INTERNAL_POSITION);
- }
-
- private int getIntegerPart(Character c)
- {
- String s = (String)m_mesgParts.get(c);
- if (s == null)
- return 0;
- return Integer.parseInt(s);
- }
-
- public String toString()
- {
- //Now construct the message from what the server sent
- //The general format is:
- //SEVERITY: Message \n
- // Detail: \n
- // Hint: \n
- // Position: \n
- // Where: \n
- // Internal Query: \n
- // Internal Position: \n
- // Location: File:Line:Routine \n
- // SQLState: \n
- //
- //Normally only the message and detail is included.
- //If INFO level logging is enabled then detail, hint, position and where are
- //included. If DEBUG level logging is enabled then all information
- //is included.
-
- StringBuffer l_totalMessage = new StringBuffer();
- String l_message = (String)m_mesgParts.get(SEVERITY);
- if (l_message != null)
- l_totalMessage.append(l_message).append(": ");
- l_message = (String)m_mesgParts.get(MESSAGE);
- if (l_message != null)
- l_totalMessage.append(l_message);
- l_message = (String)m_mesgParts.get(DETAIL);
- if (l_message != null)
- l_totalMessage.append("\n ").append(GT.tr("Detail: {0}", l_message));
-
- l_message = (String)m_mesgParts.get(HINT);
- if (l_message != null)
- l_totalMessage.append("\n ").append(GT.tr("Hint: {0}", l_message));
- l_message = (String)m_mesgParts.get(POSITION);
- if (l_message != null)
- l_totalMessage.append("\n ").append(GT.tr("Position: {0}", l_message));
- l_message = (String)m_mesgParts.get(WHERE);
- if (l_message != null)
- l_totalMessage.append("\n ").append(GT.tr("Where: {0}", l_message));
-
- if (verbosity > 2)
- {
- String l_internalQuery = (String)m_mesgParts.get(INTERNAL_QUERY);
- if (l_internalQuery != null)
- l_totalMessage.append("\n ").append(GT.tr("Internal Query: {0}", l_internalQuery));
- String l_internalPosition = (String)m_mesgParts.get(INTERNAL_POSITION);
- if (l_internalPosition != null)
- l_totalMessage.append("\n ").append(GT.tr("Internal Position: {0}", l_internalPosition));
-
- String l_file = (String)m_mesgParts.get(FILE);
- String l_line = (String)m_mesgParts.get(LINE);
- String l_routine = (String)m_mesgParts.get(ROUTINE);
- if (l_file != null || l_line != null || l_routine != null)
- l_totalMessage.append("\n ").append(GT.tr("Location: File: {0}, Routine: {1}, Line: {2}", new Object[] {l_file, l_routine, l_line}));
- l_message = (String)m_mesgParts.get(SQLSTATE);
- if (l_message != null)
- l_totalMessage.append("\n ").append(GT.tr("Server SQLState: {0}", l_message));
- }
-
- return l_totalMessage.toString();
- }
-}
diff --git a/org/postgresql/util/StreamWrapper.java b/org/postgresql/util/StreamWrapper.java
deleted file mode 100644
index 2f80da3..0000000
--- a/org/postgresql/util/StreamWrapper.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2004-2011, PostgreSQL Global Development Group
-* Copyright (c) 2004, Open Cloud Limited.
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.util;
-
-import java.io.InputStream;
-
-/**
- * Wrapper around a length-limited InputStream.
- *
- * @author Oliver Jowett (oliver at opencloud.com)
- */
-public class StreamWrapper {
- public StreamWrapper(byte[] data, int offset, int length) {
- this.stream = null;
- this.rawData = data;
- this.offset = offset;
- this.length = length;
- }
-
- public StreamWrapper(InputStream stream, int length) {
- this.stream = stream;
- this.rawData = null;
- this.offset = 0;
- this.length = length;
- }
-
- public InputStream getStream() {
- if (stream != null)
- return stream;
-
- return new java.io.ByteArrayInputStream(rawData, offset, length);
- }
-
- public int getLength() {
- return length;
- }
-
- public int getOffset() {
- return offset;
- }
-
- public byte[] getBytes() {
- return rawData;
- }
-
- public String toString() {
- return "<stream of " + length + " bytes>";
- }
-
- private final InputStream stream;
- private final byte[] rawData;
- private final int offset;
- private final int length;
-}
diff --git a/org/postgresql/util/UnixCrypt.java b/org/postgresql/util/UnixCrypt.java
deleted file mode 100644
index d22186e..0000000
--- a/org/postgresql/util/UnixCrypt.java
+++ /dev/null
@@ -1,650 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2003-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.util;
-
-/**
- * Contains static methods to encrypt and compare
- * passwords with Unix encrypted passwords.
- * <P>See <A HREF="http://www.zeh.com/local/jfd/crypt.html">
- * John Dumas's Java Crypt page</A> for the original source.</P>
- *
- * @author jdumas at zgs.com (John Dumas)
- */
-public class UnixCrypt extends Object
-{
- //
- // Null constructor - can't instantiate class
- private UnixCrypt()
- {
- }
-
- private static final char[] saltChars =
- ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./".toCharArray());
-
- private static final int ITERATIONS = 16;
-
- private static final int con_salt[] =
- {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
- 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
- 0x0A, 0x0B, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
- 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12,
- 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A,
- 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22,
- 0x23, 0x24, 0x25, 0x20, 0x21, 0x22, 0x23, 0x24,
- 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C,
- 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34,
- 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C,
- 0x3D, 0x3E, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00,
- };
-
- private static final boolean shifts2[] =
- {
- false, false, true, true, true, true, true, true,
- false, true, true, true, true, true, true, false
- };
-
- private static final int skb[][] =
- {
- {
- /* for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 */
- 0x00000000, 0x00000010, 0x20000000, 0x20000010,
- 0x00010000, 0x00010010, 0x20010000, 0x20010010,
- 0x00000800, 0x00000810, 0x20000800, 0x20000810,
- 0x00010800, 0x00010810, 0x20010800, 0x20010810,
- 0x00000020, 0x00000030, 0x20000020, 0x20000030,
- 0x00010020, 0x00010030, 0x20010020, 0x20010030,
- 0x00000820, 0x00000830, 0x20000820, 0x20000830,
- 0x00010820, 0x00010830, 0x20010820, 0x20010830,
- 0x00080000, 0x00080010, 0x20080000, 0x20080010,
- 0x00090000, 0x00090010, 0x20090000, 0x20090010,
- 0x00080800, 0x00080810, 0x20080800, 0x20080810,
- 0x00090800, 0x00090810, 0x20090800, 0x20090810,
- 0x00080020, 0x00080030, 0x20080020, 0x20080030,
- 0x00090020, 0x00090030, 0x20090020, 0x20090030,
- 0x00080820, 0x00080830, 0x20080820, 0x20080830,
- 0x00090820, 0x00090830, 0x20090820, 0x20090830,
- },
- {
- /* for C bits (numbered as per FIPS 46) 7 8 10 11 12 13 */
- 0x00000000, 0x02000000, 0x00002000, 0x02002000,
- 0x00200000, 0x02200000, 0x00202000, 0x02202000,
- 0x00000004, 0x02000004, 0x00002004, 0x02002004,
- 0x00200004, 0x02200004, 0x00202004, 0x02202004,
- 0x00000400, 0x02000400, 0x00002400, 0x02002400,
- 0x00200400, 0x02200400, 0x00202400, 0x02202400,
- 0x00000404, 0x02000404, 0x00002404, 0x02002404,
- 0x00200404, 0x02200404, 0x00202404, 0x02202404,
- 0x10000000, 0x12000000, 0x10002000, 0x12002000,
- 0x10200000, 0x12200000, 0x10202000, 0x12202000,
- 0x10000004, 0x12000004, 0x10002004, 0x12002004,
- 0x10200004, 0x12200004, 0x10202004, 0x12202004,
- 0x10000400, 0x12000400, 0x10002400, 0x12002400,
- 0x10200400, 0x12200400, 0x10202400, 0x12202400,
- 0x10000404, 0x12000404, 0x10002404, 0x12002404,
- 0x10200404, 0x12200404, 0x10202404, 0x12202404,
- },
- {
- /* for C bits (numbered as per FIPS 46) 14 15 16 17 19 20 */
- 0x00000000, 0x00000001, 0x00040000, 0x00040001,
- 0x01000000, 0x01000001, 0x01040000, 0x01040001,
- 0x00000002, 0x00000003, 0x00040002, 0x00040003,
- 0x01000002, 0x01000003, 0x01040002, 0x01040003,
- 0x00000200, 0x00000201, 0x00040200, 0x00040201,
- 0x01000200, 0x01000201, 0x01040200, 0x01040201,
- 0x00000202, 0x00000203, 0x00040202, 0x00040203,
- 0x01000202, 0x01000203, 0x01040202, 0x01040203,
- 0x08000000, 0x08000001, 0x08040000, 0x08040001,
- 0x09000000, 0x09000001, 0x09040000, 0x09040001,
- 0x08000002, 0x08000003, 0x08040002, 0x08040003,
- 0x09000002, 0x09000003, 0x09040002, 0x09040003,
- 0x08000200, 0x08000201, 0x08040200, 0x08040201,
- 0x09000200, 0x09000201, 0x09040200, 0x09040201,
- 0x08000202, 0x08000203, 0x08040202, 0x08040203,
- 0x09000202, 0x09000203, 0x09040202, 0x09040203,
- },
- {
- /* for C bits (numbered as per FIPS 46) 21 23 24 26 27 28 */
- 0x00000000, 0x00100000, 0x00000100, 0x00100100,
- 0x00000008, 0x00100008, 0x00000108, 0x00100108,
- 0x00001000, 0x00101000, 0x00001100, 0x00101100,
- 0x00001008, 0x00101008, 0x00001108, 0x00101108,
- 0x04000000, 0x04100000, 0x04000100, 0x04100100,
- 0x04000008, 0x04100008, 0x04000108, 0x04100108,
- 0x04001000, 0x04101000, 0x04001100, 0x04101100,
- 0x04001008, 0x04101008, 0x04001108, 0x04101108,
- 0x00020000, 0x00120000, 0x00020100, 0x00120100,
- 0x00020008, 0x00120008, 0x00020108, 0x00120108,
- 0x00021000, 0x00121000, 0x00021100, 0x00121100,
- 0x00021008, 0x00121008, 0x00021108, 0x00121108,
- 0x04020000, 0x04120000, 0x04020100, 0x04120100,
- 0x04020008, 0x04120008, 0x04020108, 0x04120108,
- 0x04021000, 0x04121000, 0x04021100, 0x04121100,
- 0x04021008, 0x04121008, 0x04021108, 0x04121108,
- },
- {
- /* for D bits (numbered as per FIPS 46) 1 2 3 4 5 6 */
- 0x00000000, 0x10000000, 0x00010000, 0x10010000,
- 0x00000004, 0x10000004, 0x00010004, 0x10010004,
- 0x20000000, 0x30000000, 0x20010000, 0x30010000,
- 0x20000004, 0x30000004, 0x20010004, 0x30010004,
- 0x00100000, 0x10100000, 0x00110000, 0x10110000,
- 0x00100004, 0x10100004, 0x00110004, 0x10110004,
- 0x20100000, 0x30100000, 0x20110000, 0x30110000,
- 0x20100004, 0x30100004, 0x20110004, 0x30110004,
- 0x00001000, 0x10001000, 0x00011000, 0x10011000,
- 0x00001004, 0x10001004, 0x00011004, 0x10011004,
- 0x20001000, 0x30001000, 0x20011000, 0x30011000,
- 0x20001004, 0x30001004, 0x20011004, 0x30011004,
- 0x00101000, 0x10101000, 0x00111000, 0x10111000,
- 0x00101004, 0x10101004, 0x00111004, 0x10111004,
- 0x20101000, 0x30101000, 0x20111000, 0x30111000,
- 0x20101004, 0x30101004, 0x20111004, 0x30111004,
- },
- {
- /* for D bits (numbered as per FIPS 46) 8 9 11 12 13 14 */
- 0x00000000, 0x08000000, 0x00000008, 0x08000008,
- 0x00000400, 0x08000400, 0x00000408, 0x08000408,
- 0x00020000, 0x08020000, 0x00020008, 0x08020008,
- 0x00020400, 0x08020400, 0x00020408, 0x08020408,
- 0x00000001, 0x08000001, 0x00000009, 0x08000009,
- 0x00000401, 0x08000401, 0x00000409, 0x08000409,
- 0x00020001, 0x08020001, 0x00020009, 0x08020009,
- 0x00020401, 0x08020401, 0x00020409, 0x08020409,
- 0x02000000, 0x0A000000, 0x02000008, 0x0A000008,
- 0x02000400, 0x0A000400, 0x02000408, 0x0A000408,
- 0x02020000, 0x0A020000, 0x02020008, 0x0A020008,
- 0x02020400, 0x0A020400, 0x02020408, 0x0A020408,
- 0x02000001, 0x0A000001, 0x02000009, 0x0A000009,
- 0x02000401, 0x0A000401, 0x02000409, 0x0A000409,
- 0x02020001, 0x0A020001, 0x02020009, 0x0A020009,
- 0x02020401, 0x0A020401, 0x02020409, 0x0A020409,
- },
- {
- /* for D bits (numbered as per FIPS 46) 16 17 18 19 20 21 */
- 0x00000000, 0x00000100, 0x00080000, 0x00080100,
- 0x01000000, 0x01000100, 0x01080000, 0x01080100,
- 0x00000010, 0x00000110, 0x00080010, 0x00080110,
- 0x01000010, 0x01000110, 0x01080010, 0x01080110,
- 0x00200000, 0x00200100, 0x00280000, 0x00280100,
- 0x01200000, 0x01200100, 0x01280000, 0x01280100,
- 0x00200010, 0x00200110, 0x00280010, 0x00280110,
- 0x01200010, 0x01200110, 0x01280010, 0x01280110,
- 0x00000200, 0x00000300, 0x00080200, 0x00080300,
- 0x01000200, 0x01000300, 0x01080200, 0x01080300,
- 0x00000210, 0x00000310, 0x00080210, 0x00080310,
- 0x01000210, 0x01000310, 0x01080210, 0x01080310,
- 0x00200200, 0x00200300, 0x00280200, 0x00280300,
- 0x01200200, 0x01200300, 0x01280200, 0x01280300,
- 0x00200210, 0x00200310, 0x00280210, 0x00280310,
- 0x01200210, 0x01200310, 0x01280210, 0x01280310,
- },
- {
- /* for D bits (numbered as per FIPS 46) 22 23 24 25 27 28 */
- 0x00000000, 0x04000000, 0x00040000, 0x04040000,
- 0x00000002, 0x04000002, 0x00040002, 0x04040002,
- 0x00002000, 0x04002000, 0x00042000, 0x04042000,
- 0x00002002, 0x04002002, 0x00042002, 0x04042002,
- 0x00000020, 0x04000020, 0x00040020, 0x04040020,
- 0x00000022, 0x04000022, 0x00040022, 0x04040022,
- 0x00002020, 0x04002020, 0x00042020, 0x04042020,
- 0x00002022, 0x04002022, 0x00042022, 0x04042022,
- 0x00000800, 0x04000800, 0x00040800, 0x04040800,
- 0x00000802, 0x04000802, 0x00040802, 0x04040802,
- 0x00002800, 0x04002800, 0x00042800, 0x04042800,
- 0x00002802, 0x04002802, 0x00042802, 0x04042802,
- 0x00000820, 0x04000820, 0x00040820, 0x04040820,
- 0x00000822, 0x04000822, 0x00040822, 0x04040822,
- 0x00002820, 0x04002820, 0x00042820, 0x04042820,
- 0x00002822, 0x04002822, 0x00042822, 0x04042822,
- },
- };
-
- private static final int SPtrans[][] =
- {
- {
- /* nibble 0 */
- 0x00820200, 0x00020000, 0x80800000, 0x80820200,
- 0x00800000, 0x80020200, 0x80020000, 0x80800000,
- 0x80020200, 0x00820200, 0x00820000, 0x80000200,
- 0x80800200, 0x00800000, 0x00000000, 0x80020000,
- 0x00020000, 0x80000000, 0x00800200, 0x00020200,
- 0x80820200, 0x00820000, 0x80000200, 0x00800200,
- 0x80000000, 0x00000200, 0x00020200, 0x80820000,
- 0x00000200, 0x80800200, 0x80820000, 0x00000000,
- 0x00000000, 0x80820200, 0x00800200, 0x80020000,
- 0x00820200, 0x00020000, 0x80000200, 0x00800200,
- 0x80820000, 0x00000200, 0x00020200, 0x80800000,
- 0x80020200, 0x80000000, 0x80800000, 0x00820000,
- 0x80820200, 0x00020200, 0x00820000, 0x80800200,
- 0x00800000, 0x80000200, 0x80020000, 0x00000000,
- 0x00020000, 0x00800000, 0x80800200, 0x00820200,
- 0x80000000, 0x80820000, 0x00000200, 0x80020200,
- },
- {
- /* nibble 1 */
- 0x10042004, 0x00000000, 0x00042000, 0x10040000,
- 0x10000004, 0x00002004, 0x10002000, 0x00042000,
- 0x00002000, 0x10040004, 0x00000004, 0x10002000,
- 0x00040004, 0x10042000, 0x10040000, 0x00000004,
- 0x00040000, 0x10002004, 0x10040004, 0x00002000,
- 0x00042004, 0x10000000, 0x00000000, 0x00040004,
- 0x10002004, 0x00042004, 0x10042000, 0x10000004,
- 0x10000000, 0x00040000, 0x00002004, 0x10042004,
- 0x00040004, 0x10042000, 0x10002000, 0x00042004,
- 0x10042004, 0x00040004, 0x10000004, 0x00000000,
- 0x10000000, 0x00002004, 0x00040000, 0x10040004,
- 0x00002000, 0x10000000, 0x00042004, 0x10002004,
- 0x10042000, 0x00002000, 0x00000000, 0x10000004,
- 0x00000004, 0x10042004, 0x00042000, 0x10040000,
- 0x10040004, 0x00040000, 0x00002004, 0x10002000,
- 0x10002004, 0x00000004, 0x10040000, 0x00042000,
- },
- {
- /* nibble 2 */
- 0x41000000, 0x01010040, 0x00000040, 0x41000040,
- 0x40010000, 0x01000000, 0x41000040, 0x00010040,
- 0x01000040, 0x00010000, 0x01010000, 0x40000000,
- 0x41010040, 0x40000040, 0x40000000, 0x41010000,
- 0x00000000, 0x40010000, 0x01010040, 0x00000040,
- 0x40000040, 0x41010040, 0x00010000, 0x41000000,
- 0x41010000, 0x01000040, 0x40010040, 0x01010000,
- 0x00010040, 0x00000000, 0x01000000, 0x40010040,
- 0x01010040, 0x00000040, 0x40000000, 0x00010000,
- 0x40000040, 0x40010000, 0x01010000, 0x41000040,
- 0x00000000, 0x01010040, 0x00010040, 0x41010000,
- 0x40010000, 0x01000000, 0x41010040, 0x40000000,
- 0x40010040, 0x41000000, 0x01000000, 0x41010040,
- 0x00010000, 0x01000040, 0x41000040, 0x00010040,
- 0x01000040, 0x00000000, 0x41010000, 0x40000040,
- 0x41000000, 0x40010040, 0x00000040, 0x01010000,
- },
- {
- /* nibble 3 */
- 0x00100402, 0x04000400, 0x00000002, 0x04100402,
- 0x00000000, 0x04100000, 0x04000402, 0x00100002,
- 0x04100400, 0x04000002, 0x04000000, 0x00000402,
- 0x04000002, 0x00100402, 0x00100000, 0x04000000,
- 0x04100002, 0x00100400, 0x00000400, 0x00000002,
- 0x00100400, 0x04000402, 0x04100000, 0x00000400,
- 0x00000402, 0x00000000, 0x00100002, 0x04100400,
- 0x04000400, 0x04100002, 0x04100402, 0x00100000,
- 0x04100002, 0x00000402, 0x00100000, 0x04000002,
- 0x00100400, 0x04000400, 0x00000002, 0x04100000,
- 0x04000402, 0x00000000, 0x00000400, 0x00100002,
- 0x00000000, 0x04100002, 0x04100400, 0x00000400,
- 0x04000000, 0x04100402, 0x00100402, 0x00100000,
- 0x04100402, 0x00000002, 0x04000400, 0x00100402,
- 0x00100002, 0x00100400, 0x04100000, 0x04000402,
- 0x00000402, 0x04000000, 0x04000002, 0x04100400,
- },
- {
- /* nibble 4 */
- 0x02000000, 0x00004000, 0x00000100, 0x02004108,
- 0x02004008, 0x02000100, 0x00004108, 0x02004000,
- 0x00004000, 0x00000008, 0x02000008, 0x00004100,
- 0x02000108, 0x02004008, 0x02004100, 0x00000000,
- 0x00004100, 0x02000000, 0x00004008, 0x00000108,
- 0x02000100, 0x00004108, 0x00000000, 0x02000008,
- 0x00000008, 0x02000108, 0x02004108, 0x00004008,
- 0x02004000, 0x00000100, 0x00000108, 0x02004100,
- 0x02004100, 0x02000108, 0x00004008, 0x02004000,
- 0x00004000, 0x00000008, 0x02000008, 0x02000100,
- 0x02000000, 0x00004100, 0x02004108, 0x00000000,
- 0x00004108, 0x02000000, 0x00000100, 0x00004008,
- 0x02000108, 0x00000100, 0x00000000, 0x02004108,
- 0x02004008, 0x02004100, 0x00000108, 0x00004000,
- 0x00004100, 0x02004008, 0x02000100, 0x00000108,
- 0x00000008, 0x00004108, 0x02004000, 0x02000008,
- },
- {
- /* nibble 5 */
- 0x20000010, 0x00080010, 0x00000000, 0x20080800,
- 0x00080010, 0x00000800, 0x20000810, 0x00080000,
- 0x00000810, 0x20080810, 0x00080800, 0x20000000,
- 0x20000800, 0x20000010, 0x20080000, 0x00080810,
- 0x00080000, 0x20000810, 0x20080010, 0x00000000,
- 0x00000800, 0x00000010, 0x20080800, 0x20080010,
- 0x20080810, 0x20080000, 0x20000000, 0x00000810,
- 0x00000010, 0x00080800, 0x00080810, 0x20000800,
- 0x00000810, 0x20000000, 0x20000800, 0x00080810,
- 0x20080800, 0x00080010, 0x00000000, 0x20000800,
- 0x20000000, 0x00000800, 0x20080010, 0x00080000,
- 0x00080010, 0x20080810, 0x00080800, 0x00000010,
- 0x20080810, 0x00080800, 0x00080000, 0x20000810,
- 0x20000010, 0x20080000, 0x00080810, 0x00000000,
- 0x00000800, 0x20000010, 0x20000810, 0x20080800,
- 0x20080000, 0x00000810, 0x00000010, 0x20080010,
- },
- {
- /* nibble 6 */
- 0x00001000, 0x00000080, 0x00400080, 0x00400001,
- 0x00401081, 0x00001001, 0x00001080, 0x00000000,
- 0x00400000, 0x00400081, 0x00000081, 0x00401000,
- 0x00000001, 0x00401080, 0x00401000, 0x00000081,
- 0x00400081, 0x00001000, 0x00001001, 0x00401081,
- 0x00000000, 0x00400080, 0x00400001, 0x00001080,
- 0x00401001, 0x00001081, 0x00401080, 0x00000001,
- 0x00001081, 0x00401001, 0x00000080, 0x00400000,
- 0x00001081, 0x00401000, 0x00401001, 0x00000081,
- 0x00001000, 0x00000080, 0x00400000, 0x00401001,
- 0x00400081, 0x00001081, 0x00001080, 0x00000000,
- 0x00000080, 0x00400001, 0x00000001, 0x00400080,
- 0x00000000, 0x00400081, 0x00400080, 0x00001080,
- 0x00000081, 0x00001000, 0x00401081, 0x00400000,
- 0x00401080, 0x00000001, 0x00001001, 0x00401081,
- 0x00400001, 0x00401080, 0x00401000, 0x00001001,
- },
- {
- /* nibble 7 */
- 0x08200020, 0x08208000, 0x00008020, 0x00000000,
- 0x08008000, 0x00200020, 0x08200000, 0x08208020,
- 0x00000020, 0x08000000, 0x00208000, 0x00008020,
- 0x00208020, 0x08008020, 0x08000020, 0x08200000,
- 0x00008000, 0x00208020, 0x00200020, 0x08008000,
- 0x08208020, 0x08000020, 0x00000000, 0x00208000,
- 0x08000000, 0x00200000, 0x08008020, 0x08200020,
- 0x00200000, 0x00008000, 0x08208000, 0x00000020,
- 0x00200000, 0x00008000, 0x08000020, 0x08208020,
- 0x00008020, 0x08000000, 0x00000000, 0x00208000,
- 0x08200020, 0x08008020, 0x08008000, 0x00200020,
- 0x08208000, 0x00000020, 0x00200020, 0x08008000,
- 0x08208020, 0x00200000, 0x08200000, 0x08000020,
- 0x00208000, 0x00008020, 0x08008020, 0x08200000,
- 0x00000020, 0x08208000, 0x00208020, 0x00000000,
- 0x08000000, 0x08200020, 0x00008000, 0x00208020
- }
- };
-
- private static final byte cov_2byte[] =
- {
- 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
- 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44,
- 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C,
- 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54,
- 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x61, 0x62,
- 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A,
- 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72,
- 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A
- };
-
- private static final int byteToUnsigned(byte b)
- {
- int value = (int)b;
-
- return (value >= 0 ? value : value + 256);
- }
-
- private static int fourBytesToInt(byte b[], int offset)
- {
- int value;
-
- value = byteToUnsigned(b[offset++]);
- value |= (byteToUnsigned(b[offset++]) << 8);
- value |= (byteToUnsigned(b[offset++]) << 16);
- value |= (byteToUnsigned(b[offset++]) << 24);
-
- return (value);
- }
-
- private static final void intToFourBytes(int iValue, byte b[], int offset)
- {
- b[offset++] = (byte)((iValue) & 0xff);
- b[offset++] = (byte)((iValue >>> 8 ) & 0xff);
- b[offset++] = (byte)((iValue >>> 16) & 0xff);
- b[offset++] = (byte)((iValue >>> 24) & 0xff);
- }
-
- private static final void PERM_OP(int a, int b, int n, int m, int results[])
- {
- int t;
-
- t = ((a >>> n) ^ b) & m;
- a ^= t << n;
- b ^= t;
-
- results[0] = a;
- results[1] = b;
- }
-
- private static final int HPERM_OP(int a, int n, int m)
- {
- int t;
-
- t = ((a << (16 - n)) ^ a) & m;
- a = a ^ t ^ (t >>> (16 - n));
-
- return (a);
- }
-
- private static int [] des_set_key(byte key[])
- {
- int schedule[] = new int[ITERATIONS * 2];
-
- int c = fourBytesToInt(key, 0);
- int d = fourBytesToInt(key, 4);
-
- int results[] = new int[2];
-
- PERM_OP(d, c, 4, 0x0f0f0f0f, results);
- d = results[0];
- c = results[1];
-
- c = HPERM_OP(c, -2, 0xcccc0000);
- d = HPERM_OP(d, -2, 0xcccc0000);
-
- PERM_OP(d, c, 1, 0x55555555, results);
- d = results[0];
- c = results[1];
-
- PERM_OP(c, d, 8, 0x00ff00ff, results);
- c = results[0];
- d = results[1];
-
- PERM_OP(d, c, 1, 0x55555555, results);
- d = results[0];
- c = results[1];
-
- d = (((d & 0x000000ff) << 16) | (d & 0x0000ff00) |
- ((d & 0x00ff0000) >>> 16) | ((c & 0xf0000000) >>> 4));
- c &= 0x0fffffff;
-
- int s, t;
- int j = 0;
-
- for (int i = 0; i < ITERATIONS; i ++)
- {
- if (shifts2[i])
- {
- c = (c >>> 2) | (c << 26);
- d = (d >>> 2) | (d << 26);
- }
- else
- {
- c = (c >>> 1) | (c << 27);
- d = (d >>> 1) | (d << 27);
- }
-
- c &= 0x0fffffff;
- d &= 0x0fffffff;
-
- s = skb[0][ (c ) & 0x3f ] |
- skb[1][((c >>> 6) & 0x03) | ((c >>> 7) & 0x3c)] |
- skb[2][((c >>> 13) & 0x0f) | ((c >>> 14) & 0x30)] |
- skb[3][((c >>> 20) & 0x01) | ((c >>> 21) & 0x06) |
- ((c >>> 22) & 0x38)];
-
- t = skb[4][ (d ) & 0x3f ] |
- skb[5][((d >>> 7) & 0x03) | ((d >>> 8) & 0x3c)] |
- skb[6][ (d >>> 15) & 0x3f ] |
- skb[7][((d >>> 21) & 0x0f) | ((d >>> 22) & 0x30)];
-
- schedule[j++] = ((t << 16) | (s & 0x0000ffff)) & 0xffffffff;
- s = ((s >>> 16) | (t & 0xffff0000));
-
- s = (s << 4) | (s >>> 28);
- schedule[j++] = s & 0xffffffff;
- }
- return (schedule);
- }
-
- private static final int D_ENCRYPT
- (
- int L, int R, int S, int E0, int E1, int s[]
- )
- {
- int t, u, v;
-
- v = R ^ (R >>> 16);
- u = v & E0;
- v = v & E1;
- u = (u ^ (u << 16)) ^ R ^ s[S];
- t = (v ^ (v << 16)) ^ R ^ s[S + 1];
- t = (t >>> 4) | (t << 28);
-
- L ^= SPtrans[1][(t ) & 0x3f] |
- SPtrans[3][(t >>> 8) & 0x3f] |
- SPtrans[5][(t >>> 16) & 0x3f] |
- SPtrans[7][(t >>> 24) & 0x3f] |
- SPtrans[0][(u ) & 0x3f] |
- SPtrans[2][(u >>> 8) & 0x3f] |
- SPtrans[4][(u >>> 16) & 0x3f] |
- SPtrans[6][(u >>> 24) & 0x3f];
-
- return (L);
- }
-
- private static final int [] body(int schedule[], int Eswap0, int Eswap1)
- {
- int left = 0;
- int right = 0;
- int t = 0;
-
- for (int j = 0; j < 25; j ++)
- {
- for (int i = 0; i < ITERATIONS * 2; i += 4)
- {
- left = D_ENCRYPT(left, right, i, Eswap0, Eswap1, schedule);
- right = D_ENCRYPT(right, left, i + 2, Eswap0, Eswap1, schedule);
- }
- t = left;
- left = right;
- right = t;
- }
-
- t = right;
-
- right = (left >>> 1) | (left << 31);
- left = (t >>> 1) | (t << 31);
-
- left &= 0xffffffff;
- right &= 0xffffffff;
-
- int results[] = new int[2];
-
- PERM_OP(right, left, 1, 0x55555555, results);
- right = results[0];
- left = results[1];
-
- PERM_OP(left, right, 8, 0x00ff00ff, results);
- left = results[0];
- right = results[1];
-
- PERM_OP(right, left, 2, 0x33333333, results);
- right = results[0];
- left = results[1];
-
- PERM_OP(left, right, 16, 0x0000ffff, results);
- left = results[0];
- right = results[1];
-
- PERM_OP(right, left, 4, 0x0f0f0f0f, results);
- right = results[0];
- left = results[1];
-
- int out[] = new int[2];
-
- out[0] = left;
- out[1] = right;
-
- return (out);
- }
-
- /*
- * <P>Encrypt a password given the cleartext password and a "salt".</P>
- * @param salt A two-character string representing the salt used to
- * iterate the encryption engine in lots of different ways. If you
- * are generating a new encryption then this value should be
- * randomised.
- * @param original The password to be encrypted.
- * @return A string consisting of the 2-character salt followed by the
- * encrypted password.
- */
- public static final byte[] crypt(byte salt[], byte original[])
- {
- byte result[] = new byte[13];
-
- byte byteZero = salt[0];
- byte byteOne = salt[1];
-
- result[0] = byteZero;
- result[1] = byteOne;
-
- int Eswap0 = con_salt[byteZero];
- int Eswap1 = con_salt[byteOne] << 4;
-
- byte key[] = new byte[8];
-
- for (int i = 0; i < key.length; i ++)
- key[i] = (byte)0;
-
- for (int i = 0; i < key.length && i < original.length; i ++)
- {
- int iChar = (int)original[i];
-
- key[i] = (byte)(iChar << 1);
- }
-
- int schedule[] = des_set_key(key);
- int out[] = body(schedule, Eswap0, Eswap1);
-
- byte b[] = new byte[9];
-
- intToFourBytes(out[0], b, 0);
- intToFourBytes(out[1], b, 4);
- b[8] = 0;
-
- for (int i = 2, y = 0, u = 0x80; i < 13; i ++)
- {
- for (int j = 0, c = 0; j < 6; j ++)
- {
- c <<= 1;
-
- if (((int)b[y] & u) != 0)
- c |= 1;
-
- u >>>= 1;
-
- if (u == 0)
- {
- y++;
- u = 0x80;
- }
- result[i] = cov_2byte[c];
- }
- }
- return result;
- }
-
-}
-
diff --git a/org/postgresql/xa/.gitignore b/org/postgresql/xa/.gitignore
deleted file mode 100644
index 299d3b1..0000000
--- a/org/postgresql/xa/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-PGXADataSource.java
diff --git a/org/postgresql/xa/PGXAConnection.java b/org/postgresql/xa/PGXAConnection.java
deleted file mode 100644
index c70d033..0000000
--- a/org/postgresql/xa/PGXAConnection.java
+++ /dev/null
@@ -1,538 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2009-2011, PostgreSQL Global Development Group
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.xa;
-
-import org.postgresql.PGConnection;
-import org.postgresql.ds.PGPooledConnection;
-import org.postgresql.core.BaseConnection;
-import org.postgresql.core.ProtocolConnection;
-import org.postgresql.core.Logger;
-import org.postgresql.util.GT;
-import org.postgresql.util.PSQLException;
-import org.postgresql.util.PSQLState;
-
-import javax.sql.*;
-import java.sql.*;
-import java.util.*;
-import java.lang.reflect.*;
-import javax.transaction.xa.Xid;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.XAException;
-
-/**
- * The PostgreSQL implementation of {@link XAResource}.
- *
- * This implementation doesn't support transaction interleaving
- * (see JTA specification, section 3.4.4) and suspend/resume.
- *
- * Two-phase commit requires PostgreSQL server version 8.1
- * or higher.
- *
- * @author Heikki Linnakangas (heikki.linnakangas at iki.fi)
- */
-public class PGXAConnection extends PGPooledConnection implements XAConnection, XAResource
-{
- /**
- * Underlying physical database connection. It's used for issuing PREPARE TRANSACTION/
- * COMMIT PREPARED/ROLLBACK PREPARED commands.
- */
- private final BaseConnection conn;
- private final Logger logger;
-
- /*
- * PGXAConnection-object can be in one of three states:
- *
- * IDLE
- * Not associated with a XA-transaction. You can still call
- * getConnection and use the connection outside XA. currentXid is null.
- * autoCommit is true on a connection by getConnection, per normal JDBC
- * rules, though the caller can change it to false and manage transactions
- * itself using Connection.commit and rollback.
- *
- * ACTIVE
- * start has been called, and we're associated with an XA transaction.
- * currentXid is valid. autoCommit is false on a connection returned by
- * getConnection, and should not be messed with by the caller or the XA
- * transaction will be broken.
- *
- * ENDED
- * end has been called, but the transaction has not yet been prepared.
- * currentXid is still valid. You shouldn't use the connection for anything
- * else than issuing a XAResource.commit or rollback.
- */
- private Xid currentXid;
-
- private int state;
-
- private static final int STATE_IDLE = 0;
- private static final int STATE_ACTIVE = 1;
- private static final int STATE_ENDED = 2;
-
- /*
- * When an XA transaction is started, we put the underlying connection
- * into non-autocommit mode. The old setting is saved in
- * localAutoCommitMode, so that we can restore it when the XA transaction
- * ends and the connection returns into local transaction mode.
- */
- private boolean localAutoCommitMode = true;
-
- private void debug(String s) {
- logger.debug("XAResource " + Integer.toHexString(this.hashCode()) + ": " + s);
- }
-
- public PGXAConnection(BaseConnection conn) throws SQLException
- {
- super(conn, true, true);
- this.conn = conn;
- this.state = STATE_IDLE;
- this.logger = conn.getLogger();
- }
-
-
- /**** XAConnection interface ****/
-
- public Connection getConnection() throws SQLException
- {
- if (logger.logDebug())
- debug("PGXAConnection.getConnection called");
-
- Connection conn = super.getConnection();
-
- // When we're outside an XA transaction, autocommit
- // is supposed to be true, per usual JDBC convention.
- // When an XA transaction is in progress, it should be
- // false.
- if(state == STATE_IDLE)
- conn.setAutoCommit(true);
-
- /*
- * Wrap the connection in a proxy to forbid application from
- * fiddling with transaction state directly during an XA transaction
- */
- ConnectionHandler handler = new ConnectionHandler(conn);
- return (Connection)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{Connection.class, PGConnection.class}, handler);
- }
-
- public XAResource getXAResource() {
- return this;
- }
-
- /*
- * A java.sql.Connection proxy class to forbid calls to transaction
- * control methods while the connection is used for an XA transaction.
- */
- private class ConnectionHandler implements InvocationHandler
- {
- private Connection con;
-
- public ConnectionHandler(Connection con)
- {
- this.con = con;
- }
-
- public Object invoke(Object proxy, Method method, Object[] args)
- throws Throwable
- {
- if (state != STATE_IDLE)
- {
- String methodName = method.getName();
- if (methodName.equals("commit") ||
- methodName.equals("rollback") ||
- methodName.equals("setSavePoint") ||
- (methodName.equals("setAutoCommit") && ((Boolean) args[0]).booleanValue()))
- {
- throw new PSQLException(GT.tr("Transaction control methods setAutoCommit(true), commit, rollback and setSavePoint not allowed while an XA transaction is active."),
- PSQLState.OBJECT_NOT_IN_STATE);
- }
- }
- try {
- return method.invoke(con, args);
- } catch (InvocationTargetException ex) {
- throw ex.getTargetException();
- }
- }
- }
-
-
- /**** XAResource interface ****/
-
- /**
- * Preconditions:
- * 1. flags must be one of TMNOFLAGS, TMRESUME or TMJOIN
- * 2. xid != null
- * 3. connection must not be associated with a transaction
- * 4. the TM hasn't seen the xid before
- *
- * Implementation deficiency preconditions:
- * 1. TMRESUME not supported.
- * 2. if flags is TMJOIN, we must be in ended state,
- * and xid must be the current transaction
- * 3. unless flags is TMJOIN, previous transaction using the
- * connection must be committed or prepared or rolled back
- *
- * Postconditions:
- * 1. Connection is associated with the transaction
- */
- public void start(Xid xid, int flags) throws XAException {
- if (logger.logDebug())
- debug("starting transaction xid = " + xid);
-
- // Check preconditions
- if (flags != XAResource.TMNOFLAGS && flags != XAResource.TMRESUME && flags != XAResource.TMJOIN)
- throw new PGXAException(GT.tr("Invalid flags"), XAException.XAER_INVAL);
-
- if (xid == null)
- throw new PGXAException(GT.tr("xid must not be null"), XAException.XAER_INVAL);
-
- if (state == STATE_ACTIVE)
- throw new PGXAException(GT.tr("Connection is busy with another transaction"), XAException.XAER_PROTO);
-
- // We can't check precondition 4 easily, so we don't. Duplicate xid will be catched in prepare phase.
-
- // Check implementation deficiency preconditions
- if (flags == TMRESUME)
- throw new PGXAException(GT.tr("suspend/resume not implemented"), XAException.XAER_RMERR);
-
- // It's ok to join an ended transaction. WebLogic does that.
- if (flags == TMJOIN)
- {
- if (state != STATE_ENDED)
- throw new PGXAException(GT.tr("Transaction interleaving not implemented"), XAException.XAER_RMERR);
-
- if (!xid.equals(currentXid))
- throw new PGXAException(GT.tr("Transaction interleaving not implemented"), XAException.XAER_RMERR);
- } else if(state == STATE_ENDED)
- throw new PGXAException(GT.tr("Transaction interleaving not implemented"), XAException.XAER_RMERR);
-
- try
- {
- localAutoCommitMode = conn.getAutoCommit();
- conn.setAutoCommit(false);
- }
- catch (SQLException ex)
- {
- throw new PGXAException(GT.tr("Error disabling autocommit"), ex, XAException.XAER_RMERR);
- }
-
- // Preconditions are met, Associate connection with the transaction
- state = STATE_ACTIVE;
- currentXid = xid;
- }
-
- /**
- * Preconditions:
- * 1. Flags is one of TMSUCCESS, TMFAIL, TMSUSPEND
- * 2. xid != null
- * 3. Connection is associated with transaction xid
- *
- * Implementation deficiency preconditions:
- * 1. Flags is not TMSUSPEND
- *
- * Postconditions:
- * 1. connection is disassociated from the transaction.
- */
- public void end(Xid xid, int flags) throws XAException {
- if (logger.logDebug())
- debug("ending transaction xid = " + xid);
-
- // Check preconditions
-
- if (flags != XAResource.TMSUSPEND && flags != XAResource.TMFAIL && flags != XAResource.TMSUCCESS)
- throw new PGXAException(GT.tr("Invalid flags"), XAException.XAER_INVAL);
-
- if (xid == null)
- throw new PGXAException(GT.tr("xid must not be null"), XAException.XAER_INVAL);
-
- if (state != STATE_ACTIVE || !currentXid.equals(xid))
- throw new PGXAException(GT.tr("tried to call end without corresponding start call"), XAException.XAER_PROTO);
-
- // Check implementation deficiency preconditions
- if (flags == XAResource.TMSUSPEND)
- throw new PGXAException(GT.tr("suspend/resume not implemented"), XAException.XAER_RMERR);
-
- // We ignore TMFAIL. It's just a hint to the RM. We could roll back immediately
- // if TMFAIL was given.
-
- // All clear. We don't have any real work to do.
- state = STATE_ENDED;
- }
-
- /**
- * Preconditions:
- * 1. xid != null
- * 2. xid is in ended state
- *
- * Implementation deficiency preconditions:
- * 1. xid was associated with this connection
- *
- * Postconditions:
- * 1. Transaction is prepared
- */
- public int prepare(Xid xid) throws XAException {
- if (logger.logDebug())
- debug("preparing transaction xid = " + xid);
-
- // Check preconditions
- if (!currentXid.equals(xid))
- {
- throw new PGXAException(GT.tr("Not implemented: Prepare must be issued using the same connection that started the transaction"),
- XAException.XAER_RMERR);
- }
- if (state != STATE_ENDED)
- throw new PGXAException(GT.tr("Prepare called before end"), XAException.XAER_INVAL);
-
- state = STATE_IDLE;
- currentXid = null;
-
- if (!conn.haveMinimumServerVersion("8.1"))
- throw new PGXAException(GT.tr("Server versions prior to 8.1 do not support two-phase commit."), XAException.XAER_RMERR);
-
- try
- {
- String s = RecoveredXid.xidToString(xid);
-
- Statement stmt = conn.createStatement();
- try
- {
- stmt.executeUpdate("PREPARE TRANSACTION '" + s + "'");
- }
- finally
- {
- stmt.close();
- }
- conn.setAutoCommit(localAutoCommitMode);
-
- return XA_OK;
- }
- catch (SQLException ex)
- {
- throw new PGXAException(GT.tr("Error preparing transaction"), ex, XAException.XAER_RMERR);
- }
- }
-
- /**
- * Preconditions:
- * 1. flag must be one of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS or TMSTARTTRSCAN | TMENDRSCAN
- * 2. if flag isn't TMSTARTRSCAN or TMSTARTRSCAN | TMENDRSCAN, a recovery scan must be in progress
- *
- * Postconditions:
- * 1. list of prepared xids is returned
- */
- public Xid[] recover(int flag) throws XAException {
- // Check preconditions
- if (flag != TMSTARTRSCAN && flag != TMENDRSCAN && flag != TMNOFLAGS && flag != (TMSTARTRSCAN | TMENDRSCAN))
- throw new PGXAException(GT.tr("Invalid flag"), XAException.XAER_INVAL);
-
- // We don't check for precondition 2, because we would have to add some additional state in
- // this object to keep track of recovery scans.
-
- // All clear. We return all the xids in the first TMSTARTRSCAN call, and always return
- // an empty array otherwise.
- if ((flag & TMSTARTRSCAN) == 0)
- return new Xid[0];
- else
- {
- try
- {
- Statement stmt = conn.createStatement();
- try
- {
- // If this connection is simultaneously used for a transaction,
- // this query gets executed inside that transaction. It's OK,
- // except if the transaction is in abort-only state and the
- // backed refuses to process new queries. Hopefully not a problem
- // in practise.
- ResultSet rs = stmt.executeQuery("SELECT gid FROM pg_prepared_xacts");
- LinkedList l = new LinkedList();
- while (rs.next())
- {
- Xid recoveredXid = RecoveredXid.stringToXid(rs.getString(1));
- if (recoveredXid != null)
- l.add(recoveredXid);
- }
- rs.close();
-
- return (Xid[]) l.toArray(new Xid[l.size()]);
- }
- finally
- {
- stmt.close();
- }
- }
- catch (SQLException ex)
- {
- throw new PGXAException(GT.tr("Error during recover"), ex, XAException.XAER_RMERR);
- }
- }
- }
-
- /**
- * Preconditions:
- * 1. xid is known to the RM or it's in prepared state
- *
- * Implementation deficiency preconditions:
- * 1. xid must be associated with this connection if it's not in prepared state.
- *
- * Postconditions:
- * 1. Transaction is rolled back and disassociated from connection
- */
- public void rollback(Xid xid) throws XAException {
- if (logger.logDebug())
- debug("rolling back xid = " + xid);
-
- // We don't explicitly check precondition 1.
-
- try
- {
- if (currentXid != null && xid.equals(currentXid))
- {
- state = STATE_IDLE;
- currentXid = null;
- conn.rollback();
- conn.setAutoCommit(localAutoCommitMode);
- }
- else
- {
- String s = RecoveredXid.xidToString(xid);
-
- conn.setAutoCommit(true);
- Statement stmt = conn.createStatement();
- try
- {
- stmt.executeUpdate("ROLLBACK PREPARED '" + s + "'");
- }
- finally
- {
- stmt.close();
- }
- }
- }
- catch (SQLException ex)
- {
- throw new PGXAException(GT.tr("Error rolling back prepared transaction"), ex, XAException.XAER_RMERR);
- }
- }
-
- public void commit(Xid xid, boolean onePhase) throws XAException {
- if (logger.logDebug())
- debug("committing xid = " + xid + (onePhase ? " (one phase) " : " (two phase)"));
-
- if (xid == null)
- throw new PGXAException(GT.tr("xid must not be null"), XAException.XAER_INVAL);
-
- if (onePhase)
- commitOnePhase(xid);
- else
- commitPrepared(xid);
- }
-
- /**
- * Preconditions:
- * 1. xid must in ended state.
- *
- * Implementation deficiency preconditions:
- * 1. this connection must have been used to run the transaction
- *
- * Postconditions:
- * 1. Transaction is committed
- */
- private void commitOnePhase(Xid xid) throws XAException {
- try
- {
- // Check preconditions
- if (currentXid == null || !currentXid.equals(xid))
- {
- // In fact, we don't know if xid is bogus, or if it just wasn't associated with this connection.
- // Assume it's our fault.
- throw new PGXAException(GT.tr("Not implemented: one-phase commit must be issued using the same connection that was used to start it"),
- XAException.XAER_RMERR);
- }
- if (state != STATE_ENDED)
- throw new PGXAException(GT.tr("commit called before end"), XAException.XAER_PROTO);
-
- // Preconditions are met. Commit
- state = STATE_IDLE;
- currentXid = null;
-
- conn.commit();
- conn.setAutoCommit(localAutoCommitMode);
- }
- catch (SQLException ex)
- {
- throw new PGXAException(GT.tr("Error during one-phase commit"), ex, XAException.XAER_RMERR);
- }
- }
-
- /**
- * Preconditions:
- * 1. xid must be in prepared state in the server
- *
- * Implementation deficiency preconditions:
- * 1. Connection must be in idle state
- *
- * Postconditions:
- * 1. Transaction is committed
- */
- private void commitPrepared(Xid xid) throws XAException {
- try
- {
- // Check preconditions. The connection mustn't be used for another
- // other XA or local transaction, or the COMMIT PREPARED command
- // would mess it up.
- if (state != STATE_IDLE || conn.getTransactionState() != ProtocolConnection.TRANSACTION_IDLE)
- throw new PGXAException(GT.tr("Not implemented: 2nd phase commit must be issued using an idle connection"),
- XAException.XAER_RMERR);
-
- String s = RecoveredXid.xidToString(xid);
-
- localAutoCommitMode = conn.getAutoCommit();
- conn.setAutoCommit(true);
- Statement stmt = conn.createStatement();
- try
- {
- stmt.executeUpdate("COMMIT PREPARED '" + s + "'");
- }
- finally
- {
- stmt.close();
- conn.setAutoCommit(localAutoCommitMode);
- }
- }
- catch (SQLException ex)
- {
- throw new PGXAException(GT.tr("Error committing prepared transaction"), ex, XAException.XAER_RMERR);
- }
- }
-
- public boolean isSameRM(XAResource xares) throws XAException {
- // This trivial implementation makes sure that the
- // application server doesn't try to use another connection
- // for prepare, commit and rollback commands.
- return xares == this;
- }
-
- /**
- * Does nothing, since we don't do heuristics,
- */
- public void forget(Xid xid) throws XAException {
- throw new PGXAException(GT.tr("Heuristic commit/rollback not supported"), XAException.XAER_NOTA);
- }
-
- /**
- * We don't do transaction timeouts. Just returns 0.
- */
- public int getTransactionTimeout() {
- return 0;
- }
-
- /**
- * We don't do transaction timeouts. Returns false.
- */
- public boolean setTransactionTimeout(int seconds) {
- return false;
- }
-}
diff --git a/org/postgresql/xa/PGXADataSource.java.in b/org/postgresql/xa/PGXADataSource.java.in
deleted file mode 100644
index 10e89c8..0000000
--- a/org/postgresql/xa/PGXADataSource.java.in
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.postgresql.xa;
-
-import javax.sql.XADataSource;
-
-/**
- * XA-enabled DataSource implementation.
- *
- * @author Heikki Linnakangas (heikki.linnakangas at iki.fi)
- */
-public class PGXADataSource
- extends @XA_DS_CLASS@
- implements XADataSource
-{
-}
-
diff --git a/org/postgresql/xa/PGXADataSourceFactory.java b/org/postgresql/xa/PGXADataSourceFactory.java
deleted file mode 100644
index 4edc0be..0000000
--- a/org/postgresql/xa/PGXADataSourceFactory.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2007-2011, PostgreSQL Global Development Group
-*
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.xa;
-
-import org.postgresql.ds.common.*;
-
-import javax.naming.*;
-import java.util.Hashtable;
-
-/**
- * An ObjectFactory implementation for PGXADataSource-objects.
- */
-
-public class PGXADataSourceFactory extends PGObjectFactory
-{
- /* All the other PostgreSQL DataSource use PGObjectFactory directly, but we
- * can't do that with PGXADataSource because referencing PGXADataSource
- * from PGObjectFactory would break "JDBC2 Enterprise" edition build which
- * doesn't include PGXADataSource.
- */
-
- public Object getObjectInstance(Object obj, Name name, Context nameCtx,
- Hashtable environment) throws Exception
- {
- Reference ref = (Reference)obj;
- String className = ref.getClassName();
- if (className.equals("org.postgresql.xa.PGXADataSource"))
- {
- return loadXADataSource(ref);
- }
- else
- return null;
- }
-
- private Object loadXADataSource(Reference ref)
- {
- PGXADataSource ds = new PGXADataSource();
- return loadBaseDataSource(ds, ref);
- }
-}
diff --git a/org/postgresql/xa/PGXAException.java b/org/postgresql/xa/PGXAException.java
deleted file mode 100644
index 5fd1dbf..0000000
--- a/org/postgresql/xa/PGXAException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2009-2011, PostgreSQL Global Development Group
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.xa;
-
-import javax.transaction.xa.XAException;
-
-/**
- * A convenience subclass of <code>XAException</code> which makes it easy to
- * create an instance of <code>XAException</code> with a human-readable
- * message, a <code>Throwable</code> cause, and an XA error code.
- *
- * @author Michael S. Allman
- */
-public class PGXAException extends XAException {
- PGXAException(String message, int errorCode) {
- super(message);
-
- this.errorCode = errorCode;
- }
-
- PGXAException(String message, Throwable cause, int errorCode) {
- super(message);
-
- initCause(cause);
- this.errorCode = errorCode;
- }
-
- PGXAException(Throwable cause, int errorCode) {
- super(errorCode);
-
- initCause(cause);
- }
-}
diff --git a/org/postgresql/xa/RecoveredXid.java b/org/postgresql/xa/RecoveredXid.java
deleted file mode 100644
index 8fd91ad..0000000
--- a/org/postgresql/xa/RecoveredXid.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2009-2011, PostgreSQL Global Development Group
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.xa;
-
-import java.util.Arrays;
-import javax.transaction.xa.Xid;
-
-import org.postgresql.util.Base64;
-
-class RecoveredXid implements Xid {
- int formatId;
- byte[] globalTransactionId;
- byte[] branchQualifier;
-
- public int getFormatId() {
- return formatId;
- }
-
- public byte[] getGlobalTransactionId() {
- return globalTransactionId;
- }
-
- public byte[] getBranchQualifier() {
- return branchQualifier;
- }
-
- public boolean equals(Object o) {
- if (o == this) // optimization for the common case.
- return true;
-
- if (!(o instanceof Xid))
- return false;
-
- Xid other = (Xid) o;
- if (other.getFormatId() != formatId)
- return false;
- if (!Arrays.equals(globalTransactionId, other.getGlobalTransactionId()))
- return false;
- if (!Arrays.equals(branchQualifier, other.getBranchQualifier()))
- return false;
-
- return true;
- }
-
- /**
- * This is for debugging purposes only
- */
- public String toString()
- {
- return xidToString(this);
- }
-
- //--- Routines for converting xid to string and back.
-
- static String xidToString(Xid xid) {
- return xid.getFormatId() + "_"
- + Base64.encodeBytes(xid.getGlobalTransactionId(), Base64.DONT_BREAK_LINES) + "_"
- + Base64.encodeBytes(xid.getBranchQualifier(), Base64.DONT_BREAK_LINES);
- }
-
- /**
- * @param s
- * @return recovered xid, or null if s does not represent a
- * valid xid encoded by the driver.
- */
- static Xid stringToXid(String s) {
- RecoveredXid xid = new RecoveredXid();
-
- int a = s.indexOf("_");
- int b = s.lastIndexOf("_");
-
- if (a == b) // this also catches the case a == b == -1.
- return null;
-
- try
- {
- xid.formatId = Integer.parseInt(s.substring(0, a));
- xid.globalTransactionId = Base64.decode(s.substring(a + 1, b));
- xid.branchQualifier = Base64.decode(s.substring(b + 1));
-
- if (xid.globalTransactionId == null || xid.branchQualifier == null)
- return null;
- }
- catch (Exception ex)
- {
- return null; // Doesn't seem to be an xid generated by this driver.
- }
-
- return xid;
- }
-}
diff --git a/org/postgresql/xa/jdbc3/AbstractJdbc3XADataSource.java b/org/postgresql/xa/jdbc3/AbstractJdbc3XADataSource.java
deleted file mode 100644
index 8b185a8..0000000
--- a/org/postgresql/xa/jdbc3/AbstractJdbc3XADataSource.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2009-2011, PostgreSQL Global Development Group
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.xa.jdbc3;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import javax.naming.Referenceable;
-import javax.naming.Reference;
-import javax.sql.XAConnection;
-
-import org.postgresql.xa.*;
-
-import org.postgresql.core.BaseConnection;
-import org.postgresql.ds.common.BaseDataSource;
-
-/**
- * XA-enabled DataSource implementation.
- *
- * @author Heikki Linnakangas (heikki.linnakangas at iki.fi)
- */
-public class AbstractJdbc3XADataSource extends BaseDataSource implements Referenceable
-{
- /**
- * Gets a connection to the PostgreSQL database. The database is identified by the
- * DataSource properties serverName, databaseName, and portNumber. The user to
- * connect as is identified by the DataSource properties user and password.
- *
- * @return A valid database connection.
- * @throws SQLException
- * Occurs when the database connection cannot be established.
- */
- public XAConnection getXAConnection() throws SQLException
- {
- return getXAConnection(getUser(), getPassword());
- }
-
- /**
- * Gets a XA-enabled connection to the PostgreSQL database. The database is identified by the
- * DataSource properties serverName, databaseName, and portNumber. The user to
- * connect as is identified by the arguments user and password, which override
- * the DataSource properties by the same name.
- *
- * @return A valid database connection.
- * @throws SQLException
- * Occurs when the database connection cannot be established.
- */
- public XAConnection getXAConnection(String user, String password) throws SQLException
- {
- Connection con = super.getConnection(user, password);
- return new PGXAConnection((BaseConnection) con);
- }
-
- public String getDescription() {
- return "JDBC3 XA-enabled DataSource from " + org.postgresql.Driver.getVersion();
- }
-
- /**
- * Generates a reference using the appropriate object factory.
- */
- protected Reference createReference() {
- return new Reference(
- getClass().getName(),
- PGXADataSourceFactory.class.getName(),
- null);
- }
-}
diff --git a/org/postgresql/xa/jdbc4/AbstractJdbc4XADataSource.java b/org/postgresql/xa/jdbc4/AbstractJdbc4XADataSource.java
deleted file mode 100644
index 3da3c05..0000000
--- a/org/postgresql/xa/jdbc4/AbstractJdbc4XADataSource.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*-------------------------------------------------------------------------
-*
-* Copyright (c) 2009-2011, PostgreSQL Global Development Group
-*
-*-------------------------------------------------------------------------
-*/
-package org.postgresql.xa.jdbc4;
-
-import java.sql.SQLFeatureNotSupportedException;
-
-import org.postgresql.xa.jdbc3.AbstractJdbc3XADataSource;
-
-public class AbstractJdbc4XADataSource
- extends AbstractJdbc3XADataSource
-{
-
- public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException
- {
- throw org.postgresql.Driver.notImplemented(this.getClass(), "getParentLogger()");
- }
-
-}
-
diff --git a/src/pom/pom.xml b/src/pom/pom.xml
deleted file mode 100644
index 4dabcd2..0000000
--- a/src/pom/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project>
- <modelVersion>4.0.0</modelVersion>
- <groupId>@maven.group.id@</groupId>
- <artifactId>@maven.artifact.id@</artifactId>
- <packaging>jar</packaging>
- <name>PostgreSQL JDBC Driver</name>
- <version>@maven.artifact.version.string@</version>
- <description>@maven.artifact.description@ @jdbc.version.upper@</description>
- <url>http://jdbc.postgresql.org</url>
- <developers>
- <developer>
- <id>davecramer</id>
- <name>Dave Cramer</name>
- </developer>
- <developer>
- <id>jurka</id>
- <name>Kris Jurka</name>
- </developer>
- <developer>
- <id>oliver</id>
- <name>Oliver Jowett</name>
- </developer>
- </developers>
- <licenses>
- <license>
- <name>BSD License</name>
- <url>http://jdbc.postgresql.org/license.html</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
- <scm>
- <connection>scm:git:git at github.com:pgjdbc/pgjdbc.git</connection>
- <developerConnection>scm:git:git at github.com:pgjdbc/pgjdbc.git</developerConnection>
- <url>git at github.com:pgjdbc/pgjdbc.git</url>
- </scm>
- <distributionManagement>
- <repository>
- <uniqueVersion>false</uniqueVersion>
- <id>org.postgresql</id>
- <url>https://oss.sonatype.org/content/repositories/snapshots</url>
- <layout>legacy</layout>
- </repository>
- </distributionManagement>
-</project>
diff --git a/ssltest.properties b/ssltest.properties
deleted file mode 100644
index a38c4ab..0000000
--- a/ssltest.properties
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-certdir=certdir
-
-ssloff8=
-ssloff8prefix=
-
-#sslhostnossl8=jdbc:postgresql://localhost:5432/hostnossldb?sslpassword=sslpwd
-sslhostnossl8prefix=
-
-#sslhostgh8=jdbc:postgresql://localhost:5432/hostdb?sslpassword=sslpwd
-sslhostgh8prefix=
-#sslhostbh8=jdbc:postgresql://127.0.0.1:5432/hostdb?sslpassword=sslpwd
-sslhostbh8prefix=
-
-#sslhostsslgh8=jdbc:postgresql://localhost:5432/hostssldb?sslpassword=sslpwd
-sslhostsslgh8prefix=
-#sslhostsslbh8=jdbc:postgresql://127.0.0.1:5432/hostssldb?sslpassword=sslpwd
-sslhostsslbh8prefix=
-
-#sslhostsslcertgh8=jdbc:postgresql://localhost:5432/hostsslcertdb?sslpassword=sslpwd
-sslhostsslcertgh8prefix=
-#sslhostsslcertbh8=jdbc:postgresql://127.0.0.1:5432/hostsslcertdb?sslpassword=sslpwd
-sslhostsslcertbh8prefix=
-
-#sslcertgh8=jdbc:postgresql://localhost:5432/certdb?sslpassword=sslpwd
-sslcertgh8prefix=
-#sslcertbh8=jdbc:postgresql://127.0.0.1:5432/certdb?sslpassword=sslpwd
-sslcertbh8prefix=
-
-ssloff9=
-ssloff9prefix=
-
-#sslhostnossl9=jdbc:postgresql://localhost:5432/hostnossldb?sslpassword=sslpwd
-sslhostnossl9prefix=
-
-#sslhostgh9=jdbc:postgresql://localhost:5432/hostdb?sslpassword=sslpwd
-sslhostgh9prefix=
-#sslhostbh9=jdbc:postgresql://127.0.0.1:5432/hostdb?sslpassword=sslpwd
-sslhostbh9prefix=
-
-#sslhostsslgh9=jdbc:postgresql://localhost:5432/hostssldb?sslpassword=sslpwd
-sslhostsslgh9prefix=
-#sslhostsslbh9=jdbc:postgresql://127.0.0.1:5432/hostssldb?sslpassword=sslpwd
-sslhostsslbh9prefix=
-
-#sslhostsslcertgh9=jdbc:postgresql://localhost:5432/hostsslcertdb?sslpassword=sslpwd
-sslhostsslcertgh9prefix=
-#sslhostsslcertbh9=jdbc:postgresql://127.0.0.1:5432/hostsslcertdb?sslpassword=sslpwd
-sslhostsslcertbh9prefix=
-
-#sslcertgh9=jdbc:postgresql://localhost:5432/certdb?sslpassword=sslpwd
-sslcertgh9prefix=
-#sslcertbh9=jdbc:postgresql://127.0.0.1:5432/certdb?sslpassword=sslpwd
-sslcertbh9prefix=
diff --git a/update-translations.sh b/update-translations.sh
deleted file mode 100755
index 4d57182..0000000
--- a/update-translations.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-#
-
-ant clean
-find . -name '*.java' -o -name '*.java.in' > translation.filelist
-xgettext -k -kGT.tr -F -f translation.filelist -L Java -o org/postgresql/translation/messages.pot
-rm translation.filelist
-
-for i in org/postgresql/translation/*.po
-do
- msgmerge -U $i org/postgresql/translation/messages.pot
- polang=`basename $i .po`
- msgfmt -j -l $polang -r org.postgresql.translation.messages -d . $i
-done
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git
More information about the pkg-java-commits
mailing list