Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

I'm trying to connect to a SQLAnywhere 17 databas from Java. I have sajdbc4.jar in my classpath and I've added ../System/lib64 to my java.library.path. When I try to load the driver it fails trying to load a dependent library. Does anyone have an idea of what I might be doing wrong here ?

Exception in thread "main" java.lang.UnsatisfiedLinkError: /Applications/SQLAnywhere17/System/lib64/libdbjdbc17.dylib: dlopen(/Applications/SQLAnywhere17/System/lib64/libdbjdbc17.dylib, 1): Library not loaded: libdbtasks17_r.dylib Referenced from: /Applications/SQLAnywhere17/System/lib64/libdbjdbc17.dylib Reason: image not found at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0( at java.lang.ClassLoader.loadLibrary( at java.lang.Runtime.loadLibrary0( at java.lang.System.loadLibrary( at sap.jdbc4.sqlanywhere.IDriver.try_load( at sap.jdbc4.sqlanywhere.IDriver.<clinit>( at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance( at sun.reflect.DelegatingConstructorAccessorImpl.newInstance( at java.lang.reflect.Constructor.newInstance( at java.lang.Class.newInstance( at java.util.ServiceLoader$LazyIterator.nextService( at java.util.ServiceLoader$ at java.util.ServiceLoader$ at java.sql.DriverManager$ at java.sql.DriverManager$ at Method) at java.sql.DriverManager.loadInitialDrivers( at java.sql.DriverManager.<clinit>( at Test.main(

asked 31 Jan '17, 09:47

johan's gravatar image

accept rate: 0%

I will be assuming you have installed and set up the environment using the SQL Anywhere provided scripts but if that has not been done I would recommend starting with that focus first.

I suspect you are running one the latest MAC OS X operating systems (El Capitan or Sierra, ie. Mac OS X 10.11+) which has had a negative change to the DYLD_LIBRARY_PATH and LD_LIBRARY_PATH environment settings. To address that you will need include the SQL Anywhere lib64 (or lib32) directory in your -Djava.library.path=... ; as you have implied you may have already but worth rechecking.

Because of this evolving situation on Mac OS X, there have been numerous changes to the SQL Anywhere software (for this) so you do want to make sure you have applied a patch (any that brings the build number to 1356 or higher) that includes "Engineering Case" #793527.

The description of the fix can be found in the v16 and V12 Release Notes (EBF###_*_README.htm) files but the description for this fix is currently missing from the V17 one; I'm looking into getting that omission addressed.

permanent link

answered 31 Jan '17, 12:42

Nick%20Elson%20SAP%20SQL%20Anywhere's gravatar image

Nick Elson S...
accept rate: 32%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 31 Jan '17, 09:47

question was seen: 2,667 times

last updated: 31 Jan '17, 12:42