skip to Main Content

Random mysql crash when closing a statement

I have the following code: Statement statement =createStatement(); try (java.sql.ResultSet resultset = statement.executeQuery()) { while (resultset.next()) { myObject.setProcessingDate(resultset.getDate(1)); myObject.set... } }finally { if (statement != null) { statement.close(); } } I know that statement object should be created in the…

VIEW QUESTION

Else statement's code is also printing even though if statement is true – Mysql

This is the code: <% try { String enteredOtp = request.getParameter("otps"); String actualOtp = (String) session.getAttribute("OTP"); if (enteredOtp.equals(actualOtp)) { String eemail = (String)session.getAttribute("eemail"); Connection con; Class.forName("com.mysql.jdbc.Driver"); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql","root","12345"); Statement stm = con.createStatement(); String m = "select * from empinfo…

VIEW QUESTION
Back To Top
Search