• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A question regarding Connection object

 
Nila dhan
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What will happen to the connection object if an exception occurs while excecuting a prepared statement.For example,


what will happen to the connection object if an exception is thrown while executing the query?
Thanks in advance
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general, the Connection object would remain able to perform further operations. That certainly ought to be the case if the exception was due to bad SQL syntax, missing data etc. If, on the other hand, the exception was due to a lost physical link to the database, the Connection would be broken.
 
Nila dhan
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a number of rows that are inserted iteratively and for each row, a Statement is prepared from connection.After insertion of a certain number of records, I get a stament has been already closed exception.
What could be the reason for this?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic