|
Re: [enhydra] database connection problem: msg#00005java.enhydra.general
Hi Thomas, It definitely looks like there's a bug in the JDBC driver - calling the isClosed() method really shouldn't ever affect the connection, but it looks like it might be closing or even corrupting the connection itself when you call it as a first step (and who knows, it might also cause problems under other conditions). The most direct solution would be to talk to the author(s) of the JDBC driver, supply them with the test code that demostrates the problem, and see if you can get them to fix the bug within a reasonable timeframe. Barring that, you might be able to patch Enhdyra itself in order to get around the problem, but I'm not sure which classes use the isClosed() method in situations where your driver would error out. You'd have to get a copy of the DODS source code for the version of DODS you're using, and start patching classes - if you're lucky, you might be able to get away with patching only the com.lutris.appserver.server.sql.standard.StandardConnectionAllocator class (which is where I found that 'Inactiv connection closed' message). Alternatively, if you're running on Windows and have an ODBC driver for the SapDB, you could try using the JDBC-ODBC driver that comes with the Java 2 SDK as a temporary solution. Regards, Mike. ----- Original Message ----- From: "Thomas Schwarzpaul" <Thomas.Schwarzpaul@xxxxxxxxxxxxxxxxxxx> To: <enhydra@xxxxxxxxxxxxx> Sent: Friday, April 15, 2005 3:15 AM Subject: Re: [enhydra] database connection problem Hi Mike, yes, i can successfully perform SQL queries. Here's the code: Class.forName("com.sap.dbtech.jdbc.DriverSapDB"); String url = "jdbc:sapdb://pchrz-trinity/HRZSHOP"; Connection con = DriverManager.getConnection(url, user, password); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT COUNT(*) ANZAHL FROM BENUTZER"); while (rs.next()) { int anzahl = rs.getInt("ANZAHL"); java.lang.System.out.println("*** ANZAHL: " + anzahl + " ***"); } System.out.println(con.isClosed()); But, when first check the connection, like this: Class.forName("com.sap.dbtech.jdbc.DriverSapDB"); String url = "jdbc:sapdb://pchrz-trinity/HRZSHOP"; Connection con = DriverManager.getConnection(url, user, password); System.out.println(con.isClosed()); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT COUNT(*) ANZAHL FROM BENUTZER"); while (rs.next()) { int anzahl = rs.getInt("ANZAHL"); java.lang.System.out.println("*** ANZAHL: " + anzahl + " ***"); } an exception is thrown. com.sap.dbtech.jdbc.exceptions.ObjectIsClosedException: SAP DBTech JDBC: Object is closed. at com.sap.dbtech.jdbc.ConnectionSapDB.assertOpen(ConnectionSapDB.java:106) at com.sap.dbtech.jdbc.ConnectionSapDB.createStatement(ConnectionSapDB.java:192) seems to be a driver problem. Thomas yes, i can successfully perform SQL queries, when I check Am Donnerstag, 14. April 2005 20:37 schrieben Sie: Hi Thomas, --------------------------------------------------------------------------------
-- You receive this message as a subscriber of the enhydra@xxxxxxxxxxxxx mailing list. To unsubscribe: mailto:enhydra-unsubscribe@xxxxxxxxxxxxx For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [enhydra] Undeploy Error ?, Slobodan Vujasinovic |
|---|---|
| Next by Date: | Re: [enhydra] Problem with aggregate function made via DODS, Daniel |
| Previous by Thread: | Re: [enhydra] database connection problem, Thomas Schwarzpaul |
| Next by Thread: | [enhydra] Undeploy Error ?, NGUYEN Hong Thai |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |