Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access 7.1.151
  HXTT Cobol 5.0.151
  HXTT DBF 7.1.152
  Buy Now
  HXTT Excel 6.1.155
  HXTT Json 1.0.123
  HXTT Paradox 7.1.151
  HXTT PDF 2.0.151
  HXTT Text(CSV) 7.1.151
  HXTT Word 1.1.151
  HXTT XML 4.0.152
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)

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


Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Sitemap