wood burning stoves*
The moose likes JDBC and the fly likes CachedRowSet execute query problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "CachedRowSet execute query problem" Watch "CachedRowSet execute query problem" New topic
Author

CachedRowSet execute query problem

Kim Kantola
Ranch Hand

Joined: May 17, 2001
Posts: 274
Hi there,
I am having a strange problem with a class that extends the CachedRowSet class. After performing an execute(Connection
connection) the connection is closed. I need to use this connection again later in the code.
After trying to use the con again, I get this exception:
java.sql.SQLException: [TDS Driver]Connection is closed
This connection only gets closed
when I run this code on my machine, but not when I run it on another machine at my office so I think it is probably some kind of
configuration problem.
Anyone ever experience this type of problem?
Thanks for any info.
The code:
public MarkInfo() throws SQLException
{
setCommand(QUERY);
}

public boolean load(Connection con, String id) throws SQLException
{
// Fetch connection and prepare statement for execution
setString(1, id);
// Execute query
execute(con);
After this execute line, the connection is closed.
Nagaraju Ramanna
Greenhorn

Joined: Sep 07, 2003
Posts: 4
Hi,
Could you please let me know how we can use CachedRowSet? I have an urgent requirement to implement this.
Thanks in advance.
regards
Nagaraju
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30136
    
150

Nagaraju,
Sun has a tutorial that covers this topic.
ps -The original post was 3 years ago.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: CachedRowSet execute query problem
 
Similar Threads
What is the problem with this code!!!
Problem with wait(), notify() and IllegalMonitorStateException
Could not locate DB driver
CachedRowSet execute query problem
Pool connection leak error