| java.lang.Object isql.SQLJDBC
SQLJDBC | public class SQLJDBC (Code) | | |
Method Summary | |
public List | SQLGetCatalogs() | public List | SQLGetColumns(String tableName) | public List | SQLGetExportedKeys(String tableName) | public List | SQLGetImportedKeys(String tableName) | public List | SQLGetIndexInfo(String tableName) | public List | SQLGetPrimaryKeys(String tableName) | public List | SQLGetSchemas() | public List | SQLGetTables() | public void | closeConnection() | public void | createCreateScript(String tname, String fname) generate a create script for a table. | public int | createInsertScript(String tname, String fname, long startrow, long endrow) creates an insert script based on data in table, and writes into
given file (appending). | public static String | formatDatatype(int java_sql_Types, String typename, int isize, int idec) | public String | formatDates(String SQLString) format dates given in #x# and ##x## pattern. | public List[] | getColumnInfo(String tableName) returns columninfo for a given table in a Vector array which can
then be displayed as output text or converted to TableMap and
put in table depending on how you want to display. | public List | getColumnNames(String tableName) | public DatabaseMetaData | getDma() return metadata. | public String | getErrorString() returns exceptions if any. | public String | getFormattedDatatypeFor(String table, String column) given a table and column name get the user friendly datatype
name for it. | public List[] | getIndexInfo(String tableName) | public long | getLastRowCount() | public List[] | getPrimaryKeyInfo(String tableName) | public PrimaryKeyInfo | getPrimaryKeyInfoX(String tableName) | public static List | getRememberedValues(SQLForm _form, String column) retrieve remembered values for a column. | public List | getTableNames() | public List | getTableNames(String patt) returns a list of table for a given pattern, used while cacheing
column names for tab completion. | public String | getWarningString() | public static void | main(String args) | public String | processVariables(SQLForm _form, String SQLString) prompts the user for variables in sql in the form of ${VAR}. | public Object | reflectInvoke(String str) | public String | refreshDatabase() | public int[] | runBatch(String[] batch) | public String | runSQL(String SQLString) This method is first called to run an SQL and return a string. | public String | runSQL(String SQLString, long startrow, long endrow) runSQL - this is the method that executes the SQL string and puts
it into a String for caller.
If caller is appending the entire output to some textarea ( as
is the case here!) then
returning the entire result in the existing StringBuffer would involve
less
work. | public Object | runSelect(String SQLString) This method is called when you want to run an sql and get a
Tablemodel in return for displaying in JTable. | public Object | runSelect(String SQLString, long startrow, long endrow) this returns a Model object to be used with JTables, and is only
for select statement. | public void | setColSep(String sColSep) | public void | setConn(Connection newConn) | public void | setDma(DatabaseMetaData newDma) | public static void | setRememberedValue(SQLForm _form, String column, String value) Add a value to remembered values. | public void | setVendorSpecificConfigurations(String databaseProductName) set vendor specific varaibles. |
driverNotCapable | boolean driverNotCapable(Code) | | |
lastProcessedRowCount | long lastProcessedRowCount(Code) | | |
closeConnection | public void closeConnection()(Code) | | |
createCreateScript | public void createCreateScript(String tname, String fname)(Code) | | generate a create script for a table.
This doesnt create the primary key TODO using getImportedKeys.
if using mysql you can use "show create table mytable"
|
createInsertScript | public int createInsertScript(String tname, String fname, long startrow, long endrow)(Code) | | creates an insert script based on data in table, and writes into
given file (appending). Also takes row to start with, and row to
end with
|
formatDatatype | public static String formatDatatype(int java_sql_Types, String typename, int isize, int idec)(Code) | | Format a datatype as VARCHAR(2) or NUMBER(2,1) or INTEGER or
DATETIME
|
formatDates | public String formatDates(String SQLString)(Code) | | format dates given in #x# and ##x## pattern.
single asterisks are replaced with a single date, double are
replaced with a range.
ranges are used when you want a full month or year, from start to
end.
|
getColumnInfo | public List[] getColumnInfo(String tableName)(Code) | | returns columninfo for a given table in a Vector array which can
then be displayed as output text or converted to TableMap and
put in table depending on how you want to display.
|
getErrorString | public String getErrorString()(Code) | | returns exceptions if any.
RK added on 20040104 18:54:36
returns a null if no exception.
|
getFormattedDatatypeFor | public String getFormattedDatatypeFor(String table, String column)(Code) | | given a table and column name get the user friendly datatype
name for it.
this was used in substituting $dt in sqlpattern for NOT NULL
cases.
|
getLastRowCount | public long getLastRowCount()(Code) | | |
getRememberedValues | public static List getRememberedValues(SQLForm _form, String column)(Code) | | retrieve remembered values for a column.
THis should go into a class now.
|
getTableNames | public List getTableNames(String patt) throws SQLException(Code) | | returns a list of table for a given pattern, used while cacheing
column names for tab completion.
|
processVariables | public String processVariables(SQLForm _form, String SQLString)(Code) | | prompts the user for variables in sql in the form of ${VAR}.
RK added on 20040202 12:33:58
|
reflectInvoke | public Object reflectInvoke(String str)(Code) | | invokes a method in DatabaseMetaDataClass
|
runSQL | public String runSQL(String SQLString)(Code) | | This method is first called to run an SQL and return a string.
This decides how any rows to print.
|
runSQL | public String runSQL(String SQLString, long startrow, long endrow)(Code) | | runSQL - this is the method that executes the SQL string and puts
it into a String for caller.
If caller is appending the entire output to some textarea ( as
is the case here!) then
returning the entire result in the existing StringBuffer would involve
less
work.
|
runSelect | public Object runSelect(String SQLString) throws Exception(Code) | | This method is called when you want to run an sql and get a
Tablemodel in return for displaying in JTable. It checks how many
rows to print.
|
runSelect | public Object runSelect(String SQLString, long startrow, long endrow) throws Exception(Code) | | this returns a Model object to be used with JTables, and is only
for select statement. runSQL is to be used for all others
and for selects that should return a String.
Return an Integer for other operations - number of rows
affected.
|
setColSep | public void setColSep(String sColSep)(Code) | | in case the user want to change the column separator
|
setConn | public void setConn(Connection newConn)(Code) | | This method is called by the thread only
|
setRememberedValue | public static void setRememberedValue(SQLForm _form, String column, String value)(Code) | | Add a value to remembered values.
This should go into a class now.
|
setVendorSpecificConfigurations | public void setVendorSpecificConfigurations(String databaseProductName)(Code) | | set vendor specific varaibles. Currently these are start and end
tags for printing fields of different datatypes
RK added on 20031229 14:13:04
added closing single quotes in fields.
|
|
|