What can I do if the number of the command handles in my application over the limitation?

~ 0 min
2016-03-07 04:43

User should modify their application to prepare once and execute n times.

For example:

ps2 = this.conn.prepareStatement("insert into TESTDB values(?, ?, ?);"); 

         for(int i=0; i<list.size();i++)

{

                            tData = (TestData)list.get(i);

                            ps2.setString(1,tData.shp_cd);

                            ps2.setString(2,tData.shp_nm);

                            ps2.setString(3,tData.tel_no);

                                 ps2.executeUpdate();

                            this.conn.commit();

}

To improve performance, we suggest writing application as the above example i.e. PREPARES SQL statement just once and then EXECUTE it as many times as they need during the run of the program.

Average rating 0 (0 Votes)

You cannot comment on this entry

Tags