Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Cobol v2.1
  HXTT DBF v5.2
  HXTT Excel v4.2
  HXTT Paradox v5.2
  HXTT Text(CSV) v5.2
  HXTT XML v1.2
Offshore Outsourcing
Oracle Data Import/Export
DB2 Data Import/Export
Sybase Data Import/Export
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Hongxin Technology & Trade Ltd. of Xiangtan City (abbr, HXTT)

HXTT ACCESS
Access_JDBC30.jar - ArrayIndexOutOfBoundsException
Gabriele Cagliani
2008-06-20 00:44:46.0
During INSERT of a lot of lines my program goes to Exception.
I used Access driver 3.0 or 2.0.
I think ther are some problems into your drivers

Abend Msg2:Error executing SQL1: Errore:java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at com.hxtt.b.p.a(Unknown Source)
at com.hxtt.sql.access.as.a(Unknown Source)
at com.hxtt.sql.access.as.int(Unknown Source)
at com.hxtt.sql.access.as.a(Unknown Source)
at com.hxtt.sql.access.as.a(Unknown Source)
at com.hxtt.sql.access.a7.if(Unknown Source)
at com.hxtt.sql.access.j.if(Unknown Source)
at com.hxtt.sql.access.j.do(Unknown Source)
at com.hxtt.sql.access.a2.a(Unknown Source)
at com.hxtt.sql.w.a(Unknown Source)
at com.hxtt.sql.b0.for(Unknown Source)
at com.hxtt.sql.bu.int(Unknown Source)
at com.hxtt.sql.de.a(Unknown Source)
at com.hxtt.sql.bm.a(Unknown Source)
at com.hxtt.sql.ag.a(Unknown Source)
at com.hxtt.sql.dg.char(Unknown Source)
at com.hxtt.sql.dg.executeUpdate(Unknown Source)
at jooecreate.copy.PrceAgripr.(PrceAgripr.java:169)
at jooecreate.JooeCreateThread.run(JooeCreateThread.java:165)
at java.lang.Thread.run(Thread.java:619)

Java Result: 12
Re:Access_JDBC30.jar - ArrayIndexOutOfBoundsException
HXTT Support
2008-06-23 19:09:41.0
HXTT Access should meet some invalid infromation in your access database file. If possible, please email us that test sql and mdb file so that we can recur your issue.
Re:Re:Access_JDBC30.jar - ArrayIndexOutOfBoundsException
Gabriele
2008-06-24 01:18:46.0
There are not invalid information.
If I use JDBC-ODBC all is OK.
My application loads 40 tables into 180 different mdb.

However, I workaround this problem with "SQLWarning sqlW = conn.getWarnings();" every 10000 lines.

I attach only one class that inserts lines.



/*
* Calendar.java
*
*/
package jooecreate.copy;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import jooecreate.util.Message;

/**
*
* @author Gabriele
*/
public class Calendar
{

/** Creates a new instance of Calendar */
public Calendar()
{
}

public Calendar(Connection connInp, Connection connOut, String slmnPin, Message message)
{

String insertTxt = "insert into WOE_CALENDAR " +
" values (?,?,?) ";

String sqlTxt = "Select " +
" CLDR_ID, " +
" CLDR_YEAR, " +
" CLDR_DAYS " +
" from WOE_CALENDAR" +
" order by CLDR_ID," +
" CLDR_YEAR";

PreparedStatement prepStmt = null;
Statement sql = null;
try
{
sql = connInp.createStatement();
}
catch (Exception e)
{
message.SendAbend("Calendar", "Errore PrepStmt e=", e.getMessage());
}
int totalInsert = 0;
boolean eofSelect = false;

try
{
Statement sqlOut = connOut.createStatement();
sqlOut.execute("drop table WOE_CALENDAR");
}
catch (SQLException e)
{
}

try
{
Statement sqlOut = connOut.createStatement();
String sqlOutTxt = "create table WOE_CALENDAR (" +
" CLDR_ID CHAR (4) not null," +
" CLDR_YEAR CHAR (4) not null," +
" CLDR_DAYS LONGVARCHAR not null," +
" PRIMARY KEY " +
" (" +
" CLDR_ID," +
" CLDR_YEAR" +
" ))";

sqlOut.execute(sqlOutTxt);
}
catch (SQLException e)
{
message.SendAbend("Calendar", "Error executing SQLMdb: ", e.getMessage());
}
try
{
prepStmt = connOut.prepareStatement(insertTxt);
}
catch (SQLException e)
{
message.SendAbend("Calendar", "Couldn't close database OUT", e.getMessage());
}
try
{
ResultSet line = sql.executeQuery(sqlTxt);
while (line.next())
{
prepStmt.setString(1, line.getString(1));
prepStmt.setString(2, line.getString(2));
prepStmt.setString(3, line.getString(3));

prepStmt.executeUpdate();
totalInsert++;
}
}
catch (SQLException e)
{
message.SendAbend("Calendar", "Error executing SQL: ", e.getMessage());
return;
}
try
{
connOut.commit();
}
catch (SQLException e)
{
}
message.Send("Calendar", "Total Insert =" + totalInsert);
return;
}
}

Re:Re:Re:Access_JDBC30.jar - ArrayIndexOutOfBoundsException
HXTT Support
2008-06-29 04:29:37.0
Passed test with your code for inserting 25000 rows of test data. It should be an index issue. You can try temporarily to remove your PRIMARY KEY, then that Exception should disappear. If possible, you can zip and email a csv file with your test data, so that we can recur your issue.
Re:Re:Re:Re:Access_JDBC30.jar - ArrayIndexOutOfBoundsException
Gabriele
2008-07-07 23:58:50.0
I prepared a test program.
If I run using JDBC-ODBC (isHXTT = false) there are no problem.
Using HXTT driver yes.
To run this program create an empty Test.mdb into directory D:\HXTT
Run more times.

/*
* TestHXTT
* Gabriele Cagliani
*/
package testhxtt1;

import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
*
* @author Gabriele
*/
public class TestHXTT1
{
// Change Directory
private static String dbq = "D:\\HXTT\\Test.mdb";
// set isHXTT true / false;
private static boolean isHXTT = true;

/**
* @param args the command line arguments
*/
public static void main(String[] args)
{
new TestHXTT1();
System.exit(0);
}

public TestHXTT1()
{
if (isHXTT)
{
loadHXTTDriver();
}
else
{
loadOdbcDriver();
}
for (int i = 1; i <= 200; i++)
{
System.out.println("Run number " + i);
Connection conn = null;
if (isHXTT)
{
conn = connectHXTT();
}
else
{
conn = connectOdbc();
}
if (isHXTT)
{
dropTableHXTT(conn, i);
commitMdb(conn);
createTableHXTT(conn, i);
commitMdb(conn);
}
else
{
createTableOdbc(conn, i);
commitMdb(conn);
}
loadTable(conn, i);
commitMdb(conn);
closeMdb(conn);
}
}

private void loadOdbcDriver()
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch (ClassNotFoundException ex)
{
System.out.println("There was a problem loading the database driver." + ex.getMessage());
Logger.getLogger(TestHXTT1.class.getName()).log(Level.SEVERE, null, ex);
}
}

private void loadHXTTDriver()
{
try
{
Class.forName("com.hxtt.sql.access.AccessDriver").newInstance();
}
catch (ClassNotFoundException ex)
{
System.out.println("There was a problem loading the database driver." + ex.getMessage());
Logger.getLogger(TestHXTT1.class.getName()).log(Level.SEVERE, null, ex);
}
catch (InstantiationException ex)
{
System.out.println("There was a problem loading the database driver." + ex.getMessage());
Logger.getLogger(TestHXTT1.class.getName()).log(Level.SEVERE, null, ex);
}
catch (IllegalAccessException ex)
{
System.out.println("There was a problem loading the database driver." + ex.getMessage());
Logger.getLogger(TestHXTT1.class.getName()).log(Level.SEVERE, null, ex);
}
}

private Connection connectHXTT()
{
Connection conn = null;
try
{
String URL = "jdbc:Access:///" + dbq;
conn = DriverManager.getConnection(URL);
conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
}
catch (SQLException ex)
{
System.out.println("There was a problem connecting to the database." + ex.getMessage());
Logger.getLogger(TestHXTT1.class.getName()).log(Level.SEVERE, null, ex);
}
return conn;
}

private Connection connectOdbc()
{
Connection conn = null;
try
{
String URL = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};ExtendedAnsiSQL=1;DBQ=" + dbq + ";DriverID=22;MaxBufferSize=1024;Exclusive=1";
conn = DriverManager.getConnection(URL);
}
catch (SQLException ex)
{
System.out.println("There was a problem connecting to the database." + ex.getMessage());
Logger.getLogger(TestHXTT1.class.getName()).log(Level.SEVERE, null, ex);
}
return conn;
}

private void commitMdb(Connection conn)
{
try
{
conn.commit();
}
catch (SQLException e)
{
}
}

private void closeMdb(Connection conn)
{
try
{
conn.close();
}
catch (SQLException e)
{
}
}

private void dropTableHXTT(Connection conn, int i)
{
try
{
Statement sqlOut = conn.createStatement();
sqlOut.execute("drop table IF EXISTS HXTT_PROD_" + i);
sqlOut.close();
conn.commit();
}
catch (SQLException e)
{
}
}

private boolean createTableHXTT(Connection conn, int i)
{
try
{
Statement sqlOut = conn.createStatement();
String sqlOutTxt = "create table HXTT_PROD_" + i +
" (" +
" KEY_PROGR integer," + //CONSTRAINT PKEY Primary Key
" CODE char (3) NOT NULL," +
" CODE_ID char (2) NOT NULL," +
" SLS_DEPT_ID char (3) NOT NULL," +
" PROD_ID char (11) NOT NULL," +
" PROD_SHRT_ID char (8) NOT NULL," +
" ATMV_PART_ID char (5) NOT NULL," +
" PROD_STUS_CODE char (1) NOT NULL," +
" PROD_DESC varchar (100) NOT NULL," +
" PROD_SHRT_DESC varchar (50) NOT NULL," +
" SELL_UNIT char (4) NOT NULL," +
" PROD_LGTH_DIMN decimal (12,5) NOT NULL," +
" LGTH_UNIT char (4) NOT NULL," +
" PROD_WDTH_DIMN decimal(12, 5) NOT NULL," +
" WDTH_UNIT char (4) NOT NULL," +
" OTSD_DIAM_DIMN decimal(12, 5) NOT NULL," +
" INSD_DIAM_DIMN decimal(12, 5) NOT NULL," +
" ECCN_NBR char (6) NOT NULL," +
" SET_KID_IND char (1) NOT NULL," +
" STAT_CODE char (12) NOT NULL," +
" MIN_ORD_QTY decimal(12, 2) NOT NULL," +
" MAX_ORD_QTY decimal(12, 2) NOT NULL," +
" SMLS_SLBL_PACK_QTY decimal(12, 2) NOT NULL," +
" MIN_ORD_QTY_SD decimal(12, 2) NOT NULL," +
" MAX_ORD_QTY_SD decimal(12, 2) NOT NULL," +
" SMLS_SLBL_PACK_QTY_SD decimal(12, 2) NOT NULL," +
" MAIN_SLS_DEPT_CODE char (3) NOT NULL," +
" SLS_WRNY_DAYS integer NOT NULL," +
" VAT_RATE_CODE char (2) NOT NULL" +
" )";
sqlOut.execute(sqlOutTxt);
sqlOut.clearBatch();
sqlOut.close();
conn.commit();
}
catch (SQLException e)
{
System.out.println("Error executing create Table: " + e.getMessage());
}
try
{
Statement sqlOut = conn.createStatement();
sqlOut.execute("CREATE UNIQUE INDEX " +
" PK_HHTT_PROD_" + i +
" ON HXTT_PROD_" + i +
" (" +
" CODE AND" +
" CODE_ID AND" +
" SLS_DEPT_ID AND" +
" PROD_ID AND" +
" KEY_PROGR " +
" PRIMARY KEY) ");
sqlOut.clearBatch();
sqlOut.close();
conn.commit();
}
catch (SQLException e)
{
System.out.println("Error executing create TableIndex: " + e.getMessage());
}
return true;
}

private boolean createTableOdbc(Connection conn, int i)
{
try
{
Statement sqlOut = conn.createStatement();
sqlOut.execute("drop table HXTT_PROD_" + i);
sqlOut.close();
}
catch (SQLException e)
{
}
try
{
Statement sqlOut = conn.createStatement();
String sqlOutTxt = "create table HXTT_PROD_" + i +
" (" +
" KEY_PROGR integer," + //CONSTRAINT PKEY Primary Key
" CODE char (3) NOT NULL," +
" CODE_ID char (2) NOT NULL," +
" SLS_DEPT_ID char (3) NOT NULL," +
" PROD_ID char (11) NOT NULL," +
" PROD_SHRT_ID char (8) NOT NULL," +
" ATMV_PART_ID char (5) NOT NULL," +
" PROD_STUS_CODE char (1) NOT NULL," +
" PROD_DESC varchar (100) NOT NULL," +
" PROD_SHRT_DESC varchar (50) NOT NULL," +
" SELL_UNIT char (4) NOT NULL," +
" PROD_LGTH_DIMN decimal (12,5) NOT NULL," +
" LGTH_UNIT char (4) NOT NULL," +
" PROD_WDTH_DIMN decimal(12, 5) NOT NULL," +
" WDTH_UNIT char (4) NOT NULL," +
" OTSD_DIAM_DIMN decimal(12, 5) NOT NULL," +
" INSD_DIAM_DIMN decimal(12, 5) NOT NULL," +
" ECCN_NBR char (6) NOT NULL," +
" SET_KID_IND char (1) NOT NULL," +
" STAT_CODE char (12) NOT NULL," +
" MIN_ORD_QTY decimal(12, 2) NOT NULL," +
" MAX_ORD_QTY decimal(12, 2) NOT NULL," +
" SMLS_SLBL_PACK_QTY decimal(12, 2) NOT NULL," +
" MIN_ORD_QTY_SD decimal(12, 2) NOT NULL," +
" MAX_ORD_QTY_SD decimal(12, 2) NOT NULL," +
" SMLS_SLBL_PACK_QTY_SD decimal(12, 2) NOT NULL," +
" MAIN_SLS_DEPT_CODE char (3) NOT NULL," +
" SLS_WRNY_DAYS integer NOT NULL," +
" VAT_RATE_CODE char (2) NOT NULL, " +
" CONSTRAINT [PK_HXTT_PROD_" + i +
"] PRIMARY KEY CLUSTERED" +
" (" +
" CODE ," +
" CODE_ID," +
" SLS_DEPT_ID," +
" PROD_ID," +
" KEY_PROGR " +
" ))";
sqlOut.execute(sqlOutTxt);
sqlOut.close();
}
catch (SQLException e)
{
System.out.println("Error executing create Table: " + e.getMessage());
}
return true;
}

private synchronized void loadTable(Connection conn, int i)
{
String insertTxt = "insert " +
" into HXTT_PROD_" + i +
" (KEY_PROGR," +
" CODE," +
" CODE_ID," +
" SLS_DEPT_ID," +
" PROD_ID," +
" PROD_SHRT_ID," +
" ATMV_PART_ID," +
" PROD_STUS_CODE," +
" PROD_DESC," +
" PROD_SHRT_DESC," +
" SELL_UNIT," +
" PROD_LGTH_DIMN," +
" LGTH_UNIT," +
" PROD_WDTH_DIMN," +
" WDTH_UNIT," +
" OTSD_DIAM_DIMN," +
" INSD_DIAM_DIMN," +
" ECCN_NBR," +
" SET_KID_IND," +
" STAT_CODE," +
" MIN_ORD_QTY," +
" MAX_ORD_QTY," +
" SMLS_SLBL_PACK_QTY," +
" MIN_ORD_QTY_SD," +
" MAX_ORD_QTY_SD," +
" SMLS_SLBL_PACK_QTY_SD," +
" MAIN_SLS_DEPT_CODE," +
" SLS_WRNY_DAYS," +
" VAT_RATE_CODE) " +
" values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ";

PreparedStatement prepStmt = null;
try
{
prepStmt = conn.prepareStatement(insertTxt);
}
catch (SQLException e)
{
}
for (int progr = 1; progr <= 300; progr++)
{
try
{
prepStmt.setInt(1, progr);
prepStmt.setString(2, "AAA");
prepStmt.setString(3, "BB");
prepStmt.setString(4, "DEP");
prepStmt.setString(5, "PROD_ID");
prepStmt.setString(6, "SHORT");
prepStmt.setString(7, "ATMV");
prepStmt.setString(8, "S");
prepStmt.setString(9, "DESCRIPTION");
prepStmt.setString(10, "DESCR");

prepStmt.setString(11, "SELL");
prepStmt.setBigDecimal(12, BigDecimal.TEN);
prepStmt.setString(13, "LGTH");
prepStmt.setBigDecimal(14, BigDecimal.ONE);
prepStmt.setString(15, "WDTH");
prepStmt.setBigDecimal(16, BigDecimal.ONE);
prepStmt.setBigDecimal(17, BigDecimal.ONE);
prepStmt.setString(18, "ECCN");
prepStmt.setString(19, "I");
prepStmt.setString(20, "STAT_CODE");

prepStmt.setBigDecimal(21, BigDecimal.ONE);
prepStmt.setBigDecimal(22, BigDecimal.ONE);
prepStmt.setBigDecimal(23, BigDecimal.ONE);
prepStmt.setBigDecimal(24, BigDecimal.ONE);
prepStmt.setBigDecimal(25, BigDecimal.ONE);
prepStmt.setBigDecimal(26, BigDecimal.ONE);
prepStmt.setString(27, "ZZZ");
prepStmt.setInt(28, 123);
prepStmt.setString(29, "YY");

prepStmt.executeUpdate();
}
catch (SQLException ex)
{
System.out.println("There was a problem inserting line " + progr +
" Ex.:" + ex.getMessage());
Logger.getLogger(TestHXTT1.class.getName()).log(Level.SEVERE, null, ex);
return;
}
}
try
{
prepStmt.close();
}
catch (SQLException ex)
{
Logger.getLogger(TestHXTT1.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
Re:Re:Re:Re:Re:Access_JDBC30.jar - ArrayIndexOutOfBoundsException
HXTT Support
2008-07-09 07:28:53.0
Please download the latest package, which I have tested with your test code. Thanks.
Re:Re:Re:Re:Re:Re:Access_JDBC30.jar - ArrayIndexOutOfBoundsException
Gabriele
2008-07-15 07:10:21.0
Is there a limit of 10 key fields definition ?
I attach Exception and program.
Prepare Test.mdb into directory D:/HXTT and run
Thanks
Mr. Gabriele


run:
Error executing create Table: java.lang.ArrayIndexOutOfBoundsException: 52
at com.hxtt.global.x.a(Unknown Source)
at com.hxtt.sql.access.aw.a(Unknown Source)
at com.hxtt.sql.access.ae.a(Unknown Source)
at com.hxtt.sql.bm.a(Unknown Source)
at com.hxtt.sql.ag.a(Unknown Source)
at com.hxtt.sql.ag.a(Unknown Source)
at com.hxtt.sql.ag.a(Unknown Source)
at com.hxtt.sql.ag.executeUpdate(Unknown Source)
at com.hxtt.sql.access.aw.a(Unknown Source)
at com.hxtt.sql.access.ae.a(Unknown Source)
at com.hxtt.sql.de.a(Unknown Source)
at com.hxtt.sql.bm.a(Unknown Source)
at com.hxtt.sql.ag.a(Unknown Source)
at com.hxtt.sql.ag.a(Unknown Source)
at com.hxtt.sql.ag.execute(Unknown Source)
at testhxtt3.TestHXTT3.createTableHXTT(TestHXTT3.java:198)
at testhxtt3.TestHXTT3.(TestHXTT3.java:57)
at testhxtt3.TestHXTT3.main(TestHXTT3.java:30)


/*
* TestHXTT
* Gabriele Cagliani
*/
package testhxtt3;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
*
* @author Gabriele
*/
public class TestHXTT3
{
// Change Directory
private static String dbq = "D:\\HXTT\\Test.mdb";
// set isHXTT true / false;
private static boolean isHXTT = true;

/**
* @param args the command line arguments
*/
public static void main(String[] args)
{
new TestHXTT3();
System.exit(0);
}

public TestHXTT3()
{
if (isHXTT)
{
loadHXTTDriver();
}
else
{
loadOdbcDriver();
}
Connection conn = null;
if (isHXTT)
{
conn = connectHXTT();
}
else
{
conn = connectOdbc();
}
if (isHXTT)
{
dropTableHXTT(conn);
commitMdb(conn);
createTableHXTT(conn);
commitMdb(conn);
}
else
{
createTableOdbc(conn);
commitMdb(conn);
}
commitMdb(conn);
closeMdb(conn);
}

private void loadOdbcDriver()
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch (ClassNotFoundException ex)
{
System.out.println("There was a problem loading the database driver." + ex.getMessage());
Logger.getLogger(TestHXTT3.class.getName()).log(Level.SEVERE, null, ex);
}
}

private void loadHXTTDriver()
{
try
{
Class.forName("com.hxtt.sql.access.AccessDriver").newInstance();
}


catch (ClassNotFoundException ex)
{
System.out.println("There was a problem loading the database driver." + ex.getMessage());
Logger.getLogger(TestHXTT3.class.getName()).log(Level.SEVERE, null, ex);
} catch (InstantiationException ex)
{
System.out.println("There was a problem loading the database driver." + ex.getMessage());
Logger.getLogger(TestHXTT3.class.getName()).log(Level.SEVERE, null, ex);
} catch (IllegalAccessException ex)
{
System.out.println("There was a problem loading the database driver." + ex.getMessage());
Logger.getLogger(TestHXTT3.class.getName()).log(Level.SEVERE, null, ex);
}
}

private Connection connectHXTT()
{
Connection conn = null;
try
{
String URL = "jdbc:Access:///" + dbq;
conn = DriverManager.getConnection(URL);
conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
}
catch (SQLException ex)
{
System.out.println("There was a problem connecting to the database." + ex.getMessage());
Logger.getLogger(TestHXTT3.class.getName()).log(Level.SEVERE, null, ex);
}
return conn;
}

private Connection connectOdbc()
{
Connection conn = null;
try
{
String URL = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};ExtendedAnsiSQL=1;DBQ=" + dbq + ";DriverID=22;MaxBufferSize=1024;Exclusive=1";
conn = DriverManager.getConnection(URL);
}
catch (SQLException ex)
{
System.out.println("There was a problem connecting to the database." + ex.getMessage());
Logger.getLogger(TestHXTT3.class.getName()).log(Level.SEVERE, null, ex);
}
return conn;
}

private void commitMdb(Connection conn)
{
try
{
conn.commit();
}
catch (SQLException e)
{
}
}

private void closeMdb(Connection conn)
{
try
{
conn.close();
}
catch (SQLException e)
{
}
}

private void dropTableHXTT(Connection conn)
{
try
{
Statement sqlOut = conn.createStatement();
sqlOut.execute("drop table IF EXISTS HXTT_TEST");
sqlOut.close();
conn.commit();
}
catch (SQLException e)
{
}
}

private boolean createTableHXTT(Connection conn)
{
try
{
Statement sqlOut = conn.createStatement();
String sqlOutTxt = "create table HXTT_TEST" +
" (" +
" K1 char (3) NOT NULL," +
" K2 char (3) NOT NULL," +
" K3 char (3) NOT NULL," +
" K4 char (3) NOT NULL," +
" K5 char (3) NOT NULL," +
" K6 char (3) NOT NULL," +
" K7 char (3) NOT NULL," +
" K8 char (3) NOT NULL," +
" K9 char (3) NOT NULL," +
" K10 char (3) NOT NULL," +
" K11 char (3) NOT NULL," +
" HXTT_DATA char (100) NOT NULL," +
" PRIMARY KEY " +
" (" +
" K1, K2, K3, K4, K5, " +
" K6, K7, K8, K9, K10, K11" +
" ))";
sqlOut.execute(sqlOutTxt);
sqlOut.clearBatch();
sqlOut.close();
conn.commit();
}
catch (SQLException e)
{
System.out.println("Error executing create Table: " + e.getMessage());
}
return true;
}

private boolean createTableOdbc(Connection conn)
{
try
{
Statement sqlOut = conn.createStatement();
sqlOut.execute("drop table HXTT_TEST");
}
catch (SQLException e)
{
}
try
{
Statement sqlOut = conn.createStatement();
String sqlOutTxt = "create table HXTT_TEST" +
" (" +
" K1 char (3) NOT NULL," +
" K2 char (3) NOT NULL," +
" K3 char (3) NOT NULL," +
" K4 char (3) NOT NULL," +
" K5 char (3) NOT NULL," +
" K6 char (3) NOT NULL," +
" K7 char (3) NOT NULL," +
" K8 char (3) NOT NULL," +
" K9 char (3) NOT NULL," +
" K10 char (3) NOT NULL," +
" K11 char (3) NOT NULL," +
" HXTT_DATA char (100) NOT NULL," +
" CONSTRAINT PK_HXTT_TEST" +
" PRIMARY KEY CLUSTERED" +
" (" +
" K1, K2, K3, K4, K5, " +
" K6, K7, K8, K9, K10, K11" +
" ))";
sqlOut.execute(sqlOutTxt);
sqlOut.close();
}
catch (SQLException e)
{
System.out.println("Error executing create Table: " + e.getMessage());
}
return true;
}
}

Re:Re:Re:Re:Re:Re:Re:Access_JDBC30.jar - ArrayIndexOutOfBoundsException
HXTT Support
2008-07-15 09:54:35.0
>Is there a limit of 10 key fields definition ?
Yeah. MS Access has such a limitation. The next version of HXTT Access will discard more than 10 key fields, and use the first 10 column in sql to build index. Thanks for your report.

Search Key   Search by Last 50 Questions




Google
 

Address: 9 Station Rd., Xiangtan City, Hunan Province, P.R. China
Postcode: 411100
Phone: (86)731-58225727
Fax: (86)731-58225727
Email: webmaster@hxtt.com
Copyright © 1999-2011 Hongxin Technology & Trade Ltd. | All Rights Reserved. | Privacy | Legal | Sitemap