This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes SQL exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "SQL exception" Watch "SQL exception" New topic

SQL exception

Vladimir Kositsky
Ranch Hand

Joined: Nov 03, 2000
Posts: 116
i am trying to update MS Access database from JTable while editing in cell, so setValueAt() overriden as shows below.
First update it works , but on second following exception appears:

[Microsoft][ODBC Microsoft Access Driver]Prepared statement not a cursor-specification
public void setValueAt(Object value, int row, int column) {
String query = null;
try {
String tableName = metaData.getTableName(column+1);
if (tableName == null) {
System.out.println("Table name returned null.");
String columnName = getColumnName(column);
query =
"update "+ "EMPLOYEES_7"+
" set "+columnName+" = "+dbRepresentation(column, value)+
" where inx = " + row;
querry = null;
catch (SQLException e) {
System.err.println("Update failed");
Vector dataRow = (Vector)rows.elementAt(row);
dataRow.setElementAt(value, column);
Please help
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

check out this discussion where it says that MS Access
doesn't support prepared stmts.
- satya

Take a Minute, Donate an Hour, Change a Life
Anurag Mishra
Ranch Hand

Joined: Sep 27, 2001
Posts: 133
Just Use to remove an exception.
I agree. Here's the link:
subject: SQL exception
It's not a secret anymore!