|
MySQL Connector/J size='-1'>5.1.6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mysql.jdbc.util.ServerController
public class ServerController
Controls a MySQL server using Java RunTime methods
Field Summary | |
---|---|
static java.lang.String |
BASEDIR_KEY
Where is the server installed? |
static java.lang.String |
DATADIR_KEY
Where are the databases installed? |
static java.lang.String |
DEFAULTS_FILE_KEY
Where is the config file located? |
static java.lang.String |
EXECUTABLE_NAME_KEY
What is the name of the executable to run? |
static java.lang.String |
EXECUTABLE_PATH_KEY
What is the path to the mysql server executable (if not standard?) |
Constructor Summary | |
---|---|
ServerController(java.lang.String baseDir)
Creates a ServerController with the directory for the MySQL server. |
|
ServerController(java.lang.String basedir,
java.lang.String datadir)
Creates a server controller for the MySQL server with the given basedir and datadir. |
Method Summary | |
---|---|
void |
forceStop()
Forcefully terminates the server process (if started). |
java.util.Properties |
getServerProps()
Returns the list of properties that will be used to start/control the server. |
void |
setBaseDir(java.lang.String baseDir)
Sets the basedir to use when starting MySQL. |
void |
setDataDir(java.lang.String dataDir)
Sets the data to use when starting MySQL. |
java.lang.Process |
start()
Starts the server, returning a java.lang.Process instance that represents the mysql server. |
void |
stop(boolean forceIfNecessary)
Stops the server (if started) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BASEDIR_KEY
public static final java.lang.String DATADIR_KEY
public static final java.lang.String DEFAULTS_FILE_KEY
public static final java.lang.String EXECUTABLE_NAME_KEY
public static final java.lang.String EXECUTABLE_PATH_KEY
Constructor Detail |
---|
public ServerController(java.lang.String baseDir)
baseDir
- the base directory for the MySQL server.public ServerController(java.lang.String basedir, java.lang.String datadir)
basedir
- the basedir to use when starting MySQL.datadir
- the datadir to use when starting MySQL.Method Detail |
---|
public void setBaseDir(java.lang.String baseDir)
baseDir
- the basedir to use when starting MySQL.public void setDataDir(java.lang.String dataDir)
dataDir
- the basedir to use when starting MySQL.public java.lang.Process start() throws java.io.IOException
java.io.IOException
- if an error occurs while starting the mysql server.public void stop(boolean forceIfNecessary) throws java.io.IOException
forceIfNecessary
- use forceStop if mysqladmin doesn't shut the server down
java.io.IOException
- if an error occurs while stopping the serverpublic void forceStop()
public java.util.Properties getServerProps()
|
MySQL Connector/J size='-1'>5.1.6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |