public void checkInResource(String resourceType, String resourceName) throws SQLException { try { CallableStatement cstmt = DBConnection.returnCallableStatememt("{call check_in_pkg.check_in_proc(?, ?,?,?,?)}"); cstmt.setString(1, resourceType); cstmt.setString(2, resourceName.toUpperCase()); cstmt.setString(3, userType); cstmt.setString(4, userName); cstmt.registerOutParameter(5, java.sql.Types.VARCHAR); String outputMessage = DBConnection.returnMessage(cstmt, 5); System.out.println(outputMessage); } catch (SQLException e) { throw e; } }
public void showDues() { try { ResultSet rs; CallableStatement cstmt = DBConnection.returnCallableStatememt("{call show_dues_pkg.show_dues_proc(?, ?, ?, ?)}"); cstmt.setString(1, userType); cstmt.setString(2, userName); cstmt.registerOutParameter(3, OracleTypes.CURSOR); cstmt.registerOutParameter(4, OracleTypes.VARCHAR); ArrayList<Object> arrayList = DBConnection.returnResultSetAndError(cstmt, 3, 4); if (!arrayList.get(1).equals(Constant.kBlankString)) { System.out.println(arrayList.get(1)); Utility.callUserDialogueBox(this.userName, this.userType); return; } rs = (ResultSet) arrayList.get(0); if (!rs.next()) { System.out.println("\nYou don't have any due !!\n"); Utility.callUserDialogueBox(this.userName, this.userType); return; } else { System.out.println( "Resource Type" + "\t" + "Name" + "\t" + "Expected due date" + "\t" + "Total Dues (USD)"); System.out.println( "---------------------------------------------------------------------------------------------------------------------------------------------------------"); do { String resourceType = rs.getString("type"); String name = rs.getString("name"); String expectedDueDate = rs.getString("due_start_date"); String totalDues = rs.getString("due_in_dollars"); System.out.println( resourceType + "\t" + name + "\t\t" + expectedDueDate + "\t" + totalDues); } while (rs.next()); } } catch (SQLException e) { PrintSQLException.printSQLException(e); Utility.badErrorMessage(); } Utility.callUserDialogueBox(userName, userType); }