Package com.wisecoders.dbs.schema
Class ConnectorManager
java.lang.Object
com.wisecoders.dbs.schema.ConnectorManager
- Direct Known Subclasses:
CLIConnectorManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Connector
createConnector
(String dbId) static Connector
createConnector
(String alias, String dbId, String host, int port, String driverClassName, String instance, String user) Create a connector with for the same Rdbms as the model.static Connector
createConnector
(String alias, String dbId, String driverClassName, String jdbcURL, String userName, String password) Create a connection using the given JDBC URL.static Connector
createConnector
(String alias, String dbId, String driverClassName, String driverJarFileName, String urlTemplateName, String host, int port, String instance, String user, boolean readOnly) Create a connection to database, using the driver jar file name (if there are more drivers), the JDBC URL template namestatic Connector
createH2LocalConnector
(String name, String filePath) static Connector
duplicateConnector
(Connector other) Duplicate an existing connectorstatic Connector
static javafx.collections.ObservableList<Connector>
getConnectors
(String dbId) static Connector
getConnectors
(String dbId, String connectorAlias) static String
proposeName
(String dbId, String name) static void
refresh()
static void
resetConnectors
(String dbId) static void
static void
-
Field Details
-
decimalFormat000
-
-
Constructor Details
-
ConnectorManager
public ConnectorManager()
-
-
Method Details
-
getConnectorDbIdList
-
getConnectors
-
getConnectors
-
getConnectors
-
getByName
-
createConnector
-
createConnector
public static Connector createConnector(String alias, String dbId, String driverClassName, String driverJarFileName, String urlTemplateName, String host, int port, String instance, String user, boolean readOnly) Create a connection to database, using the driver jar file name (if there are more drivers), the JDBC URL template name- Parameters:
alias
- - a name for the connectiondbId
- the database namedriverClassName
- is the name of the class to connect to database. Open the Connection Dialog in DbSchema and you will see the class name and driverJarFileName listed there.driverJarFileName
- is the name of the jar driver file under 'Users/CURRENT_USER/.DbSchema/RDBMS_NAME/drivers'. Use null if you have a single driver, or specify the file name if you use multiple drivers.urlTemplateName
- is the name which shows in the Connection Dialog when choosing a connection:'Standard', 'Using Authentication'....host
- the server host name. You should be able to ping this host ('ping hostname')'port
- where the server runsinstance
- the name of the database or instance in the database serveruser
- to connect toreadOnly
- connection- Returns:
- a Connector class you can use for connecting to database
-
createConnector
public static Connector createConnector(String alias, String dbId, String driverClassName, String jdbcURL, String userName, String password) Create a connection using the given JDBC URL. The DBMS will be the same as the project DBMS.- Parameters:
alias
- The connection alias, can be any pseud-name.driverClassName
- The class name of the driver, you can find it in the JDBC combo of the connection dialog.jdbcURL
- The JDBC URL. Same can be used if you enter 'Edit Manually' in DbSchema.userName
- The database username.password
- The database password.- Returns:
- The created connection.
-
createConnector
public static Connector createConnector(String alias, String dbId, String host, int port, String driverClassName, String instance, String user) Create a connector with for the same Rdbms as the model. The driver is the fist found in the list of drivers.- Parameters:
alias
- of the connector in the project connectors listhost
- of the databaseport
- of the databasedriverClassName
- to useinstance
- of the databaseuser
- in the database- Returns:
- the connector
-
duplicateConnector
Duplicate an existing connector- Parameters:
other
- the new connector alias- Returns:
- The new connector
-
refresh
public static void refresh() -
proposeName
-
saveConnectors
public static void saveConnectors() -
savePasswords
public static void savePasswords() -
createH2LocalConnector
-
resetConnectors
-