try
{
Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”);
String connString=”jdbc:odbc:Driver={Microsoft dbase Driver (*.dbf)};DefaultDir=E:db”;//DeafultDir indicates the location of the db
Connection connection=DriverManager.getConnection(connString);
String sql=”SELECt * FROM table_name where condition”;// usual sql query
Statement stmt=connection.createStatement();
ResultSet resultSet=stmt.executeQuery(sql);
while(resultSet.next())
{
System.out.println();
}
System.out.println();
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
catch (SQLException e)
{
e.printStackTrace();
}
有用。而且我想,由于Java提供了一种读/写dbf的绝妙方法,因此无需探索其他(打开/关闭)api。
谢谢你们。



