org.jmonks.batch.framework.util
Class JdbcConnectionHelper

java.lang.Object
  extended byorg.jmonks.batch.framework.util.JdbcConnectionHelper

public final class JdbcConnectionHelper
extends java.lang.Object

JdbcConnectionHelper helps the jdbc repository and db configuration factory to create the jdbc connections with the given configuration map and closes the connections.

Since:
1.0
Version:
1.0
Author:
Suresh Pragada

Field Summary
static java.lang.String PROPERTY_DATABASE_PASSWORD
          Constant defines the property name for database password which is password.
static java.lang.String PROPERTY_DATABASE_USER_NAME
          Constant defines the property name for database user name which is username.
static java.lang.String PROPERTY_JDBC_DRIVER_CLASS_NAME
          Constant defines the property name for jdbc driver class name which is jdbc-driver-class-name.
static java.lang.String PROPERTY_JDBC_URL
          Constant defines the property name for database URL which is jdbc-url.
 
Method Summary
static void closeConnection(java.sql.Connection connection)
          Closes the given connection.
static java.sql.Connection getConnection(java.util.Map configMap)
          Get the required properties from the given configMap and establishes the connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_JDBC_DRIVER_CLASS_NAME

public static final java.lang.String PROPERTY_JDBC_DRIVER_CLASS_NAME
Constant defines the property name for jdbc driver class name which is jdbc-driver-class-name.

See Also:
Constant Field Values

PROPERTY_JDBC_URL

public static final java.lang.String PROPERTY_JDBC_URL
Constant defines the property name for database URL which is jdbc-url.

See Also:
Constant Field Values

PROPERTY_DATABASE_USER_NAME

public static final java.lang.String PROPERTY_DATABASE_USER_NAME
Constant defines the property name for database user name which is username.

See Also:
Constant Field Values

PROPERTY_DATABASE_PASSWORD

public static final java.lang.String PROPERTY_DATABASE_PASSWORD
Constant defines the property name for database password which is password.

See Also:
Constant Field Values
Method Detail

getConnection

public static java.sql.Connection getConnection(java.util.Map configMap)
Get the required properties from the given configMap and establishes the connection. Returns null, if it cannot establish the connection.

Parameters:
configMap - Map contains the properties required to create the connection.
Returns:
Returns the database connction, null, if it cannot establish the connection.

closeConnection

public static void closeConnection(java.sql.Connection connection)
Closes the given connection. Doesn't throw any exceptions to the caller.