edu.wpi.cs.DSRG.xmldb.JDBCClient
Class JDBCClient

java.lang.Object
  |
  +--edu.wpi.cs.DSRG.xmldb.JDBCClient.JDBCClient
Direct Known Subclasses:
OracleJDBCClient

public class JDBCClient
extends java.lang.Object

An Client based on the JDBC Driver. So far, it cannot handle stream typed columns. It's a Oracle Biased JDBCClient. by default the autocommit is false.


Field Summary
(package private)  java.sql.Connection con
          Connection of one session.
(package private) static int DEFAULT_ROW_PREFETCH
          Default Row prefetch.
(package private) static java.lang.String DSRG_URL
          URL Address of DSRG
(package private)  java.util.Vector failedQueries
          This is used to keep track of any failed queries in this connection.
(package private) static java.lang.String ODBC_Driver
          ODBC Driver name
(package private) static java.lang.String Oracle_Driver
          Oracle JDBC Driver name
(package private)  java.lang.String password
          Current connection's password
(package private) static java.lang.String SHIBA_URL
          URL Address of Shiba
(package private)  java.sql.Statement stmt
          SQL statement
(package private)  int totalQueries
          This is used to keep track of how many query has been executed totally.
(package private)  java.lang.String uri
          Current connection's uri
(package private)  java.lang.String username
          Current connection's username
(package private) static java.lang.String WPI_URL
          URL Address of WPI
(package private) static java.lang.String XMLDB_URL
          URL Address of XMLDB
 
Constructor Summary
(package private) JDBCClient()
          Default constructor, not for external use.
  JDBCClient(java.lang.String url, java.lang.String usr, java.lang.String pwd)
          Start the session.
 
Method Summary
 void commit()
           
 void finalize()
           
(package private)  java.lang.String findURI(java.lang.String uri)
          Try to prefetch the URI.
 java.sql.Connection getConnection()
          Return the database connection.
 int getNumberOfColumns(java.lang.String table_name)
           
 java.sql.ResultSet processQuery(java.lang.String sql)
          For compatibility with both client and server side JDBC connections, we assume there is no autocommit feature (due to server side JDBC connection disable that feature).
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

DEFAULT_ROW_PREFETCH

static final int DEFAULT_ROW_PREFETCH
Default Row prefetch. This valued need to be tuned based on different network setting.

failedQueries

java.util.Vector failedQueries
This is used to keep track of any failed queries in this connection.

totalQueries

int totalQueries
This is used to keep track of how many query has been executed totally.

WPI_URL

static final java.lang.String WPI_URL
URL Address of WPI

SHIBA_URL

static final java.lang.String SHIBA_URL
URL Address of Shiba

XMLDB_URL

static final java.lang.String XMLDB_URL
URL Address of XMLDB

DSRG_URL

static final java.lang.String DSRG_URL
URL Address of DSRG

Oracle_Driver

static final java.lang.String Oracle_Driver
Oracle JDBC Driver name

ODBC_Driver

static final java.lang.String ODBC_Driver
ODBC Driver name

con

java.sql.Connection con
Connection of one session.

stmt

java.sql.Statement stmt
SQL statement

uri

java.lang.String uri
Current connection's uri

username

java.lang.String username
Current connection's username

password

java.lang.String password
Current connection's password
Constructor Detail

JDBCClient

JDBCClient()
Default constructor, not for external use.

JDBCClient

public JDBCClient(java.lang.String url,
                  java.lang.String usr,
                  java.lang.String pwd)
Start the session.
Method Detail

findURI

java.lang.String findURI(java.lang.String uri)
Try to prefetch the URI.

getConnection

public java.sql.Connection getConnection()
Return the database connection.

processQuery

public java.sql.ResultSet processQuery(java.lang.String sql)
For compatibility with both client and server side JDBC connections, we assume there is no autocommit feature (due to server side JDBC connection disable that feature). Hence every query will be committed, or rollback explicitly.

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

getNumberOfColumns

public int getNumberOfColumns(java.lang.String table_name)

commit

public void commit()
            throws java.sql.SQLException