
The following is a snippet of code from a Java application which uses Connector/J to query a MySQL database. Identify possible problems and possible solutions.
Connection cn= DriverManager.getConnection("jdbc:mysql://repserver.intranet:4987/active?user=rbradstreet"); Statement s= null; ResultSet rs= null; s= cn.createStatement(java.sql.ResultSet.TYPEFORWARDONLY, java.sql.ResultSet.CONCURREADONLY); s.setFetchSize(Integer.MIN_VALUE); s.execute("SELECT res_id FROM reservations WHERE filled= 0"); rs= s.getResultSet(); while (rs.next()) { Reservation v= UnfilledReservation(rs.getInteger(1)); LockReservation(v); FillReservation(rs.getInteger(1)); UnlockReservation(v); } rs.close();
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.