public class FBManager extends java.lang.Object implements FBManagerMBean
In particular, they can be created and dropped using the jboss service lifecycle operations start and stop.
See FBManagerMBean for documentation.
| Constructor and Description |
|---|
FBManager() |
FBManager(GDSType type) |
FBManager(java.lang.String type) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Alias for
FBManagerMBean.stop() |
void |
createDatabase(java.lang.String fileName,
java.lang.String user,
java.lang.String password)
Create a database with the specified file name, user name and password on the specified
server
and port. |
void |
dropDatabase(java.lang.String fileName,
java.lang.String user,
java.lang.String password)
Drop a database with the specified file name, user name and password on the specified
server
and port. |
java.lang.String |
getDefaultCharacterSet() |
int |
getDialect() |
java.lang.String |
getFileName() |
java.lang.String |
getName() |
int |
getPageSize() |
java.lang.String |
getPassword() |
int |
getPort() |
java.lang.String |
getServer() |
java.lang.String |
getState() |
java.lang.String |
getType() |
java.lang.String |
getUserName() |
boolean |
isCreateOnStart()
Get if the database will be created when calling
FBManagerMBean.start(). |
boolean |
isDatabaseExists(java.lang.String fileName,
java.lang.String user,
java.lang.String password)
Check if a database exists with the specified file name, user name and password on the specified
server
and port. |
boolean |
isDropOnStop()
Get if the database will be created when calling
FBManagerMBean.stop(). |
boolean |
isForceCreate()
Get if the database will be be dropped if exists when creating a database.
|
void |
setCreateOnStart(boolean createOnStart)
Set if the database will be created when calling
FBManagerMBean.start(). |
void |
setDefaultCharacterSet(java.lang.String firebirdCharsetName)
Set the default database character set to use when creating a new database.
|
void |
setDialect(int dialect)
Set the database dialect to use when creating a new database.
|
void |
setDropOnStop(boolean dropOnStop)
Set if the database will be created when calling
FBManagerMBean.stop(). |
void |
setFileName(java.lang.String fileName)
Set the file name or alias of the database.
|
void |
setForceCreate(boolean forceCreate)
Set if the database will be be dropped if exists when creating a database.
|
void |
setPageSize(int pageSize)
Set the page size to use when creating a new database.
|
void |
setPassword(java.lang.String password)
Set the password.
|
void |
setPort(int port)
Set the port of the Firebird server.
|
void |
setServer(java.lang.String host)
Set the host name of the Firebird server.
|
void |
setType(java.lang.String type)
Set the GDS plugin type to use.
|
void |
setUserName(java.lang.String userName)
Set the user name.
|
void |
start()
Start this manager.
|
void |
stop()
Stop this manager.
|
public FBManager()
public FBManager(GDSType type)
public FBManager(java.lang.String type)
public void start()
throws java.lang.Exception
FBManagerMBean
If FBManagerMBean.isCreateOnStart() is true, will attempt to create a new database specified using
the server, port, fileName and related properties. If the specified already exists,
nothing will be created unless FBManagerMBean.isForceCreate() is true. When forceCreate is true
an attempt will be made to drop the database.
start in interface FBManagerMBeanjava.lang.IllegalStateException - If this manager is not startedjava.lang.Exception - For failures to start or create the databasepublic void stop()
throws java.lang.Exception
FBManagerMBean
If FBManagerMBean.isDropOnStop() is true, will attempt to drop the database specified using the server,
port, fileName and related properties,
If the manager is currently stopped, this method will do nothing.
stop in interface FBManagerMBeanjava.lang.Exception - For failures to drop the database.public void close()
throws java.lang.Exception
FBManagerMBeanFBManagerMBean.stop()close in interface java.lang.AutoCloseableclose in interface FBManagerMBeanjava.lang.Exceptionpublic java.lang.String getState()
getState in interface FBManagerMBean"Stopped" or "Started"public java.lang.String getName()
getName in interface FBManagerMBeanpublic void setServer(java.lang.String host)
FBManagerMBeansetServer in interface FBManagerMBeanhost - Hostnamepublic java.lang.String getServer()
getServer in interface FBManagerMBean"localhost")public void setPort(int port)
FBManagerMBeansetPort in interface FBManagerMBeanport - Port of the Firebird serverpublic int getPort()
getPort in interface FBManagerMBean3050)public java.lang.String getFileName()
getFileName in interface FBManagerMBeanpublic void setFileName(java.lang.String fileName)
FBManagerMBeansetFileName in interface FBManagerMBeanfileName - File name or alias of the databasepublic java.lang.String getType()
getType in interface FBManagerMBeanGDSFactory.getDefaultGDSType())public void setType(java.lang.String type)
FBManagerMBeansetType in interface FBManagerMBeantype - GDS plugin type name (PURE_JAVA, NATIVE, EMBEDDED, LOCAL)public java.lang.String getUserName()
getUserName in interface FBManagerMBeanpublic void setUserName(java.lang.String userName)
FBManagerMBeansetUserName in interface FBManagerMBeanuserName - User namepublic java.lang.String getPassword()
getPassword in interface FBManagerMBeanpublic void setPassword(java.lang.String password)
FBManagerMBeansetPassword in interface FBManagerMBeanpassword - Passwordpublic void setDialect(int dialect)
FBManagerMBeansetDialect in interface FBManagerMBeandialect - Database dialect (1 or 3)FBManagerMBean.getDialect()public int getDialect()
getDialect in interface FBManagerMBeanpublic void setPageSize(int pageSize)
FBManagerMBean
The value for pageSize must be one of PageSizeConstants. The default value depends on the
Firebird version.
Some values are not valid on all Firebird versions.
setPageSize in interface FBManagerMBeanpageSize - The page size to be used in the created database, see PageSizeConstantsPageSizeConstantspublic int getPageSize()
getPageSize in interface FBManagerMBean-1 if the database default is used.public void setDefaultCharacterSet(java.lang.String firebirdCharsetName)
FBManagerMBeansetDefaultCharacterSet in interface FBManagerMBeanfirebirdCharsetName - Character set name, use Firebird names only; null will use Firebird default (NONE).
Specifying an invalid name will result in an exception during database creation.public java.lang.String getDefaultCharacterSet()
getDefaultCharacterSet in interface FBManagerMBeannull means not set.FBManagerMBean.setDefaultCharacterSet(String)public boolean isCreateOnStart()
FBManagerMBeanFBManagerMBean.start().isCreateOnStart in interface FBManagerMBeantrue when the database will be created on start, false otherwise.public void setCreateOnStart(boolean createOnStart)
FBManagerMBeanFBManagerMBean.start().setCreateOnStart in interface FBManagerMBeancreateOnStart - true to create the database on start, false to not create on start (default)public boolean isDropOnStop()
FBManagerMBeanFBManagerMBean.stop().isDropOnStop in interface FBManagerMBeantrue to drop the database on stop, false otherwisepublic void setDropOnStop(boolean dropOnStop)
FBManagerMBeanFBManagerMBean.stop().setDropOnStop in interface FBManagerMBeandropOnStop - true to drop the database on stop, false to not drop on stop (default)public boolean isForceCreate()
FBManagerMBeanisForceCreate in interface FBManagerMBeantrue to drop existing database on create, false to not create a database if it exists.public void setForceCreate(boolean forceCreate)
FBManagerMBeansetForceCreate in interface FBManagerMBeanforceCreate - true to drop existing database on create, false to not create a database if it exists.public void createDatabase(java.lang.String fileName,
java.lang.String user,
java.lang.String password)
throws java.lang.Exception
FBManagerMBeanserver
and port.
On creation, the following properties will used to configure the database: dialect, pageSize,
defaultCharacterSet.
If the database already exists, and forceCreate is true, the database will be dropped. If
false, no database will be created.
createDatabase in interface FBManagerMBeanfileName - Database file name or aliasuser - User namepassword - Passwordjava.lang.IllegalStateException - If this manager is not startedjava.lang.Exception - If database creation fails.public void dropDatabase(java.lang.String fileName,
java.lang.String user,
java.lang.String password)
throws java.lang.Exception
FBManagerMBeanserver
and port.dropDatabase in interface FBManagerMBeanfileName - Database file name or aliasuser - User namepassword - Passwordjava.lang.Exception - If this manager is not started or database drop fails.public boolean isDatabaseExists(java.lang.String fileName,
java.lang.String user,
java.lang.String password)
throws java.lang.Exception
FBManagerMBeanserver
and port.
Existence is checked by connecting to the database, so any connection error, including invalid credentials, will report the database as not existing.
isDatabaseExists in interface FBManagerMBeanfileName - Database file name or aliasuser - User namepassword - Passwordtrue if the database exists and can be connected, false if the database does not exist
or any other error occurred.java.lang.Exception - Currently no other exception is thrown, this may change in the futureCopyright © 2001-2022 Jaybird (Firebird JDBC/JCA) team. All rights reserved.