Skip to Content
avatar image
Former Member

When connecting to IQ16.0 using the sajdbc4.jar driver occur "no dbjdbc16 ~ " error

[Environment]

SAP IQ 16.0 SP11

HP-UXi 11.3

[Reproducing]

1.

export CLASSPATH=.:$IQDIR16/java/sajdbc4.jar:$CLASSPATH

export SHLIB_PATH=$IQDIR16/lib64:$SHLIB_PATH

export PATH=$IQDIR16/lib64:$PATH

2. javac JDBCConnect.java

3. java JDBCConnect

Exception in thread "main" java.lang.UnsatisfiedLinkError: no dbjdbc16 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1889) at java.lang.Runtime.loadLibrary0(Runtime.java:849) at java.lang.System.loadLibrary(System.java:1092) at sybase.jdbc4.sqlanywhere.IDriver.try_load(IDriver.java:487) at sybase.jdbc4.sqlanywhere.IDriver.<clinit>(IDriver.java:425) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at java.lang.Class.newInstance(Class.java:387) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:373) at java.util.ServiceLoader$1.next(ServiceLoader.java:445) at java.sql.DriverManager$2.run(DriverManager.java:510) at java.sql.DriverManager$2.run(DriverManager.java:490) at java.security.AccessController.doPrivileged(Native Method) at java.sql.DriverManager.loadInitialDrivers(DriverManager.java:490) at java.sql.DriverManager.<clinit>(DriverManager.java:100) at JDBCConnect.main(JDBCConnect.java:29)

[JDBCConnect.java]

import java.io.*;

import java.sql.*;

public class JDBCConnect { public static void main( String args[] )

{ try

{ String arg;

Connection con;

// Select the JDBC driver and create a connection.May throw a SQLException.

// Choices are:

// 1. jConnect driver ( jconnect )

// 2. SQL Anywhere JDBC 4.0 driver ( jdbc4 )

if( args.length > 0 ) { arg = args[0]; }

else

{ arg = "jdbc4"; }

if( arg.compareToIgnoreCase( "jconnect" ) == 0 )

{

con = DriverManager.getConnection( "jdbc:sybase:Tds:solutek5:1600", "DBA", "sql");

}

else

{

con = DriverManager.getConnection( "jdbc:sqlanywhere:uid=DBA;pwd=sql;links=TCPIP{host=solutek5:1600}" );

}

System.out.println("Using "+arg+" driver");

Statement stmt = con.createStatement();

ResultSet rs = stmt.executeQuery( "select @@version" );

while (rs.next())

{

System.out.println(rs.getObject(1)) ;

} rs.close();

stmt.close();

con.close();

}

catch (SQLException sqe)

{ System.out.println("Unexpected exception : " + sqe.toString() + ", sqlstate = " + sqe.getSQLState());

System.exit(1);

}

catch (Exception e)

{

e.printStackTrace();

System.exit(1);

}

System.exit(0);

}

}

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers