s8361: Java: User Exp-JDBC + MySQL.
|
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-... |
Constructor Summary | |
JsrSQL()
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. |