からAccessデータベースを更新し、私は、NetBeans経由UCanAccessを使用してAccessテーブルの小さな変化を作りたいが、私はラインで「サポートされていない照合ソート順」エラーのJava
pst.executeUpdate();
データベースの内容に問題が発生しました:
をdatabase name : duruBistro.accdb
table name : person
field names: tc_no (text)
name (text)
surname (text)
salary (number)
コード:
Connection conn = DriverManager.getConnection("jdbc:ucanaccess://C:\\Users\\ysnndr \\Documents\\accessDB\\duruBistro.accdb");
String query = "UPDATE PERSON SET SALARY = ? WHERE TC_NO = '189'";
PreparedStatement pst = conn.prepareStatement(query);
pst.setInt(1, 2500);
pst.executeUpdate();
例外:
run:
java.lang.IllegalArgumentException: Given index [email protected][
name: (PERSON) PrimaryKey
number: 0
isPrimaryKey: true
isForeignKey: false
data: [email protected][
dataNumber: 0
pageNumber: 317
isBackingPrimaryKey: true
isUnique: true
ignoreNulls: false
columns: [
[email protected][
column: [email protected][
name: (PERSON) TC_NO
type: 0xa (TEXT)
number: 17
length: 22
variableLength: true
compressedUnicode: true
textSortOrder: SortOrder[1055(0)]
]
flags: 1
]
]
initialized: false
pageCache: [email protected][
pages: (uninitialized)
]
]
] is not usable for indexed lookups due to unsupported collating sort order SortOrder[1055(0)] for text index
at com.healthmarketscience.jackcess.impl.IndexCursorImpl.createCursor(IndexCursorImpl.java:111)
net.ucanaccess.jdbc.UcanaccessSQLException: Given index [email protected][
name: (PERSON) PrimaryKey
number: 0
isPrimaryKey: true
isForeignKey: false
data: [email protected][
dataNumber: 0
pageNumber: 317
at com.healthmarketscience.jackcess.CursorBuilder.toCursor(CursorBuilder.java:302)
at net.ucanaccess.commands.IndexSelector.getCursor(IndexSelector.java:148)
isBackingPrimaryKey: true
isUnique: true
at net.ucanaccess.commands.CompositeCommand.persist(CompositeCommand.java:83)
ignoreNulls: false
columns: [
[email protected][
column: [email protected][
name: (PERSON) TC_NO
type: 0xa (TEXT)
number: 17
length: 22
variableLength: true
compressedUnicode: true
textSortOrder: SortOrder[1055(0)]
]
flags: 1
]
]
initialized: false
pageCache: [email protected][
pages: (uninitialized)
]
]
] is not usable for indexed lookups due to unsupported collating sort order SortOrder[1055(0)] for text index
at net.ucanaccess.jdbc.UcanaccessConnection.flushIO(UcanaccessConnection.java:312)
at net.ucanaccess.jdbc.UcanaccessConnection.commit(UcanaccessConnection.java:202)
at net.ucanaccess.jdbc.AbstractExecute.executeBase(AbstractExecute.java:143)
at net.ucanaccess.jdbc.ExecuteUpdate.execute(ExecuteUpdate.java:56)
at net.ucanaccess.jdbc.UcanaccessPreparedStatement.executeUpdate(UcanaccessPreparedStatement.java:248)
at com.ui.AccdbcConnection.main(AccdbcConnection.java:29)
BUILD SUCCESSFUL (total time: 1 second)
あなたの例外を正しくフォーマットしますか? – HaveNoDisplayName
同じSQLをAccessで直接動作させることはできますか?あなたのJDBCドライバはプライマリキーで設定したtextSortOrderをサポートしていない可能性がありますが、私はAccessのエキスパートではありません。 – Rup
あなたは 'SALARY'のように' TC_NO'というパラメータを使用していませんか? – MadProgrammer