Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 49168 invoked from network); 14 Feb 2001 14:51:36 -0000 Received: from ns.stardivision.de (HELO stardivision.de) (62.156.160.99) by h31.sny.collab.net with SMTP; 14 Feb 2001 14:51:36 -0000 Received: from fma-11085.stardiv.de (fma-11085.stardiv.de [172.17.11.85]) by stardivision.de (8.9.0/8.9.0) with SMTP id PAA12121 for ; Wed, 14 Feb 2001 15:51:36 +0100 From: Frank Mau Date: Wed, 14 Feb 2001 14:51:39 GMT Message-ID: <20010214.14513962@fma-11085.stardiv.de> Subject: Re: connecting to MS-SQL To: tomcat-user@jakarta.apache.org In-Reply-To: <00bc01c0968b$62931200$24ce72c0@mofet.macam.ac.il> References: <00bc01c0968b$62931200$24ce72c0@mofet.macam.ac.il> X-Mailer: Mozilla/3.0 (compatible; StarOffice/5.2;Win32) X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Hi,=20 I think you should try this code-snippet: ... Connection con =3D null; try { // get data from database con =3D DriverManager.getConnection( ... ); // replace with your=20 DB-connector Statement stmt =3D con.createStatement(); ResultSet rs =3D stmt.executeQuery( "put your SQL-Statement here" ); if ( null !=3D rs ) { while( rs.next() ) { ... (get data with rs.getString() etc.) } rs.close(); } rs =3D null; stmt.close(); stmt =3D null; } catch( Exception e ) { ... // some exception handling here =09 } finally { // don't forget to close the connection !! try { con.close(); con =3D null; } catch( Exception e ) {} } ... Bye Frank >>>>>>>>>>>>>>>>>> Urspr=FCngliche Nachricht <<<<<<<<<<<<<<<<<< Am 14.02.01, 14:38:10, schrieb "David Treves" zum= =20 Thema connecting to MS-SQL: > Hi, > I am trying to connect to a MS-SQL 7 database. I manage to create = all > the necessary object, but when I execute the servlet I get the followi= ng > error: > [Microsoft][ODBC Driver Manager] Invalid cursor state > I use JdbcOdbc driver supplied with SDK 1.3 > Any idea? > David Treves > ---------------------------------------------------------------------= > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, email: tomcat-user-help@jakarta.apache.org