Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
  HXTT Cobol v2.1
  HXTT DBF v5.2
  Buy Now
  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)

Table name problems
2016-02-01 07:57:34.0
Hi there,

let's say I have two DBF files in the directory "c:/test". One is called "test_1.dbf", the other one is called "test~1.dbf".

The connection string then would be: "jdbc:DBF:///c:/test"

If I run this:

Connection con = DriverManager.getConnection(url, "", "");
ResultSet rs = con.getMetaData().getColumns(null, null, "test_1", null);

the ResultSet object does not only contain the column metadta from test_1.dbf, but from test~1.dbf, too! How can I stop this without changing the file name?


Re:Table name problems
2016-02-02 02:07:27.0
Yeah, I'm an idiot. As it turns out, die table name parameter in the getColumns() method is used as a pattern and the underscore matches any character.

But there still is a problem. When I try to escape the underscore the getColumns() method will return an empty result set. My code:

String url = "jdbc:DBF:///c:/dbf";
Connection con = DriverManager.getConnection(url, "", "");
ResultSet rs = con.getMetaData().getColumns(null, null, "test\\_1", null);

while ( {
// 3 == table name
// 4 == column name
System.out.println(rs.getString(3) + " - " + rs.getString(4));

What am I doing wrong?
Re:Re:Table name problems
HXTT Support
2016-02-04 03:21:51.0
At ,

Within a pattern String, "%" means match any substring of 0 or more characters, and "_" means match any one character. Only metadata entries matching the search pattern are returned. But there is not an escape character defination for \:(

We will add that feature soon.

Re:Re:Re:Table name problems
2016-02-04 03:24:02.0
I worked around this issue - thanks for the information, though!
Re:Re:Re:Re:Table name problems
HXTT Support
2016-02-08 22:15:58.0
The latest package has supported \ as escape character for metadata.
Re:Re:Re:Re:Re:Table name problems
2016-02-09 01:16:37.0

Search Key   Search by Last 50 Questions


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