Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Generic Database Connection problem

  1. #1
    Join Date
    May 2011
    Posts
    23

    Default Generic Database Connection problem

    I need to extract data from a SQLAnywhere 11 database. Since it is not supported directly by kettle I added the suitable drivers, but I get the following errors:

    -------------------
    Error connecting to database [SQL Anywhere] : org.pentaho.di.core.exception.KettleDatabaseException:
    Error occured while trying to connect to the database

    Error connecting to database: (using class sybase.jdbc.sqlanywhere.IDriver)
    no dbjdbc11 in java.library.path


    org.pentaho.di.core.exception.KettleDatabaseException:
    Error occured while trying to connect to the database

    Error connecting to database: (using class sybase.jdbc.sqlanywhere.IDriver)
    no dbjdbc11 in java.library.path

    at org.pentaho.di.core.database.Database.normalConnect(Database.java:374)
    at org.pentaho.di.core.database.Database.connect(Database.java:323)
    at org.pentaho.di.core.database.Database.connect(Database.java:285)
    at org.pentaho.di.core.database.Database.connect(Database.java:275)
    -------------

    The SQLAnywhere driver is a bit messy since it is not a native JDBC driver, it requires a DLL. So here the description of all what I have done and tried so far:

    I use a JAR file named sajdbc.jar, which is the correct driver file for SQLAnywhere 11.0.1 (according to a SYBASE blog from the Product Manager)
    I put this file in <kettle directory\libext\JDBC

    According to Sybase there is a DLL required. The DLL is called 'dbjdbc11.dll' and that seems not be found by kettle! I put the DLL into the directory
    <kettle directory>\libswt\win32

    Then there is the Java 32-bit / 64-bit mess! I have kettle running on a Vista 64-bit maschine. But I have a 32-bit Java VM version 1.6.0_25-b06 installed. So I copied the 32-bit version of the above JDBC DLL and put it in the libswt\win32 directory.

    Do I miss something? Can anybody give me a hint what might be wrong here?

    Many thanks for your help!
    Thomas

  2. #2
    Join Date
    Nov 2008
    Posts
    777

    Default

    The DLL file will have to be put in a folder that is included in the %PATH% environment variable and that most likely does not include <kettle directory>\libswt\win32. You should either put that DLL somewhere in the %PATH% or dynamically define the java.library.path variable when java starts. This resouce might help:

    http://www.inonit.com/cygwin/jni/helloWorld/load.html

    I don't think the 32-bit/64-bit mess should be a problem as long as you are using 32-bit Java and the DLL is also 32-bit. The only time I had that problem was with 64-bit Java and 32-bit drivers. Good Luck!
    pdi-ce-4.4.0-stable
    Java 1.7 (64 bit)
    MySQL 5.6 (64 bit)
    Windows 7 (64 bit)

  3. #3
    Join Date
    May 2011
    Posts
    23

    Default

    Hi Darell,

    Thanks for your reply. Unfortunately I have no luck with that. I put the DLL in a directory which is in my path. Same error message still. However the \libswt\win32 or \libswt\win64 directories should work as well. If I look at the spoon.bat file I find the following:

    set OPT=%PENTAHO_DI_JAVA_OPTIONS% "-Djava.library.path=%LIBSPATH%"

    And a bit above that line the %LIBSPATH% variable is defined as follows:

    --
    IF %IS64BITJAVA% == 1 GOTO :USE64

    :USE32
    REM ===========================================
    REM Using 32bit Java, so include 32bit SWT Jar
    REM ===========================================
    set LIBSPATH=libswt\win32
    GOTO :CONTINUE
    :USE64
    REM ===========================================
    REM Using 64bit java, so include 64bit SWT Jar
    REM ===========================================
    set LIBSPATH=libswt\win64
    set SWTJAR=..\libswt\win64
    :CONTINUE
    popd
    ------

    So these two directories are in any case in the java.library.path. Unfortunately it does not work and there must be another problem which I currently don't see. Is anybody reading this who managed to install a custom JDBC driver which requires an additional DLL (non-native driver)?

    Any help would be greatly apreciated!

    Thomas

  4. #4
    Join Date
    May 2011
    Posts
    23

    Default

    OK I got it working with a native JDBC (class 4) driver which is available from Sybase. The product is called jConnect, registered users can download ist. For SQLAnywhere 11.x jConnect 6.0.5 with jconn3.jar driver is supported, for SQLAnywhere 12.x jConnect 7.x with jconn4.jar should be used.

    The following settings worked for me:

    Create 'Generic database' with accesstype 'Native (JDBC)'
    Custom Connection URL: jdbc:sybase:Tds:<DB-Server IP | DB-Server DNS name>:<SQLAny port, default is 2638>
    Custom Driver Class Name: com.sybase.jdbc3.jdbc.SybDriver
    User Name: db user name eg dba
    Password: the password eg sql


    The hybrid version did not work for me since whatever I have done the required DLL could not be found by kettle.

    Hope this is useful for others who may need to connect to an SQLAnywhere server.

  5. #5
    Join Date
    Apr 2012
    Posts
    1

    Default Resolution to JDBC drivers that require additional DLLs

    I solved the problem by modifying Spoon.bat to include my OS PATH variable in the the LIBSPATH variable like this: set LIBSPATH=libswt\win32;%PATH%

    This modification assumes that the necessary DLLs are located on your path.

    Hope someone finds this useful.

    Scott

    Quote Originally Posted by tbednarz View Post
    Hi Darell,

    Thanks for your reply. Unfortunately I have no luck with that. I put the DLL in a directory which is in my path. Same error message still. However the \libswt\win32 or \libswt\win64 directories should work as well. If I look at the spoon.bat file I find the following:

    set OPT=%PENTAHO_DI_JAVA_OPTIONS% "-Djava.library.path=%LIBSPATH%"

    And a bit above that line the %LIBSPATH% variable is defined as follows:

    --
    IF %IS64BITJAVA% == 1 GOTO :USE64

    :USE32
    REM ===========================================
    REM Using 32bit Java, so include 32bit SWT Jar
    REM ===========================================
    set LIBSPATH=libswt\win32
    GOTO :CONTINUE
    :USE64
    REM ===========================================
    REM Using 64bit java, so include 64bit SWT Jar
    REM ===========================================
    set LIBSPATH=libswt\win64
    set SWTJAR=..\libswt\win64
    :CONTINUE
    popd
    ------

    So these two directories are in any case in the java.library.path. Unfortunately it does not work and there must be another problem which I currently don't see. Is anybody reading this who managed to install a custom JDBC driver which requires an additional DLL (non-native driver)?

    Any help would be greatly apreciated!

    Thomas

  6. #6
    Join Date
    Jan 2014
    Posts
    11

    Default

    HI thanks for posting this information, very helpful, however I do not manage to get it work.

    Why the Custom Driver Class Name is called: com.sybase.jdbc3.jdbc.SybDriver

    I just put the jconn3.jar file into \biserver-ce\tomcat\lib

    Do I somehow have to unpack this jar file or install it???

    Thanks and best regards
    Michael

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.