|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.sql.Connector
public final class Connector
The Connector class provides some simplified access to several database systems through static methods. Although the class doesn't require any additional driver software for compilation, certain methods may through SQLException if the specified driver is not present at the time.
| Method Summary | |
|---|---|
static Connection |
getHsqldbConnection(String dbName,
String login,
String password)
provides JDBC access through the Hsqldb driver (http://hsqldb.sourceforge.net/) |
static Connection |
getHsqldbConnection(String host,
String dbName,
String login,
String password)
provides JDBC access through the Hsqldb driver (http://hsqldb.sourceforge.net/) |
static Connection |
getMDBConnection(File mdbFile)
provides some simplified access to an existing Microsoft Access database through Sun's JDBC/ODBC bridge |
static Connection |
getMDBConnection(File mdbFile,
File workGroupFile,
Properties props)
provides some simplified access to an existing Microsoft Access database through Sun's JDBC/ODBC bridge |
static Connection |
getMDBConnection(File mdbFile,
File workGroupFile,
String user,
String password,
Properties props)
provides some simplified access to an existing Microsoft Access database through Sun's JDBC/ODBC bridge |
static Connection |
getMDBConnection(File mdbFile,
Properties props)
provides some simplified access to an existing Microsoft Access database through Sun's JDBC/ODBC bridge |
static Connection |
getMySQLConnection(String dbName)
returns getMySQLConnection("localhost", dbName) |
static Connection |
getMySQLConnection(String host,
String dbName)
provides simplified access to a MySQL database using the MySQL Connector/J 3.1 driver. |
static Connection |
getMySQLConnection(String host,
String dbName,
int port,
String login,
String password)
provides simplified access to a MySQL database using MySQL Connector/J 3.1 |
static Connection |
getMySQLConnection(String host,
String dbName,
String login,
String password)
uses the standard port 3306 |
static Connection |
getODBCConnection(String dbName)
provides some simplified access to existing ODBC connections through Sun's JDBC/ODBC bridge |
static Connection |
getODBCConnection(String dbName,
Properties props)
|
static Connection |
getODBCConnection(String dbName,
String login,
String password)
provides some simplified access to existing ODBC connections through Sun's JDBC/ODBC bridge |
static Connection |
getSQLServerConnection(String host,
String dbName,
String login,
String password)
getSQLServerConnection() provides access to a Microsoft SQL-Server database. |
static String |
getSQLServerDriver()
|
static void |
setSQLServerDriver(String driverClassName)
sets the name of the driver class to be used by getSQLServerConnection(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Connection getMySQLConnection(String dbName)
throws SQLException
getMySQLConnection("localhost", dbName)
SQLExceptiongetMySQLConnection(String, String)
public static Connection getMySQLConnection(String host,
String dbName)
throws SQLException
host - hostname; unless a port is specified, 3306 is useddbName - name of the database
SQLException
public static Connection getMySQLConnection(String host,
String dbName,
String login,
String password)
throws SQLException
SQLException
public static Connection getMySQLConnection(String host,
String dbName,
int port,
String login,
String password)
throws SQLException
SQLException
public static Connection getMDBConnection(File mdbFile)
throws SQLException
SQLException
public static Connection getMDBConnection(File mdbFile,
Properties props)
throws SQLException
SQLException
public static Connection getMDBConnection(File mdbFile,
File workGroupFile,
String user,
String password,
Properties props)
throws SQLException
SQLException
public static Connection getMDBConnection(File mdbFile,
File workGroupFile,
Properties props)
throws SQLException
SQLException
public static Connection getODBCConnection(String dbName)
throws SQLException
SQLException
public static Connection getODBCConnection(String dbName,
Properties props)
throws SQLException
SQLException
public static Connection getODBCConnection(String dbName,
String login,
String password)
throws SQLException
SQLExceptionpublic static String getSQLServerDriver()
public static void setSQLServerDriver(String driverClassName)
throws IllegalArgumentException
getSQLServerConnection().
Currently known drivers: com.microsoft.jdbc.sqlservernet.sourceforge.jtds.jdbc.Drivercom.microsoft.sqlserver.jdbc.SQLServerDriver
IllegalArgumentException - if the given driver name isn't known to this implementation
public static Connection getSQLServerConnection(String host,
String dbName,
String login,
String password)
throws SQLException
SQLExceptionsetSQLServerDriver(String)
public static Connection getHsqldbConnection(String host,
String dbName,
String login,
String password)
throws SQLException
SQLException
public static Connection getHsqldbConnection(String dbName,
String login,
String password)
throws SQLException
dbName - the path and name of the database (example: /dir/db1)login - as a default, sa can be used for the system administrator
SQLException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||