Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error java.sql.SQLException: ORA-00911: invalid character [duplicate]

Tags:

sql

oracle

jdbc

I have error for code:

String sql = "CREATE USER ken IDENTIFIED BY 11;";  try {     Class.forName("oracle.jdbc.OracleDriver");     con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "system", "kenilyas");     System.out.println("1111111111111");     System.out.println("222222");     pst = con.prepareStatement(sql);     System.out.println("333333");     try {         System.out.println("333333");         pst.execute();         System.out.println("creating");     } catch (Exception e) {         JOptionPane.showMessageDialog(null, e);     } } catch (Exception e) {     JOptionPane.showMessageDialog(null, e); } 
like image 958
user3425433 Avatar asked Mar 16 '14 10:03

user3425433


1 Answers

The problem is ;

sql = "CREATE USER ken IDENTIFIED BY 11;"; 

Remove the ; from above string.

like image 113
Abhishek Avatar answered Sep 23 '22 06:09

Abhishek