org.kuali.db
Class JDBCUtils

java.lang.Object
  extended by org.kuali.db.JDBCUtils

public class JDBCUtils
extends Object

Various JDBC related utility methods


Field Summary
(package private)  org.springframework.context.ApplicationContext context
           
static String JDBC_CONFIGURATIONS
           
static String JDBC_CONTEXT
           
(package private)  List<JDBCConfiguration> jdbcConfigs
           
 
Constructor Summary
JDBCUtils()
           
 
Method Summary
static void closeQuietly(Connection conn)
           
static void closeQuietly(ResultSet rs)
           
static void closeQuietly(ResultSet rs, Statement stmt, Connection conn)
           
static void closeQuietly(Statement stmt)
           
static void closeQuietly(Statement stmt, Connection conn)
           
 JDBCConfiguration getDatabaseConfiguration(DatabaseType type)
          Given a database type, return the corresponding JDBC configuration
 JDBCConfiguration getDatabaseConfiguration(String url)
          Given a JDBC url, attempt to locate the corresponding JDBCConfig object
 String getDatabaseName(String url)
          Given a JDBC connection URL, extract only the database name.
 String getServerUrl(String url)
          Given a JDBC connection URL, generate a new connection URL to connect directly to the database server itself (ie: no database specified).
static void rollbackQuietly(Connection conn)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JDBC_CONTEXT

public static final String JDBC_CONTEXT
See Also:
Constant Field Values

JDBC_CONFIGURATIONS

public static final String JDBC_CONFIGURATIONS
See Also:
Constant Field Values

context

org.springframework.context.ApplicationContext context

jdbcConfigs

List<JDBCConfiguration> jdbcConfigs
Constructor Detail

JDBCUtils

public JDBCUtils()
Method Detail

getDatabaseConfiguration

public JDBCConfiguration getDatabaseConfiguration(DatabaseType type)
Given a database type, return the corresponding JDBC configuration

Returns:
JDBCConfiguration

getDatabaseConfiguration

public JDBCConfiguration getDatabaseConfiguration(String url)
Given a JDBC url, attempt to locate the corresponding JDBCConfig object

Parameters:
url -
Returns:
JDBCConfiguration

getDatabaseName

public String getDatabaseName(String url)
Given a JDBC connection URL, extract only the database name.

Parameters:
url - a JDBC connection URL
Returns:
the database name

getServerUrl

public String getServerUrl(String url)
Given a JDBC connection URL, generate a new connection URL to connect directly to the database server itself (ie: no database specified).

Parameters:
url - a JDBC connection URL
Returns:
a new JDBC connection URL to connect directly to the database server

closeQuietly

public static void closeQuietly(ResultSet rs,
                                Statement stmt,
                                Connection conn)

closeQuietly

public static void closeQuietly(Statement stmt,
                                Connection conn)

closeQuietly

public static void closeQuietly(ResultSet rs)

closeQuietly

public static void closeQuietly(Statement stmt)

closeQuietly

public static void closeQuietly(Connection conn)

rollbackQuietly

public static void rollbackQuietly(Connection conn)


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.