This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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.
 
wood burning stoves
 
subject: Connect FoxPro DB using JDBC ODBC Bridge
 
Similar Threads
Need Suggestion
Netbeans and MS Access
Connect FoxPro DB using JDBC ODBC Bridge - new
Problem: Unable to allocate a connection
can I change JDBC Driver ?