JDBC Driver for SQL/MX Programmer's Reference
public class TestBLOB
{
public static void main (String[] args)
throws java.io.FileNotFoundException, java.io.IOException
{
int numBytes;
int recKey;
long start;
long end;
Connection conn1 = null;
// Set jdbcmx.blobTableName System Property. This property
// can also be added to the command line through
// "-Djdbcmx.blobTableName=...", or a
// java.util.Properties object can be used and passed to
// getConnection.
System.setProperty( "jdbcmx.blobTableName","cat.sch.blobdatatbl" );
if (args.length < 2) {
System.out.println("arg[0]=; arg[1]=file; arg[2]=");
return;
}
// byte array for the blob
byte[] whatever = new byte[5000];
for (int i=0; i<5000; i++) whatever[i] = 71; // "G"
String k = "K";
for (int i=0; i<5000; i++) k = k + "K";
System.out.println("string length = " + k.length());
java.io.ByteArrayInputStream iXstream
= new java.io.ByteArrayInputStream(whatever);
numBytes = iXstream.available();
if (args.length == 3)
numBytes = Integer.parseInt(args[2]);
recKey = Integer.parseInt(args[0]);
System.out.println("Key: " + recKey +"; Using "
+ numBytes + " of file " + args[1]);
try {
Class.forName("com.tandem.sqlmx.SQLMXDriver");
start = System.currentTimeMillis();
conn1 = DriverManager.getConnection("jdbc:sqlmx:");
System.out.println("Cleaning up test tables...");