Before you can use the iAnywhere JDBC driver in your application, you must load the appropriate driver. Load the JDBC 3.0 version of the iAnywhere JDBC driver with the following statement:
DriverManager.registerDriver( (Driver) Class.forName( "ianywhere.ml.jdbcodbc.jdbc3.IDriver").newInstance() );
Load the JDBC 2.0 version of the iAnywhere JDBC driver with the following statement:
DriverManager.registerDriver( (Driver) Class.forName( "ianywhere.ml.jdbcodbc.IDriver").newInstance() );
Using the newInstance method works around issues in some browsers.
As the classes are loaded using Class.forName, the package containing the iAnywhere JDBC driver does not have to be imported using import statements.
jodbc.jar must be in your classpath when you run the application.
The Java component of the iAnywhere JDBC driver is included in the jodbc.jar file installed into the Java subdirectory of your SQL Anywhere installation. For Windows, the native component is dbjodbc10.dll in the win32 subdirectory of your SQL Anywhere installation; for Unix, the native component is dbjodbc10.so. This component must be in the system path. When deploying applications using this driver, you must also deploy the ODBC driver files.