freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Lance Andersen <lancea AT sybase.com>
- To: TDS Development Group <freetds AT franklin.oit.unc.edu>
- Subject: Re: FreeTDS JDBC problem
- Date: Fri, 17 Sep 1999 08:19:39 -0400
This will depend on the driver implementation.
jConnect will get rid of the ResultSet pending on rs1 in the example
below.
However the following will get you what you want with jConnect:
Conn con = DriverManger.getConnection();
Statement stmt = con.createStatement();
Statement stmt2 = con.createStatement()
ResultSet rs = stmt.executeQuery("select * from titles");//gets 5 rows
rs.next();
ResultSet rs2= stmts.executeQuery("select * from authors");// get 4
rows
rs2.next();
rs.next(); // this is ok and will get a row
Regards,
Lance
Andreas Tille wrote:
>
> Hello,
>
> at first I have to say that I'm a very beginner in Java programming
> in general and JDBC programming in special. I have the following
> skeleton of a servlet
>
> ...
> ResultSet rs1, rs2;
> Statement stmt = con.createStatement();
>
> rs1 = stmt.executeQuery(query1);
> if ( rs1.next() ) { ... }
> rs2 = stmt.executeQuery(query2);
> if ( rs2.next() ) { ... }
>
> while ( rs1.next() ) { ... }
>
> I found out that the last line breaks the servlet. So my question
> is: Is it a general JDBC problem that I can't use two different
> result sets at the same time or is it a FreeTDS JDBC problem?
>
> Kind regards
>
> Andreas.
>
> ---
> You are currently subscribed to freetds as: lancea AT sybase.com
> To unsubscribe, forward this message to $subst('Email.Unsub')
--
===============================================================================
Lance J. Andersen Email: lancea AT sybase.com
Sybase Product Support Engineering Phone:(781) 564-6336
77 South Bedford Street Fax: (781) 564-6148
Burlington, MA 01803
The Dark Knight Returns!!! Let's Go Penguins!!!
===============================================================================
-
FreeTDS JDBC problem,
Andreas Tille, 09/17/1999
- <Possible follow-up(s)>
- Re: FreeTDS JDBC problem, Lance Andersen, 09/17/1999
- Re: FreeTDS JDBC problem, Craig Spannring, 09/17/1999
- Re: FreeTDS JDBC problem, Andreas Tille, 09/20/1999
- FreeTDS JDBC problem, Craig Spannring, 09/21/1999
Archive powered by MHonArc 2.6.24.