- 25 Oct, 2001 1 commit
-
-
Bruce Momjian authored
-
- 09 Oct, 2001 1 commit
-
-
Barry Lind authored
That patch broke the ability to read data from binary cursors. --Barry Lind Modified Files: pgsql/src/interfaces/jdbc/org/postgresql/Connection.java pgsql/src/interfaces/jdbc/org/postgresql/ResultSet.java pgsql/src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Connection.java pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Connection.java pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/UpdateableResultSet.java
-
- 10 Sep, 2001 1 commit
-
-
Bruce Momjian authored
This patch does the following: - Adds binary datatype support (bytea) - Changes getXXXStream()/setXXXStream() methods to be spec compliant - Adds ability to revert to old behavior Details: Adds support for the binary type bytea. The ResultSet.getBytes() and PreparedStatement.setBytes() methods now work against columns of bytea type. This is a change in behavior from the previous code which assumed the column type was OID and thus a LargeObject. The new behavior is more complient with the JDBC spec as BLOB/CLOB are to be used for LargeObjects and the getBytes()/setBytes() methods are for the databases binary datatype (which is bytea in postgres). Changes the behavior of the getBinaryStream(), getAsciiStream(), getCharacterStream(), getUnicodeStream() and their setXXXStream() counterparts. These methos now work against either the bytea type (BinaryStream) or the text types (AsciiStream, CharacterStream, UnicodeStream). The previous behavior was that these all assumed the underlying column was of type OID and thus a LargeObject. The spec/javadoc for these methods indicate that they are for LONGVARCHAR and LONGVARBINARY datatypes, which are distinct from the BLOB/CLOB datatypes. Given that the bytea and text types support upto 1G, they are the LONGVARBINARY and LONGVARCHAR datatypes in postgres. Added support for turning off the above new functionality. Given that the changes above are not backwardly compatible (however they are more spec complient), I added the ability to revert back to the old behavior. The Connection now takes an optional parameter named 'compatible'. If the value of '7.1' is passed, the driver reverts to the 7.1 behavior. If the parameter is not passed or the value '7.2' is passed the behavior is the new behavior. The mechanism put in place can be used in the future when/if similar needs arise to change behavior. This is patterned after how Oracle does this (i.e. Oracle has a 'compatible' parameter that behaves in a similar manner). Misc fixes. Cleaned up a few things I encountered along the way. Note that in testing the patch I needed to ignore whitespace differences in order to get it to apply cleanly (i.e. patch -l -i byteapatch.diff). Also this patch introduces a new file (src/interfaces/jdbc/org/postgresql/util/PGbytea.java). Barry Lind
-
- 06 Sep, 2001 1 commit
-
-
Bruce Momjian authored
the JDBC driver. I've done this by extracting it into a new method object called QueryExecutor (should go into org/postgresql/core/) and then taking it apart into different methods in that class. A short summary: * Extracted ExecSQL() from Connection into a method object called QueryExecutor. * Moved ReceiveFields() from Connection to QueryExecutor. * Extracted parts of the original ExecSQL() method body into smaller methods on QueryExecutor. * Bug fix: The instance variable "pid" in Connection was used in two places with different meaning. Both were probably in dead code, but it's fixed anyway. Anders Bengtsson
-
- 24 Aug, 2001 1 commit
-
-
Bruce Momjian authored
This patch moves the logic that looks up TypeOid, PGTypeName, and SQLTypeName from Field to Connection. It is moved to connection since it needs to differ from the jdbc1 to jdbc2 versions and Connection already has different subclasses for the two driver versions. It also made sense to move the logic to Connection as some of the logic was already there anyway. Barry Lind
-
- 30 Jul, 2001 1 commit
-
-
Bruce Momjian authored
connection implementations (org.postgresql.jdbc[1|2].Connection) into their superclass (org.postgresql.Connection). It also changes the close() methods of Connection and PG_Stream, so that PG_Stream no longer is responsible for sending the termination packet 'X' to the backend. I figured that protocol-level stuff like that belonged in Connection more than in PG_Stream. Anders Bengtsson
-
- 21 Jul, 2001 1 commit
-
-
Bruce Momjian authored
in Connection - note: I've updated setCatalog(String catalog) from my previous diff so it checks whether it is already connected to the specified catalog. Jason Davies
-
- 13 Feb, 2001 1 commit
-
-
Peter Mount authored
Tue Feb 13 16:33:00 GMT 2001 peter@retep.org.uk - More TestCases implemented. Refined the test suite api's. - Removed need for SimpleDateFormat in ResultSet.getDate() improving performance. - Rewrote ResultSet.getTime() so that it uses JDK api's better. Tue Feb 13 10:25:00 GMT 2001 peter@retep.org.uk - Added MiscTest to hold reported problems from users. - Fixed PGMoney. - JBuilder4/JDBCExplorer now works with Money fields. Patched Field & ResultSet (lots of methods) for this one. Also changed cash/money to return type DOUBLE not DECIMAL. This broke JBuilder as zero scale BigDecimal's can't have decimal places! - When a Statement is reused, the previous ResultSet is now closed. - Removed deprecated call in ResultSet.getTime() Thu Feb 08 18:53:00 GMT 2001 peter@retep.org.uk - Changed a couple of settings in DatabaseMetaData where 7.1 now supports those features - Implemented the DatabaseMetaData TestCase. Wed Feb 07 18:06:00 GMT 2001 peter@retep.org.uk - Added comment to Connection.isClosed() explaining why we deviate from the JDBC2 specification. - Fixed bug where the Isolation Level is lost while in autocommit mode. - Fixed bug where several calls to getTransactionIsolationLevel() returned the first call's result.
-
- 31 Jan, 2001 1 commit
-
-
Peter Mount authored
- Fixed bug where Statement.setMaxRows() was a global setting. Now limited to just itself. - Changed LargeObject.read(byte[],int,int) to return the actual number of bytes read (used to be void). - LargeObject now supports InputStream's! - PreparedStatement.setBinaryStream() now works! - ResultSet.getBinaryStream() now returns an InputStream that doesn't copy the blob into memory first! - Connection.isClosed() now tests to see if the connection is still alive rather than if it thinks it's alive.
-
- 18 Jan, 2001 1 commit
-
-
Peter Mount authored
- Added new error message into errors.properties "postgresql.notsensitive" This is used by jdbc2.ResultSet when a method is called that should fetch the current value of a row from the database refreshRow() for example. - These methods no longer throw the not implemented but the new noupdate error. This is in preparation for the Updateable ResultSet support which will overide these methods by extending the existing class to implement that functionality, but needed to show something other than notimplemented: moveToCurrentRow() moveToInsertRow() rowDeleted() rowInserted() all update*() methods, except those that took the column as a String as they were already implemented to convert the String to an int. - getFetchDirection() and setFetchDirection() now throws "postgresql.notimp" as we only support one direction. The CursorResultSet will overide this when its implemented. - Created a new class under jdbc2 UpdateableResultSet which extends ResultSet and overides the relevent update methods. This allows us to implement them easily at a later date. - In jdbc2.Connection, the following methods are now implemented: createStatement(type,concurrency); getTypeMap(); setTypeMap(Map); - The JDBC2 type mapping scheme almost complete, just needs SQLInput & SQLOutput to be implemented. - Removed some Statement methods that somehow appeared in Connection. - In jdbc2.Statement() getResultSetConcurrency() getResultSetType() setResultSetConcurrency() setResultSetType() - Finally removed the old 6.5.x driver.
-
- 09 Oct, 2000 1 commit
-
-
Bruce Momjian authored
-
- 08 Oct, 2000 1 commit
-
-
Bruce Momjian authored
couldn't produce a full patch using cvs diff -c this time since I have created new files and anonymous cvs usage doesn't allow you to adds. I'm supplying the modified src/interfaces/jdbc as a tarball at : http://www.candleweb.no/~gunnar/projects/pgsql/postgres-jdbc-2000-10-05.tgz The new files that should be added are : ? org/postgresql/PGStatement.java ? org/postgresql/ObjectPool.java ? org/postgresql/ObjectPoolFactory.java There is now a global static pool of free byte arrays and used byte arrays connected to a statement object. This is the role of the new PGStatement class. Access to the global free array is synchronized, while we rely on the PG_Stream synchronization for the used array. My measurements show that the perfomance boost on this code is not quite as big as my last shot, but it is still an improvement. Maybe some of the difference is due to the new synchronization on the global array. I think I will look into choosing between on a connection level and global level. I have also started experimented with improving the performance of the various conversions. The problem here is ofcourse related handle the various encodings. One thing I found to speed up ResultSet.getInt() a lot was to do custom conversion on the byte array into int instead of going through the getString() to do the conversion. But I'm unsure if this is portable, can we assume that a digit never can be represented by more than one byte ? It works fine in my iso-latin-8859-1 environment, but what about other environments ? Maybe we could provide different ResultSet implementations depending on the encoding used or delegate some methods of the result set to an "converter class". Check the org/postgresql/jdbc2/FastResultSet.java in the tarball above to see the modified getInt() method. Regards, Gunnar
-
- 06 Jun, 2000 1 commit
-
-
Peter Mount authored
Added org/postgresql/DriverClass.java to the list of files removed by make clean (it's dynamically built) Fixed Statement, so that the update count is valid when an SQL DELETE operation is done. While fixing the update count, made it easier to get the OID of the last insert as well. Example is in example/basic.java
-
- 17 Apr, 2000 1 commit
-
-
Peter Mount authored
-
- 14 Sep, 1999 1 commit
-
-
Peter Mount authored
-
- 18 May, 1999 1 commit
-
-
Peter Mount authored
-
- 17 Jan, 1999 1 commit
-
-
Bruce Momjian authored
file containing the latest version of the JDBC driver, allowing it to be compiled and used under JDK 1.2 and later. NB: None (well almost none) of the new methods actually do anything. This release only handles getting it to compile and run. Now this is done, I'll start working on implementing the new stuff. Now this tar file replaces everything under src/interfaces/jdbc. I had to do it this way, rather than diffs, because most of the classes under the postgresql subdirectory have moved to a new directory under that one, to enable the support of the two JDBC standards. Here's a list of files in the tar file. Any file not listed here (in the postgresql directory) will have to be deleted, otherwise it could cause the driver to fail: Peter Mount
-