aspose file tools*
The moose likes JDBC and the fly likes Connect FoxPro DB using JDBC ODBC Bridge Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connect FoxPro DB using JDBC ODBC Bridge" Watch "Connect FoxPro DB using JDBC ODBC Bridge" New topic
Author

Connect FoxPro DB using JDBC ODBC Bridge

Tony Caos
Greenhorn

Joined: Jun 28, 2006
Posts: 2
Hi all,

I'm Tony. I've got a trouble when trying to connect to FoxPro DB using JDBC ODBC Bridge.

I create an ODBC bridge on System DSN with:


Here's my coding:
try {
// load driver...
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();

// create connection...
String url = "jdbcdbc:TestDBF";
Connection con = DriverManager.getConnection(url);

// test sql prepared statement...
String sql = "SELECT count(*) as count_result FROM USERS";
PreparedStatement stmt = con.prepareStatement(sql);
ResultSet rs = stmt.executeQuery();
int count = 0;
while(rs.next()) {
count = rs.getInt("count_result");
System.out.println(count);
}

rs.close();
stmt.close();
con.close();
}
catch(Exception exc) {
exc.printStackTrace();
}

It run properly if I deploy as a Java Application.
But when I deployed on Web Application using WebSphere Application Server 6.0, it throws the errors:
- java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]File 'users.dbf' does not exist.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connect FoxPro DB using JDBC ODBC Bridge
 
Similar Threads
Need Suggestion
Problem: Unable to allocate a connection
can I change JDBC Driver ?
Netbeans and MS Access
Connect FoxPro DB using JDBC ODBC Bridge - new