org.jminor.common.db
Class DatabaseConnections
java.lang.Object
org.jminor.common.db.DatabaseConnections
public final class DatabaseConnections
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
createConnection
public static DatabaseConnection createConnection(Database database,
User user)
throws ClassNotFoundException,
SQLException
- Constructs a new DatabaseConnection instance, based on the given Connection object.
NB. auto commit is disabled on the Connection that is provided.
- Parameters:
database
- the databaseuser
- the user for the db-connection
- Returns:
- a new DatabaseConnection instance
- Throws:
SQLException
- in case there is a problem connecting to the database
ClassNotFoundException
- in case the JDBC driver class was not found
createConnection
public static DatabaseConnection createConnection(Database database,
User user,
Connection connection)
throws SQLException
- Constructs a new DatabaseConnection instance, based on the given Connection object.
NB. auto commit is disabled on the Connection that is provided.
- Parameters:
database
- the databaseuser
- the user for the db-connectionconnection
- the Connection object to base this DatabaseConnection on
- Returns:
- a new DatabaseConnection instance
- Throws:
SQLException
- in case there is a problem connecting to the database