ojb.broker.util
Class SampleThread

java.lang.Object
  |
  +--ojb.broker.util.SampleThread
All Implemented Interfaces:
java.lang.Runnable

class SampleThread
extends java.lang.Object
implements java.lang.Runnable


Field Summary
(package private)  boolean batchMode
           
(package private)  java.util.Vector childThreads
           
(package private)  char command
           
(package private)  java.sql.Connection con
           
(package private)  java.lang.StringBuffer curStatement
           
(package private)  java.sql.DatabaseMetaData dma
           
(package private)  java.io.BufferedReader in
           
(package private)  boolean norsClose
           
(package private)  java.sql.PreparedStatement pstmt
           
(package private)  java.sql.ResultSet rs
           
(package private)  boolean rsmd
           
(package private)  java.lang.String sql
           
(package private)  java.lang.String sqlName
           
(package private)  java.sql.Statement stmt
           
(package private)  java.lang.String url
           
 
Constructor Summary
SampleThread(java.lang.String fileName)
          Each thread has its own set of SQL commands and its own statement objects.
 
Method Summary
(package private)  void closers()
          Closes any current result set.
(package private) static void dispResultSet(java.sql.ResultSet rs)
          dispResultSet Displays all columns and rows in the given result set
(package private) static java.lang.String dispRow(java.sql.ResultSet rs)
          Display the current row in the results set.
(package private)  void getSQL(java.lang.String loopStatement)
          Gets the next line of SQL from the file.
 void run()
          This routine does the work of this particular thread.
(package private)  void waitForChildren()
          Waits for all child threads to complete before continuing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

con

java.sql.Connection con

in

java.io.BufferedReader in

stmt

java.sql.Statement stmt

pstmt

java.sql.PreparedStatement pstmt

rs

java.sql.ResultSet rs

dma

java.sql.DatabaseMetaData dma

childThreads

java.util.Vector childThreads

url

java.lang.String url

sqlName

java.lang.String sqlName

command

char command

sql

java.lang.String sql

curStatement

java.lang.StringBuffer curStatement

norsClose

boolean norsClose

batchMode

boolean batchMode

rsmd

boolean rsmd
Constructor Detail

SampleThread

public SampleThread(java.lang.String fileName)
Each thread has its own set of SQL commands and its own statement objects. They share the same connection though. They could equally well use different connections.

Method Detail

waitForChildren

void waitForChildren()
               throws java.lang.InterruptedException
Waits for all child threads to complete before continuing.

java.lang.InterruptedException

closers

void closers()
       throws java.sql.SQLException
Closes any current result set.

java.sql.SQLException

getSQL

void getSQL(java.lang.String loopStatement)
      throws java.io.IOException
Gets the next line of SQL from the file. Sets the global char command and the global String sql

java.io.IOException

run

public void run()
This routine does the work of this particular thread.

Specified by:
run in interface java.lang.Runnable

dispResultSet

static void dispResultSet(java.sql.ResultSet rs)
                   throws java.sql.SQLException
dispResultSet Displays all columns and rows in the given result set

java.sql.SQLException

dispRow

static java.lang.String dispRow(java.sql.ResultSet rs)
                         throws java.sql.SQLException
Display the current row in the results set.

java.sql.SQLException


Authors: Thomas Mahler and others. (C) 2000, 2001.
All rights reserved. Published under the Gnu Public License.
http://objectbridge.sourceforge.net
Version: 0.8.375, 2002-04-04