Good day for you! When i try to connect to the database with sajdbc.jar driver i get error message "no dbjdbc17 in java.library.path: /Applications/SQLAnywhere17/System/lib64:...". System.setProperty("java.library.path","/Applications/SQLAnywhere17/System/lib64/"); Connection con = DriverManager.getConnection( "jdbc:sqlanywhere:" + "UserID=dba;" + "Password=sql;" + "Host=127.0.0.1:2638;" + "ServerName=srvname;" + "DatabaseName=dbname;" ); This issue only in macos and linux. In windows the same code works perfectly. echo $SQLANY17 /Applications/SQLAnywhere17/System ls -l /Applications/SQLAnywhere17/System/lib64/ | grep libdbjdbc17 -r-xr-xr-x 1 user admin libdbjdbc17.dylib Using jconn4.jar driver give the next error: "SQL Anywhere Error -103: Invalid user ID or password 010HA: The server denied your request to use the high-availability feature. Please reconfigure your database, or do not request a high-availability session." Does anyone know how to solve this problems? |
The error message "no dbjdbc17 in java.library.path" indicates that the Java Virtual Machine (JVM) is unable to locate the SQL Anywhere JDBC driver's native library. The native library is a platform-specific dynamic link library (DLL) or shared object file that provides the driver's native method implementation. To resolve this issue, use the following command before initiating the connection to add the directory containing the native library to the JVM's library path: System.setProperty("java.library.path", "/Applications/SQLAnywhere17/System/lib64/"); You may also try passing the library path as a command-line input to the JVM when launching it: java -Djava.library.path=/Applications/SQLAnywhere17/System/lib64/ YourMainClass If you continue to receive the "Invalid user ID or password" error while using the jconn4.jar driver, it is likely that the user ID or password you are using is wrong, or that the database server is not configured to support high-availability connections. You can try connecting to the database server with the same user ID and password that you use with other tools or clients. You may also look for any error messages linked to the high-availability functionality in the database server logs. If you're still having problems, you may try contacting the SQL Anywhere JDBC driver's provider for assistance. Thank you very much for your contribution. Through this, we are better understanding how to solve this problem. Could you please tell me in which section of eclipse I could configure this? I have tried different options but it keeps throwing me the following error: An internal error occurred during: "Test connection". no dbjdbc17 in java.library.path: /Users/mandres/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
(15 Mar, 08:03)
mandres
|
If I source sa_config.sh, I am able to load the library. Otherwise, I see the behaviour that you report. There must be an environment element that must be defined - typically $SQLANY17 but I have tried that with no luck. Note that on MacOS 10.11, the full path to the library must be used (as documented). Is there a reason to not use sa_config?
sa_config was called earlier. Unfortunately it doesn't help.
I have the same problem.. I want to make a report using BIRT (eclipse) and I get the same error. I'm working in macOS
If you have sourced the environment with sa_config.sh (assuming BASH), the java.library.path should not need to be changed (comment out that line).
Can you check
to see if all shared objects are resolved?
and ensure that LD_LIBRARY_PATH is defined as per the sa_config. And also check in the java app by checking the value with:
FWIW, do you mean the script has been "called" or really be "sourced", as that is an important difference?
source /Applications/SQLAnywhere17/System/bin64/sa_config.sh
/Applications/SQLAnywhere17/System/lib64/libdbjdbc17.dylib: @rpath/libdbjdbc17.dylib (compatibility version 0.0.0, current version 0.0.0) @rpath/libdbtasks17_r.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 800.6.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)
/Applications/SQLAnywhere17/System/lib64:
library_path = /Applications/SQLAnywhere17/System/lib64:/Applications/SQLAnywhere17/System/lib64:/Users/mrjill/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.