JDBC Type 4 Driver 1.1 Programmer's Reference

System.out.println("Key: " + recKey +"; Using "
+ length + " of file " + args[1]);
try {
Class.forName("com.tandem.t4jdbc.SQLMXDriver");
start = System.currentTimeMillis();
//url should be of the form:
// jdbc:t4sqlmx://ip_address|machine_name:port_number/:”
String url = “jdbc:t4sqlmx://mymachine:6000/:”;
conn1 = DriverManager.getConnection(url);
System.out.println("Cleaning up test tables...");
Statement stmt0 = conn1.createStatement();
stmt0.execute("delete from clobdatatbl");
stmt0.execute("delete from clobbase");
conn1.setAutoCommit(false);
}
catch (Exception e1) {
e1.printStackTrace();
}
// PreparedStatement interface example - This technique
// is suitable if the LOB data is already on the NonStop
// system disk.
try {
System.out.println("PreparedStatement interface
LOB insert...");
String stmtSource1 = "insert into clobbase
values (?,?)";
PreparedStatement stmt1
= conn1.prepareStatement(stmtSource1);
stmt1.setInt(1,recKey);
stmt1.setAsciiStream(2,clobFs,length);
stmt1.executeUpdate();
conn1.commit();
}
catch (SQLException e) {
e.printStackTrace();
SQLException next = e;
do {
System.out.println("Messge : " + e.getMessage());
System.out.println("Error Code : " + e.getErrorCode());
System.out.println("SQLState : " + e.getSQLState());
} while ((next = next.getNextException()) != null);
}