Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Connect FoxPro DB using JDBC ODBC Bridge - new

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi All,

I�m Tony. I�m trying to connect to FoxPro DB using JDBC ODBC bridge. And I�ve got a trouble with it.

I created an ODBC bridge at System DSN with:
- Database Type: Free Table directory
- Driver:
- collating sequence: machine.
- Exclusive: no checked.
- Fetch data in background: checked.

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

// create connection...
String url = "jdbc:odbc: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.

Please help me to fix this trouble. I do appreciate.

Regards,


Tony Caos
 
author & internet detective
Posts: 39339
755
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Closing accidental duplicate thread
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!