我有一個dbf文件,我可以在視圖中看到intersting字段的類型是L(我認爲它是邏輯類型)和M(我想這是一個備註型)dbf CREATE TABLE throws java.sql.SQLException:語法錯誤:停止解析
我嘗試使用dbf_jdbc重新DBF模板,如表:
private static final String TABLE = "create table SAMPLE ("
+ " SM Logical, "
+ " PRIM MEMO " + ")";
...
String url = "jdbc:DBF:/C:\\TEST";
Connection dbfConn = null;
PreparedStatement ps = null;
...
// instantiate it
Class.forName("com.hxtt.sql.dbf.DBFDriver").newInstance();
dbfConn = DriverManager.getConnection(url, properties);
Statement stmt = dbfConn.createStatement();
stmt.executeUpdate(TABLE);
但我發現了以下錯誤:
java.sql.SQLException: Syntax error: Stopped parse at MEMO
java.sql.SQLException: Syntax error: Stopped parse at LOGICAL
原因 - 類型名字,因爲當我使用varchar,everythins是好的。
Dbf_jdbc版本(從JAR清單文件):
Manifest-Version: 1.0
Created-By: HXTT Version Robot
Main-Class: com.hxtt.sql.admin.Admin
Name: com/hxtt/sql/dbf/
Specification-Title: HXTT DBF JDBC 3.0 Package
Implementation-Title: com.hxtt.sql.dbf
Specification-Version: 4.2.056 on April 01, 2009
Specification-Vendor: Hongxin Technology & Trade Ltd.
Comment: JDBC 3.0 Package for Xbase database
Implementation-Version: 4.2.056 on April 01, 2009
Implementation-Vendor: Hongxin Technology & Trade Ltd.
Implementation-URL: http://www.hxtt.com/dbf.html
Name: com/hxtt/sql/admin/
Specification-Title: HXTT Database Admin
Implementation-Title: com.hxtt.sql.admin
Specification-Vendor: Hongxin Technology & Trade Ltd.
Specification-Version: 0.5 on April 01, 2009
Comment: HXTT Database Admin
Implementation-Version: 0.5 on April 01, 2009
Implementation-Vendor: Hongxin Technology & Trade Ltd.
Implementation-URL: http://www.hxtt.com/dbf/dbadmin.html
所以我的問題是SQL類型,我應該使用哪一個,所以我可以使用代碼創建DBF模板,當我使用DBF的瀏覽器打開一個文件,我可以請參見字母M和L作爲類型短名稱。
舊版本的dbf沒有備忘錄字段您確定您的版本匹配 – 2012-01-16 11:41:15
我添加了版本信息我在哪裏可以找到關於版本和支持類型的信息? – Alexandr 2012-01-16 12:09:30