pin*_*nkb 16 java dbf jdbc-odbc
任何人都可以提一下最好的开源odbc:jdbc驱动程序来读/写dbf.我有一个dbf文件,我想通过Web应用程序(Tomcat应用程序)查询(选择/更新).
任何帮助/提示都会很有意义.
谢谢.
pin*_*nkb 15
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();
}
Run Code Online (Sandbox Code Playgroud)
有用.而且我猜没有必要探索其他(开放/封闭)apis,因为Java提供了一种读/写dbf的绝佳方法.
谢谢你们.
| 归档时间: |
|
| 查看次数: |
27573 次 |
| 最近记录: |