Hi,
I think you should try this code-snippet:
...
Connection con = null;
try {
// get data from database
con = DriverManager.getConnection( ... ); // replace with your
DB-connector
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery( "put your SQL-Statement here" );
if ( null != rs ) {
while( rs.next() ) {
... (get data with rs.getString() etc.)
}
rs.close();
}
rs = null;
stmt.close();
stmt = null;
} catch( Exception e ) {
... // some exception handling here
} finally {
// don't forget to close the connection !!
try { con.close(); con = null; } catch( Exception e ) {}
}
...
Bye
Frank
>>>>>>>>>>>>>>>>>> Ursprüngliche Nachricht <<<<<<<<<<<<<<<<<<
Am 14.02.01, 14:38:10, schrieb "David Treves" <[EMAIL PROTECTED]> zum
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 following
> 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: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]