Package generalDatabase
Class DBSystem
java.lang.Object
generalDatabase.DBSystem
- Direct Known Subclasses:
 BaseAccessSystem,ServerBasedSystem,SqliteSystem,SQLServerSystem
- 
Field Summary
Fields - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionabstract StringbrowseDatabases(Component parent) abstract StringbrowseDatabasesFX(int type) Browse for databases using an FX dialog.abstract booleanbooleanfind out if it's possible to open the current databse with a host application (e.g.booleanCheck a database file exists on the system.booleancheckDatabaseExists(String dbName) voidcloseConnection(PamConnection connection) Close the database connectionabstract booleancreate()Create a new databaseprotected abstract booleancreateNewDatabase(String forcedName) abstract PamCursorcreatePamCursor(EmptyTableDefinition tableDefinition) abstract booleanexists()final PamConnectionOpen a new database connection with the default name.abstract PamConnectiongetConnection(String databaseName) Open new database connection with a specific nameabstract Stringabstract SystemDialogPaneFXGet the FX pane for the database systemabstract SystemDialogPanelgetDialogPanel(Component parent) Get a database specific dialog panel to include in the database select dialog.Get a list of keywords which potentially may not be used for column names in an SQL statement.Get a shorter version of the currently open database name (e.g.abstract SQLTypesGet the SQLTypes object which can be used to preform system specific formatting of SQL strings.abstract Stringabstract booleanbooleanOpen the database with it's host application if available (e.g.protected PamConnectionreOpenConnection(PamConnection connection) Reopen a database connection. 
- 
Field Details
- 
keywords2003
- See Also:
 
 
 - 
 - 
Constructor Details
- 
DBSystem
public DBSystem() 
 - 
 - 
Method Details
- 
getSystemName
- Returns:
 - The name of the database system
 
 - 
canCreate
public abstract boolean canCreate()- Returns:
 - true if the system can create new databases.
 
 - 
getDatabaseName
- Returns:
 - the name of the currently open database.
 
 - 
getShortDatabaseName
Get a shorter version of the currently open database name (e.g. without the file path name)- Returns:
 - a shorter name
 
 - 
getSqlTypes
Get the SQLTypes object which can be used to preform system specific formatting of SQL strings.- Returns:
 
 - 
exists
public abstract boolean exists()- Returns:
 - true if the database exists
 
 - 
create
public abstract boolean create()Create a new databaseThe underlying DBSystem will be responsible for any dialogs to chose database names, etc.
- Returns:
 - true if successful.
 
 - 
getConnection
Open a new database connection with the default name. - 
getConnection
Open new database connection with a specific name- Parameters:
 databaseName-- Returns:
 
 - 
closeConnection
Close the database connection- Parameters:
 connection-
 - 
browseDatabases
 - 
getDialogPanel
Get a database specific dialog panel to include in the database select dialog.- Parameters:
 parent- parent component- Returns:
 - dialog panel
 
 - 
createPamCursor
 - 
hasDriver
public abstract boolean hasDriver()- Returns:
 - true if the driver for this database system is available on this computer. the availability of database system will depend both on the OS and whether software are installed.
 
 - 
getKeywords
Get a list of keywords which potentially may not be used for column names in an SQL statement. In reality, this list is complete overkill. Override for each system and try to reduce the list as much as possible.- Returns:
 - list of restricted keywords.
 
 - 
canOpenDatabase
public boolean canOpenDatabase()find out if it's possible to open the current databse with a host application (e.g. MS Access).- Returns:
 - true if it's possible.
 
 - 
openCurrentDatabase
public boolean openCurrentDatabase()Open the database with it's host application if available (e.g. open MS access database with Access).- Returns:
 - true if opened sucessfully.
 
 - 
reOpenConnection
Reopen a database connection. This has a default action of doing absolutely nothing since it's only actually required by SqLite before it writes after doing some reading.- Parameters:
 connection- existing connection- Returns:
 - new connection.
 
 - 
getDialogPaneFX
Get the FX pane for the database system- Returns:
 - the FX settings pane for the database system.
 
 - 
browseDatabasesFX
Browse for databases using an FX dialog.- Parameters:
 type-- Returns:
 
 - 
checkDatabaseExists
 - 
checkDatabaseExists
public boolean checkDatabaseExists()Check a database file exists on the system. Default code here is not suitable for server based database systems.- Returns:
 - false if a file name is there, but no file.
 
 - 
createNewDatabase
 
 -