1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| while(rstemp.next()){
int hh = Integer.parseInt(rstemp.getTime(3).toString().substring(0,2));
int mm = Integer.parseInt(rstemp.getTime(3).toString().substring(3,5));
int ss = Integer.parseInt(rstemp.getTime(3).toString().substring(6,8));
double h = rstemp.getDouble(5);
int dhh = (int)h;
double dmmtemp = (rstemp.getDouble(5)-dhh)*600;
int dmm = (int)(dmmtemp/10);
caltemp.set(a,m,Integer.parseInt(planning[x][1]),hh,mm,ss);
String timedeb = a+"-"+(m+1)+"-"+planning[x][1]+" "+hh+":"+mm+":"+ss;
timedeb=formatTStamp(timedeb);
caltemp.add(Calendar.HOUR, dhh);
caltemp.add(Calendar.MINUTE,dmm);
String timefin = caltemp.get(Calendar.YEAR)+"-"+(caltemp.get(Calendar.MONTH)+1)+"-"+caltemp.get(Calendar.DAY_OF_MONTH)+" ";
timefin += ""+caltemp.get(Calendar.HOUR_OF_DAY)+":"+caltemp.get(Calendar.MINUTE)+":"+caltemp.get(Calendar.SECOND);
timefin=formatTStamp(timefin);
String reqtmp = requp + " "+rstemp.getInt(1)+"," + rstemp.getInt(2)+"," + "'"+rstemp.getTime(3)+"'," + "'"+rstemp.getTime(4)+"'," + rstemp.getDouble(5)+","+ rstemp.getDouble(6)+","+ rstemp.getDouble(7)+",1,'"+timedeb+"','"+timefin+"',"+ rstemp.getInt(8)+")";
try {
int res = connection.updateSql(reqtmp);
if(res<0)
JOptionPane.showMessageDialog(this,this.connection.getErreurSql(),"erreur classe connection",JOptionPane.INFORMATION_MESSAGE);
} catch (HeadlessException e) {
JOptionPane.showMessageDialog(null,e.toString(),"erreur",JOptionPane.INFORMATION_MESSAGE); }
} |
Partager