Experimente executar um rs.next() antes do rs.getString()...

Vanei Anderson Heidemann
Senior Programmer
Sun Certified JAVA Developer
DATASUL S.A.

"Ou n�s encontramos um caminho, ou abrimos um" - An�bal

Cadastre seu Curriculum na Internet:
http://www.curriculum.com.br/indicadopor.asp?indicadopor=P2044-402

For my always up-to-date contact information, click here:
http://www.planetall.com/main.asp?cid=1073200
It's private, secure, and free!

> -----Original Message-----
> From: Fabio Retzlaff [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 13, 1999 10:21 AM
> To: [EMAIL PROTECTED]
> Subject: ResultSet
> 
> 
> Este c�digo est� dando o seguinte erro: [Microsoft][ODBC 
> Driver Manager]
> Invalid cursor state
> 
> try {
>       Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>       String url = "jdbc:odbc:Catalog";
>       Connection con = DriverManager.getConnection(url, "", "");      
>       Statement stmt = con.createStatement();
>       ResultSet rs = stmt.executeQuery("SELECT * FROM CUSTOMER WHERE
> LOGNAME = '" + user + "';");
>                                       
>       String log = null;
>       log = rs.getString("LOGNAME"); // LINHA ONDE ACONTECE O ERRO
>       out.println("<H1> Welcome " + log + "!!</H1>");
> }
> catch (SQLException e) {
>       out.println("SQLException: " + e.getMessage());
> }
> catch (Exception e) {
>       out.println("Exception: " + e.getMessage());
> }
> 
> ALGU�M SABE O QUE PODE ESTAR ACONTECENDO???
> 
> VALEU!!!!
> * Para nao receber mais e-mails da lista, acesse 
> <http://www.sun.com.br:8080/guest/RemoteAvailab> leLists>, 
> coloque seu e-mail, escolha a lista 
> <[EMAIL PROTECTED]> e de um <submit>.
> 
* Para nao receber mais e-mails da lista, acesse 
<http://www.sun.com.br:8080/guest/RemoteAvailableLists>, coloque seu e-mail, escolha a 
lista <[EMAIL PROTECTED]> e de um <submit>.

Responder a