dbxml.sax
Class JDBCInputSource

java.lang.Object
  |
  +--org.xml.sax.InputSource
        |
        +--dbxml.sax.JDBCInputSource

public class JDBCInputSource
extends org.xml.sax.InputSource

JDBC data source to work with SAX parser and applications. This class specializes org.xml.sax.InputSource to encapsulate the requried information to access a table in a database.

Author:
Ramnivas Laddad

Constructor Summary
JDBCInputSource(java.lang.String connectionURL, java.lang.String userName, java.lang.String passwd, java.lang.String tableName)
          Construct a JDBC data source
 
Method Summary
 java.sql.Connection getConnection()
          Get a Connection object for this source.
 java.lang.String getTableName()
          Get the table name of this JDBC data source.
 
Methods inherited from class org.xml.sax.InputSource
getByteStream, getCharacterStream, getEncoding, getPublicId, getSystemId, setByteStream, setCharacterStream, setEncoding, setPublicId, setSystemId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCInputSource

public JDBCInputSource(java.lang.String connectionURL,
                       java.lang.String userName,
                       java.lang.String passwd,
                       java.lang.String tableName)
Construct a JDBC data source
Parameters:
connectionURL - a JDBC URL of a database
userName - user name for connecting to the database
passwd - password for connecting to the database
tableName - table name to be accessed from SAX parser/applications.
Method Detail

getTableName

public java.lang.String getTableName()
Get the table name of this JDBC data source.
Returns:
table name

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Get a Connection object for this source. Obtains and returns connection to the URL given in constructor and returns it.
Returns:
a connectrion to the given JDBC URL
Throws:
java.sql.SQLException - exception that occured while getting connection from DriverManager