summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc
AgeCommit message (Collapse)Author
2001-08-17This patch updates some comments in the DatabaseMetaData classes toBruce Momjian
reflect a mail thread that discussed our conformance (or lack thereof) to the SQL92 spec. Barry Lind
2001-08-17Thanks for your feedback (and patience). Enclosed is my thirdBruce Momjian
attempt at a patch to 7.1.2 to support Array. [I think I've solved the mangled patch problem. Hotmail seems to try to format the text file, so gzipping it should solve this problem.] In this patch I've incorporated Barry's feedback. Specifically: 1) OIDs are no longer hard-coded into Array.java. In order to support this change I added a getOID(String) method to Field.java which receives a PostgreSQL field type and returns a value from java.sql.Types. I couldn't get away from using OIDs altogether because the JDBC spec for Array specifies that some methods return a ResultSet. This requires I construct Field objects, which means I need OIDs. At least this approach doesn't hard code these values. A Hashtable cache has been added to Field so that an SQL lookup isn't necessary (following the model already in Field.java). 2) Rewired the base formatting code in ResultSet.java to use 'to' methods, which are then exposed as static methods in ResultSet. These methods are used in Array to format the data without duplications in the code. 3) Artifact call to first() in ResultSet.getArray() removed. Greg Zoller
2001-08-17Attached is the patch requested by Tom Lane (see below). ItBruce Momjian
includes two changes in the JDBC driver: 1) When connected to a backend >= 7.2: use obj_description() and col_description() instead of direct access to pg_description. 2) In DatabaseMetaData.getTables()/getColumns()/getProcedures(): when there is no comment on the object, return null in the REMARKS column of the ResultSet, instead of the default string "no remarks". Change 2 first appeared as a side-effect of change 1, but it is actually more compliant with the JDBC spec: "String object containing an explanatory comment on the table/column/procedure, which may be null". The default string "no remarks" was strictly speaking incorrect, as it could not be distinguished from a real user comment "no remarks". So I removed the default string completely. Change 2 might break existing code that doesn't follow the JDBC spec and isn't prepared to handle a null in the REMARKS column of getTables()/getColumns()/getProcedures. Patch tested with jdbc2 against both a 7.1 and a CVS tip backend. I did not have a jdbc1 environment to build and test with, but since the touched code is identical in jdbc1 and jdbc2 I don't foresee any problems. Regards, Ren? Pijlman
2001-08-10Attached is a patch to remove some redundant code in the JDBC driver.Bruce Momjian
* Merges identical code from org.postgresql.jdbc[1|2].Statement into org.postgresql.Statement. * Moves escapeSQL() method from Connection to Statement (the only place it's used) * Minor cleanup of the new isolation level stuff. * Minor cleanup of version string handling. Anders Bengtsson
2001-08-07I think you replaced too many things with put(...Bruce Momjian
Here is a context diff from latest cvs And I see why you couldn't apply the last diff, the setCatalog diff has been backed out, that was causing the compile problem in the first place. This following one needs to be applied to allow the current cvs to compile Dave Cramer
2001-08-04Compile fix for jdbc1.Bruce Momjian
2001-08-04Attached is a patch that does the following:Bruce Momjian
1) improves performance of commit/rollback by reducing number of round trips to the server 2) uses 7.1 functionality for setting the transaction isolation level 3) backs out a patch from 11 days ago because that code failed to compile under jdk1.1 Details: 1) The old code was doing the following for each commit: commit begin set transaction isolation level xxx thus a call to commit was performing three round trips to the database. The new code does this in one round trip as: commit; begin; set transaction isolation level xxx In a simple test program that performs 1000 transactions (where each transaction does one simple select inside that transaction) has the following before and after timings: Client and Server on same machine old new --- --- 1.877sec 1.405sec 25.1% improvement Client and Server on different machines old new --- --- 4.184sec 2.927sec 34.3% improvement (all timings are an average of four different runs) 2) The driver was using 'set transaction isolation level xxx' at the begining of each transaction, instead of using the new 7.1 syntax of 'set session characteristics as transaction isolation level xxx' which only needs to be done once instead of for each transaction. This is done conditionally (i.e. if server is 7.0 or older do the old behaviour, else do the new behaviour) to not break backward compatibility. This also required the movement of some code to check/test database version numbers from the DatabaseMetaData object to the Connection object. 3) Finally while testing, I discovered that the code that was checked in 11 days ago actually didn't compile. The code in the patch for Connection.setCatalog() used Properties.setProperty() which only exists in JDK1.2 or higher. Thus compiling the JDBC1 driver failed as this method doesn't exist. Thus I backed out that patch. Barry Lind
2001-07-30This patch merges the identical methods from the JDBC1 and JDBC2Bruce Momjian
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
2001-07-21Move EncodingTest.java file.Bruce Momjian
2001-07-21DatabaseMetaData.getColumns() doesn't appear to get the defaultBruce Momjian
value for each column. Here is a context diff of CVS which should fix it. Jason Davies
2001-07-21Great, here is a context diff of CVS for implementing the get/setCatalog methodsBruce Momjian
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
2001-07-21JDBC encoding additions.Bruce Momjian
Here's a patch against the current CVS. The changes from the previous patch are mostly related to the changed interface for PG_Stream. Anders Bengtsson
2001-07-15The attached patch fixes problems with the JDBC driver handling longBruce Momjian
null terminated strings. The FE/BE protocol sends in some cases null terminated strings to the client. The docs for the FE/BE protocol state that there is no limit on the size of a null terminated string sent to the client and a client should be coded using an expanding buffer to deal with large strings. The old code did not do this and gave an error if a null terminated string was greater than either 4 or 8K. It appears that with the advent of TOAST very long SQL statements are becoming more common, and apparently some error messages from the backend include the SQL statement thus easily exceeding the 8K limit in the old code. In fixing I also cleaned up some calls in the JDBC fastpath code that were not doing character set conversion under multibyte, and removed some methods that were no longer needed. I also removed a potential threading problem with a shared variable that was being used in Connection.java. Thanks to Steve Wampler for discovering the problem and sending the initial diffs that were the basis of this patch. thanks, --Barry
2001-07-12Add missing encode file.Bruce Momjian
2001-07-09German message localization for JDBCPeter Eisentraut
2001-07-09postgresql.badint property name was probably meant to bePeter Eisentraut
postgresql.res.badint, since that's the name in the properties file.
2001-07-08Implement DatabaseMetaData.getCatalogs()Peter Eisentraut
2001-07-08Bring DatabaseMetaData feature tests up to date:Peter Eisentraut
* NULLs are sorted differently in 7.2 * table correlation names are supported * GROUP BY, ORDER BY unrelated is supported since 6.4 * ESCAPE/LIKE only supported since 7.1 * outer joins only since 7.1 * preferred term for procedure is "function" * preferred term for catalog is "database" * supports SELECT for UPDATE since 6.5 * supports subqueries * supports UNION; supports UNION ALL since 7.1 * update some of the max lengths to match reality * rearrange some functions to match the order in the spec for easier maintenance
2001-07-07Sync with jdbc2, remove gratuitous white space differences.Peter Eisentraut
2001-07-06Resolve a number of oddities in the Java build. First, remove the weirdPeter Eisentraut
redirections between the build files, which didn't work completely. Now you just go to the directory of your choice and run make. Clean up the build files to have a logical order, fix the unnecessary rebuilds, prevent the deleting targets from removing files they're not responsible for. Ant 1.3 does not have a bug. It deletes directories just fine if you follow the documentation.
2001-07-06Terminate message doesn't have a trailing zero byte.Peter Eisentraut
2001-07-04Remove ConnectionHook.java. No longer used, bad code.Bruce Momjian
2001-07-04The attached patch removes some old and dead code (and some relatedBruce Momjian
misleading comments) from the PG_Stream class. Anders Bengtsson
2001-07-04This patch moves the setting of the timezone on the SimpleDateFormatBruce Momjian
object inside the initialization section instead of doing it everytime the setTimestamp method is called. Thanks to Dave Harkness for this suggestion. Barry Lind
2001-07-04Attached is a patch to remove the ConnectionHook functionality and thusBruce Momjian
the JDK 1.3 dependency. For a further explanation see my posting to the JDBC list on Friday, explaining why this is being done. Barry Lind
2001-06-29SimpleDateFormat performance improvement, thread-safe.Bruce Momjian
Barry Lind
2001-06-25High memory usageBruce Momjian
Here is a patch which inspired by Michael Stephens that should work Dave Cramer
2001-06-11 Got two patches that were found by folks on the Castor list, that we'd like toBruce Momjian
submit. These were done for the jdbc2 driver. The first one is for support of the Types.BIT in the PreparedStatement class. The following lines need to be inserted in the switch statment, at around line 530: (Prepared statment, line 554, before the default: switch case Types.BIT: if (x instanceof Boolean) { set(parameterIndex, ((Boolean)x).booleanValue() ? "TRUE" : "FALSE"); } else { throw new PSQLException("postgresql.prep.type"); } break; The second one is dealing with blobs, inserted in PreparedStatemant.java (After previous patch line, 558): case Types.BINARY: case Types.VARBINARY: setObject(parameterIndex,x); break; and in ResultSet.java (Around line 857): case Types.BINARY: case Types.VARBINARY: return getBytes(columnIndex); Ned Wolpert <ned.wolpert@knowledgenet.com>
2001-06-07Document and work around ANT bug that prevents directory deletion.Bruce Momjian
2001-06-07This adds unary plus capability. No grammar changes, per Tom's request.Bruce Momjian
Marko Kreen
2001-06-06Add large object finalization cleanup to the proper java file.Bruce Momjian
2001-06-06Remove large object finalize code. Compile error.Bruce Momjian
2001-06-04protected void finalize() {Bruce Momjian
close(); } in LargeObject.java so that the db resources are released when it is garbage collected or am I missing something? Philip Crotwell
2001-06-01The following patch for JDBC fixes an issue with jdbc running on aBruce Momjian
non-multibyte database loosing 8bit characters. This patch will cause the jdbc driver to ignore the encoding reported by the database when multibyte isn't enabled and use the JVM default in that case. Barry Lind
2001-05-30I just got bitten by this too. I use type timestamp in theBruce Momjian
database, and often need the latest timestamp, but want to format it as a date. With 7.0.x, I just select ts from foo order by ts desc limit 1 and in java: d = res.getDate(1); but this fails everywhere in my code now :( http://java.sun.com/j2se/1.3/docs/guide/jdbc/spec/jdbc-spec.frame7.html says The ResultSet.getXXX methods will attempt to convert whatever SQL type was returned by the database to whatever Java type is returned by the getXXX method. Palle Girgensohn
2001-05-30Fix for Druid. We did not support some PROCEDURE queries.Bruce Momjian
Dave Cramer
2001-05-28Attached is a patch to fix the problem Thomas mentions below. The JDBCBruce Momjian
driver now correctly handles timezones that are offset fractional hours from GMT (ie. -06:30). Barry Lind
2001-05-25Mention failure of ANT to delete directories on clean.Bruce Momjian
2001-05-25The following patch corrects a make install problem when buildingBruce Momjian
under Cygwin. The root cause of this problem is that (Sun) java is a native Win32 app and hence does not understand Cygwin Posix style paths. The solution is to use Cygwin's cygpath utility to convert the Posix style JDBC installation directory path into a Win32 one before invoking ant. I'm not sure if my patch is the best way to correct this issue but my goal was to confine the Cygwin specific constructs to Jason Tishler
2001-05-24There are a number of changes. The main ones are:Bruce Momjian
return oid on insert handle all primitive data types handle single quotes and newlines in Strings handle null variables deal with non public and final variables (not very well, though) Ken K
2001-05-23Fix ANT for *.properties files.Bruce Momjian
2001-05-23Fix ANT so it only has '*.class' files, not the 'tags' file.Bruce Momjian
2001-05-22Back out timezone fix. Not needed in jdbc1.Bruce Momjian
2001-05-19Prevent ANT from recreating the JAR files just because theBruce Momjian
errors.properties files were being copied.
2001-05-17Fix pg_index statistics query to join proper relation.Bruce Momjian
2001-05-17Included is a patch that fixes a bug introduced in the lastest versionBruce Momjian
(1.22) of interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java. That change removed a line that set the variable s to the value of the stringbuffer. This fix changes the following if checks to check the length of the stringbuffer instead of s, since s no longer contains the string the if conditions are expecting. The bug manifests itself in getTimestamp() loosing the timezone information of timestamps selected from the database, thereby causing the time to be incorrect. Barry Lind
2001-05-17Cleanup of backpatch of jdbc2 improvements to jdbc1:Bruce Momjian
Here's what I came up with. The biggest difference api between JDK1.x and later versions is the support for collections. The problem was with the Vector class; in jdk1.x there is no method called add, so I changed the calls to addElement. Also no addAll, so I rewrote the method slightly to not require addAll. While reviewing this I notices some System.out.println statements that weren't commented out. So I commented them out in both versions. The upshot of all of this is that I have clean compile, but no idea if the code works ;( Dave Cramer
2001-05-17Fix 'make clean' with jdbc and ant by using filesets.Bruce Momjian
2001-05-17Mark column as not used.Bruce Momjian
2001-05-16Fix for HASH for index lookups in ODBC.Bruce Momjian