I connect with our IDE (Servoy, an Eclipse plug-in) to SQL Anywhere 12.0.1 using the jconn3.jar driver. Among the JDBC parameters, the URL and Driver are set to: URL: jdbc:sybase:Tds:localhost:2638?ServiceName=dbName&CHARSET=utf8 Driver: com.sybase.jdbc3.jdbc.SybDriver
This works fine (for years already :-)
Now i would like to use the sajdbc4.jar driver and set the 2 above mentioned parameters to: URL: jdbc:sqlanywhere:localhost:2638?ServiceName=dbName&CHARSET=utf8 Driver: sybase.jdbc4.sqlanywhere.IDriver
but get the error message (when I try to save the newly defined Database Server, i. e. JDBC Adaptor): Save Failed no dbjdbc12 in Java.library.path
I am on OS X 10.7.5 and Java 1.6.0_35
It's true that there is no dbjdbc12.jar in the library path, because in OS X it's called libdbjdbc12.dylib as described here: http://dcx.sybase.com/index.html#1201/en/dbprogramming/jdbc-driver-deploy.html But may be the error message is not adjusted for OS X, could that be?
Has anyone an idea what the missing piece could be to connect with this (sajdbc4.jar) driver?
PS: According to the info here: http://iablog.sybase.com/hinsperg/2009/10/connecting-to-sql-anywhere-using-jdbc/ it seems to me that there is no need to specify the Driver any more, i. e. leaving the field empty?
Thanks for any help and hints, Robert
asked 04 Oct '12, 04:11
For the SAJDBC driver on Mac OS X, we search the "DYLD_LIBRARY_PATH" environment variable to locate system libraries.
Does "libdbjdbc12.dylib" exist in a path specified by this environment variable, for this Java executable seesion? (Java's "java.library.path" will include these paths by default upon JVM launch).
Alternatively, can you source sa_config.sh prior to launching the Java session?
(And yes, with JDBC 4.0, you no longer have to use the DriverManager.registerDriver() call to register the JAR file - this now happens automatically)
FWIW, AFAIK the SAJDBC driver does not use jConnect's particular syntax to specify connection information but does use the usual SQL Anywhere connection parameters, as documented here.
So I guess once your driver loading problem is solved, you will have to adapt the connection string accordingly to be able to connect.
answered 05 Oct '12, 04:05