什么是Java的最佳开源dbf驱动程序?[已关闭]
任何人都可以提到最好的开源odbc:jdbc驱动程序来读/写dbff吗?我有一个dbf文件,我想通过Web应用程序(Tomcat应用程序)查询(选择/更新)。
任何帮助/提示将不胜感激。
谢谢。
任何人都可以提到最好的开源odbc:jdbc驱动程序来读/写dbff吗?我有一个dbf文件,我想通过Web应用程序(Tomcat应用程序)查询(选择/更新)。
任何帮助/提示将不胜感激。
谢谢。
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();
}
它的工作原理。我想没有必要探索其他(开放/封闭)api,因为Java提供了一种极好的读/写dbf方式。
谢谢大家。
您可以尝试使用 https://github.com/iryndin/jdbf - 一个简单的Java库来读/写DBF文件。我是这个库的作者,它在我的生产应用程序中运行得很好。这很简单。
请试一试。