public class DerbyDatabaseManager extends Object implements DatabaseManager
| Constructor and Description |
|---|
DerbyDatabaseManager(String jdbcURL)
method will start derby server and create a database connection
|
DerbyDatabaseManager(String jdbcURL,
String userName,
String passWord) |
| Modifier and Type | Method and Description |
|---|---|
void |
disconnect()
disconnect from database server
|
void |
execute(String sql)
execute sql statement
|
ResultSet |
executeQuery(String sqlQuery)
Executing sql query
|
void |
executeUpdate(File sqlFile)
update database information bu giving sql file
|
void |
executeUpdate(String sql)
update existing database information
|
protected void |
finalize() |
Statement |
getStatement(String sql) |
void |
setAutoCommit() |
public DerbyDatabaseManager(String jdbcURL) throws ClassNotFoundException, SQLException, IllegalAccessException, InstantiationException
jdbcURL - JDBC url sample provided in class commentException - sql exceptionsClassNotFoundExceptionSQLExceptionIllegalAccessExceptionInstantiationExceptionpublic DerbyDatabaseManager(String jdbcURL, String userName, String passWord) throws ClassNotFoundException, SQLException, IllegalAccessException, InstantiationException
jdbcURL - userName - passWord - ClassNotFoundExceptionSQLExceptionIllegalAccessExceptionInstantiationExceptionpublic void setAutoCommit()
throws SQLException
SQLExceptionpublic void executeUpdate(String sql) throws SQLException
executeUpdate in interface DatabaseManagersql - update sql stringException - sql exceptionSQLExceptionpublic void executeUpdate(File sqlFile) throws SQLException, IOException
executeUpdate in interface DatabaseManagersqlFile - sql fileException - sql exceptionSQLExceptionIOExceptionpublic ResultSet executeQuery(String sqlQuery) throws SQLException
executeQuery in interface DatabaseManagersqlQuery - query statementException - exceptionSQLExceptionpublic void execute(String sql) throws SQLException
execute in interface DatabaseManagersql - sql statementException - exceptionSQLExceptionpublic Statement getStatement(String sql) throws SQLException
getStatement in interface DatabaseManagersql - SQLExceptionpublic void disconnect()
throws SQLException
disconnect in interface DatabaseManagerSQLExceptionCopyright © 2014. All rights reserved.