ch.sahits.phpclassgenerator
Class DBConnectionFactory

java.lang.Object
  extended by 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

Constructor Summary
DBConnectionFactory()
           
 
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
 

Constructor Detail

DBConnectionFactory

public DBConnectionFactory()
Method Detail

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. localhost
uname - user name to connect to the DB
pwd - password of the user
database - or schema of the table
tablename - table name
Returns:
Object instance that can handle the quering of the database
Throws:
java.sql.SQLException - Connecting failed probably due to incorrect input