+ 3
Hello every one, i have an issue in the returned value of exectuteUpdate in java, first "UserName" is a primary key in sql tabl
String Query = "insert into user values ( '"+ UserName +"', '"+PassWord +"', '"+ mobile +"' ) ;" ; statm = Cnx.GetConnexion().createStatement(); ArrayList<Integer> list = new ArrayList<>(); int row = statm.executeUpdate(Query); if( row > 0 ) // insertion with succes { pw.println("inserted with succes ! row =" +row); //response.sendRedirect("index.html"); } else
2 Antworten
+ 2
What happens if you put single quotes around your strings in the query? Something like:
"insert into table values('" + name + "') ;"
Note the single and double quotes on either side of the name variable
+ 1
that's what i done, but the problem isn't here.