Using SQL Anywhere native driver

Questions and answers regarding general SQL and backend databases

Using SQL Anywhere native driver

Postby huber » Wed Oct 07, 2015 11:33 am

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=<database>&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=<database>;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 Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 516
Joined: Mon May 14, 2012 11:31 pm

Re: Using SQL Anywhere native driver

Postby rgansevles » Fri Oct 30, 2015 11:38 am

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
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Re: Using SQL Anywhere native driver

Postby huber » Fri Oct 30, 2015 1:31 pm

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 wrote: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
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 516
Joined: Mon May 14, 2012 11:31 pm

Re: Using SQL Anywhere native driver

Postby amcgilly » Sun Feb 07, 2016 3:32 am

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=<database>&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:

Code: Select all
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.
Adrian McGilly
Servoy Developer

Image
amcgilly
 
Posts: 375
Joined: Fri Dec 09, 2005 12:03 am
Location: San Francisco, CA

Re: Using SQL Anywhere native driver

Postby huber » Sun Feb 07, 2016 4:48 pm

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.
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 516
Joined: Mon May 14, 2012 11:31 pm

Re: Using SQL Anywhere native driver

Postby amcgilly » Mon Feb 08, 2016 12:23 am

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

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


Did you ever run into that?
Adrian McGilly
Servoy Developer

Image
amcgilly
 
Posts: 375
Joined: Fri Dec 09, 2005 12:03 am
Location: San Francisco, CA

Re: Using SQL Anywhere native driver

Postby huber » Mon Feb 08, 2016 12:11 pm

Adrian, do you use Remoter Server?

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

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


Did you ever run into that?
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 516
Joined: Mon May 14, 2012 11:31 pm

Re: Using SQL Anywhere native driver

Postby amcgilly » Mon Feb 08, 2016 5:44 pm

No, I do not use Remote Server.
Adrian McGilly
Servoy Developer

Image
amcgilly
 
Posts: 375
Joined: Fri Dec 09, 2005 12:03 am
Location: San Francisco, CA

Re: Using SQL Anywhere native driver

Postby huber » Mon Feb 08, 2016 8:25 pm

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 wrote:Adrian, do you use Remoter Server?

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

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


Did you ever run into that?
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 516
Joined: Mon May 14, 2012 11:31 pm


Return to SQL Databases

Who is online

Users browsing this forum: No registered users and 5 guests

cron