尝试插入SQL表时出现“权限不足”错误

时间:2016-08-13 06:25:52

标签: oracle jdbc

  

我正在尝试将数据插入表中,但它说“不足的特权”确切地说它给了我“线程中的异常”主“java.sql.SQLSyntaxErrorException:ORA-01031:不足的特权”错误,我无法弄明白。我在插入更新之前创建了一个表。这是我的代码

package advanced;
import java.sql.*;
public class Insertion 
{
public static void main(String[] args) throws Exception
{
    Class.forName("oracle.jdbc.driver.OracleDriver");
    System.out.println("Driver successfully loaded");
    Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","SYSTEM","2605");
    System.out.println("Successfully connected");
    Statement stmt = con.createStatement();
    System.out.println("Statement successfully created");
    int res;
    res = stmt.executeUpdate("insert into SYS.employee values(201,'Hamed','Bangalore','Engineer',57485)");

    res = stmt.executeUpdate("insert into SYS.employee values(301,'SURESH','Madras','Doctor',7475)");

    res = stmt.executeUpdate("insert into SYS.employee values(401,'RAHUL','Bombay','Engineer',45645)");
        System.out.println("Records inserted");

        stmt.close();
        con.close();    

}

}

0 个答案:

没有答案