WebLogic Server 7.0 Code Examples, BEA Systems, Inc.

examples.jdbc.oracle.extensions
Class BaseDAO

java.lang.Object
  |
  +--examples.jdbc.oracle.extensions.BaseDAO
Direct Known Subclasses:
ArraysDAO, RefsDAO, StructsDAO

public class BaseDAO
extends java.lang.Object

This class provides common database methods.

Author:
Copyright (c) 1996-2002 by BEA Systems, Inc. All Rights Reserved.

Constructor Summary
BaseDAO()
           
 
Method Summary
protected static void cleanup(java.sql.ResultSet pResultSet, java.sql.Statement pStmt, java.sql.Connection pConn)
          Utility function to clean up db usage.
static java.sql.Connection getConnection(java.lang.String url)
          Utility function to get db connection.
protected static int getNextId(java.lang.String pSequence, java.sql.Connection pConn)
          Returns the next id in the sequence
static void log(java.lang.String str)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseDAO

public BaseDAO()
Method Detail

cleanup

protected static void cleanup(java.sql.ResultSet pResultSet,
                              java.sql.Statement pStmt,
                              java.sql.Connection pConn)
                       throws java.sql.SQLException

Utility function to clean up db usage.


getConnection

public static java.sql.Connection getConnection(java.lang.String url)
                                         throws java.sql.SQLException,
                                                javax.naming.NamingException

Utility function to get db connection.


getNextId

protected static int getNextId(java.lang.String pSequence,
                               java.sql.Connection pConn)
                        throws javax.naming.NamingException,
                               java.sql.SQLException

Returns the next id in the sequence

Parameters:
String - pSequence The fully qualified sequence to query from.
Returns:
int The next id in the given sequence
Throws:
javax.naming.NamingException - Thrown on naming errors
java.sql.SQLException - Thrown on sql errors

log

public static void log(java.lang.String str)

Documentation is available at
http://e-docs.bea.com/wls/docs70

Copyright © 2002 BEA Systems, Inc. All Rights Reserved.