xdrs_impl.genericdb
Class DBUtil

java.lang.Object
  extended byxdrs_impl.genericdb.DBUtil

public class DBUtil
extends java.lang.Object

A set of utilities for communication with a database.


Constructor Summary
DBUtil()
           
 
Method Summary
static java.sql.PreparedStatement createPreparedStatement(java.sql.Connection connection, java.lang.String query)
          Create a PreparedStatement wrapping the given SQL query.
static java.sql.ResultSet executeQueryWithSingleResult(java.sql.PreparedStatement statement)
          Execute the given statement making sure there is one and only one result in the returned result set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBUtil

public DBUtil()
Method Detail

executeQueryWithSingleResult

public static java.sql.ResultSet executeQueryWithSingleResult(java.sql.PreparedStatement statement)
                                                       throws java.sql.SQLException,
                                                              soaprmi.RemoteException
Execute the given statement making sure there is one and only one result in the returned result set.

Parameters:
statement - A statement to execute.
Returns:
The result of executing the given statement.
Throws:
java.sql.SQLException
soaprmi.RemoteException

createPreparedStatement

public static java.sql.PreparedStatement createPreparedStatement(java.sql.Connection connection,
                                                                 java.lang.String query)
                                                          throws java.sql.SQLException
Create a PreparedStatement wrapping the given SQL query. This creates a PreparedStatement that can be passed to the executeQueryWithSingleResult() method.

Parameters:
connection - A database connection.
query - An SQL query.
Returns:
A PreparedStatement wrapping the given query.
Throws:
java.sql.SQLException