• Post Reply 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connect FoxPro DB using JDBC ODBC Bridge

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 = "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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic