olr.om
Class DBUtils

java.lang.Object
  extended byolr.om.DBUtils

public final class DBUtils
extends java.lang.Object

Version:
$Id: DBUtils.java,v 1.11 2004/08/04 12:11:18 roku Exp $

Constructor Summary
DBUtils()
           
 
Method Summary
static java.lang.String escapeCharacters(java.lang.String original)
           
static java.sql.Connection getConnection()
           
static int[] getIds(java.sql.ResultSet resultSet, java.lang.String columnName)
           
static long getInstanceId()
           
static java.lang.String idsToInList(int[] ids)
           
static void releaseConnection(java.sql.Connection connection)
          Commits all changes and releases a database connection.
static void releaseConnection(java.sql.Connection connection, java.lang.Exception exception)
          Rollback all queries done on this connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBUtils

public DBUtils()
Method Detail

escapeCharacters

public static java.lang.String escapeCharacters(java.lang.String original)

getIds

public static int[] getIds(java.sql.ResultSet resultSet,
                           java.lang.String columnName)
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

idsToInList

public static java.lang.String idsToInList(int[] ids)

getConnection

public static java.sql.Connection getConnection()
                                         throws java.lang.Exception
Throws:
java.lang.Exception

releaseConnection

public static void releaseConnection(java.sql.Connection connection)
Commits all changes and releases a database connection.

Parameters:
connection - The database connection to release.

releaseConnection

public static void releaseConnection(java.sql.Connection connection,
                                     java.lang.Exception exception)
Rollback all queries done on this connection. Also releases this connection.

Parameters:
connection - The connection to rollback.
exception - The Exception, which causes this rollback.

getInstanceId

public static long getInstanceId()


Copyright © 2001-2004 University of Hannover. All Rights Reserved.