I have been testing the evaluation version of HXTT DBF.
The code I I have tested is below.
When I run with : "java -cp .:./DBF_Direct_Access_JDBC30.jar Hxtt 10000", the answer I get is : "Exception in thread "main" java.lang.StackOverflowError"
I have tried running with "java -Xss256m -cp .:./DBF_Direct_Access_JDBC30.jar Hxtt 10000" but I it is the same.
Is it a bug or what?
import java.sql.*;
import java.io.*;
class Hxtt {
public static void main( String[] args ) throws SQLException, IOException, ClassNotFoundException {
long ti, tf;
int total;
try {
total = Integer.parseInt( args[0] );
} catch( Exception e ) {
total = 0;
System.err.println( "uso: java Hxtt " );
System.exit( 0 );
}
/* CONECTARSE */
ti = System.currentTimeMillis();
Class.forName( "com.hxtt.sql.dbf.DBFDriver" );
Connection con = DriverManager.getConnection( "jdbc:DBF:/." );
Statement stmt = con.createStatement();
/* CREAR TABLA */
stmt.execute( "CREATE TABLE TABLA ( CAMPO1 VARCHAR(10), CAMPO2 VARCHAR(10), CAMPO3 VARCHAR(10), CAMPO4 VARCHAR(10) ) " );
/* INDICE */
stmt.execute( "CREATE INDEX INDICE1 ON TABLA ( CAMPO1 )" );
stmt.execute( "CREATE INDEX INDICE2 ON TABLA ( CAMPO2 )" );
stmt.execute( "CREATE INDEX INDICE3 ON TABLA ( CAMPO3 )" );
stmt.execute( "CREATE INDEX INDICE4 ON TABLA ( CAMPO4 )" );
RandomAccessFile in = new RandomAccessFile( "registros.txt", "r" );
/* INSERTAR tuplas */
int cont = 0;
String s = in.readLine();
while( s != null && cont < total ) {
stmt.execute( "INSERT INTO TABLA values( '" + s.substring( 0, 10 ) + "', '" + s.substring( 10, 20 ) + "', '" + s.substring( 20, 30 ) + "', '" + s.substring( 30, 40 ) + "' )" );
cont++;
s = in.readLine();
}
/* CERRAR STATEMENT */
stmt.close();
/* CERRAR CONEXION */
con.close();
tf = System.currentTimeMillis();
System.out.println( "Registros indexados : " + total );
System.out.println( "Tiempo : " + ( tf - ti ) + " ms." );
}
}
|
Fixed a bug in IDX file cache. Thanks for your response. Please download the latest package.
|