| | | | | | | | | | AOSH Commands
add_mysql_database database_name server package
Simple API
/**
* Adds a MySQLDatabase to a Server
*
* @param aoClient the SimpleAOClient to use
* @param name the name of the database to add
* @param server the hostname of the server to add the database to
* @param packageName the name of the Package that owns the new database
*/
public static void addMySQLDatabase(
SimpleAOClient aoClient,
String name,
String server,
String packageName
) throws IOException, SQLException {
aoClient.addMySQLDatabase(name, server, packageName);
}
Full API
/**
* Adds a MySQLDatabase to a Server
*
* @param aoClient the SimpleAOClient to use
* @param name the name of the database to add
* @param server the hostname of the server to add the database to
* @param packageName the name of the Package that owns the new database
*
* @return the new MySQLDatabase
*/
public static MySQLDatabase addMySQLDatabase(
AOServConnector conn,
String name,
String server,
String packageName
) throws IOException, SQLException {
// Resolve the Server
Server se=conn.getServerTable().getServer(server);
// Resolve the Package
Package pk=conn.getPackageTable().getPackage(packageName);
// Add the MySQLDatabase
int mdPKey=se.addMySQLDatabase(name, pk);
MySQLDatabase md=conn.getMySQLDatabaseTable().getMySQLDatabase(mdPKey);
// Return the object
return md;
}
| | | | | Copyright © 2000-2024 AO Industries, Inc. |
|