zeus.ext
Class DbConnector

java.lang.Object
  extended byzeus.ext.DbConnector
All Implemented Interfaces:
java.io.Serializable

public class DbConnector
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  java.sql.Connection dbConn
           
protected  java.lang.String JDBCconnectionName
           
protected  java.lang.String JDBCdriverName
           
protected  java.lang.String password
           
protected  java.lang.String username
           
 
Constructor Summary
DbConnector(java.lang.String user, java.lang.String pw, java.lang.String driver, java.lang.String conn)
           
 
Method Summary
 boolean activeConnection()
          Check to see if an active connection exists
 void close()
          Close the connection to the db
 boolean connect()
          Connect to the db
 java.sql.Connection getConnection()
          Get the connection object for the database This is used to initiate calleable statements for PL/SQL calls
 java.sql.Statement getStatement()
          Get a statement associated with the connection
static void main(java.lang.String[] Args)
          The CRUD methods
 void sqlCommand(java.lang.String command)
          Execute an SQL command
 java.sql.ResultSet sqlQuery(java.lang.String query)
          Execute an sql query
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dbConn

protected java.sql.Connection dbConn

username

protected java.lang.String username

password

protected java.lang.String password

JDBCdriverName

protected java.lang.String JDBCdriverName

JDBCconnectionName

protected java.lang.String JDBCconnectionName
Constructor Detail

DbConnector

public DbConnector(java.lang.String user,
                   java.lang.String pw,
                   java.lang.String driver,
                   java.lang.String conn)
Method Detail

connect

public boolean connect()
                throws java.sql.SQLException
Connect to the db

Returns:
true if connection is successful, false otherwise
Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Get the connection object for the database This is used to initiate calleable statements for PL/SQL calls

Returns:
the connection object to the db
Throws:
java.sql.SQLException

getStatement

public java.sql.Statement getStatement()
                                throws java.sql.SQLException
Get a statement associated with the connection

Returns:
a statement object or null if none can be created
Throws:
java.sql.SQLException

activeConnection

public boolean activeConnection()
                         throws java.sql.SQLException
Check to see if an active connection exists

Returns:
true if a connection is live, false otherwise
Throws:
java.sql.SQLException

close

public void close()
Close the connection to the db


sqlQuery

public java.sql.ResultSet sqlQuery(java.lang.String query)
                            throws java.sql.SQLException
Execute an sql query

Parameters:
query - the sql query to execute
Returns:
the ResultSet from the query
Throws:
java.sql.SQLException

sqlCommand

public void sqlCommand(java.lang.String command)
                throws java.sql.SQLException
Execute an SQL command

Parameters:
command - the sql command to execute
Throws:
java.sql.SQLException

main

public static void main(java.lang.String[] Args)
The CRUD methods



Copyright © 2000-2003 BT Exact Technologies. All Rights Reserved.