s8361: Java: User Exp-JDBC + MySQL.
SHARE Technical Conference
August 2003


MySQL and JDBC were combined with Java Swing components to produce a complete conference registration system, including super-mail-merge like reporting capability. The project was developed by combining mainframe DB2 experience with more recent Java skills to develop a working application for the Windows platform that is 100% open-source. That was important for the non-profit organization for which this system was targeted. Come learn what the author calls "just-in-time" programming. The full HTML version of this presentation with links to the source code and demo files can be found at www.jsrsys.com.

The author has been writing programs since 1965 in Fortran, COBOL, PL/1, Algol, Pascal, C, C++, and various assembly languages. He has been exploring Java since 1996.

Steve Ryder, Senior Director
JSR Systems (SHARE Code: JSR)
2805 Robbs Run
Austin, Texas 78703


Clients for whom the speaker has developed code include:
The University of Texas at Austin 1965-1966
Texas Education Agency 1966-1995++
Houston Ind. School District 1975-1981
Conroe Ind. School District 1980-1993
United States Navy 1966-1994
Capitol Appraisal Group, Inc. 1981-...

Return to JSR Systems Services.
Return to JSR Systems' home page.
Copyright © 2003, JSR Systems, All rights reserved.

Navigation hints:

Table of Contents


DataReport class

DataUpdate class

DataLoad class

JsrSQL class

Constructor Summary
          null constructor: requires user to do setDataBaseName
JsrSQL(java.lang.String dbName)
constructor w/ dataBaseName
only needs to be suppied ONCE per class instances share connection
Normal Use:
* One (1) instance per open table
* Works with an array of rowValues, one per Column/Field
* setSelect(...everything after SELECT *)
* getColNames() // once after the SELECT (can be from multiple tables)...
Method Summary
 void close()
          closes results, stmt, conn.
 java.lang.String delete(java.lang.String[] newRowValue)
          delete current Row
 int[] getColDisplaySize()
          return all Display Sizes for most recent setSelect
 java.lang.String[] getColNames()
          return all Column Names for most recent setSelect
 int getFields(java.lang.String tableName)
          returns int # of fields (columns) for current table
 java.lang.String[] getNames()
          returns String[] of all field (column) names for current table (set by getFields).
 java.lang.String[] getRowValues()
          returns String[] of all field (column) values for current row.
 java.lang.String getString(int colNum)
          returns String value for colNum
 java.lang.String getString(java.lang.String colName)
          return String value for colName
 java.lang.String[] getTables(java.lang.String dbName)
          return String[] of all tables in this database
Windows MySQL returns all lower-case, change to Xxxxx (toUpperCase on 1st digit).
 void setDataBaseName(java.lang.String dbName)
          supply dataBaseName via call here, or constructor
 boolean setNextRow()
          moves cursor to next row, return false if no more rows.
 int setSelect(java.lang.String fromName)
          executes Query (fromName), return COUNT(*).
 java.lang.String update(java.lang.String[] newRowValue)
          reverse of getRowValues(): assumes that newRowValue "matches" rowValue[]
* assumes: [0] == WhoID, [1] == LastUpdate.

Programs (Classes/Object) Used:
Books that were helpful:
"Java in 21 Days " by Laura Lemay (SAMS)
"Java in a Nutshell" by David Flanagan (O'Reilly)
"Java SWING " by Robert Eckstein, Marc Loy & Dave Wood (O'Reilly)
"Java 2D Graphics" by Jonathan Knudsen (O'Reilly)

Return to Table of Contents