|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.org.ury.backend.database.DatabaseDriver
public class DatabaseDriver
A database connection manager that connects to the URY databases using suitably privileged accounts, and handles the processing of SQL queries.
Constructor Summary | |
---|---|
DatabaseDriver(ConfigReader config,
UserClass type)
Construct a new DatabaseDriver with the given user class. |
Method Summary | |
---|---|
java.sql.ResultSet |
executeQuery(java.lang.String sql,
int fetchSize)
Execute an unprepared SQL statement with no arguments. |
java.sql.ResultSet |
executeQuery(java.lang.String sql,
java.lang.Object[] params,
int fetchSize)
Perform a SQL statement with arguments. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DatabaseDriver(ConfigReader config, UserClass type) throws MissingCredentialsException, ConnectionFailureException
config
- The config with login details.type
- The user class to log in to the database with.
java.lang.IllegalArgumentException
- if the user class is not supported (this should not happen).
MissingCredentialsException
- if the user class login credentials could not be loaded.
ConnectionFailureException
- if the database backend failed to connect to the database
server.Method Detail |
---|
public java.sql.ResultSet executeQuery(java.lang.String sql, int fetchSize) throws java.sql.SQLException
sql
- The SQL statement to execute.fetchSize
- The maximum number of query rows to return.
java.sql.SQLException
- if a SQL error occurs.public java.sql.ResultSet executeQuery(java.lang.String sql, java.lang.Object[] params, int fetchSize) throws java.sql.SQLException
sql
- The SQL statement to execute.params
- A list of parameter objects.fetchSize
- The maximum number of query rows to return.
java.lang.IllegalArgumentException
- if any of the parameters is unsupported by the database as a
statement parameter.
java.sql.SQLException
- if a SQL error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |