Note that there are some explanatory texts on larger screens.

plurals
  1. POStringBuilder() appending Transaction id at the last iteration
    text
    copied!<p>I have below code during Xls files upload the below method calls till the last row of Xls sheet &amp; i am appending values to StringBuilder. </p> <pre><code> public boolean insertBatch(Connection con, int projectId, int venueId, String batchName, String examStartDate, String examStartTime, String examEndTime, String reportingStartTime, String reportingEndTime, int totalSeats) { String this.query = new StringBuilder().append("insert into venue_batch ( batch_code ,exam_venue_id ,exam_date ,exam_start_time ,exam_end_time ,reporting_start_time ,reporting_end_time ,total_seats,tranID) VALUES ('").append(batchName).append("' ,").append(venueId).append(" ,'").append(stDate).append("' ,'").append(examStartTime).append("' ,'").append(examEndTime).append("' ,'").append(reportingStartTime).append("' ,'").append(reportingEndTime).append("' ,").append(totalSeats).append(" )").toString(); try { this.stmt = con.createStatement(); count = this.stmt.executeUpdate(this.query); this.stmt.close(); } catch (SQLException ex) { System.out.println(new StringBuilder().append("Venue # insertBatch # SQLException").append(ex.toString()).toString()); onUploadFail(con, "Please try again!"); } } *I need to add Unique Transaction id(VenueTranId) to DB at the last during executeUpdate(this.query), in the above Query how to Proceed below is Transaction id code.Thanks All.. Calendar calendar = Calendar.getInstance(); Long lngTime = Long.valueOf(calendar.getTimeInMillis()); String VenueTranId=lngTime.toString(); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload