Class JDPJdbcDirect
java.lang.Object
|
+----JDPJdbcDirect
- public class JDPJdbcDirect
- extends Object
Class JDPJdbcDirect represents an interface for making a direct JDBC
connection rather than connecting to JDBC via JaggServer.
-
JDPJdbcDirect()
-
-
close()
- Close the statement.
-
connect()
- Make the connection to the database
-
dispResultSet(ResultSet, Vector)
- Load the result set into a vector.
-
execSQL(String, Vector)
- Run the SQL and load the results into the vector.
-
execute(String, Vector)
- Run the SQL and load the results into the vector then leave the
connection open.
-
getColumnCount()
- Get the column count for the last query.
-
getCSTR()
- Get the current CSTR (Custom Connect String - replaces DSN,UID,PWD,DB,WSID).
-
getJdbcDriver()
- Get the fully qualified class name of the JDBC driver.
-
getJdbcPrefix()
- Get the prefix to use for connecting to the JDBC driver.
-
getJdbcSuffix()
- Get the suffix to use for connecting to the JDBC driver.
-
getMaxRows()
- Get maximum number of rows.
-
getPWD()
- Get the user password.
-
getRowCount()
- Get the row count for the last query.
-
getStatement()
- Get the statement handle for this connection.
-
getTimeOut()
- Get the SQL timeout.
-
getUID()
- Get the user id.
-
setCSTR(String)
- Set CSTR (Custom Connect String - replaces DSN,UID,PWD,DB,WSID).
-
setJdbcDriver(String)
- Set the fully qualified class name of the JDBC driver.
-
setJdbcPrefix(String)
- Set the prefix to use for connecting to the JDBC driver.
-
setJdbcSuffix(String)
- Set the suffix to use for connecting to the JDBC driver.
-
setMaxRows(int)
- Set the maximum number of rows to return.
-
setPWD(String)
- Set the user password for the query.
-
setTimeOut(int)
- Set the SQL timeout.
-
setUID(String)
- Set the user id for the query.
JDPJdbcDirect
public JDPJdbcDirect()
connect
public Connection connect() throws Exception
- Make the connection to the database
- Returns:
- the handle for this connection.
getStatement
public Statement getStatement()
- Get the statement handle for this connection.
- Returns:
- the statement handle for this connection.
close
public void close() throws SQLException
- Close the statement.
execute
public int execute(String sqlString,
Vector v)
- Run the SQL and load the results into the vector then leave the
connection open.
- Parameters:
- sqlString - the sql to run.
- result - vector the vector to load.
- Returns:
- the number of rows loaded.
execSQL
public int execSQL(String sqlString,
Vector v)
- Run the SQL and load the results into the vector.
- Parameters:
- sqlString - the sql to run.
- result - vector the vector to load.
- Returns:
- the number of rows loaded.
dispResultSet
public int dispResultSet(ResultSet rs,
Vector v) throws SQLException
- Load the result set into a vector.
- Parameters:
- rs - the result set to load into the vector.
- result - vector the vector to load.
- Returns:
- the number of rows loaded.
setJdbcDriver
public void setJdbcDriver(String jdbcDriver)
- Set the fully qualified class name of the JDBC driver.
- Parameters:
- jcbdDriver - the fully qualified class name of the JDBC driver.
getJdbcDriver
public String getJdbcDriver()
- Get the fully qualified class name of the JDBC driver.
- Returns:
- jcbdDriver the fully qualified class name of the JDBC driver.
setJdbcPrefix
public void setJdbcPrefix(String jdbcPrefix)
- Set the prefix to use for connecting to the JDBC driver.
- Parameters:
- jcbdPrefix - the prefix to use for connecting to the JDBC driver.
getJdbcPrefix
public String getJdbcPrefix()
- Get the prefix to use for connecting to the JDBC driver.
- Returns:
- jcbdPrefix the prefix to use for connecting to the JDBC driver.
setJdbcSuffix
public void setJdbcSuffix(String jdbcSuffix)
- Set the suffix to use for connecting to the JDBC driver.
- Parameters:
- jcbdSuffix - the suffix to use for connecting to the JDBC driver.
getJdbcSuffix
public String getJdbcSuffix()
- Get the suffix to use for connecting to the JDBC driver.
- Returns:
- jcbdPrefix the suffix to use for connecting to the JDBC driver.
setCSTR
public void setCSTR(String CSTR)
- Set CSTR (Custom Connect String - replaces DSN,UID,PWD,DB,WSID).
- Parameters:
- CSTR - The new CSTR.
getCSTR
public String getCSTR()
- Get the current CSTR (Custom Connect String - replaces DSN,UID,PWD,DB,WSID).
- Returns:
- String containing the CSTR.
setUID
public void setUID(String UID)
- Set the user id for the query. Whether or not you need this depends on the
database system you are accessing.
- Parameters:
- UID - The user id.
getUID
public String getUID()
- Get the user id.
- Returns:
- String containing the user id.
setPWD
public void setPWD(String PWD)
- Set the user password for the query. Whether or not you need this depends on the
database system you are accessing.
- Parameters:
- PWD - The password.
getPWD
public String getPWD()
- Get the user password.
- Returns:
- String containing the user password.
setMaxRows
public void setMaxRows(int maxRows)
- Set the maximum number of rows to return. Defaults to no limit.
It is good practice to limit this to a sensible value to avoid overloading
the server or client with queries that might return many more rows than expected.
- Parameters:
- maxRows - The maximum rows to return.
getMaxRows
public int getMaxRows()
- Get maximum number of rows.
- Returns:
- int containing the maximum.
setTimeOut
public void setTimeOut(int timeOut)
- Set the SQL timeout.
- Parameters:
- timeOut - The timeout in seconds.
getTimeOut
public int getTimeOut()
- Get the SQL timeout.
- Returns:
- int containing the timeout.
getColumnCount
public int getColumnCount()
- Get the column count for the last query. If an error occurred in the last query,
the column count will be zero.
This is set by execSQL().
- Returns:
- Integer containing the column count.
getRowCount
public int getRowCount()
- Get the row count for the last query. If an error occurred in the last query,
the error return from execSQL() will be stored here.
- Returns:
- Integer containing the row count.