j3.mssql
Class JDBCHandler

java.lang.Object
  |
  +--j3.mssql.JDBCHandler

public class JDBCHandler
extends java.lang.Object

Please check the JDBC connection constants defined below. This class uses JDatabase Wizard generated files to demonstrate how to use such classes. Note: Update operations on the result sets have been commented out.


Field Summary
private static java.lang.String CLASS
           
(package private)  java.sql.Connection myConnection
           
(package private)  SpParmSQL myParmSQL
           
(package private)  java.lang.StringBuffer myReport
           
(package private)  PersonSQL mySQL
           
private static java.lang.String PASSWORD
           
private static java.lang.String URL
           
private static java.lang.String USER
           
 
Constructor Summary
JDBCHandler()
          Constructor create JDBC access classes
 
Method Summary
private  void absolute()
          Move to 3rd record in recordset, and display its contents.
private  void close()
          Close resultsets, statements and the jdbc connection
private  void closeStatements()
          Close all open JDatabase Wizard classes (statements & resultsets)
private  void cursorTests()
          Test cursor movement methods on PersonSQL
private  void deleteAll()
          delete all records
private  void deleteOne()
          Delete one record
private  void deleteRow()
          Delete the current ResultSet row
private  void displayPersonData(PersonData data)
          Display passed PersonData in a HTML table
private  void displayPersonDataRow(PersonData data)
          Display ONE PersonData record as a HTML table row.
private  void displayResultSetInfo()
          Display all misc.
private  void firstTests()
           
 java.lang.String go()
          Perform JDBC operations using the generated classes.
private  void insert()
          Insert six records
private  void insertRow()
          Move to insert position, then insert a record using the resultset
private  void lastTests()
           
private  void selectAll()
          select all records and display the resultset contents
private  void spParm()
          Call the stored procedure which uses in/out parameters
private  void updateOne()
          Update one record
private  void wrapException(java.lang.Exception e)
          Captures the error message and call stack information from an exception and displays it.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

myReport

java.lang.StringBuffer myReport

myConnection

java.sql.Connection myConnection

mySQL

PersonSQL mySQL

myParmSQL

SpParmSQL myParmSQL

CLASS

private static final java.lang.String CLASS

URL

private static final java.lang.String URL

USER

private static final java.lang.String USER

PASSWORD

private static final java.lang.String PASSWORD
Constructor Detail

JDBCHandler

public JDBCHandler()
Constructor create JDBC access classes
Method Detail

go

public java.lang.String go()
Perform JDBC operations using the generated classes.

cursorTests

private void cursorTests()
                  throws java.lang.Exception
Test cursor movement methods on PersonSQL
Throws:
java.lang.Exception -  

displayResultSetInfo

private void displayResultSetInfo()
                           throws java.lang.Exception
Display all misc. info resultset provides.
Throws:
java.lang.Exception -  

deleteRow

private void deleteRow()
                throws java.lang.Exception
Delete the current ResultSet row
Throws:
java.lang.Exception -  

firstTests

private void firstTests()
                 throws java.lang.Exception

lastTests

private void lastTests()
                throws java.lang.Exception

absolute

private void absolute()
               throws java.lang.Exception
Move to 3rd record in recordset, and display its contents.
Throws:
java.lang.Exception -  

insertRow

private void insertRow()
                throws java.lang.Exception
Move to insert position, then insert a record using the resultset
Throws:
java.lang.Exception -  

spParm

private void spParm()
             throws java.lang.Exception
Call the stored procedure which uses in/out parameters
Throws:
java.lang.Exception -  

deleteOne

private void deleteOne()
                throws java.lang.Exception
Delete one record
Throws:
java.lang.Exception -  

updateOne

private void updateOne()
                throws java.lang.Exception
Update one record
Throws:
java.lang.Exception -  

insert

private void insert()
             throws java.lang.Exception
Insert six records
Throws:
java.lang.Exception -  

deleteAll

private void deleteAll()
                throws java.lang.Exception
delete all records
Throws:
java.lang.Exception -  

selectAll

private void selectAll()
                throws java.lang.Exception
select all records and display the resultset contents
Throws:
java.lang.Exception -  

closeStatements

private void closeStatements()
Close all open JDatabase Wizard classes (statements & resultsets)

close

private void close()
Close resultsets, statements and the jdbc connection

wrapException

private void wrapException(java.lang.Exception e)
Captures the error message and call stack information from an exception and displays it.
Parameters:
e - the exception to capture

displayPersonDataRow

private void displayPersonDataRow(PersonData data)
Display ONE PersonData record as a HTML table row.
Parameters:
data - data to display, may not be null.

displayPersonData

private void displayPersonData(PersonData data)
Display passed PersonData in a HTML table
Parameters:
data -