|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.liquidsite.util.db.DatabaseConnector
org.liquidsite.util.db.MySQLDatabaseConnector
A MySQL database connector.
| Field Summary |
| Fields inherited from class org.liquidsite.util.db.DatabaseConnector |
DEFAULT_CONNECTION_TIMEOUT, DEFAULT_QUERY_TIMEOUT |
| Constructor Summary | |
MySQLDatabaseConnector(java.lang.String host,
java.lang.String user,
java.lang.String password)
Creates a new MySQL database connector. |
|
MySQLDatabaseConnector(java.lang.String host,
java.lang.String database,
java.lang.String user,
java.lang.String password)
Creates a new MySQL database connector. |
|
| Method Summary | |
void |
addAccessPrivileges(java.lang.String database,
java.lang.String user)
Adds normal access privileges to a database for a user. |
void |
createDatabase(java.lang.String database)
Creates a new database. |
void |
createUser(java.lang.String user,
java.lang.String password)
Creates a new database user. |
void |
deleteDatabase(java.lang.String database)
Deletes an existing database. |
void |
deleteUser(java.lang.String user)
Deletes an existing database user. |
java.lang.String |
getDatabaseUser()
Returns the database user being used. |
boolean |
isAdministrator()
Checks if the database user is an administrator. |
java.util.ArrayList |
listDatabases()
Lists the visible databases. |
java.util.ArrayList |
listTables(java.lang.String database)
Lists the tables in a database. |
java.util.ArrayList |
listUsers()
Lists the users in a database. |
static void |
loadDriver()
Loads the MySQL database driver. |
void |
removeAccessPrivilege(java.lang.String database,
java.lang.String user)
Removes normal access privileges to a database for a user. |
| Methods inherited from class org.liquidsite.util.db.DatabaseConnector |
execute, execute, getConnection, getConnectionTimeout, getPoolSize, getProperties, getProperty, getUrl, loadDriver, loadFunctions, returnConnection, setConnectionTimeout, setPoolSize, setProperty, toString, update |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public MySQLDatabaseConnector(java.lang.String host,
java.lang.String user,
java.lang.String password)
host - the host nameuser - the user namepassword - the user password
public MySQLDatabaseConnector(java.lang.String host,
java.lang.String database,
java.lang.String user,
java.lang.String password)
host - the host namedatabase - the database nameuser - the user namepassword - the user password| Method Detail |
public static void loadDriver()
throws DatabaseConnectionException
DatabaseConnectionException - if the driver couldn't be
found or loaded correctly
public boolean isAdministrator()
throws DatabaseConnectionException,
DatabaseException
DatabaseConnectionException - if a database connection
couldn't be established
DatabaseException - if user privileges couldn't be
determined
public java.lang.String getDatabaseUser()
throws DatabaseConnectionException,
DatabaseException
DatabaseConnectionException - if a database connection
couldn't be established
DatabaseException - if the database user couldn't be
determined
public java.util.ArrayList listDatabases()
throws DatabaseConnectionException,
DatabaseException
DatabaseConnectionException - if a database connection
couldn't be established
DatabaseException - if the list of databases couldn't be
retrieved
public java.util.ArrayList listTables(java.lang.String database)
throws DatabaseConnectionException,
DatabaseException
database - the database name
DatabaseConnectionException - if a database connection
couldn't be established
DatabaseException - if the list of tables couldn't be
retrieved
public java.util.ArrayList listUsers()
throws DatabaseConnectionException,
DatabaseException
DatabaseConnectionException - if a database connection
couldn't be established
DatabaseException - if the list of users couldn't be
retrieved
public void createDatabase(java.lang.String database)
throws DatabaseConnectionException,
DatabaseException
database - the database name
DatabaseConnectionException - if a database connection
couldn't be established
DatabaseException - if the database couldn't be created
properly
public void deleteDatabase(java.lang.String database)
throws DatabaseConnectionException,
DatabaseException
database - the database name
DatabaseConnectionException - if a database connection
couldn't be established
DatabaseException - if the database couldn't be deleted
properly
public void createUser(java.lang.String user,
java.lang.String password)
throws DatabaseConnectionException,
DatabaseException
user - the new database user namepassword - the new database user password
DatabaseConnectionException - if a database connection
couldn't be established
DatabaseException - if the database user couldn't be
created properly
public void deleteUser(java.lang.String user)
throws DatabaseConnectionException,
DatabaseException
user - the database user name
DatabaseConnectionException - if a database connection
couldn't be established
DatabaseException - if the database user couldn't be
deleted properly
public void addAccessPrivileges(java.lang.String database,
java.lang.String user)
throws DatabaseConnectionException,
DatabaseException
database - the database nameuser - the database user name
DatabaseConnectionException - if a database connection
couldn't be established
DatabaseException - if the database privileges couldn't
be set properly
public void removeAccessPrivilege(java.lang.String database,
java.lang.String user)
throws DatabaseConnectionException,
DatabaseException
database - the database nameuser - the database user name
DatabaseConnectionException - if a database connection
couldn't be established
DatabaseException - if the database privileges couldn't
be set properly
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||