ajax.wrappers.jdbc
Class JdbcWrapper
java.lang.Object
|
+--ajax.wrappers.jdbc.JdbcWrapper
- All Implemented Interfaces:
- Wrapper
- public class JdbcWrapper
- extends java.lang.Object
- implements Wrapper
Allows to access to jdbc compatible database.
Constructor Summary |
JdbcWrapper(java.lang.String createQuery,
java.lang.String tableName)
Creates a Jdbc Table with the given query. |
Method Summary |
void |
close()
Closes wrapper. (close the statement) |
java.sql.ResultSet |
executeQuery(java.lang.String query)
Executes a query. |
int |
executeUpdate(java.lang.String sql)
Executes an update. |
static Wrapper |
open(java.lang.String tableName)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JdbcWrapper
public JdbcWrapper(java.lang.String createQuery,
java.lang.String tableName)
throws WrapperException
- Creates a Jdbc Table with the given query.
- Parameters:
createQuery
- SQL CREATE query
executeQuery
public java.sql.ResultSet executeQuery(java.lang.String query)
throws WrapperException
- Executes a query.
- Specified by:
executeQuery
in interface Wrapper
- Parameters:
query
- SQL query- Returns:
- the result
- See Also:
Statement.executeQuery(String)
executeUpdate
public int executeUpdate(java.lang.String sql)
throws WrapperException
- Executes an update.
- Specified by:
executeUpdate
in interface Wrapper
- Parameters:
sql
- SQL update- Returns:
- either the row count for INSERT, UPDATE or DELETE
or 0 for SQL statements that return nothing
- See Also:
Statement.executeUpdate(String)
open
public static Wrapper open(java.lang.String tableName)
throws WrapperException
close
public void close()
- Closes wrapper. (close the statement)
- Specified by:
close
in interface Wrapper