|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.adapter.ResourceAdapterBase
com.waveset.adapter.JdbcResourceAdapter
Nested Class Summary |
Nested classes inherited from class com.waveset.adapter.ResourceAdapterBase |
ResourceAdapterBase.SimpleAccountIterator |
Nested classes inherited from class com.waveset.adapter.ResourceAdapter |
ResourceAdapter.ActionResult, ResourceAdapter.Features, ResourceAdapter.ObjectType |
Field Summary | |
static java.lang.String |
RA_DATABASE
The name of the database to connect to. |
static java.lang.String |
RA_DRIVER
The class name of the JDBC driver. |
static java.lang.String |
RA_HOST
The name of the host used on which the server is listening. |
static java.lang.String |
RA_PASSWORD
The password for the system account used to access the resource. |
static java.lang.String |
RA_PORT
The port on which the server is listening. |
static java.lang.String |
RA_QUOTING
The type of Table Name Quoting to be used in sql for this resource. |
static java.lang.String |
RA_URL_PREFIX
The JDBC driver url prefix Each driver will have a particular prefix they expect when formatting the url passed to the JDBC getConnection method. |
static java.lang.String |
RA_URL_TEMPLATE
The JDBC driver url template. |
static java.lang.String |
RA_USER
The system account name used to access the resource. |
Fields inherited from class com.waveset.adapter.ResourceAdapterBase |
_cache, _context, _excludedAccountsRule, _excludedAccountsRuleInited, _listAllObjectsAttrParse, _listAllObjectsAttrParseName, _listUserAttrParse, _listUserAttrParseName, _listUserGroupsAttrParse, _listUserGroupsAttrParseName, _resource, _thread, _trace, code_id, displayInfoCode, RA_BLOCKCOUNT, RA_LOGIN_ACTION, RA_LOGOFF_ACTION, RA_MULTI_VALUED_ATTRS, RA_TEST_MODE |
Constructor Summary | |
JdbcResourceAdapter()
Create an adapater instance, without a resource. |
|
JdbcResourceAdapter(Resource res,
ObjectCache cache)
Create an adapter instance for a resource. |
Method Summary | |
void |
addAttributeValue(java.lang.StringBuffer b,
java.lang.String attrValue,
java.lang.String attrName)
Appends attrValue to the end of StringBuffer b, which is most likely an SQL statement. |
void |
addQuoted(java.lang.StringBuffer b,
java.lang.String s)
Add a quoted string to a SQL statement we're building in a buffer. |
protected boolean |
attributeRequiresQuotingInSQL(java.lang.String mapName)
Return true iff the attribute specified by mapName requires quoting when used in SQL. |
void |
closeConnection(java.sql.Connection con)
Close a connection, quietly. |
void |
closeResult(java.sql.ResultSet res)
Close a result, quietly. |
void |
closeStatement(java.sql.PreparedStatement stmt)
Close a statement, quietly. |
protected java.util.List |
decodeCommaList(java.lang.String src)
Convert a comma delimited list of names in to a List object. |
void |
dumpResult(java.sql.ResultSet rs)
Dump a ResultSet. |
protected java.lang.String |
encodeCommaList(java.util.List list)
Convert a list of names into a comma delimited list. |
protected void |
execProcedure(java.sql.Connection con,
java.lang.String stmt)
Execute a stored procedure that doesn't return a result set. |
protected void |
execProcedure(java.sql.Connection con,
java.lang.String stmt,
int ignoreError)
Execute a stored procedure that doesn't return a result set. |
protected void |
execSql(java.sql.Connection con,
java.lang.String stmt)
Execute a simple statement, not expected to return a result. |
protected void |
execSql(java.sql.Connection con,
java.lang.String stmt,
java.lang.String arg)
Execute a simple statement, with a SQL argument. |
protected void |
execSql(java.sql.Connection con,
java.lang.String stmt,
java.lang.String arg,
int ignoreError)
Execute a simple statement, not expected to return a result, but touch each of them just to be sure and allow a SQLException to shine through. |
protected void |
flushResults(java.lang.String stmt,
java.sql.PreparedStatement st)
Spin through any results remaining for this statement. |
protected void |
flushResultsQuietly(java.sql.PreparedStatement st)
Called to flush any pending results, but not propagate any exceptions. |
java.lang.String |
formatTemplateUrl(java.lang.String template,
java.lang.String database)
Format a URL given a template. |
protected java.lang.String |
formatUrl(java.lang.String database)
Format the connection url |
java.lang.String |
formatUrl(java.lang.String prefix,
java.lang.String host,
java.lang.String port,
java.lang.String db)
This is the one used by SQL Server, and I would think it would be standard, but sadly it isnot recognized by Sybase, which has to overload this method to use ":" rather than "://" Should start using URL templates now to avoid these issues. |
java.sql.Connection |
getConnection()
Get a connection to the default database with the proxy user. |
protected java.sql.Connection |
getConnection(java.lang.String database)
Get a connection to a parciualr database with the proxy user. |
protected java.sql.Connection |
getConnection(java.lang.String db,
java.lang.String user,
java.lang.String password)
Establish a connection to a database using a particular user name and password. |
protected java.lang.String |
getConnectionString(java.sql.Connection c)
|
protected java.sql.Connection |
getConnectionUrl(java.util.HashMap args)
Obtain a pooled connection. |
protected java.sql.Connection |
getConnectionUrl(java.lang.String url)
Obtain a pooled connection. |
protected java.lang.String |
getEncryptedResourceAttribute(java.lang.String name)
Get a resource attribute value as a string, carefully. |
protected java.lang.String |
getResourceAttribute(java.lang.String name)
Get a resource attribute value as a string, carefully. |
protected java.util.List |
mergeCommaLists(java.lang.String s1,
java.lang.String s2)
Merge two comma lists together. |
protected java.util.List |
mergeStringLists(java.util.List l1,
java.util.List l2)
Merge two lists of strings together. |
void |
println(java.lang.String msg)
|
int |
queryInt(java.sql.Connection c,
java.lang.String q,
java.lang.String arg)
Run a query and return an expected integer in the first column of the first row. |
java.lang.String |
queryString(java.sql.Connection c,
java.lang.String q,
java.lang.String arg)
Run a query and return an expected string in the first column of the first row. |
void |
setDebug(boolean b)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String RA_DRIVER
public static final java.lang.String RA_URL_PREFIX
public static final java.lang.String RA_URL_TEMPLATE
public static final java.lang.String RA_HOST
public static final java.lang.String RA_PORT
public static final java.lang.String RA_DATABASE
public static final java.lang.String RA_USER
public static final java.lang.String RA_PASSWORD
public static final java.lang.String RA_QUOTING
Constructor Detail |
public JdbcResourceAdapter(Resource res, ObjectCache cache)
public JdbcResourceAdapter()
Method Detail |
public void setDebug(boolean b)
protected java.lang.String getResourceAttribute(java.lang.String name)
protected java.lang.String getEncryptedResourceAttribute(java.lang.String name) throws WavesetException
WavesetException
protected boolean attributeRequiresQuotingInSQL(java.lang.String mapName)
public void addAttributeValue(java.lang.StringBuffer b, java.lang.String attrValue, java.lang.String attrName)
public void addQuoted(java.lang.StringBuffer b, java.lang.String s)
protected java.util.List decodeCommaList(java.lang.String src)
protected java.lang.String encodeCommaList(java.util.List list)
protected java.util.List mergeCommaLists(java.lang.String s1, java.lang.String s2)
protected java.util.List mergeStringLists(java.util.List l1, java.util.List l2)
public java.sql.Connection getConnection() throws WavesetException
WavesetException
protected java.sql.Connection getConnection(java.lang.String database) throws WavesetException
WavesetException
protected java.lang.String formatUrl(java.lang.String database) throws WavesetException
WavesetException
public java.lang.String formatUrl(java.lang.String prefix, java.lang.String host, java.lang.String port, java.lang.String db)
public java.lang.String formatTemplateUrl(java.lang.String template, java.lang.String database)
protected java.sql.Connection getConnectionUrl(java.lang.String url) throws WavesetException
WavesetException
protected java.sql.Connection getConnectionUrl(java.util.HashMap args) throws WavesetException
WavesetException
protected java.sql.Connection getConnection(java.lang.String db, java.lang.String user, java.lang.String password) throws WavesetException
WavesetException
public void println(java.lang.String msg)
public void closeConnection(java.sql.Connection con)
public void closeStatement(java.sql.PreparedStatement stmt)
public void closeResult(java.sql.ResultSet res)
public int queryInt(java.sql.Connection c, java.lang.String q, java.lang.String arg) throws WavesetException
WavesetException
public java.lang.String queryString(java.sql.Connection c, java.lang.String q, java.lang.String arg) throws WavesetException
WavesetException
protected void execProcedure(java.sql.Connection con, java.lang.String stmt) throws WavesetException
WavesetException
protected void execProcedure(java.sql.Connection con, java.lang.String stmt, int ignoreError) throws WavesetException
WavesetException
protected void execSql(java.sql.Connection con, java.lang.String stmt) throws WavesetException
WavesetException
protected void execSql(java.sql.Connection con, java.lang.String stmt, java.lang.String arg) throws WavesetException
WavesetException
protected void execSql(java.sql.Connection con, java.lang.String stmt, java.lang.String arg, int ignoreError) throws WavesetException
Allow a particular vendor code error to be ignored.
WavesetException
protected void flushResults(java.lang.String stmt, java.sql.PreparedStatement st) throws java.sql.SQLException
In Sybase's case, it seems to be enough just to ask for the result to get the exception thrown, we don't have to look for a result containing an error message.
Note that freetds appeared to have a bug where if you called getResultSet and no more results were available, it would hang, apparently waiting for a network response. This makes it incompatible with the Sun documentation, and unsuitable for use here.
java.sql.SQLException
public void dumpResult(java.sql.ResultSet rs) throws java.sql.SQLException
java.sql.SQLException
protected void flushResultsQuietly(java.sql.PreparedStatement st)
protected java.lang.String getConnectionString(java.sql.Connection c)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |