Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
  HXTT Cobol v2.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  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 Cobol
Cobol JDBC Driver
Cler
2016-06-14 01:17:01.0
Hi,
I'm trying to use your jdbc driver to access old cobol archives.
For every entity I have two files: ANACOIN (without extension) and ANACOIN.vix.

Here my code:

Class.forName("com.hxtt.sql.cobol.CobolDriver").newInstance();
String url = "jdbc:cobol:/X:/conta";

String sql = "select * from ANACOIN";
Connection con = DriverManager.getConnection(url, "admin", "");
Statement stmt = con.createStatement();
stmt.setFetchSize(10);

ResultSet rs = stmt.executeQuery(sql);

On the last row I obtain an exception:
Table X:\CONTA\ANACOIN.dat doesn't exist.

Where am I wrong?

Regards,
Cler
Re:Cobol JDBC Driver
HXTT Support
2016-06-14 05:53:43.0
> String url = "jdbc:cobol:/X:/conta";
String url = "jdbc:cobol:/X:/conta?fileExtension=;";
Re:Re:Cobol JDBC Driver
Cler
2016-06-17 02:19:04.0
Ok, now get the following exception:

"Need Cobol source code file, Copybook file, FD file, XFD file, SEL file, or CREATE TABLE sql to define the table structure of X:\CONTA\ANACOIN"
Re:Re:Re:Cobol JDBC Driver
Hxtt Support
2016-06-17 04:21:48.0
Where's your data structrue description? ANACOIN.CBL, ANACOIN.CPY, ANACOIN.SEL, ANACOIN.FD, ANACOIN.XFD, and so on.
Re:Re:Re:Re:Cobol JDBC Driver
Cler
2016-06-17 08:34:49.0
Thank you, I set the url with fddir parameter and now I can't get the structure of the archive.

When I loop the result set to get field value I obtain strange chars:

4 CONTO-ACQUISTI INTEGER => null
15 ALIQUOTA-IVA-NOLEGGI INTEGER => 
16 CODICE-ABC VARCHAR => null
17 PREZZO-VENDITA JAVA_OBJECT => 
18 SCONTO2-VEND-PERC JAVA_OBJECT => [[Ljava.lang.Object;@745f0d2e
19 SCONTO-VEND-IMPORTO JAVA_OBJECT => null
20 PROVVIGIONE-PER-LISTINO JAVA_OBJECT => [[Ljava.lang.Object;@c5a82b2
21 COSTO-ULTIMO-ACQUISTO DECIMAL => [[Ljava.lang.Object;@a3a7a74
22 SCONTO-ACQ-PERC JAVA_OBJECT => 
23 MAGGIOR-ACQ-PERC DECIMAL => 
24 MAGGIOR-ACQ-IMP DECIMAL => null

How can I solve?
Re:Re:Re:Re:Re:Cobol JDBC Driver
Hxtt Support
2016-06-18 04:19:18.0
>20 PROVVIGIONE-PER-LISTINO JAVA_OBJECT => [[Ljava.lang.Object;@c5a82b2
>21 COSTO-ULTIMO-ACQUISTO DECIMAL => [[Ljava.lang.Object;@a3a7a74
According to that infromation, you should use resultSet.getObject(i-1), since maybe 21 value should be 20 value.
Because your value is JAVA_OBJECT, then your column should be array column or repeat column. You can use the following function:

colval = rs.getObject(j);
printValue(colval);

private static final void printValue(Object value){
if(value instanceof Object[]){
Object[] values=(Object[])value;
System.out.print("(");
for(int kk=0;kk if(kk>0)
System.out.print(",");
printValue(values[kk]);
}
System.out.print(")");
}else{
System.out.print(value);
}
}
Re:Re:Re:Re:Re:Cobol JDBC Driver
Hxtt Support
2016-06-18 04:20:38.0
BTW, there's no fddir parameter, you can use dir4fileDescription connection property.

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