cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Native database connection (JDBC driver)

huber1
Participant
5,855

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

View Entire Topic
Former Member

Your use of DSN= is incorrect. That should probably be DBN= given you are specifying a database name.

If you have a working ODBC DataSource (DSN) you can use DSN= to pick that up (and all the settings saved in the ODBC.ini registry under that will get picked up as well; ie. with that you may not need anything else)

If Links= is giving you a problem you can switch to HOST= instead now.

huber1
Participant
0 Likes

Thanks a lot. Seems logical. I changed it to DB=<database name="">. Also changed LINKS= to HOST= (seems also more logical to me).

I get the following error when testing the connection: Test failed: Driver class not found. Verify the Driver location.

When trying to establish a connection in the Eclipse IDE and entering the Driver (text into the the field), the Driver text gets read, indicating something is wrong. Could it be that sybase.jdbc4.sqlanywhere.IDriver ist not the correct description?

huber1
Participant
0 Likes

Looking again at your answer, I am not sure any more what you mean by your last sentence (If Links= is giving ...?

As the text part is: Links=tcpip(host=<ip-address>;port=2638) you mean to write it like this: Host=tcpip(host=<ip-address>;port=2638)?

That does not seem very logical so I mustn't have understood what you meant.

reimer_pods
Participant
0 Likes

Did you really use DB as a keyword or was that a typo? A Nick stated, DBN would be the correct identifier.

VolkerBarth
Contributor
0 Likes

No, look at Nick's link for the HOST connection parameter, HOST implies TCP/IP and specifies the machine name or IP address and optionally the port, such as

  • ...;HOST=MyMachineName;...
  • ...;HOST=MyIpAddress;...
  • ...;HOST=MyIpAddress:2638;...
huber1
Participant
0 Likes

@Reimer: Sorry, DB was I typo, I used DBN. And thanks for looking very closely.