|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ofbiz.entity.jdbc.SQLProcessor
public class SQLProcessor
SQLProcessor - provides utitlity functions to ease database access
Field Summary | |
---|---|
static java.util.List<java.lang.String> |
CONNECTION_TEST_LIST
Used for testing connections when test is enabled |
static boolean |
ENABLE_TEST
|
static int |
MAX_CONNECTIONS
|
static java.lang.String |
module
Module Name Used for debugging |
Constructor Summary | |
---|---|
SQLProcessor(java.lang.String helperName)
Construct an object based on the helper/datasource |
|
SQLProcessor(java.lang.String helperName,
java.sql.Connection connection)
Construct an object with an connection given. |
Method Summary | |
---|---|
void |
close()
Commit if required and remove all allocated resources |
void |
commit()
Commit all modifications |
void |
execQuery(java.lang.String sql,
ExecQueryCallbackFunctionIF aListener)
Execute a query based on the SQL string given. |
java.sql.ResultSet |
executeQuery()
Execute a query based on the prepared statement |
java.sql.ResultSet |
executeQuery(java.lang.String sql)
Execute a query baed ont SQL string given |
int |
executeUpdate()
Execute updates |
int |
executeUpdate(java.lang.String sql)
Execute update based on the SQL statement given |
protected void |
finalize()
|
java.sql.Connection |
getConnection()
Get a connection from the ConnectionFactory |
java.sql.PreparedStatement |
getPreparedStatement()
Getter: get the prepared statement |
java.sql.ResultSet |
getResultSet()
Getter: get the currently activ ResultSet |
boolean |
next()
Test if there more records available |
void |
prepareStatement(java.lang.String sql)
Prepare a statement. |
void |
prepareStatement(java.lang.String sql,
boolean specifyTypeAndConcur,
int resultSetType,
int resultSetConcurrency)
Prepare a statement. |
void |
prepareStatement(java.lang.String sql,
boolean specifyTypeAndConcur,
int resultSetType,
int resultSetConcurrency,
int fetchSize,
int maxRows)
Prepare a statement. |
void |
rollback()
Rollback all modifications |
void |
setBinaryStream(java.lang.Object field)
Set the next binding variable of the currently active prepared statement to write the serialized data of 'field' to a BLOB. |
void |
setBytes(byte[] bytes)
Set the next binding variable of the currently active prepared statement to write the serialized data of 'field' to a Blob with the given bytes. |
protected void |
setFetchSize(java.sql.Statement stmt,
int fetchSize)
|
void |
setValue(java.math.BigDecimal field)
Set the next binding variable of the currently active prepared statement. |
void |
setValue(java.sql.Blob field)
Set the next binding variable of the currently active prepared statement |
void |
setValue(java.lang.Boolean field)
Set the next binding variable of the currently active prepared statement. |
void |
setValue(java.sql.Clob field)
Set the next binding variable of the currently active prepared statement |
void |
setValue(java.sql.Date field)
Set the next binding variable of the currently active prepared statement. |
void |
setValue(java.lang.Double field)
Set the next binding variable of the currently active prepared statement. |
void |
setValue(java.lang.Float field)
Set the next binding variable of the currently active prepared statement. |
void |
setValue(java.lang.Integer field)
Set the next binding variable of the currently active prepared statement. |
void |
setValue(java.lang.Long field)
Set the next binding variable of the currently active prepared statement. |
void |
setValue(java.lang.Object field)
Set the next binding variable of the currently active prepared statement. |
void |
setValue(java.lang.String field)
Set the next binding variable of the currently active prepared statement. |
void |
setValue(java.sql.Time field)
Set the next binding variable of the currently active prepared statement. |
void |
setValue(java.sql.Timestamp field)
Set the next binding variable of the currently active prepared statement. |
protected void |
testConnection(java.sql.Connection con)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String module
public static java.util.List<java.lang.String> CONNECTION_TEST_LIST
public static int MAX_CONNECTIONS
public static boolean ENABLE_TEST
Constructor Detail |
---|
public SQLProcessor(java.lang.String helperName)
helperName
- The datasource helper (see entityengine.xml <datasource name="..">)public SQLProcessor(java.lang.String helperName, java.sql.Connection connection)
helperName
- The datasource helper (see entityengine.xml <datasource name="..">)connection
- The connection to be usedMethod Detail |
---|
public void commit() throws GenericDataSourceException
GenericDataSourceException
public void rollback() throws GenericDataSourceException
GenericDataSourceException
public void close() throws GenericDataSourceException
GenericDataSourceException
public java.sql.Connection getConnection() throws GenericDataSourceException, GenericEntityException
GenericDataSourceException
GenericEntityException
public void prepareStatement(java.lang.String sql) throws GenericDataSourceException, GenericEntityException
sql
- The SQL statement to be executed
GenericDataSourceException
GenericEntityException
public void prepareStatement(java.lang.String sql, boolean specifyTypeAndConcur, int resultSetType, int resultSetConcurrency) throws GenericDataSourceException, GenericEntityException
sql
- The SQL statement to be executed
GenericDataSourceException
GenericEntityException
public void prepareStatement(java.lang.String sql, boolean specifyTypeAndConcur, int resultSetType, int resultSetConcurrency, int fetchSize, int maxRows) throws GenericDataSourceException, GenericEntityException
sql
- The SQL statement to be executed
GenericDataSourceException
GenericEntityException
public java.sql.ResultSet executeQuery() throws GenericDataSourceException
GenericDataSourceException
public java.sql.ResultSet executeQuery(java.lang.String sql) throws GenericDataSourceException, GenericEntityException
sql
- The SQL string to be executed
GenericEntityException
GenericDataSourceException
public int executeUpdate() throws GenericDataSourceException
GenericDataSourceException
public int executeUpdate(java.lang.String sql) throws GenericDataSourceException
sql
- SQL statement to be executed
GenericDataSourceException
public boolean next() throws GenericDataSourceException
GenericDataSourceException
public java.sql.ResultSet getResultSet()
public java.sql.PreparedStatement getPreparedStatement()
public void execQuery(java.lang.String sql, ExecQueryCallbackFunctionIF aListener) throws GenericEntityException
sql
- The SQL string to be executedaListener
- The callback function object
GenericEntityException
public void setValue(java.lang.String field) throws java.sql.SQLException
field
-
java.sql.SQLException
public void setValue(java.sql.Timestamp field) throws java.sql.SQLException
field
-
java.sql.SQLException
public void setValue(java.sql.Time field) throws java.sql.SQLException
field
-
java.sql.SQLException
public void setValue(java.sql.Date field) throws java.sql.SQLException
field
-
java.sql.SQLException
public void setValue(java.lang.Integer field) throws java.sql.SQLException
field
-
java.sql.SQLException
public void setValue(java.lang.Long field) throws java.sql.SQLException
field
-
java.sql.SQLException
public void setValue(java.lang.Float field) throws java.sql.SQLException
field
-
java.sql.SQLException
public void setValue(java.lang.Double field) throws java.sql.SQLException
field
-
java.sql.SQLException
public void setValue(java.math.BigDecimal field) throws java.sql.SQLException
field
-
java.sql.SQLException
public void setValue(java.lang.Boolean field) throws java.sql.SQLException
field
-
java.sql.SQLException
public void setValue(java.lang.Object field) throws java.sql.SQLException
field
-
java.sql.SQLException
public void setValue(java.sql.Blob field) throws java.sql.SQLException
field
-
java.sql.SQLException
public void setValue(java.sql.Clob field) throws java.sql.SQLException
field
-
java.sql.SQLException
public void setBinaryStream(java.lang.Object field) throws java.sql.SQLException
field
-
java.sql.SQLException
public void setBytes(byte[] bytes) throws java.sql.SQLException
bytes
-
java.sql.SQLException
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
protected void testConnection(java.sql.Connection con) throws GenericEntityException
GenericEntityException
protected void setFetchSize(java.sql.Statement stmt, int fetchSize) throws java.sql.SQLException
java.sql.SQLException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |