|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dbms.DBMSBase
public class DBMSBase
Base class for the DBMS classes
Field Summary | |
---|---|
private DBMSSql |
commands
|
private DBConnection |
connection
|
Fields inherited from interface dbms.DBMSConstants |
---|
CLOSE_BRACE, COLON_SEPARATOR, COMMA, DOUBLE_QUOTE, DRIVER_LOCATION, EMPTY_STRING, FILE_SEPARATOR, LIMITED_DATABASE, NEW_LINE, OPEN_BRACE, QUOTE_CHARACTER, SINGLE_QUOTE, SPACE, USER_DIR |
Constructor Summary | |
---|---|
DBMSBase(DBMSSql commands,
java.lang.String hostname,
java.lang.String username,
java.lang.String password)
Constructor to create a connection object. |
Method Summary | |
---|---|
private java.lang.String |
createColumns(java.util.List columnNames,
java.util.List columnTypes)
concatenates the columnCreate string |
(package private) void |
getCatalogs(java.util.ArrayList<java.lang.String> catalogs)
Gets a list of the catalogs on the DBMS |
private java.sql.ResultSet |
getResultSet(java.lang.String tableName)
Uses the DBMSSql commands object to retrieve a resultset for the specific DBMS |
private java.sql.Statement |
getStatement()
|
(package private) void |
getTables(java.util.ArrayList<java.lang.String> tables,
java.lang.String catalog)
Gets a list of the tables on a catalog |
void |
insertData(java.lang.String tableName,
java.util.List columnNames,
java.util.List<java.util.List<java.lang.Object>> data)
retrieves a list of commands for the DBMS you are using |
private void |
setConnection(java.lang.String url,
java.lang.String driver,
java.lang.String username,
java.lang.String password)
Creates a new connection to a database and generates both a Statement object and a DatabaseMetaData object these are stored as instance fields (statement / dbm) |
void |
setup(java.lang.String database,
java.lang.String tableName,
java.util.List columnNames,
java.util.List columnTypes,
java.util.List<java.util.List<java.lang.Object>> data)
Creates the table based on provided information |
void |
setupDatabase(java.lang.String databaseName)
This creates a new database based on individual DBMS requirments |
void |
setupTable(java.lang.String database,
java.lang.String tableName,
java.util.List columnNames,
java.util.List columnTypes)
Updates the current list of Drivers from the config files to load a list of sqlDrivers |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private DBConnection connection
private DBMSSql commands
Constructor Detail |
---|
public DBMSBase(DBMSSql commands, java.lang.String hostname, java.lang.String username, java.lang.String password) throws java.lang.Exception
commands
- hostname
- username
- password
-
java.lang.Exception
Method Detail |
---|
private java.sql.ResultSet getResultSet(java.lang.String tableName) throws java.lang.Exception
tableName
-
java.lang.Exception
private java.lang.String createColumns(java.util.List columnNames, java.util.List columnTypes)
columnNames
- columnTypes
-
private void setConnection(java.lang.String url, java.lang.String driver, java.lang.String username, java.lang.String password) throws java.lang.Exception
url
- driver
- username
- password
-
java.lang.Exception
public void setupDatabase(java.lang.String databaseName) throws java.lang.Exception
databaseName
- the name of the database to create
java.lang.Exception
public void setup(java.lang.String database, java.lang.String tableName, java.util.List columnNames, java.util.List columnTypes, java.util.List<java.util.List<java.lang.Object>> data) throws java.lang.Exception
database
- tableName
- columnNames
- columnTypes
- data
-
java.lang.Exception
public void setupTable(java.lang.String database, java.lang.String tableName, java.util.List columnNames, java.util.List columnTypes) throws java.lang.Exception
database
- tableName
- columnNames
- columnTypes
-
java.lang.Exception
public void insertData(java.lang.String tableName, java.util.List columnNames, java.util.List<java.util.List<java.lang.Object>> data) throws java.lang.Exception
tableName
- columnNames
- data
-
java.lang.Exception
void getCatalogs(java.util.ArrayList<java.lang.String> catalogs) throws java.sql.SQLException
catalogs
- a list of catalogs to update
java.sql.SQLException
void getTables(java.util.ArrayList<java.lang.String> tables, java.lang.String catalog) throws java.sql.SQLException
tables
- catalog
-
java.sql.SQLException
private java.sql.Statement getStatement()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |