Hello Alexander,
> > java.sql.SQLException: No suitable driver
> > at java.sql.DriverManager.getDriver(DriverManager.java:243)
>
> that exception usually says something is wrong with the classpath
> (sapdbc.jar isn't included correctly). Can you check what class
> path the applications throwing that exception are using?
By now I included my test code into my enhydra application. Using the latest
version of the jdbc driver works fine with old enhydra and the old dods,
however the above exception is still thrown even though a db connection is
established using dods stuff.
Classpath of the app should be right, otherwise dods stuff should not work.
I put the code in an extra program like this, using the following classpath.
Still the above exception is thrown.
CLASSPATH = /home/thomas/test:/home/thomas/test/sapdbc.jar
/home/thomas/test is the directory of the class Test
import java.sql.*;
public class Test{
public static void main(String args[]){
try{
System.out.println("TEST");
Class.forName("com.sap.dbtech.jdbc.DriverSapDB");
Driver driver =
DriverManager.getDriver("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 + " ***");
}
} catch (Exception e){
e.printStackTrace();
}
}
}
> Regards
> Alexander Schr�der
>
> > -----Original Message-----
> > From: Thomas Schwarzpaul
> > [mailto:[EMAIL PROTECTED]
> > Sent: Friday, April 22, 2005 10:41 AM
> > To: Schroeder, Alexander; [email protected]
> > Subject: Re: problem with sapdb jdbc driver
> >
> > Hello Alexander,
> >
> > the latest version of the MAXDB jdbc driver seems to work
> > with the old version
> > of DODS i'm currently using.
> > Running it with the new version still causes the problem.
> >
> > However i don't understand why the driver seems to work with
> > the old version
> > of DODS and doesn't in my little test programm.
> > I'd have expected DODS to throw the same excpetion.
> >
> > java -jar sapdbc.jar -V still works
> >
> > package com.sap.dbtech.jdbc, MaxDB JDBC Driver, MySQL MaxDB,
> > 7.6.0 Build
> > 000-000-003-360
> >
> > and still the following exception is thrown
> >
> > java.sql.SQLException: No suitable driver
> > at java.sql.DriverManager.getDriver(DriverManager.java:243)
> >
> > Am Donnerstag, 21. April 2005 12:50 schrieb Schroeder, Alexander:
> > > Hmmm ... no, that should not be necessary. Does 'java -jar
> >
> > sapdbc.jar -V'
> >
> > > still work also with the new driver? (Java sometimes just
> >
> > ignores corrupted
> >
> > > archives in the class path, perhaps smth went wrong when
> >
> > you did download
> >
> > > the new driver).
> > >
> > > Regards
> > > Alexander Schr�der
> > >
> > > > -----Original Message-----
> > > > From: Thomas Schwarzpaul
> > > > [mailto:[EMAIL PROTECTED]
> > > > Sent: Thursday, April 21, 2005 11:06 AM
> > > > To: Schroeder, Alexander; [email protected]
> > > > Subject: Re: problem with sapdb jdbc driver
> > > >
> > > > Hi Alexander,
> > > >
> > > > just replaced the driver. Now the following exception is thrown:
> > > >
> > > > java.sql.SQLException: No suitable driver
> > > > at
> >
> > java.sql.DriverManager.getDriver(DriverManager.java:243)
> >
> > > > Do i have to change
> > > > Class.forName("com.sap.dbtech.jdbc.DriverSapDB") ?
> > > >
> > > > Regards
> > > > Thomas
> > > >
> > > > Am Donnerstag, 21. April 2005 10:32 schrieb Schroeder, Alexander:
> > > > > Hello Thomas,
> > > > >
> > > > > could you try the latest and greatest MaxDB JDBC driver? It
> > > >
> > > > should work
> > > >
> > > > > seamlessly, as it is backward compatible.
> > > > >
> > > > > Regards
> > > > > Alexander Schr�der
> > > > > SAP DB, SAP Labs Berlin
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Thomas Schwarzpaul
> > > > > > [mailto:[EMAIL PROTECTED]
> > > > > > Sent: Thursday, April 21, 2005 10:27 AM
> > > > > > To: [email protected]
> > > > > > Subject: Re: problem with sapdb jdbc driver
> > > > > >
> > > > > > Hello Alexander,
> > > > > >
> > > > > > forgot to mention this. We're running sapdb 7.3. I downloaded
> > > > > > the latest
> > > > > > driver for 7.3 from the sapdb website.
> > > > > >
> > > > > > java -jar sapdbc.jar -V says the following:
> > > > > >
> > > > > >
> > > > > > package com.sap.dbtech.jdbc, SAP DB JDBC Driver, SAP AG,
> > > > > > 7.4.4 Build
> > > > > > 003-000-002-502
> > > > > >
> > > > > > Is this really a driver for 7.3?
> > > > > >
> > > > > > The problem also occurs with earlier version of the driver.
> > > > > >
> > > > > > package com.sap.dbtech.jdbc, SAP DB JDBC Driver, SAP AG,
> > > > > > 7.4.4 Build
> > > > > > 001-000-156-754
> > > > > >
> > > > > > Regards
> > > > > > Thomas
> > > > > >
> > > > > > Am Donnerstag, 21. April 2005 10:12 schrieb
> >
> > Schroeder, Alexander:
> > > > > > > Hello Thomas,
> > > > > > >
> > > > > > > can you tell me which version of the JDBC driver (java -jar
> > > > > >
> > > > > > sapdbc.jar -V)
> > > > > >
> > > > > > > you use?
> > > > > > >
> > > > > > > Regards
> > > > > > > Alexander Schr�der
> > > > > > > SAP DB, SAP Labs Berlin
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: Thomas Schwarzpaul
> > > > > > > > [mailto:[EMAIL PROTECTED]
> > > > > > > > Sent: Thursday, April 21, 2005 9:57 AM
> > > > > > > > To: [email protected]
> > > > > > > > Subject: problem with sapdb jdbc driver
> > > > > > > >
> > > > > > > > Hello,
> > > > > > > >
> > > > > > > > i'm facing the following problem:
> > > > > > > >
> > > > > > > > When setting up a database connection and performing sql
> > > > > > > > queries like this:
> > > > > > > >
> > > > > > > > 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");
> > > > > > > > System.out.println("*** ANZAHL: " + anzahl + " ***");
> > > > > > > > }
> > > > > > > > System.out.println(con.isClosed());
> > > > > > > >
> > > > > > > > everything works fine, but when i call isClosed() before
> > > > > > > > executing the sql
> > > > > > > > query an exception is thrown:
> > > > > > > >
> > > > > > > >
> > > > > > > > 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");
> > > > > > > > System.out.println("*** ANZAHL: " + anzahl + " ***");
> > > > > > > > }
> >
> > 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(Connection
> >
> > > > > > > > SapDB.java:192)
> > > > > > > >
> > > > > > > > actually this probelm occured using DODS to access our
> > > > > > > > database. DODS first
> > > > > > > > checks wether or not a databaseconnection is open. The
> > > > > > > > isClosed method always
> > > > > > > > returns true and no connection is established.
> >
> > For debugging
> >
> > > > > > > > i wrote the
> > > > > > > > above test programm and it seems that this not a
> >
> > DODS problem.
> >
> > > > > > > > Any help is greatly appreciated.
> > > > > > > >
> > > > > > > > Thomas Schwarzpaul
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > MaxDB Discussion Mailing List
> > > > > > > > For list archives: http://lists.mysql.com/maxdb
> > > > > > > > To unsubscribe:
> >
> > http://lists.mysql.com/[EMAIL PROTECTED]
> >
> > > > > > --
> > > > > > MaxDB Discussion Mailing List
> > > > > > For list archives: http://lists.mysql.com/maxdb
> > > > > > To unsubscribe:
> > > > > > http://lists.mysql.com/[EMAIL PROTECTED]
--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]