|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectprefuse.data.io.sql.ConnectionFactory
public class ConnectionFactory
| Field Summary | |
|---|---|
static java.lang.String |
DRIVER_JDBC_OBDC
String constant for the JDBC/ODBC bridge driver |
static java.lang.String |
DRIVER_MYSQL
String constant for the commonly used MySQL JDBC driver |
static java.lang.String |
PROTOCOL_JDBC
Protocol prefix for JDBC URLs |
static java.lang.String |
SUBPROTOCOL_JDBC_ODBC
Sub-protocol prefix for JDBC/ODBC bridge connections |
static java.lang.String |
SUBPROTOCOL_MYSQL
Sub-protocol prefix for MySQL connections |
| Constructor Summary | |
|---|---|
ConnectionFactory()
|
|
| Method Summary | |
|---|---|
static DatabaseDataSource |
getDatabaseConnection(java.sql.Connection conn)
Get a new database connection, using a default handler. |
static DatabaseDataSource |
getDatabaseConnection(java.sql.Connection conn,
SQLDataHandler handler)
Get a new database connection. |
static DatabaseDataSource |
getDatabaseConnection(java.lang.String driver,
java.lang.String url,
java.lang.String user,
java.lang.String password)
Get a new database connection, using a default handler. |
static DatabaseDataSource |
getDatabaseConnection(java.lang.String driver,
java.lang.String url,
java.lang.String user,
java.lang.String password,
SQLDataHandler handler)
Get a new database connection. |
static SQLDataHandler |
getDefaultHandler()
Get an instance of the default SQL data handler. |
static DatabaseDataSource |
getMySQLConnection(java.lang.String host,
java.lang.String database,
java.lang.String user,
java.lang.String password)
Get a new database connection to a MySQL database, using a default handler. |
static DatabaseDataSource |
getMySQLConnection(java.lang.String host,
java.lang.String database,
java.lang.String user,
java.lang.String password,
SQLDataHandler handler)
Get a new database connection to a MySQL database. |
| 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 DRIVER_MYSQL
public static final java.lang.String DRIVER_JDBC_OBDC
public static final java.lang.String PROTOCOL_JDBC
public static final java.lang.String SUBPROTOCOL_MYSQL
public static final java.lang.String SUBPROTOCOL_JDBC_ODBC
| Constructor Detail |
|---|
public ConnectionFactory()
| Method Detail |
|---|
public static SQLDataHandler getDefaultHandler()
public static DatabaseDataSource getDatabaseConnection(java.sql.Connection conn,
SQLDataHandler handler)
throws java.sql.SQLException
conn - the Connection object to the databasehandler - the data handler to use
java.sql.SQLException - if an SQL error occurs
public static DatabaseDataSource getDatabaseConnection(java.sql.Connection conn)
throws java.sql.SQLException
conn - the Connection object to the database
java.sql.SQLException - if an SQL error occurs
public static DatabaseDataSource getDatabaseConnection(java.lang.String driver,
java.lang.String url,
java.lang.String user,
java.lang.String password,
SQLDataHandler handler)
throws java.sql.SQLException,
java.lang.ClassNotFoundException
driver - the database driver to use, must resolve to a valid Java
class on the current classpath.url - the url for the database, of the form
"jdbc:user - the database usernamepassword - the database passwordhandler - the sql data handler to use
java.sql.SQLException
java.lang.ClassNotFoundException
public static DatabaseDataSource getDatabaseConnection(java.lang.String driver,
java.lang.String url,
java.lang.String user,
java.lang.String password)
throws java.sql.SQLException,
java.lang.ClassNotFoundException
driver - the database driver to use, must resolve to a valid Java
class on the current classpath.url - the url for the database, of the form
"jdbc:user - the database usernamepassword - the database password
java.sql.SQLException
java.lang.ClassNotFoundException
public static DatabaseDataSource getMySQLConnection(java.lang.String host,
java.lang.String database,
java.lang.String user,
java.lang.String password,
SQLDataHandler handler)
throws java.sql.SQLException,
java.lang.ClassNotFoundException
host - the ip address or host name of the database serverdatabase - the name of the particular database to useuser - the database usernamepassword - the database passwordhandler - the sql data handler to use
java.sql.SQLException
java.lang.ClassNotFoundException
public static DatabaseDataSource getMySQLConnection(java.lang.String host,
java.lang.String database,
java.lang.String user,
java.lang.String password)
throws java.sql.SQLException,
java.lang.ClassNotFoundException
host - the ip address or host name of the database serverdatabase - the name of the particular database to useuser - the database usernamepassword - the database password
java.sql.SQLException
java.lang.ClassNotFoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||