cancel
Showing results for 
Search instead for 
Did you mean: 

Why am I getting "Invalid ODBC handle" when using sajdbc4?

0 Kudos
5,823

Hello,

I cannot get sajdbc4 to work under Linux when trying to connect to a High Availability server system. I have successfully configured it for use with WildFly under Windows but when I try to recreate this same setup under Ubuntu 16.0.4 I get the following error as soon as I try to establish a connection to SQL Anywhere 17:

java.sql.SQLException: Invalid ODBC handle

java -XshowSettings:properties

shows:

java.library.path = /usr/java/packages/lib/amd64
        /usr/lib64
        /lib64
        /lib
        /usr/lib

I have placed in /lib64 the following files and created symbolic links as described in the documentation:

drwxr-xr-x  2 root   root   4.0K Apr  9 23:35 .
drwxr-xr-x 23 root   root   4.0K Apr  8 18:07 ..
lrwxrwxrwx  1 root   root     32 Jan 15 02:51 ld-linux-x86-64.so.2 -> /lib/x86_64-linux-gnu/ld-2.23.so
lrwxrwxrwx  1 root   root     17 Apr  9 23:33 libdbicu17_r.so -> libdbicu17_r.so.1
-rwxrwxrwx  1 wizard wizard 1.7M Apr  9 22:03 libdbicu17_r.so.1
lrwxrwxrwx  1 root   root     17 Apr  9 23:33 libdbicudt17.so -> libdbicudt17.so.1
-rwxrwxrwx  1 wizard wizard 4.1M Apr  9 22:03 libdbicudt17.so.1
lrwxrwxrwx  1 root   root     16 Apr  9 23:34 libdbjdbc17.so -> libdbjdbc17.so.1
-rwxrwxrwx  1 wizard wizard 2.7M Apr  9 22:03 libdbjdbc17.so.1
lrwxrwxrwx  1 root   root     17 Apr  9 23:34 libdbrsa17_r.so -> libdbrsa17_r.so.1
-rwxrwxrwx  1 wizard wizard 2.3M Apr  9 22:03 libdbrsa17_r.so.1
lrwxrwxrwx  1 root   root     19 Apr  9 23:35 libdbtasks17_r.so -> libdbtasks17_r.so.1
-rwxrwxrwx  1 wizard wizard 180K Apr  9 22:03 libdbtasks17_r.so.1

My Connection String looks like:

jdbc:sqlanywhere:Host=[IPAddress]:[Port];DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1;ServerName=[AlternateServerName]

Can someone help me understand what is wrong so I can use sajdbc4 under Linux?

Thank you.

View Entire Topic

Hi Volker,

Well, it was the language file. Under a Linux installation of SQL Anywhere 17 the language files are not found along with the .so files and a web posting I saw (somewhere else) suggested that this was optional under Linux! That caused me to not proactively go looking for the language files. But since I had exhausted all other known possibilities I went looking, found them and adding one fixed the problem. I note that Sybase/SAP failed to improve the error message as was suggested might be done in the link you supplied.

Also, I don't know how to convert your reply to the answer! If you can explain how I'll do so!

Henrique5
Discoverer
0 Kudos
where the language file should be included?