|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.syncsoft.plainsql.PSconnection
public class PSconnection
Wrapper to the JDBC connection class. Provides simple methods for executing statements, and creating dedicated SQL or table objects. The connection is associated with a statement cache, which allows SQL to be executed directly by connection methods without causing excessive parse requests. Jan 13 GH
| Field Summary | |
|---|---|
java.sql.DatabaseMetaData |
dbMetaData
|
| Constructor Summary | |
|---|---|
PSconnection(java.sql.Connection jdbcConnection)
Create a conneciton object, supplying a JDBC connection. |
|
| Method Summary | |
|---|---|
void |
close()
Close the connection. |
void |
commit()
Issue a COMMIT. |
PlainProc |
createProc(java.lang.String sql)
Create a stored procedure object |
PSsequence |
createSequence(java.lang.String sequenceName)
Returns an object that can be used to generate "portable" sequences |
PlainSql |
createSql(java.lang.String sql)
Create a SQL object (wrapper to a preparedStatemetn). |
PlainSql |
createSql(java.lang.String fileName,
java.lang.String sqlName)
|
PlainTable |
createTable(java.lang.String tablename)
Create a table object which is like a PlainSQL object for a SELECT * FROM table but also has some methods for easy DML |
PlainTable |
createTable(java.lang.String tablename,
java.lang.String additionalSQL)
Create a table object which is like a PlainSQL object for a SELECT * FROM table but also has some methods for easy DML |
PlainTableDDL |
createTableDDL(java.lang.String tablename)
Create a table DDL object which is used to create table, indexes & such in a way that is a bit easier and portable than building up SQL text |
int |
doSql(java.lang.String sql,
java.lang.Object... args)
Execute a non-query with bind variables. |
ProcedureResult |
executeProc(java.lang.String procName,
java.lang.Object... procArguments)
Execute a stored procedure, returning a structure that contains the output parameters and the result sets |
RowSet |
fetchAll(java.lang.String sql,
java.lang.Object... args)
Execute the SQL, with bind variables as appropriate, and return a Rowset of data |
int |
getFetchahead()
|
java.sql.Connection |
getJdbcConnection()
Return the JDBC connection used by the PSconnection |
java.util.logging.Logger |
getLogger()
Retrieves the Logger object associated with the connection |
java.lang.String |
getRdbmsName()
Return the RDBMS product name as returned by DatabaseMetaData.getProductName() |
StmtCache |
getStmtcache()
Get the statement cache object for this connection |
PlainTable |
getTable(java.lang.String tablename)
Create a "table" DML object |
java.sql.Date |
javaSqlDateNow()
|
void |
rollback()
|
void |
setFetchahead(int fetchahead)
Set the fetchahead value that will be applied to all statements created by this connection. |
void |
setLogLevel(java.util.logging.Level l)
Set the logger level TODO: DOESN"T WORK!!!!!!! |
boolean |
tableExists(java.lang.String tablename)
Check to see if there is a table that can be queried with the given name. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.sql.DatabaseMetaData dbMetaData
| Constructor Detail |
|---|
public PSconnection(java.sql.Connection jdbcConnection)
throws java.sql.SQLException
jdbcConnection -
java.sql.SQLException| Method Detail |
|---|
public java.sql.Date javaSqlDateNow()
public ProcedureResult executeProc(java.lang.String procName,
java.lang.Object... procArguments)
throws java.sql.SQLException
procName - - name of the procedure (Not including CALL)procArguments - : Array of procedure arguments
java.sql.SQLExceptionpublic java.lang.String getRdbmsName()
public void close()
throws java.sql.SQLException
java.sql.SQLException
public void commit()
throws java.sql.SQLException
java.sql.SQLException
public PlainProc createProc(java.lang.String sql)
throws java.sql.SQLException
sql - -
eg "{CALL proc()}"
java.sql.SQLException
public PSsequence createSequence(java.lang.String sequenceName)
throws java.sql.SQLException
sequenceName -
java.sql.SQLException
public PlainSql createSql(java.lang.String sql)
throws java.sql.SQLException
sql -
java.sql.SQLException
public PlainSql createSql(java.lang.String fileName,
java.lang.String sqlName)
throws java.sql.SQLException,
java.io.IOException
java.sql.SQLException
java.io.IOException
public PlainTable createTable(java.lang.String tablename)
throws java.sql.SQLException
conn - -
PSconnection objecttablename -
java.sql.SQLException
public PlainTable createTable(java.lang.String tablename,
java.lang.String additionalSQL)
throws java.sql.SQLException
conn - -
PSconnection objecttablename - additionalSQL - Additional SQL clauses (usually a restricting where clause)
java.sql.SQLException
public PlainTableDDL createTableDDL(java.lang.String tablename)
throws java.sql.SQLException
conn - -
PSconnection objecttablename -
java.sql.SQLException
public int doSql(java.lang.String sql,
java.lang.Object... args)
throws java.sql.SQLException
sql - args - array of bind variables
java.sql.SQLException
public RowSet fetchAll(java.lang.String sql,
java.lang.Object... args)
throws java.sql.SQLException
sql - SQL to be executedargs - array of bind variables
java.sql.SQLExceptionpublic int getFetchahead()
public java.sql.Connection getJdbcConnection()
public java.util.logging.Logger getLogger()
public StmtCache getStmtcache()
public PlainTable getTable(java.lang.String tablename)
throws java.sql.SQLException
tablename -
java.sql.SQLException
public void rollback()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void setFetchahead(int fetchahead)
fetchahead - public void setLogLevel(java.util.logging.Level l)
l - public boolean tableExists(java.lang.String tablename)
tablename -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||