I have a class set up which simply inserts into a database. When I call this class repeatedly in a loop it works ok but when I call it once it doesn't perform the insert. Calling a short loop and placing the loop index in the database, I can see that it seems not to be performing the LAST insert. For example if I write <br><br>for (int i=0;i<4;i++)<br> {call insert class}<br><br>I see in the database column containing the i value:<br><br>0<br>1<br>2<br><br>But NOT 3.<br><br>This means that a single call, which is also the <i>last</i> call, does nothing. Here is the class:<br><br><font color=red><br>import java.util.*;<br>import java.sql.*;<br><br>public class searchJDBC <br> {<br> Connection connobj = null;<br> Statement stmtobj = null;<br> <br> public void setConnection(String DBstr)<br> {<br> try {<br> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"<br> connobj = DriverManager.getConnection("jdbcdbc:"+DBstr);<br> stmtobj = connobj.createStatement();<br> }<br> catch(ClassNotFoundException e) {e.getMessage();} <br> catch(SQLException e) {System.out.println(e.getMessage());} <br> <br> }<br> <br> public void insertSQLstr(String SQLstr)<br> {<br> try {<br> stmtobj.executeUpdate(SQLstr);<br> }<br> catch(SQLException e) {System.out.println(e.getMessage());}<br> } <br> <br> }</font><br><br> There's hardly anything to this and it does work but only under repeated calls. It must be something really simple. Any help appreciated. <p>--Will Duty<br><a href=mailto:wduty@radicalfringe.com>wduty@radicalfringe.com</a><br><a href= > </a><br>