Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
  HXTT Cobol v2.1
  HXTT DBF v5.2
  HXTT Excel v4.2
  HXTT Paradox v5.2
  HXTT Text(CSV) v5.2
 
  Buy Now
  Support
  Download
  Document
  FAQ
  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 Text(CSV)
Hibernate and HXTT Text Driver
James Frankman
2006-06-05 12:24:49.0
I am currently evaluating the HXTT Text Driver because we have a need to read and process a text file. I am confused on how to map my class to the text file since the text file is not described by any DB. I know from your JDBC examples, you need to issue a "CREATE TABLE" statement to define the layout of the text file you need to manipulate. How is this sort of thing done with Hibernate?
Re:Hibernate and HXTT Text Driver
HXTT Support
2006-06-05 19:28:23.0
First, download HXTT Hibernate Support Package.
Second, please read CREATE TABLE sql. If you're using CSV or TSV table, you needn't even to define CREATE TABLE.
Thirdly, please read connection property table at Connecting to the Database. For instance, you can use jdbc:text:////yourTextFileDirectory?schemaFile=aSchemaFile.sql;fileExtension=TXT . If you stored all "CREATE TABLE" sqls in that aSchemaFile.sql file, HXTT Text (CSV) will load those table declaration sqls .

Re:Re:Hibernate and HXTT Text Driver
jfrankman
2006-06-06 10:01:05.0
I created "aSchemaFile.sql" and added it to the connection url as follows:

String url = "jdbc:Text:/.?schemaFile=aSchemaFile.sql;fileExtension=idx";
Connection con = DriverManager.getConnection(url, "", "");
Statement stmt = con.createStatement();
stmt.setFetchSize(10);
String sql="select * from \"KeyPayChecks.idx\"";
ResultSet rs = stmt.executeQuery(sql);

However when I do this I get the following stack trace:

java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at com.hxtt.sql.text.l.b(Unknown Source)
at com.hxtt.sql.text.l.void(Unknown Source)
at com.hxtt.sql.text.b.a(Unknown Source)
at com.hxtt.sql.text.b.a(Unknown Source)
at com.hxtt.sql.text.e.a(Unknown Source)
at com.hxtt.sql.be.if(Unknown Source)
at com.hxtt.sql.cx.a(Unknown Source)
at com.hxtt.sql.cx.a(Unknown Source)
at com.hxtt.sql.be.a(Unknown Source)
at com.hxtt.sql.be.a(Unknown Source)
at com.hxtt.sql.ab.a(Unknown Source)
at com.hxtt.sql.ab.a(Unknown Source)
at com.hxtt.sql.ab.executeQuery(Unknown Source)
at com.idfbins.keybank.ImageIndexFileServices.getRecords(ImageIndexFileServices.java:94)
at com.idfbins.keybank.Tester.main(Tester.java:15)
java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at com.hxtt.sql.text.l.b(Unknown Source)
at com.hxtt.sql.text.l.void(Unknown Source)
at com.hxtt.sql.text.b.a(Unknown Source)
at com.hxtt.sql.text.b.a(Unknown Source)
at com.hxtt.sql.text.e.a(Unknown Source)
at com.hxtt.sql.be.if(Unknown Source)
at com.hxtt.sql.cx.a(Unknown Source)
at com.hxtt.sql.cx.a(Unknown Source)
at com.hxtt.sql.be.a(Unknown Source)
at com.hxtt.sql.be.a(Unknown Source)
at com.hxtt.sql.ab.a(Unknown Source)
at com.hxtt.sql.ab.a(Unknown Source)
at com.hxtt.sql.ab.executeQuery(Unknown Source)
at com.idfbins.keybank.ImageIndexFileServices.getRecords(ImageIndexFileServices.java:94)
at com.idfbins.keybank.Tester.main(Tester.java:15)


at com.hxtt.global.SQLState.SQLException(Unknown Source)
at com.hxtt.sql.be.a(Unknown Source)
at com.hxtt.sql.ab.a(Unknown Source)
at com.hxtt.sql.ab.a(Unknown Source)
at com.hxtt.sql.ab.executeQuery(Unknown Source)
at com.idfbins.keybank.ImageIndexFileServices.getRecords(ImageIndexFileServices.java:94)
at com.idfbins.keybank.Tester.main(Tester.java:15)
0
Re:Re:Re:Hibernate and HXTT Text Driver
HXTT Support
2006-06-06 20:01:40.0
That issue was resulted by an invalid default value in your Create Table sql. Supported. Please download the latest package.

If possible, please paste your Create Table sql.
Re:Re:Re:Re:Hibernate and HXTT Text Driver
james frankman
2006-06-07 06:33:37.0
You are correct, I was off by one character in the definitions and there was some junk at the end of the sql file I had to delete. Once I found this, it has been working correctly. Thanks for your help.

P.S. It would be nice if a "SQL not valid" exception was thrown when this sort of thing happens. The "array Index out of bounds" is really reporting the effect of the error not the cause.
Re:Re:Re:Re:Re:Hibernate and HXTT Text Driver
HXTT Support
2006-06-07 06:41:03.0
Yeah. So the latest package will stuff/truncate that invalid default value without ArrayIndexOutOfBoundsException.

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