Can anyone rewrite the red part into pure SQL format.( stored procedures)
//System.out.printin(address arrt1]) PreparedStatement insert Address connection.prepareStatement(.. + "INSERT INTO , address? +"VALUES (NULL, ?,?,?,?,? insertAddress.setString(1, address arr]); insertAddress.setString(2, address arr1]); insertAddress.setString(3, address arr[2]); insertAddress.setstring(4, address arr[3]); insertAddress.setInt(5, Integer.parseInt (address arr[4])) insertAddress.execute) PreparedStatement insertPatient connection.prepareStatement(" +"INSERT INTO patient' "VALUES (NULL,,?,?,LAST INSERT ID) insertPatient.setstring(1, p.getFirstName)); insertPatient.setString(2, p.getLastName)); insertPatient.setString(3, p.getPhoneNumber)) insertPatient.executeO; PreparedStatement insertPaymentMethod connection "prepareStatement(.. //+ SELECT id INTO @id from 'payment-method. WHERE ,description. = ? LMIT 1;. +"INSERT INTO payment method VALUES" +(NULL,) insertPaymentMethod.setstring(1, p.getPaymentMethod)); insertPaymentMethod.execute); SimpleDateFormat dateFormat- new SimpleDateFormat( "MMddyyyy java.util.Date date dateFormat.parse(p.getDateOfFilled)) Date sq1Date new Date(date.getTime)) PreparedStatement insertPrescription = connection.prepareStatement(.. +INSERT INTO prescription + "VALUES (NULL, (SELECT MAX(id) FROM 'patient'), ? ?, LAST-?NSERT-?D()); . insertPrescription.setInt(1, p.getPrescriberId)); insertPrescription.setDate(2, sqlDate); insertPrescription.execute) PreparedStatement insertConpanyName connection. prepa restatement("" +"INSERT INTO drug company +"VALUES (NULL, ?, ) insertCompanyName.setString(1, p.getDrugCompanyO) insertCompanyName.execute) PreparedStatement insertDrug connection.prepareStatement( +"INSERT INTO drug + "VALUES (NULL, ?,?,?,?,?, LAST-INSERT-ID());"); insertDrug.setString(1, p.getDrugNameO); insertDrug.setDouble(2, p.getDrugCostO); insertDrug.setDouble(3, p.getAmount)); insertDrug.setInt (4, p.getUnitO); insertDrug.setInt (5, p.getDose)); insertDrug.execute); PreparedStatement insertPrescriptionItems connection.prepareStatement( +"INSERT INTO prescription itens + "VALUES ( (SELECT MAX(id) FROM 'prescription.), LAST-INSERT-ID()); "); insertPrescriptionItems.executeO