JDBC Driver

This section provides detailed instructions for the configuration and deployment of the jBASE JDBC 2.0 Driver.

The jBASE JDBC 2.0 Driver is a jBASE component implementing the JDBC API. The JDBC API is part of the JavaTM 2 Platform Standard Edition 5.0 (J2SETM).

The following diagrams show two of the most common deployment scenarios. In both cases, the JDBC API implemented by the jBASE JDBC 2.0 Driver provides client applications with the ability to perform SQL queries against a jBASE server.

Deploying the JDBC Driver

This section shows the deployment of JDBC Driver on JBoss application server.

The jBASE JDBC Driver is packaged as a Java Archive (JAR) file. To use the JDBC Driver from a non-managed client application, it necessary to place this archive inside your CLASSPATH. To deploy this archive on a managed environment, it is necessary to configure a deployment descriptor specific to the application server.

Developers Guide

The following section provides a detailed guide on how to connect and access the jBASE server.

JDBC API Reference

The jBASE JDBC 2.0 Driver implements a subset of the JDBC 2.0 API. Refer the JDBC specification documentation or refer to the JDBC API javadoc documentation for further information.

The following example shows how a client application can execute an SQL SELECT query and display the obtained result set:

Statement stat = null;
try {
    //Create an SQL statement and perform a SQL SELECT query
    stat = cx.createStatement();
    ResultSet rs = stat.executeQuery("SELECT NAME FROM MYTABLE");
    //Obtain the meta data associated to the result set to print the no. of columns
    ResultSetMetaData rsMetaData = rs.getMetaData();
    System.out.println("Number of columns: " + rsMetaData.getColumnCount());
    //Fetch all rows and display the first column
    while(rs.next()) {
        System.out.println("NAME: " + rs.getString("NAME"));
    }
} catch(SQLException e) {
    throw e;
} finally {
    closeDB(stat);
}

Bookmark Name Actions
Feedback
x