This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Connect FoxPro DB using JDBC ODBC Bridge
 
It's not a secret anymore!