Answers for "passing parameters in sql query java"

0

java sql query with parameters

statement =con.prepareStatement("SELECT * from employee WHERE  userID = :userId");
   statement.setString(userId, userID);
   ResultSet rs = statement.executeQuery();
// Or, you can use ? in place of named value - :userId..

   statement =con.prepareStatement("SELECT * from employee WHERE  userID = ?");
   statement.setString(1, userID);
Posted by: Guest on October-06-2021
0

java sql query with parameters

statement =con.prepareStatement("SELECT * from employee WHERE  userID = :userId");
   statement.setString(userId, userID);
   ResultSet rs = statement.executeQuery();
// Or, you can use ? in place of named value - :userId..

   statement =con.prepareStatement("SELECT * from employee WHERE  userID = ?");
   statement.setString(1, userID);
Posted by: Guest on October-06-2021

Code answers related to "passing parameters in sql query java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language