I am currently trying to do a simple test with:
on Windows 7 64-bit
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.
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.
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() );
answered 17 Mar '14, 14:43
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.
answered 17 Mar '14, 13:42