JDBC ResultSet Question
Posted on 2003-02-21
I have a program that executes the following in a thread.
Result result = stmt.execute();
while( result.next() )
Send out email based on the data I have.
If OK then go to deleteRecord( conn )
deleteRecord( Connection conn )
PreparedStatement stmt = conn.createPreparedStatement(..);
Is it ok to delete that record while the result set from the function above still has it?
Also. I'm using SQL Server and when I execute the PreparedStatement it adds another connection to the user ( USing the sp_who2, etc to see how many connections the user has ).
But when I call the close it doesnt release that connection. These functions are being executed in a separate thread so I wonder if using Statement would solve the problem.
I'm using SQL Server 2000, JTDS driver.
Thanks in advance