UCAExc ::: 5.0.0-SNAPSHOT用户缺少特权或找不到对象:语句[UPDATE PersonSET address ='null'WHERE name ='null']]中的PERSONSET >> [

问题描述 投票:0回答:1
package jdbcex; import java.sql.*; public class JdbcDmlEx { public static void main(String[] args) { String[] arr; arr = new String[3]; try { Class.forName("net.ucanaccess.jdbc.UcanaccessDriver"); Connection conn = DriverManager.getConnection("jdbc:ucanaccess://C:\\access\\PersonInfo.accdb"); Statement st = conn.createStatement(); //execute the query / DML String addVar = arr[0]; String nameVar = arr[1]; String sql = "UPDATE Person" + "SET address = '" + addVar + " ' " + "WHERE name = '" + nameVar + " ' " ; PreparedStatement pstmt = conn.prepareStatement(sql); int num = pstmt.executeUpdate(); // process the results of the query System.out.println(num + " records updated"); conn.close(); }catch(Exception sqlEx) { System.out.println(sqlEx); } }//end of main }//end of class
无法理解问题所在。有人可以帮忙吗?

UCAExc ::: 5.0.0-SNAPSHOT用户缺少特权或找不到对象:语句[UPDATE PersonSET address ='null'WHERE name ='null']中的PERSONSET

继续收到此错误。

软件包jdbcex;导入java.sql。*;公共类JdbcDmlEx {public static void main(String [] args){String [] arr; arr =新的String [3];尝试{Class.forName(“ net.ucanaccess.jdbc ....

java sqlexception ucanaccess
1个回答
0
投票
更改此行:
© www.soinside.com 2019 - 2024. All rights reserved.