Prepared Statements

Code Fragment 1:

Statement stmt = con.createStatement();
String updateString = “UPDATE COFFEES SET SALES = 75 ” +
“WHERE COF_NAME LIKE ‘Colombian’”;
stmt.executeUpdate(updateString);

Code Fragment 2:

PreparedStatement updateSales = con.prepareStatement(
“UPDATE COFFEES SET SALES = ? WHERE COF_NAME LIKE ? “);
updateSales.setInt(1, 75);
updateSales.setString(2, “Colombian”);
updateSales.executeUpdate():

Leave a comment

Hey!

I’m Bedrock. Discover the ultimate Minetest resource – your go-to guide for expert tutorials, stunning mods, and exclusive stories. Elevate your game with insider knowledge and tips from seasoned Minetest enthusiasts.

Join the club

Stay updated with our latest tips and other news by joining our newsletter.

Design a site like this with WordPress.com
Get started