Using SQL Anywhere native driver

Hi

I am trying to setup the native driver for SQL Anywhere. Until now, we use(d) the Java driver jconn3.jar and for version 16 jconn4.jar. This works as intended with
URL = jdbc:sybase:Tds:localhost:2638?ServiceName=&CHARSET=utf8
Driver = com.sybase.jdbc4.jdbc.SybDriver

Using the native driver (sajdbc4.jar) needs setting of the java.library.path to point to compiled library files, as described here: http://dcx.sybase.com/index.html#sa160/ … eploy.html

I am having some troubles to add a library path, either in servoy_server.sh (can’t get it to start without error) and don’t know where to set it for the Servoy Developer.

I am using following
URL = jdbc:sqlanywhere:DSN=;LINKS=tcpip(host=localhost;port=2638)
Driver = sybase.jdbc4.sqlanywhere.IDriver

Has anyone successfully configured the native driver for SQL Anywhere or some hints how to get it to work?

OS X 10.10.5
Java 1.8.0_60
Servoy 7.4.4

Thanks in advance
Robert

Robert,

In servoy_server.sh adding
-Djava.library.path=/path/to/libdir
to the command should work.
Another possibility is adding to the PATH variable.

What is the error you uget when starting servoy_server?

Rob

Hi Rob

Nice to hear from you again (Hello Again ;-) You are back at Servoy, so it seems?

I have opened a thread at the SQL Anywhere Forum. If you have access please see the forum entry there:
http://sqlanywhere-forum.sap.com/questi … ta-modeler

Connecting to the database via the native jdbc driver is not a Servoy problem. But may be someone has found a way to natively connect to SQL Anywhere instead of connecting via the Tds protocol (which is the native protocol of Adaptive Server Enterprise).
Where you ever able to connect natively via sajdbc4.jar, i. e. having following parameters:
URL: jdbc:sqlanywhere:DSN=Hades;LINKS=tcpip(host=localhost;port=2638)
Driver: sybase.jdbc4.sqlanywhere.IDriver

Regards,

rgansevles:
Robert,

In servoy_server.sh adding
-Djava.library.path=/path/to/libdir
to the command should work.
Another possibility is adding to the PATH variable.

What is the error you uget when starting servoy_server?

Rob

I am trying to setup the native driver for SQL Anywhere. Until now, we use(d) the Java driver jconn3.jar and for version 16 jconn4.jar. This works as intended with
URL = jdbc:sybase:Tds:localhost:2638?ServiceName=&CHARSET=utf8
Driver = com.sybase.jdbc4.jdbc.SybDriver

I’m using Servoy 7.4.5 and Sybase SQL Anywhere 16 and I just tried upgrading my jdbc driver from jdbc3 (jconn3.jar) to jdbc4 (jconn4.jar) and when I started up a Servoy Smart Client app I immediately got this error:

EXCEPTION OBJECT: com.servoy.j2db.dataprocessing.DataException: SQL Anywhere Error -685: Resource governor for 'prepared statements' exceeded

I went back to jdbc3 and the app worked fine again so I’ve left it like that. Did you ever see that error and if so do you remember how you got around it?

Thanks a lot.

Hi Adrian

On what OS are you running SQL Anywhere? Right click on the database in Sybase Central/SQL Central (SQLA 17) and select menu Options. You get the dialog Database Options. There you have a parameter called max_statement_count. Default value is 50 (setting is per database). Increase it for example to 200 (you have to test what works good with your application) and the governor error should be gone. This was change introduced in SQL Anywhere 16, also valid in SQL Anywhere 17. By the way, you noticed that SQL Anywhere 17 is available? May be it’s better to move on to this version, if there are no specific reasons to stay with version 16.

Hope this helps.
Robert

PS: There is also a (big) change with Remote Servers to be aware if you use them.

Thank you Robert. That got rid of the error. Now I’m getting this one hundreds of times on startup:

com.servoy.j2db.dataprocessing.DataException: JZ0TC: Attempted conversion between an illegal pair of types.

Did you ever run into that?

Adrian, do you use Remoter Server?

amcgilly:
Thank you Robert. That got rid of the error. Now I’m getting this one hundreds of times on startup:

com.servoy.j2db.dataprocessing.DataException: JZ0TC: Attempted conversion between an illegal pair of types.

Did you ever run into that?

No, I do not use Remote Server.

Hi Adrian

Yes, I also run into that but I vaguely remember I used a data type which does not exist in Java, i. e. the JDBC driver. Unfortunately I can’t remember what data type it was.

Robert

huber:
Adrian, do you use Remoter Server?

amcgilly:
Thank you Robert. That got rid of the error. Now I’m getting this one hundreds of times on startup:

com.servoy.j2db.dataprocessing.DataException: JZ0TC: Attempted conversion between an illegal pair of types.

Did you ever run into that?