Hello,
The following sample program fails with a nullpointer.
The latest DBF_JDBC30.jar is used.
Rob
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class DBFTest4
{
public static void main(String[] args) throws Exception
{
String user = "";
String password = "";
String url = "jdbc:dbf:////tmp/dbftest?lockType=VFP";
String driver = "com.hxtt.sql.dbf.DBFDriver";
Class.forName(driver);
try
{
Connection connection = DriverManager.getConnection(url, user, password);
Statement statement = connection.createStatement();
statement.execute("drop table tst");
statement.close();
connection.close();
}
catch (SQLException e)
{
// table does not exists
}
Connection connection = DriverManager.getConnection(url, user, password);
Statement statement = connection.createStatement();
statement.execute("create table tst (x integer not null, primary key (x))");
statement.close();
PreparedStatement prepareStatement = connection.prepareStatement("select x from tst order by x asc");
ResultSet rs = prepareStatement.executeQuery();
rs.close();
prepareStatement.close();
connection.close();
System.out.println("OK");
}
}
|
That unexpected issue was resulted by compacted IDX format with Xbase lock. Fixed. Please download the latest package.
|