什么是Java的最佳开源dbf驱动程序? [英] What is the best opensource dbf driver for java?
本文介绍了什么是Java的最佳开源dbf驱动程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以提及读写dbf的最佳可用开源odbc:jdbc驱动程序吗? 我有一个dbf文件,我想通过Web应用程序(Tomcat应用程序)查询(选择/更新).
Can anybody please mention the best available opensource odbc:jdbc driver to read / write dbf.? I have a dbf file which I would like to query (select/update) via a web application (Tomcat app).
任何帮助/提示都将是有益的.
Any help/tips would be appreciative.
谢谢.
推荐答案
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.
It works. And I guess there will be no need to explore for other (open/closed) apis as Java has provided an excellent way to read/write dbf.
谢谢大家.
这篇关于什么是Java的最佳开源dbf驱动程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文