AnsweredAssumed Answered

Data push using JDBC - Batch insertion

Question asked by rama.commuri on Jan 9, 2015
Latest reply on Jan 18, 2015 by rama.commuri

Hi,

We are trying to push data to PI Archive using JDBC and we notice the following issue. We are taking data from a .csv file and trying to push "Time Stamps and Data" for around 250 tags (batch insertion). When we attempt the insertion, we get an indication that all records were inserted. However, we notice that only a few records are getting updated in the archive (for all tags). However, when we attempt the insertion again, we notice that all tags are getting updated for all time stamps.

 

We are using the following statement for insertion. Please let us know if we need to follow a different method for batch insertion.

Thanks,

 

con.prepareStatement("INSERT INTO PICOMP2 (TAG, TIME, VALUE) VALUES (?, ?, ?)");

for(row=0;row<data.length;row++)

                    {

                       

                        ps.setString(1, heads[i]);

                        ps.setString(2, data[row][0]);

                        ps.setDouble(3, new Double(data[row][i]));

                     

                        ps.addBatch();

                       

                    }

int rval[]=ps.executeBatch(); // showing correct results here but data is not getting reflected in the archive

Outcomes