JDBC Quick Start IDS Server

Home

Products
   IDS Server
   IDS JDBC Driver
  .NET Data Provider
  .NET SQL Driver
   What's New

Download
   IDS Server Trial
   ODBC Drivers
   Other Tools

Pricing

Ordering

Support
   FAQ
   Articles
   JDBC Quick Start

Company
   About Us
   Our Customers
   Contact



 

How to Select A Driver

The built-in JDBC API in J2SE 1.4 is JDBC 3.0. The built-in JDBC API of J2SE 1.3 and 1.2 is JDBC 2.1, while the older JDK 1.1 has JDBC 1.0. IDS JDBC Driver supports all of these J2SE and JDK releases. Developers can select among six different versions of this driver base on their deployment requirements. There are essentially two types of deployment: 1) stand-alone Java applications, servlets and Web Start applications; 2) Java applets. The following table shows how to select an IDS JDBC Driver that is right for you. All driver archives are installed in directory "IDSServer\classes".

Target Environment Driver Archive
* JDBC 3.0 applications, servlets and Web Start applications
   running with J2SE 1.4.x, J2EE 1.4.x. 
* JDBC 3.0 applets for browers with Java plug-in 1.4.x
jdk14drv.jar
* JDBC 2.1 applications, servlets and Web Start applications
   running with J2SE 1.3.x and 1.2.x, J2EE 1.3.x and 1.2.x.
* JDBC 2.1 applets for browsers with Java plug-in 1.3.x and 1.2.x.
jdk13drv.jar
* JDBC 1.0 applications running with JDK 1.1.x. 
* JDBC 1.0 applets for version 4 or newer Web browsers(1) with default Java VM.
jdk11drv.jar
* JDBC 2.1 applets for version 4 or newer Web browsers(1) with default Java VM. jdk13drv-v4browser.jar
* JDBC 2.1 applets for version 3 or newer Web browsers(2) with default Java VM. jdk12drv-v4browser.zip (3)
* JDBC 1.1 applets for version 3 or newer Web browsers(2) with default Java VM. jdk11drv-v3browser.zip (3)
  1. Version 4 or newer Web browsers are: Internet Explorer 4.0 to 6.x, Communicator 4.x. Their default Java VM are JDK 1.1 compatible VM.
  2. Version 3 or newer Web browsers are: Internet Explorer 3.x, Netscape Navigator 3.0x. Their default Java VM are JDK 1.0.2 compatible VM.
  3. IDS Software no longer actively supports Internet Explorer 3.x and Netscape Navigator 3.x. These driver archives are from the previous release of IDS Server 3.5.7.

IDS JDBC Driver consists of several Java packages. Driver archive jdk14drv.jar, jdk13drv.jar and jdk11drv.jar contains package ids.sql that implements the standard java.sql package of the JDBC API. These the first two also contains package ids.jdbc that implements the javax.sql package of JDBC 3.0 and 2.1 API.

Driver archive jdk13drv-v4browser.jar contains package java2.sql that implements the JDBC 2.1 API for Web browsers with a JDK 1.1 compatible Java VM (Internet Explorer 4.0 to 6.x and Netscape Communicator 4.x). jdk12drv-v3browser.zip and jdk11drv-3browser.zip contains package j102.sql that implements the JDBC API for Web browsers with a JDK 1.02 compatible Java VM (Internet Explorer 3.x and Netscape Navigator 3.x).

How to Use the Driver

Three steps are required to use the IDS JDBC Driver in a Java program: 1) Composing a Connection URL, 2) Initialize the driver, 3) Making a connection. A typical Connection URL for looks like this:

    "jdbc:ids://ip_address:12/conn?dsn='MyDB'&uid='MyName'&pwd='sECreT'"

where ip_address:12 is the address and port number of the IDS Server. The default port number is 12, but it can be changed in the "idss.ini" file. 'MyDB' is the ODBC data source name (or Oracle server alias, see next topic). 'MyName' is the user ID of the target database. 'sECreT' is the password of the database user ID. For a complete reference on the syntax of the Connection URL, please refer to Section 4.4 and 4.5 of the IDS Server User's Guide.

There are several ways to initialize the driver and make a connection. If you like to use the DriverManager.getConnection() method, you can use the following:

    Class.forName("ids.sql.IDSDriver").newInstance();
    Connection conn = DriverManager.getConnection(url,"scott", "tiger");

If you like to use the Driver.connect() method, you can create a JDBC Connection instance like this:

    Driver drv = (Driver)
        Class.forName("ids.sql.IDSDriver").newInstance();
    Connection conn = drv.connect(url, prop);

There is a much simpler alternative looks like the following. The only drawback is that this requires you to include the "IDS_Server_directory\classes" directory in the CLASSPATH environment before compiling.

    Driver drv = new ids.sql.IDSDriver();
    Connection conn = drv.connect(url, prop);

Using java2.sql.IDSDriver

This driver is for applets using JDBC 2.1 features runing in Version 4 browsers (see 4A.(1)). When writing applets using this driver, first import the java2.sql.* package instead of java.sql.*. Then initialize the driver class java2.sql.IDSDriver instead of ids.sql.IDSDriver. The syntax of the Connection URL remains the same. For example,

    import java2.sql.*; // Instead of import java.sql.*;
    ...
    Driver drv = new java2.sql.IDSDriver();
    Connection conn = drv.connect(url, prop);

You must add archive "IDS_Server\classes\jdk13drv-v4browsers.jar" to the CLASSPATH environment variable before compiling your applet.

Using j102.sql.IDSDriver

When using the driver for JDK 1.0.2 compatible browsers, you need to do two things differently. First is to import the j102.sql.* package instead of java.sql.* in your Java program. Second is to initialize driver class j102.sql.IDSDriver instead of ids.sql.IDSDriver. There is difference in the syntax of the Connection URL. For example,

    import j102.sql.*;  // Instead of import java.sql.*;
    ...
    Driver drv = new j102.sql.IDSDriver();
    Connection conn = drv.connect(url, prop);

You must add archive "IDS_Server\classes\jdk12drv-v3browsers.zip" to the CLASSPATH environment variable before compiling your applet.


Copyright c 1997-2006 IDS Software. All rights reserved.