Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

edu.virtualschool.jwaa.dbms.DBQuery Class Reference

Collaboration diagram for edu.virtualschool.jwaa.dbms.DBQuery:

Collaboration graph
[legend]
List of all members.

Detailed Description

Convenience wrapper for JDBC ResultSets. The main reason for this seems to be the preference for throwing Faults for consistency instead of SQLExceptions. Arguably no longer appropriate now that Exception supports chaining. Consider replacing by ResultSet. Fixme. Usage:
Query results = new Query(dbms, "select * from TableName"); while (results.hasNext()) { String s = results.getString("aColumName"); long i = results.getLong("anotherColumName"); }

Copyright 2002 by Brad Cox: <bcox@virtualschool.edu>

Definition at line 43 of file DBQuery.java.

Public Member Functions

boolean hasNext () throws DB.Fault
void close () throws DB.Fault
void finalize () throws DB.Fault
final Array getArray (String n) throws DB.Fault
final Blob getBlob (String n) throws DB.Fault
final boolean getBoolean (String n) throws DB.Fault
final byte[] getBytes (String n) throws DB.Fault
final byte getByte (String n) throws DB.Fault
final Clob getClob (int i) throws DB.Fault
final Clob getClob (String n) throws DB.Fault
final double getDouble (String n) throws DB.Fault
final double getDouble (int i) throws DB.Fault
final float getFloat (String n) throws DB.Fault
final int getInt (String n) throws DB.Fault
final int getInt (int i) throws DB.Fault
final InputStream getAsciiStream (String n) throws DB.Fault
final InputStream getBinaryStream (String n) throws DB.Fault
final Reader getCharacterStream (String n) throws DB.Fault
final Date getDate (String n, Calendar cal) throws DB.Fault
final Date getDate (String n) throws DB.Fault
final Time getTime (String n, Calendar cal) throws DB.Fault
final Time getTime (String n) throws DB.Fault
final Timestamp getTimestamp (String n, Calendar cal) throws DB.Fault
final Timestamp getTimestamp (String n) throws DB.Fault
final long getLong (String n) throws DB.Fault
final long getLong (int i) throws DB.Fault
final Object getObject (int i, java.util.Map map) throws DB.Fault
final Object getObject (String n, Map map) throws DB.Fault
final Object getObject (String n) throws DB.Fault
final Ref getRef (int i) throws DB.Fault
final Ref getRef (String n) throws DB.Fault
final ResultSetMetaData getMetaData () throws DB.Fault
final short getShort (String n) throws DB.Fault
final SQLWarning getWarnings () throws DB.Fault
final Statement getStatement () throws DB.Fault
final String getCursorName () throws DB.Fault
final String getString (String n) throws DB.Fault
final String getString (int i) throws DB.Fault
String toString ()
String inspect ()

Protected Member Functions

 DBQuery (DB dbms, String sql) throws DB.Fault

Protected Attributes

final String sql
final ResultSet results
final DB dbms


Constructor & Destructor Documentation

edu.virtualschool.jwaa.dbms.DBQuery.DBQuery DB  dbms,
String  sql
throws DB.Fault [protected]
 

Create a Query (JDBC ResultSet). This is called solely by DB's query(sql) method.

Parameters:
dbms 
sql 
Exceptions:
DB.Fault 

Definition at line 58 of file DBQuery.java.

References edu.virtualschool.jwaa.dbms.DB.connection.

00059   {
00060     this.sql = sql;
00061     this.dbms = dbms;
00062     try 
00063     {
00064       this.results = dbms.connection.createStatement().executeQuery(sql); 
00065     }
00066     catch (SQLException e) 
00067     { 
00068       throw new DB.Fault(e, e); 
00069     }
00070   }


The documentation for this class was generated from the following file: