|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteasik.sketch.util.Export.Database.DatabaseBuilder
public class DatabaseBuilder
A class to convert a sketch to a database through an existing database platform.
Field Summary | |
---|---|
private java.sql.Connection |
_con
The connection made to the database |
private java.lang.String |
_dataTypePlatform
The database used |
private DatabaseUI |
_db
The UI used to gather information to form the connection |
private java.lang.String |
_name
The name of the database |
private SketchToSchema |
_schema
The schema built from the XML file |
private ExportHandler |
_sqlHandler
The handler made from the file |
Constructor Summary | |
---|---|
DatabaseBuilder(ExportHandler sh,
DatabaseUI db)
Creates a new database builder which forms a connection to the database. |
Method Summary | |
---|---|
private java.lang.String |
checkURL(java.lang.String url)
Class to prompt the user for the URL of the database. |
private boolean |
setConstraints()
Sets the constraint string in the database. |
private boolean |
setDatabase()
Method to create a new database and set this database to be the one to use from all points afterwords |
private boolean |
setFailTable()
Sets the fail table and procedure for the newly created database so failures can be logged and triggers can produce an error statement should an illegal operation be performed. |
private boolean |
setTables()
A method to create the database tables. |
private boolean |
setTriggers()
A method to pass trigger strings to the SQL server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.sql.Connection _con
private java.lang.String _name
private java.lang.String _dataTypePlatform
private SketchToSchema _schema
private ExportHandler _sqlHandler
private DatabaseUI _db
Constructor Detail |
---|
public DatabaseBuilder(ExportHandler sh, DatabaseUI db)
sh
- The export handler for this sketchdb
- The UI containing information about the connectionMethod Detail |
---|
private java.lang.String checkURL(java.lang.String url) throws java.lang.Exception
url
- The URL provided by the user
java.lang.Exception
- If the URL is null or contains spacesprivate boolean setDatabase()
private boolean setTables()
private boolean setFailTable()
private boolean setConstraints()
private boolean setTriggers()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |