Skip to main content

Is it above correct statement insert date in Access database table

No replies
lse123
Offline
Joined: 2008-10-12
Points: 0

     String sqlCommand2= "INSERT INTO Orders VALUES('1020','0020','"+new java.util.Date()+"','"+new java.util.Date()+"',"+OrderTotals2.getTotal()+","+OrderTotals2.getShipping()+","+OrderTotals2.getTax()+")" ;<br />
//  OrderNumber, CustID,date-ordered,date-shipped,....<br />
sttmnt1.executeUpdate(sqlCommand2);

Is it above correct statement insert date in Access database table OR this is for MySQL... I have Access and 3 tables: Customer,Orders, OrderDetail although only first populated each script execution, well?

Is it this correct order populate tables correct:Customer,Orders, OrderDetail ?

Please Tell me and for below, is it correct code?

   List lineList2 = OrderTotals2.getLineList();</p>
<p>        for (int i = 0; i < lineList2.size(); i++)<br />
        {<br />
          OrderPlantItem lineItem0 = (OrderPlantItem)lineList2.get(i);</p>
<p>          String sqlCommand3= "INSERT INTO OrderDetail VALUES('1021',"+i+1+","+lineItem0.getPlantID()+","+lineItem0.getQty()+","+lineItem0.getSubtotal()+")" ;</p>
<p>          sttmnt2.executeUpdate(sqlCommand3);<br />
        }<br />