String s1 = PasswordText4.getText();
String s2 = ConfirmText4.getText();
String s3 = NameText4.getText();
String s4 = UsernameText4.getText();
St
Berger is right, you need to add spaces between your query parts, for example:
String sql = " BEGIN "
+ " UPDATE LOGIN SET USERNAME = ?, PASSWORD = ?, NAME = ? "
+ " WHERE USERNAME = ?; "
+ " commit; "
+ " END;" ;
You can do something likewise,
String sql = "UPDATE LOGIN SET USERNAME = ?, PASSWORD = ?, NAME = ? WHERE USERNAME = ?"
PreparedStatement preparedStatement = dbConnection.prepareStatement(sql);
preparedStatement .setString(1, UsernameText4.getText());
preparedStatement .setString(2, PasswordText4.getText());
preparedStatement .setString(3, NameText4.getText());
preparedStatement .setString(4, jLabel16.getText());
preparedStatement .executeUpdate();
....
dbConnection.commit();
Friends,
I too encountered the same issue when I execute a sequence of SQL queries (few queries are commented thru my Java program
Solution: Remove all commented SQL lines and then execute, you will not get "UNINITIALIED" error any more.
java.sql.sqlexception: Invalid SQL type: sqlKind = UNINITIALIZED
This error occurs when there is syntax error. check your syntax, Print the query and run the same query on your SQL client tool like SQL Developer, Toad, DBeaver..,
Example: consider below is the o/p of Sysout
[select * from dual] & ["select * from dual"] //sqlKind = UNINITIALIZED
select * from dual // This is good
Note all three queries run, but first two needs to be replace and []"" has to be removed before sending it for execution.