Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
  HXTT Cobol v5.0
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT DBF v7.1
  HXTT Excel v6.1
  HXTT Json v1.0
  HXTT Paradox v7.1
  HXTT PDF v2.0
  HXTT Text(CSV) v7.1
  HXTT Word v1.1
  HXTT XML v4.0
Offshore Outsourcing
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
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT Cobol
Cobol JDBC Driver
Cler
2016-06-14 01:17:01
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
> 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
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
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
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
>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
BTW, there's no fddir parameter, you can use dir4fileDescription connection property.

Search Key   Search by Last 50 Questions




Google
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Refund | Sitemap