「Java入門」PreparedStatementでDBを操作する

Javaコード:
String sql = “select * from user where name = ? and age < ?”;
PreparedStatement pstmt = connection.prepareStatement(sql);
pstmt.setString(1,"yamada");//パラメータ1の設定
pstmt.setInt(2,"30″): //パラメータ2の設定
ResultSet rs = pstmt.executeQuery();//結果を取得

Java

Posted by arkgame