Hi
I submitted a question yesterday regarding your driver and Apple WebObjects. I believe the problem to be with your driver. I have attached some sample code. Basically any fetch from the database which refers to a column named CHECK will fail with this error:
The following error occured in reading from the table: java.sql.SQLException: Failed to parse: Stopped parse at CHECK
CHECK is the most important column for my application. It's the check number on a restaurant ticket and used extensively by the Aloha POS. Here is my code:
import java.sql.*;
class Examplebase {
public static void main(String[] args) {
try {
Class.forName("com.hxtt.sql.dbf.DBFDriver");
Connection connection = DriverManager.getConnection("jdbc:dbf:////Network/Servers/xserve/Volumes/Primary/Users/bradydonald/Desktop/20051105");
Statement statement = connection.createStatement();
// This statement will fail if the t0.CHECK column is there. Remove that column and it will work fine. Why?
ResultSet resultSet = statement.executeQuery("SELECT t0.AMOUNT, t0.CHECK, t0.CLOSEHOUR, t0.CLOSEMIN, t0.COUNT, t0.DOB, t0.EMPLOYEE, t0.OCCASION, t0.OPENHOUR, t0.OPENMIN, t0.ORDERHOUR, t0.ORDERMIN, t0.PERIOD, t0.REVENUE, t0.REVID2, t0.SHIFT, t0.TIPEMP, t0.TYPE, t0.TYPEID, t0.TYPEID2, t0.UNIT, t0._rowid_ FROM GNDSALE t0");
// This statement will also work:
//ResultSet resultSet = statement.executeQuery("SELECT t0.* FROM GNDSALE t0");
while (resultSet.next())
{
System.out.println(resultSet.getString(1) + " " + resultSet.getString(2));
}
resultSet.close();
statement.close();
connection.close();
} catch(java.lang.ClassNotFoundException cnfException) {
System.out.println("The following error occured in finding the HXTT driver: " + cnfException);
} catch(SQLException sqlException) {
System.out.println("The following error occured in reading from the table: " + sqlException);
}
}
}
Just email me if you want the DBF I am using.
|
Please download the latest package since we have supported CHECK (a SQL reserved word) as column name.
|