on 2014 Mar 17 6:38 AM
Hi all,
I am currently trying to do a simple test with:
on Windows 7 64-bit
I'm following: http://dcx.sybase.com/index.html#1201/en/dbprogramming/jdbc-url-driver.html
The error message I am getting is: SQLAnywhereAccessPoint: java.sql.SQLException: No suitable driver found for jdbc:ianywhere:dsn=MY_DSN
I have verified the DSN with dbdsn -ls.
I have placed: sajdbc4.jar and dbjdbc12.dll into C:Program FilesApache Software FoundationTomcat 7.0lib
I have added sajdbc4.jar to the Eclipse project Build Path.
When starting Tomcat, the dlls become locked.
I've tried:
conn = DriverManager.getConnection("jdbc:ianywhere:dsn=MSV_TEST_Central:uid=dba:pwd=sql"); conn = DriverManager.getConnection(driverConnectionURL, connDetails.getUsername(), connDetails.getPassword());
But I can't get it working.
Any ideas?
Thanks,
Shao
There appears to be a bug in Tomcat which requires even JDBC4 drivers to need to register the driver. There is a similar discussion on this topic involving a mySQL JDBC4 driver.
Adding the following prior to the connection attempt should workaround the issue:
DriverManager.registerDriver( (Driver) Class.forName( "sybase.jdbc4.sqlanywhere.IDriver").newInstance() );
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your URL header is incorrect. For sajdbc4.jar you need to use jdbc:sqlanywhere not jdbc:ianywhere. During the entire exchange above, Breck in particular has pointed to the sqlanywhere versus ianywhere distinction but all of you debug messages still say ianywhere. Please make sure you change the URL header to jdbc:sqlanywhere and properly rebuild your application.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Khamis. Sorry - a lot of the debug messages showing the connections get the driverConnectionURL variable which gets retrieved from the database which is wrong. But the code does use jdbc:sqlanywhere (as shown in the error) as I override it. I'll get it fixed in the database - I had changed it originally from it's original value of jdbc:odbc as from the Sybase docs it could be confused with something else.
User | Count |
---|---|
67 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.