public interface DatabaseServices
extends org.apache.tapestry5.ioc.services.RegistryShutdownListener
| Modifier and Type | Method and Description |
|---|---|
void |
bindParam(java.sql.PreparedStatement sql,
int index,
java.lang.Object data)
Bind a parameter to a SQL statement.
|
java.sql.Connection |
checkConnection(java.lang.String database)
Return a connection to the specified database, failing if it does not
exist.
|
void |
delete(java.lang.String db,
java.lang.String index,
java.lang.String table,
java.util.Map<java.lang.String,java.lang.Object> where)
Top level wrapper for a delete statement.
|
void |
execute(java.lang.String db,
java.lang.String index,
java.lang.String sql,
java.util.List<java.lang.Object> fields)
Top level wrapper to execute simple non-returning SQL, such as create
or update statements.
|
void |
free(java.sql.PreparedStatement sql)
Free the resources for a prepared statement.
|
java.sql.Connection |
getConnection(java.lang.String database)
Return a connection to the specified database.
|
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
getResults(java.sql.PreparedStatement sql)
Parse the results of the query into a basic Java data structure.
|
void |
insert(java.lang.String db,
java.lang.String index,
java.lang.String table,
java.util.Map<java.lang.String,java.lang.Object> fields)
Top level wrapper for an insert statement.
|
java.sql.PreparedStatement |
prepare(java.sql.Connection db,
java.lang.String index,
java.lang.String sql)
Prepare and return an SQL statement, filing it under the provided index.
|
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
select(java.lang.String db,
java.lang.String index,
java.lang.String sql,
java.util.List<java.lang.Object> fields)
Top level wrapper for a select statement.
|
java.sql.Connection checkConnection(java.lang.String database)
throws java.lang.Exception
database - The name of the database to connect to.java.lang.Exception - if there is a connection error.java.sql.Connection getConnection(java.lang.String database)
throws java.lang.Exception
database - The name of the database to connect to.java.lang.Exception - if there is a connection error.java.sql.PreparedStatement prepare(java.sql.Connection db,
java.lang.String index,
java.lang.String sql)
throws java.lang.Exception
db - The database connection to use.index - The index to store the statement under.sql - The SQL statement to prepare.java.lang.Exception - if there is an error.void bindParam(java.sql.PreparedStatement sql,
int index,
java.lang.Object data)
throws java.lang.Exception
sql - The prepared statement to bind to.index - Specifies which placeholder to bind to (starts at 1).data - The data to bind to that placeholder.java.lang.Exception - if there is an error.void free(java.sql.PreparedStatement sql)
throws java.lang.Exception
sql - The prepared statement to release.java.lang.Exception - if there is an error.java.util.List<java.util.Map<java.lang.String,java.lang.String>> getResults(java.sql.PreparedStatement sql)
throws java.lang.Exception
sql - The prepared statement to get the results from.java.lang.Exception - if there is an error.java.util.List<java.util.Map<java.lang.String,java.lang.String>> select(java.lang.String db,
java.lang.String index,
java.lang.String sql,
java.util.List<java.lang.Object> fields)
throws java.lang.Exception
db - The database connection to use.index - The index to file this statement under for caching.sql - The sql string to execute.fields - The data to bind against placeholders. NULL is valid.java.lang.Exception - if there is an error.void insert(java.lang.String db,
java.lang.String index,
java.lang.String table,
java.util.Map<java.lang.String,java.lang.Object> fields)
throws java.lang.Exception
db - The database connection to use.index - The index to file this statement under for caching.table - The name of the table to insert into.fields - The data to insert, a map of java.lang.Exception - if there is an error.void delete(java.lang.String db,
java.lang.String index,
java.lang.String table,
java.util.Map<java.lang.String,java.lang.Object> where)
throws java.lang.Exception
db - The database connection to use.index - The index to file this statement under for caching.table - The name of the table to delete.fields - The data to use in a where clause. key/value pairsjava.lang.Exception - if there is an error.void execute(java.lang.String db,
java.lang.String index,
java.lang.String sql,
java.util.List<java.lang.Object> fields)
throws java.lang.Exception
db - The database connection to use.index - The index to file this statement under for caching.sql - The sql string to execute.fields - The data to bind against placeholders. NULL is valid.java.lang.Exception - if there is an error.Copyright © 2009-2019. All Rights Reserved.