|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xalan.lib.sql.XConnection
An XSLT extension that allows a stylesheet to access JDBC data. From the stylesheet perspective, XConnection provides 3 extension functions: new(), query(), and close(). Use new() to call one of XConnection constructors, which establishes a JDBC driver connection to a data source and returns an XConnection object. Then use the XConnection object query() method to return a result set in the form of a row-set element. When you have finished working with the row-set, call the XConnection object close() method to terminate the connection.
Field Summary | |
java.sql.Connection |
m_connection
The JDBC connection. |
java.lang.String |
m_dbURL
A database URL of the form jdbc:subprotocol:subname. |
java.lang.String |
m_driver
A JDBC driver of the form "foo.bar.Driver". |
java.lang.String |
m_password
A password. |
java.util.Properties |
m_protocol
A list of arbitrary string tag/value pairs as connection arguments; normally at least a "user" and "password" property should be included. |
java.lang.String |
m_user
A user ID. |
Constructor Summary | |
XConnection(java.lang.String driver,
java.lang.String dbURL)
Create an XConnection object with just a driver and database URL. |
|
XConnection(java.lang.String driver,
java.lang.String dbURL,
Element protocolElem)
Create an XConnection object with a connection protocol |
|
XConnection(java.lang.String driver,
java.lang.String dbURL,
java.lang.String user,
java.lang.String password)
Create an XConnection object with user ID and password. |
Method Summary | |
void |
close()
Close the connection to the data source. |
void |
connect(java.lang.String driver,
java.lang.String dbURL,
java.lang.String user,
java.lang.String password,
java.util.Properties protocol,
int getConnectionArgs)
Connect to the JDBC database. |
NodeIterator |
query(java.lang.String queryString)
Execute a query statement by instantiating an XStatement object. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public java.lang.String m_driver
public java.lang.String m_dbURL
public java.lang.String m_user
public java.lang.String m_password
public java.util.Properties m_protocol
public java.sql.Connection m_connection
Constructor Detail |
public XConnection(java.lang.String driver, java.lang.String dbURL)
driver
- JDBC driver of the form foo.bar.Driver.dbURL
- database URL of the form jdbc:subprotocol:subname.public XConnection(java.lang.String driver, java.lang.String dbURL, java.lang.String user, java.lang.String password)
driver
- JDBC driver of the form foo.bar.Driver.dbURL
- database URL of the form jdbc:subprotocol:subname.user
- user ID.password
- connection password.public XConnection(java.lang.String driver, java.lang.String dbURL, Element protocolElem)
driver
- JDBC driver of the form foo.bar.Driver.dbURL
- database URL of the form jdbc:subprotocol:subname.protocolElem
- list of string tag/value connection arguments,
normally including at least "user" and "password".Method Detail |
public void connect(java.lang.String driver, java.lang.String dbURL, java.lang.String user, java.lang.String password, java.util.Properties protocol, int getConnectionArgs)
driver
- Database url of the form jdbc:subprotocol:subname .dbURL
- database URL of the form jdbc:subprotocol:subname.user
- user IDpassword
- connection password.protocol
- List of arbitrary string tag/value pairs as
connection arguments; normally at least a "user" and "password"
property should be included.getConnectionArgs
- Connection argumentspublic NodeIterator query(java.lang.String queryString) throws java.sql.SQLException
queryString
- the SQL query.public void close() throws java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |