ch.sahits.phpclassgenerator
Class DBConnectionFactory
java.lang.Object
ch.sahits.phpclassgenerator.DBConnectionFactory
public class DBConnectionFactory
- extends java.lang.Object
This factory gets you the appropriate DBConnection class for your DB product
- Version:
- 1.0
$Revision: 1.2 $ changed by $Author: hotzst $ at $Date: 2007/08/18 16:39:05 $
- Author:
- Andi Hotz, (c) 2007
|
Method Summary |
static DBConnection |
getConnection(java.lang.String product,
java.lang.String hostname,
java.lang.String uname,
java.lang.String pwd,
java.lang.String database,
java.lang.String tablename)
Constructor initializes the connection data |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DBConnectionFactory
public DBConnectionFactory()
getConnection
public static DBConnection getConnection(java.lang.String product,
java.lang.String hostname,
java.lang.String uname,
java.lang.String pwd,
java.lang.String database,
java.lang.String tablename)
throws java.sql.SQLException
- Constructor initializes the connection data
- Parameters:
product - what kind of DB (MySQL, PostgeSQL, Oracle, Derby, MS SQL Server, ...)hostname - of the db eg. localhostuname - user name to connect to the DBpwd - password of the userdatabase - or schema of the tabletablename - table name
- Returns:
- Object instance that can handle the quering of the database
- Throws:
java.sql.SQLException - Connecting failed probably due to incorrect input