jpl.eda.util
Class JDBC_DB

java.lang.Object
  extended byjpl.eda.util.JDBC_DB

public class JDBC_DB
extends java.lang.Object

This class is a wrapper for JDBC.

Version:
$Revision: 1.3 $
Author:
D. Crichton

Field Summary
 java.lang.String TO_DATE_FORMAT
           
 
Constructor Summary
JDBC_DB(java.util.Properties sys_props)
          JDBC_DB Constructor method will create class instance and load the Oracle DB driver
JDBC_DB(java.util.Properties sys_props, java.sql.Connection srv_connect)
           
 
Method Summary
 void closeConnection()
          closeConnection Close a connection to the database.
 void commit()
          commit
 java.sql.ResultSet executeQuery(java.lang.String cmd)
          executeQuery Send an SQL query to the DBMS to be executed.
 void executeSQLCommand(java.lang.String cmd)
          executeSQLCommand Send an SQL command to the DBMS to be executed.
protected  void finalize()
           
 java.sql.Connection getConnection()
           
 int getCount(java.lang.String cmd)
          getCount Will return a count when user passes sting select count(*) from ...
 void openConnection()
          openConnection Open a connection to the database.
 void openConnection(java.lang.String username, java.lang.String password, java.lang.String database)
           
 void rollback()
          rollback
 void setAutoCommitMode(boolean autoCommitMode)
           
 java.lang.String toDateStr(java.util.Date inDate)
          Convert Date to string in format for Oracle TO_DATE processing - DD-MM-YY HH24:MI:SS
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TO_DATE_FORMAT

public final java.lang.String TO_DATE_FORMAT
See Also:
Constant Field Values
Constructor Detail

JDBC_DB

public JDBC_DB(java.util.Properties sys_props)
        throws java.sql.SQLException
JDBC_DB Constructor method will create class instance and load the Oracle DB driver


JDBC_DB

public JDBC_DB(java.util.Properties sys_props,
               java.sql.Connection srv_connect)
        throws java.sql.SQLException
Method Detail

setAutoCommitMode

public void setAutoCommitMode(boolean autoCommitMode)

openConnection

public void openConnection()
                    throws java.sql.SQLException
openConnection Open a connection to the database.

Throws:
java.sql.SQLException

openConnection

public void openConnection(java.lang.String username,
                           java.lang.String password,
                           java.lang.String database)
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

closeConnection

public void closeConnection()
closeConnection Close a connection to the database.


executeSQLCommand

public void executeSQLCommand(java.lang.String cmd)
                       throws java.sql.SQLException
executeSQLCommand Send an SQL command to the DBMS to be executed.

Throws:
java.sql.SQLException

executeQuery

public java.sql.ResultSet executeQuery(java.lang.String cmd)
                                throws java.sql.SQLException
executeQuery Send an SQL query to the DBMS to be executed.

Throws:
java.sql.SQLException

getCount

public int getCount(java.lang.String cmd)
             throws java.sql.SQLException
getCount Will return a count when user passes sting select count(*) from ...

Throws:
java.sql.SQLException

commit

public void commit()
            throws java.sql.SQLException
commit

Throws:
java.sql.SQLException

rollback

public void rollback()
rollback


finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable

toDateStr

public java.lang.String toDateStr(java.util.Date inDate)
Convert Date to string in format for Oracle TO_DATE processing - DD-MM-YY HH24:MI:SS


getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Throws:
java.sql.SQLException


Copyright © 1999-2005 NASA Jet Propulsion Laboratory, California Institute of Technology. All Rights Reserved.