Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. /**
  2.      * Adds the given CPT codes to the given office visit
  3.      *
  4.      * @param cptCode
  5.      * @param visitID
  6.      * @return
  7.      * @throws DBException
  8.      */
  9.     public long addProcedureToOfficeVisit (String cptCode, long visitID, String hcpid) throws DBException {
  10.         Connection conn = null;
  11.         PreparedStatement ps = null;
  12.         try {
  13.             conn = factory.getConnection();
  14.             ps = conn.prepareStatement("INSERT INTO OVProcedure (CPTCode,VisitID,HCPID) VALUES (?,?,?)");
  15.             ps.setString(1, cptCode);
  16.             ps.setLong(2, visitID);
  17.             ps.setString(3, hcpid);
  18.             ps.executeUpdate();
  19.             return DBUtil.getLastInsert(conn);
  20.         } catch (SQLException e) {
  21.             e.printStackTrace();
  22.             throw new DBException(e);
  23.         } finally {
  24.             DBUtil.closeConnection(conn, ps);
  25.         }
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement