|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.optional.data.sql.DataConnection
public class DataConnection
An extended database connection that allows integration of a local database and replication to/from a remote database.
Copyright (c) Xoetrope Ltd. 2001-2004
$Revision: 2.13 $ License: see license.txt
| Constructor Summary | |
|---|---|
DataConnection(XProject currentProject,
java.lang.String name)
Construct a new connection |
|
DataConnection(XProject currentProject,
java.lang.String name,
boolean replicate)
Construct a new connection |
|
| Method Summary | |
|---|---|
ConnectionObject |
borrowConnection()
Borrow the connection object |
void |
closeQuery()
Close the resources used by the query |
void |
commit()
Explicitly force a commit |
java.sql.PreparedStatement |
createPreparedStatement(java.lang.String sql,
java.lang.String connName)
Create a prepared statement. |
java.sql.PreparedStatement |
createPreparedStatement(java.lang.String sql,
java.lang.String connName,
boolean forwardOnly)
Create a prepared statement. |
java.sql.ResultSet |
executeQuery(java.lang.String sql)
Execute a SQL query |
java.sql.ResultSet |
executeQuery(java.lang.String sql,
java.lang.String connName,
boolean writable)
Execute a SQL query. |
int |
executeUpdate(java.lang.String sql)
Execute a SQL update statement. |
boolean |
getDoesEscapeProcessing()
Gets the escape processing flag for the underlying JDBC implementation |
java.sql.ResultSet |
getMetaData(java.lang.String tableName)
Get a list of the fields in a table. |
long |
getNextPseudoId(java.lang.String tableName)
Get the next PSUEDOID for the names table |
static int |
getReplicationStatementCount()
|
static void |
resetReplicationStatementCount()
|
void |
returnConnection()
Return the connection object to the pool |
void |
returnPreparedStatement(java.sql.PreparedStatement ps)
Create a prepared statement. |
void |
returnStatement(java.sql.Statement s)
Create a statement. |
int |
serializeData(XMLElement data,
java.sql.ResultSet resultSet,
ServiceProxyArgs args)
|
void |
setAutoCommit(boolean state)
Set the auto commit state |
void |
setDoesEscapeProcessing(boolean escapeProcessing)
Set the escape processing flag for the underlying JDBC implementation |
static void |
setReplicationEnabled(boolean state)
Set the replication mode |
static void |
shutdown(java.lang.String connParamName)
Execute a SHUTDOWN statement |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataConnection(XProject currentProject,
java.lang.String name)
currentProject - the current or owner projectname - the connection name
public DataConnection(XProject currentProject,
java.lang.String name,
boolean replicate)
currentProject - the current or owner projectname - the connection namereplicate - true to attempt use of the replication service| Method Detail |
|---|
public int executeUpdate(java.lang.String sql)
throws java.lang.Exception
sql - the SQL statement to be executed
java.lang.Exception
public java.sql.ResultSet executeQuery(java.lang.String sql)
throws java.sql.SQLException
sql - the SQL statement to be executed
java.sql.SQLException
public java.sql.ResultSet executeQuery(java.lang.String sql,
java.lang.String connName,
boolean writable)
throws java.sql.SQLException
sql - the SQL statementconnName - the connection namewritable - true to attempt to create an updatable resultset
java.sql.SQLExceptionpublic void closeQuery()
public java.sql.PreparedStatement createPreparedStatement(java.lang.String sql,
java.lang.String connName,
boolean forwardOnly)
throws java.sql.SQLException
sql - the SQL statementconnName - the connection nameforwardOnly - true for a result set that is ResultSet.TYPE_FORRWAD_ONLY
java.sql.SQLException
public java.sql.PreparedStatement createPreparedStatement(java.lang.String sql,
java.lang.String connName)
throws java.sql.SQLException
sql - the SQL statementconnName - the connection name
java.sql.SQLExceptionpublic void returnPreparedStatement(java.sql.PreparedStatement ps)
ps - the PreparedStatement to be returnedpublic void returnStatement(java.sql.Statement s)
s - the Statement to be returnedpublic java.sql.ResultSet getMetaData(java.lang.String tableName)
tableName - the table name
public ConnectionObject borrowConnection()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void returnConnection()
public static void shutdown(java.lang.String connParamName)
throws java.lang.Exception
connParamName - the name of the connection on which the shutdown
statement is executed, or null for the default connection
java.lang.Exception
public int serializeData(XMLElement data,
java.sql.ResultSet resultSet,
ServiceProxyArgs args)
throws java.sql.SQLException,
java.io.IOException
java.sql.SQLException
java.io.IOExceptionpublic long getNextPseudoId(java.lang.String tableName)
tableName - the table name whose ID is to be inspected
public static int getReplicationStatementCount()
public static void resetReplicationStatementCount()
public static void setReplicationEnabled(boolean state)
true - to allow replication, false to turn it off
public void commit()
throws java.sql.SQLException
java.sql.SQLException
public void setAutoCommit(boolean state)
throws java.sql.SQLException
true - to turn auto commit on
java.sql.SQLExceptionpublic boolean getDoesEscapeProcessing()
public void setDoesEscapeProcessing(boolean escapeProcessing)
doesEscapeProcessing - true to setEscapeProcssing( true )
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||