1
,im需要使連接成爲excel數據庫。連接成功,但輸入值,它給出了「操作必須使用可更新查詢」異常。Excel DB:對於jdbc程序,操作必須使用可更新的查詢
這裏是代碼:
String url="jdbc:odbc:Sample"; //CHANGE THE DATABASE NAME
Connection conn= DriverManager.getConnection(url,"","");
PreparedStatement prepstat = null;
String insert="INSERT INTO [Sheet1$] ([AccountID], [ProjectID], [PositionID]) VALUES (?,?,?)";
prepstat= conn.prepareStatement(insert);
prepstat.setString(1, accountID);
prepstat.setString(2, projectID);
prepstat.setString(3, positionID);
prepstat.executeUpdate(); // this is where the exception occurs
我們該怎麼做? – amalbose 2011-02-17 10:53:43