MySQL Connector/J size='-1'>5.0.8

com.mysql.jdbc.util
Class ServerController

java.lang.Object
  extended bycom.mysql.jdbc.util.ServerController

public class ServerController
extends java.lang.Object

Controls a MySQL server using Java RunTime methods

Version:
$Id: ServerController.java,v 1.1.2.1 2005/05/13 18:58:39 mmatthews Exp $
Author:
Mark Matthews

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

BASEDIR_KEY

public static final java.lang.String BASEDIR_KEY
Where is the server installed?

See Also:
Constant Field Values

DATADIR_KEY

public static final java.lang.String DATADIR_KEY
Where are the databases installed?

See Also:
Constant Field Values

DEFAULTS_FILE_KEY

public static final java.lang.String DEFAULTS_FILE_KEY
Where is the config file located?

See Also:
Constant Field Values

EXECUTABLE_NAME_KEY

public static final java.lang.String EXECUTABLE_NAME_KEY
What is the name of the executable to run?

See Also:
Constant Field Values

EXECUTABLE_PATH_KEY

public static final java.lang.String EXECUTABLE_PATH_KEY
What is the path to the mysql server executable (if not standard?)

See Also:
Constant Field Values
Constructor Detail

ServerController

public ServerController(java.lang.String baseDir)
Creates a ServerController with the directory for the MySQL server. The 'datadir' is set to the same directory.

Parameters:
baseDir - the base directory for the MySQL server.

ServerController

public ServerController(java.lang.String basedir,
                        java.lang.String datadir)
Creates a server controller for the MySQL server with the given basedir and datadir.

Parameters:
basedir - the basedir to use when starting MySQL.
datadir - the datadir to use when starting MySQL.
Method Detail

setBaseDir

public void setBaseDir(java.lang.String baseDir)
Sets the basedir to use when starting MySQL.

Parameters:
baseDir - the basedir to use when starting MySQL.

setDataDir

public void setDataDir(java.lang.String dataDir)
Sets the data to use when starting MySQL.

Parameters:
dataDir - the basedir to use when starting MySQL.

start

public java.lang.Process start()
                        throws java.io.IOException
Starts the server, returning a java.lang.Process instance that represents the mysql server.

Returns:
Process a java.lang.Process instance representing the mysql server process.
Throws:
java.io.IOException - if an error occurs while starting the mysql server.

stop

public void stop(boolean forceIfNecessary)
          throws java.io.IOException
Stops the server (if started)

Parameters:
forceIfNecessary - use forceStop if mysqladmin doesn't shut the server down
Throws:
java.io.IOException - if an error occurs while stopping the server

forceStop

public void forceStop()
Forcefully terminates the server process (if started).


getServerProps

public java.util.Properties getServerProps()
Returns the list of properties that will be used to start/control the server.

Returns:
Properties the list of properties.

MySQL Connector/J size='-1'>5.0.8