com.ibm.as400.access.jdbcClient
Class Main
java.lang.Object
com.ibm.as400.access.jdbcClient.Main
- All Implemented Interfaces:
- Runnable
public class Main
- extends Object
- implements Runnable
Main class for the jdbcClient program. This sample client uses JDBC to connect to
the specified URL using the specified userid and password.
This program is provided AS/IS and formal support will NOT be provided.
This program should not be used in a production environment.
Because this program is provided AS/IS, no consideration is made for NLS support.
|
Method Summary |
static void |
appendMixedUXOutput(StringBuffer sb,
char[] chars)
|
static void |
dispResultSet(ResultSet rs)
|
void |
executeCallCommand(String command,
PrintStream out1)
|
void |
executeCLCommand(String clCommand,
PrintStream out1)
|
boolean |
executeCommand(String command1,
PrintStream out1)
Executes a command that is not an SQL query. |
void |
executeSqlCommand(String command,
PrintStream out1)
|
boolean |
executeTopLevelCommand(String command,
PrintStream out1)
Execute a top level command. |
Object |
getParameterObject(String thisParm,
PrintStream out1)
|
Connection |
getPooledConnection(String thisConnectUserId,
String thisConnectPassword,
String connectUrl,
PrintStream out1)
|
int |
go(InputStream in,
PrintStream out1)
|
static void |
main(String[] args)
|
Array |
makeArray(Object parameter,
String arrayType)
|
void |
processException(SQLException ex,
String command,
PrintStream out1)
|
String |
removeProperty(String url,
String newProperties)
|
void |
run()
|
void |
setManualResultSetColType(ResultSetMetaData rsmd)
|
void |
setParameter(PreparedStatement cstmt,
String thisParm,
int parm,
PrintStream out)
|
void |
setPassword(String newpassword)
|
void |
setUrl(String newUrl)
|
void |
setUserId(String newUserId,
PrintStream out1)
|
void |
showMixedUXOutput(PrintStream out1,
char[] chars)
|
void |
useConnectionPool(boolean value)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
knownDrivers
public static String[] knownDrivers
promptString
public static String promptString
usage
public static String usage
commandHelp
public static String[] commandHelp
Main
public Main(String url,
String userid,
String password)
throws SQLException
- Throws:
SQLException
Main
public Main(String command,
PrintStream out)
go
public int go(InputStream in,
PrintStream out1)
run
public void run()
- Specified by:
run in interface Runnable
useConnectionPool
public void useConnectionPool(boolean value)
setUrl
public void setUrl(String newUrl)
setUserId
public void setUserId(String newUserId,
PrintStream out1)
setPassword
public void setPassword(String newpassword)
removeProperty
public String removeProperty(String url,
String newProperties)
setManualResultSetColType
public void setManualResultSetColType(ResultSetMetaData rsmd)
throws SQLException
- Throws:
SQLException
getPooledConnection
public Connection getPooledConnection(String thisConnectUserId,
String thisConnectPassword,
String connectUrl,
PrintStream out1)
throws SQLException
- Throws:
SQLException
executeCLCommand
public void executeCLCommand(String clCommand,
PrintStream out1)
throws Exception
- Throws:
Exception
executeCallCommand
public void executeCallCommand(String command,
PrintStream out1)
throws Exception
- Throws:
Exception
executeSqlCommand
public void executeSqlCommand(String command,
PrintStream out1)
throws Exception
- Throws:
Exception
processException
public void processException(SQLException ex,
String command,
PrintStream out1)
executeTopLevelCommand
public boolean executeTopLevelCommand(String command,
PrintStream out1)
- Execute a top level command. This may be an SQL statement or a command !
- Parameters:
command - out1 -
- Returns:
executeCommand
public boolean executeCommand(String command1,
PrintStream out1)
- Executes a command that is not an SQL query.
The ! has already been stripped from the command.
- Parameters:
command1 - out1 -
- Returns:
dispResultSet
public static void dispResultSet(ResultSet rs)
throws SQLException
- Throws:
SQLException
showMixedUXOutput
public void showMixedUXOutput(PrintStream out1,
char[] chars)
appendMixedUXOutput
public static void appendMixedUXOutput(StringBuffer sb,
char[] chars)
getParameterObject
public Object getParameterObject(String thisParm,
PrintStream out1)
setParameter
public void setParameter(PreparedStatement cstmt,
String thisParm,
int parm,
PrintStream out)
throws SQLException
- Throws:
SQLException
makeArray
public Array makeArray(Object parameter,
String arrayType)
throws Exception
- Throws:
Exception
main
public static void main(String[] args)