Connection conn = null;
ResultSet rs = null;
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:mysql://localhost/sampledb","root","");
Statement stmt = conn.createStatement();
String sql = "select * from userinfo where status = 2";
rs = stmt.executeQuery(sql);
stmt.close();
String view = rs.getString("userid");
// String view = "https://www.google.com";
response.sendRedirect(view);
} catch(Exception e) {
e.printStackTrace();
}
finally {
}
なんか上手くいきませんね。executeQuery以降が駄目っぽいです。