|
NetCharts Server | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--chartworks.es.plugin.GetJdbcData
GetJdbcData is a general class used to extract data from any Jdbc data source. Callers should minimally invoke setServerURLBase setDriverName setDBName OR setJNDILookupName before making any calls to the other methods with the exception of the stringQuery and printQuery convenience calls. By default, GetJdbcData will attempt to use the Jdbc-Odbc bridge if no other driver is specified.
| Constructor Summary | |
GetJdbcData()
|
|
| Method Summary | |
void |
executeJdbc(java.lang.String dbName,
java.lang.String sql,
java.util.Vector rows)
Execute a Jdbc statement |
void |
executeJdbc(java.lang.String sql,
java.util.Vector rows)
Execute a Jdbc statement |
static java.util.Date |
getDate(java.sql.ResultSet rs,
java.sql.ResultSetMetaData rsmd,
int i)
|
static boolean |
isDate(java.sql.ResultSetMetaData rsmd,
int i)
|
static void |
main(java.lang.String[] args)
|
void |
printQuery(java.lang.String dbName,
java.lang.String sql,
java.io.PrintWriter p)
printQuery executes the given SQL statement and writes the output to the given PrintWriter |
void |
setDateFormat(java.lang.String dateFormat)
Allows specification of date format |
void |
setDBName(java.lang.String dbName)
Sets the Database or DSN name. |
void |
setDriverName(java.lang.String driverName)
Sets the JDBC driver name |
void |
setIncludeColumnNames(java.lang.String includeColumnNames)
If true, the first row of the result set will be the column label/name. |
void |
setJNDIInitialContextFactory(java.lang.String jndiInitialContextFactory)
Sets the JNDI Initial Context Factory class name. |
void |
setJNDILookupName(java.lang.String jndiLookupName)
Sets the JNDI lookup name. |
void |
setLoginAndPassword(java.lang.String login,
java.lang.String password)
Sets the login and password to be used when logging into the server |
void |
setMultipleResults(boolean multipleResults)
Sets whether or not to process multiple result sets/update counts. |
void |
setMultipleResults(java.lang.String multipleResults)
Sets whether or not to process multiple result sets/update counts. |
void |
setNullString(java.lang.String nullString)
Sets the string to use if the database contains a null |
void |
setProperties(java.lang.String properties)
Allows users to pass in property values to be used at connection time. |
void |
setServerURLBase(java.lang.String serverURLBase)
Sets the base part of the server URL, for example "jdbc:odbc:" for the JDBC-ODBC bridge. |
void |
setSimpleDateFormat(java.lang.String dateFormat)
Allows specification of simple date format |
void |
setSkipNulls(boolean skipNulls)
Sets whether or not null items should be added to the output. |
void |
setSkipNulls(java.lang.String skipNulls)
Sets whether or not null items should be added to the output. |
void |
setStayAlive(boolean stayAlive)
Determines if concurrent queries should use the same connection. |
void |
setStayAlive(java.lang.String stayAlive)
Determines if concurrent queries should use the same connection. |
void |
setStdoutDebuggingOn(boolean stdoutDebuggingOn)
Allows debugging messages to be written to standard output. |
void |
setStdoutDebuggingOn(java.lang.String stdoutDebuggingOn)
Allows debugging messages to be written to standard output. |
java.lang.StringBuffer |
stringQuery(java.lang.String dbName,
java.lang.String sql)
stringQuery executes the given SQL statement and returns a StringBuffer with the result data. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GetJdbcData()
| Method Detail |
public java.lang.StringBuffer stringQuery(java.lang.String dbName,
java.lang.String sql)
dbName - The name of the database or DSNsql - The select statement
public void printQuery(java.lang.String dbName,
java.lang.String sql,
java.io.PrintWriter p)
dbName - The name of the database or DSNsql - The select statementp - The output object to write the results topublic void setServerURLBase(java.lang.String serverURLBase)
serverURLBase - The JDBC server URL base. If not set, "jdbc:odbc:" is used.public void setNullString(java.lang.String nullString)
nullString - Null string. If not set, "null"
is used.public void setDriverName(java.lang.String driverName)
driverName - JDBC driver name. If not set, "sun.jdbc.odbc.JdbcOdbcDriver"
is used.public void setDBName(java.lang.String dbName)
dbName - Database or DSN namepublic void setJNDIInitialContextFactory(java.lang.String jndiInitialContextFactory)
jndiInitialContextFactory - JNDI Initial Context Factory class
name.public void setJNDILookupName(java.lang.String jndiLookupName)
jndiLookupName - JNDI lookup name of the javax.sql.DataSource.
public void setLoginAndPassword(java.lang.String login,
java.lang.String password)
login - database user namepassword - database user passwordpublic void setSkipNulls(java.lang.String skipNulls)
skipNulls - if true, and the query result returns a null, the string
"null" will be added to the output. If false and the
query result returns a null, nothing is added to the output.public void setSkipNulls(boolean skipNulls)
skipNulls - if true, and the query result returns a null, the string
"null" will be added to the output. If false and the
query result returns a null, nothing is added to the output.public void setMultipleResults(java.lang.String multipleResults)
multipleResults - if true multiple results are processed,
otherwise only the first results is processed.public void setMultipleResults(boolean multipleResults)
multipleResults - if true multiple results are processed,
otherwise only the first results is processed.public void setStayAlive(java.lang.String stayAlive)
stayAlive - If true, connection will not be closed between calls to
executeJdbc()public void setStayAlive(boolean stayAlive)
stayAlive - If true, connection will not be closed between calls to
executeJdbc()public void setProperties(java.lang.String properties)
properties - List of connection properties.public void setDateFormat(java.lang.String dateFormat)
dateFormat - - Date format string - detailed in NetCharts documentationpublic void setSimpleDateFormat(java.lang.String dateFormat)
simpleDateFormat - - Date format string - detailed in Java SimpleDateFormat doc.public void setStdoutDebuggingOn(java.lang.String stdoutDebuggingOn)
stdoutDebuggingOn - - If true, write out debugging messagespublic void setStdoutDebuggingOn(boolean stdoutDebuggingOn)
stdoutDebuggingOn - - If true, write out debugging messagespublic void setIncludeColumnNames(java.lang.String includeColumnNames)
includeColumnNames - If true get the column label or name
public void executeJdbc(java.lang.String dbName,
java.lang.String sql,
java.util.Vector rows)
throws java.lang.Exception
dbName - Name of database to append to serverURLBasesql - Select or other SQL statementrows - The output structure consisting of a vector containing a
vector for each output row.
public void executeJdbc(java.lang.String sql,
java.util.Vector rows)
throws java.lang.Exception
sql - Select or other SQL statementrows - The output structure consisting of a vector containing a
vector for each output row.public static void main(java.lang.String[] args)
public static boolean isDate(java.sql.ResultSetMetaData rsmd,
int i)
throws java.sql.SQLException
public static java.util.Date getDate(java.sql.ResultSet rs,
java.sql.ResultSetMetaData rsmd,
int i)
throws java.sql.SQLException
|
NetCharts Server | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Visual Mining, Inc. | Copyright © Visual Mining, Inc. 1996 - 2004 |
Last Modified: Aug 3, 2004 |