Package generalDatabase
Class ServerBasedSystem
java.lang.Object
generalDatabase.DBSystem
generalDatabase.ServerBasedSystem
- All Implemented Interfaces:
PamSettings
,SettingsNameProvider
- Direct Known Subclasses:
MySQLSystem
,PostgreSQLSystem
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbrowseDatabases
(Component parent) browseDatabasesFX
(int type) Browse for databases using an FX dialog.abstract String
buildDatabaseUrl
(String ipAddress, int portNumber, String databaseName) boolean
abstract String
boolean
checkDatabaseExists
(String dbName) boolean
create()
Create a new databaseboolean
createNewDatabase
(String name) createPamCursor
(EmptyTableDefinition tableDefinition) boolean
exists()
abstract String
getConnection
(String databaseName) Open new database connection with a specific nameabstract int
abstract String
Get the FX pane for the database systemgetDialogPanel
(Component parent) Get a database specific dialog panel to include in the database select dialog.abstract String
abstract String
Get the database schema name - the name of the databse on the server which manages the other databaseslong
abstract String
boolean
boolean
boolean
restoreSettings
(PamControlledUnitSettings pamControlledUnitSettings) Methods inherited from class generalDatabase.DBSystem
canOpenDatabase, checkDatabaseExists, closeConnection, getConnection, getKeywords, getShortDatabaseName, getSqlTypes, openCurrentDatabase
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface PamController.PamSettings
getUnitType
-
Constructor Details
-
ServerBasedSystem
-
-
Method Details
-
browseDatabases
- Specified by:
browseDatabases
in classDBSystem
-
canCreate
public boolean canCreate() -
create
public boolean create()Description copied from class:DBSystem
Create a new databaseThe underlying DBSystem will be responsible for any dialogs to chose database names, etc.
-
exists
public boolean exists() -
getDriverClassName
-
getDefaultUser
-
getConnection
Description copied from class:DBSystem
Open new database connection with a specific name- Specified by:
getConnection
in classDBSystem
- Returns:
-
getSystemName
- Specified by:
getSystemName
in classDBSystem
- Returns:
- The name of the database system
-
hasDriver
public boolean hasDriver() -
getDialogPanel
Description copied from class:DBSystem
Get a database specific dialog panel to include in the database select dialog.- Specified by:
getDialogPanel
in classDBSystem
- Parameters:
parent
- parent component- Returns:
- dialog panel
-
getDefaultPort
public abstract int getDefaultPort() -
getSchemaName
Get the database schema name - the name of the databse on the server which manages the other databases- Returns:
-
createNewDatabase
-
getAvailableDatabaseString
-
checkAvailableDatabaseResult
-
buildDatabaseUrl
-
isServerConnected
public boolean isServerConnected() -
getDatabaseName
- Specified by:
getDatabaseName
in classDBSystem
- Returns:
- the name of the currently open database.
-
getSettingsReference
- Specified by:
getSettingsReference
in interfacePamSettings
- Returns:
- The serialisable object that will be stored
-
getSettingsVersion
public long getSettingsVersion()- Specified by:
getSettingsVersion
in interfacePamSettings
- Returns:
- An integer version number for the settings
-
getUnitName
- Specified by:
getUnitName
in interfaceSettingsNameProvider
- Returns:
- A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
-
restoreSettings
- Specified by:
restoreSettings
in interfacePamSettings
- Returns:
- true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required
-
createPamCursor
- Specified by:
createPamCursor
in classDBSystem
-
getDialogPaneFX
Description copied from class:DBSystem
Get the FX pane for the database system- Specified by:
getDialogPaneFX
in classDBSystem
- Returns:
- the FX settings pane for the database system.
-
browseDatabasesFX
Description copied from class:DBSystem
Browse for databases using an FX dialog.- Specified by:
browseDatabasesFX
in classDBSystem
- Returns:
-
checkDatabaseExists
- Overrides:
checkDatabaseExists
in classDBSystem
-