Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
  HXTT Cobol v5.0
  HXTT DBF v7.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel v6.1
  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 DBF
Access to Files via Samba
Kit Kennedy
2011-09-29 06:13:01.0
I am trying to access the .dbf files using your Samba support.
If I use this JDBC connection, then it hangs at the "executeQuery" statement and never returns a result.

private static final String FOXPRO_FILE_FOLDER = "dtc1/meis-serverbu/Kit"; //Location of the .dbf files
private static final String JDBC_URL = "jdbc:dbf:smb://" + DOMAIN + ";" + USERNAME + ":" + PASSWORD + "@" + FOXPRO_FILE_FOLDER;

If I use this JDBC connection, then it returns a result in less than a second:

private static final String FOXPRO_FILE_FOLDER = "/home/kkennedy/Desktop/VFP";
private static final String JDBC_URL = "jdbc:dbf:///" + FOXPRO_FILE_FOLDER;

Do you have any ideas why it hangs and doesn't return a result??? Thank you for your assistance.

This is the method that I use to connect:
public static List> execute(String sqlStatement) throws ClassNotFoundException, SQLException {
Class.forName(DRIVER_CLASS);
Properties properties = new Properties();
properties.setProperty("loadIndices", "false");
Connection conn = DriverManager.getConnection(JDBC_URL, properties);
System.out.println("Connection established");
Statement stmt = conn.createStatement();
System.out.println("Executing Statement...");
ResultSet resultSet = stmt.executeQuery(sqlStatement); //This is the statement where it hangs.
List> dataRows = new ArrayList>();
while (resultSet.next()) {
System.out.println("Obtaining Results...");
List singleDataRow = new ArrayList();
for (int j = 1; j <= resultSet.getMetaData().getColumnCount(); j++) {
singleDataRow.add(resultSet.getObject(j));
}
dataRows.add(singleDataRow);
}
System.out.println("Returning Results");
stmt.close();
conn.close();
return dataRows;
}
Re:Access to Files via Samba
HXTT Support
2011-09-29 06:40:04.0
>private static final String JDBC_URL = "jdbc:dbf:smb://" + DOMAIN + ";" + USERNAME + ":" + PASSWORD + "@" + FOXPRO_FILE_FOLDER;
jdbc:dbf:smb://[[[domain;]username[:password]@]server[:port]/[[share/[dir/]file]]][?[param=value]]
I guess that you should use
private static final String JDBC_URL = "jdbc:dbf:smb://" + USERNAME + ":" + PASSWORD + "@"+DOMAIN+"/" + FOXPRO_FILE_FOLDER;
since dtc1 likes a directory name, not a server name.
For SAMBA support, you should download Java CIFS Client Library, which is developed by Michael B. Allen.


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 | Sitemap