on ‎2016 Nov 02 11:17 AM
Hi
I am still trying to get a running (working) native JDBC database connection to a SQL Anywhere 17 database. I tried with the following URL and Driver settings on Windows Server (2008 R2) and OS X 10.11.5. On both platforms, a SQL Anywhere version 17.0.4.2129 is running. It's a standard install done by the installer (wizard). Unfortunately I have no success on making a connection on either OS.
In the database server connection fields URL and Driver, I use:
URL: jdbc:sqlanywhere:DSN=<database>;Links=tcpip(host=<ip-address>;port=2638);
Driver: sybase.jdbc4.sqlanywhere.IDriver
This settings are based on my older thread about JDBC database connections. Read thread here if appropriate: http://sqlanywhere-forum.sap.com/questions/16414/jdbc-driver-for-oracle-data-modeler
Using following settings works with jconn3.jar on both platforms:
URL: jdbc:sybase:Tds:<ip-adress>:2638?ServiceName=<database>&CHARSET=utf8
Driver: com.sybase.jdbc3.jdbc.SybDriver
What settings and driver files are other people using? Where are they located?
I still have hope to get the native connection run. The motivation for me is that as far as I understood it is a (much) faster connection.
Regards, Robert
Request clarification before answering.
Make sure the JDBC driver is in your classpath (Windows example here).
set CLASSPATH=.;path-to-sqla\\java\\sajdbc4.jar
If you are writing the JDBC app, your connection code should look something like this (add/replace whatever connection parameters you like).
Connection conn;
try
{
conn = DriverManager.getConnection("jdbc:sqlanywhere:uid=DBA;pwd=sql" );
}
catch( Exception e )
{
System.err.println( "Error! Could not connect" );
System.err.println( e.getMessage() );
conn = null;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It seems, according to this thread: https://blogs.sap.com/2014/05/02/connecting-to-sql-anywhere-using-jdbc-2/comment-page-1/#comment-352...
that the Driver name is now sap.jdbc4.sqlanywhere.IDriver
Unfortunately, it still does not work on OS X 10.11. But at least the driver can be loaded. The remaining problems may have something to do with the lib files not being accessible.
Yes, I like to. The euro message is: "no dbjdbc17 in java.library.path". I included the path to the libraries but there are somehow not accessible by the connection/driver. I now assume this is the still existing SQL Anywhere problem discussed on my earlier thread: http://sqlanywhere-forum.sap.com/questions/16414/jdbc-driver-for-oracle-data-modeler
May be it has also something to do with the naming on OS X of the libraries. The error message is for a Windows OS and should not occur on a UNIX flavor OS, should it? The equivalent to the dbjdbc17.dll and the other needed native libraries is libdbjdbc17.dylib etc.
I thought in SQL Anywhere 17 the problem is solved but it does not seem to be. Except I am missing something.
I would very much like to hear about the solution.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.