pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: [INTERFACES] ResultSet....
5+ messages / 3 participants
[nested] [flat]

* Re: [INTERFACES] ResultSet....
@ 1999-07-21 10:57  PostgreSQL <postgres@sys.com.mx>
  parent: Robson Martins <robson@netalfa.com.br>
  1 sibling, 0 replies; 5+ messages in thread

From: PostgreSQL @ 1999-07-21 10:57 UTC (permalink / raw)
  To: Robson Martins <robson@netalfa.com.br>; +Cc: pgsql-interfaces



On Wed, 21 Jul 1999, Robson Martins wrote:

> Hello all, i want to make a select count(*) and set a variable with this value i''m using the command:
>    rs = st.executeQuery("select count(*) from imoveis where imo_situ = 'venda' and imo_tipo = 'kiti'");
>    total = rs;
> But this doesnt work!
> How do i do what i want?
> I use Postgresql 6.5 and everything is working right (database connection), i only want to know how do i do this!
> Help me..
> Hugs...Robson
> 



Hi there




total = rs.getInt("count");


Leonel Nunez




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* ResultSet....
@ 1999-07-21 13:23  Robson Martins <robson@netalfa.com.br>
  0 siblings, 2 replies; 5+ messages in thread

From: Robson Martins @ 1999-07-21 13:23 UTC (permalink / raw)
  To: pgsql-interfaces

Hello all, i want to make a select count(*) and set a variable with this value i''m using the command:
   rs = st.executeQuery("select count(*) from imoveis where imo_situ = 'venda' and imo_tipo = 'kiti'");
   total = rs;
But this doesnt work!
How do i do what i want?
I use Postgresql 6.5 and everything is working right (database connection), i only want to know how do i do this!
Help me..
Hugs...Robson

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [INTERFACES] ResultSet....
@ 1999-07-21 14:08  Constantin Teodorescu <teo@flex.ro>
  parent: Robson Martins <robson@netalfa.com.br>
  1 sibling, 0 replies; 5+ messages in thread

From: Constantin Teodorescu @ 1999-07-21 14:08 UTC (permalink / raw)
  To: Robson Martins <robson@netalfa.com.br>; +Cc: pgsql-interfaces

First of all :

PLEASE, FIND A GOOD JAVA BOOK AND LEARN JAVA AND JDBC!
Also, download JDBC documentation from Sun and read it!
You will find all the information you need and even some examples.
This list is * NOT * intented to be used for Java (JDBC) training.

> Robson Martins wrote:
> 
> Hello all, i want to make a select count(*) and set a variable with
> this value i''m using the command:
>    rs = st.executeQuery("select count(*) from imoveis where imo_situ =
> 'venda' and imo_tipo = 'kiti'");
>    total = rs;
> But this doesnt work!

Try total = rs.getInt(1);

Best regards,
-- 
Constantin Teodorescu
FLEX Consulting Braila, ROMANIA



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [INTERFACES] ResultSet....
@ 1999-07-21 17:26  Robson Martins <robson@netalfa.com.br>
  0 siblings, 0 replies; 5+ messages in thread

From: Robson Martins @ 1999-07-21 17:26 UTC (permalink / raw)
  To: pgsql-interfaces

-----Mensagem original-----
De: Constantin Teodorescu <teo@flex.ro>
Para: Robson Martins <robson@netalfa.com.br>
Cc: PostgreSQL Interfaces <pgsql-interfaces@postgreSQL.org>
Data: Quarta-feira, 21 de Julho de 1999 11:38
Assunto: Re: [INTERFACES] ResultSet....


>First of all :
>
>PLEASE, FIND A GOOD JAVA BOOK AND LEARN JAVA AND JDBC!
>Also, download JDBC documentation from Sun and read it!
>You will find all the information you need and even some examples.
>This list is * NOT * intented to be used for Java (JDBC) training.
>
>> Robson Martins wrote:
>>
>> Hello all, i want to make a select count(*) and set a variable with
>> this value i''m using the command:
>>    rs = st.executeQuery("select count(*) from imoveis where imo_situ =
>> 'venda' and imo_tipo = 'kiti'");
>>    total = rs;
>> But this doesnt work!
>
>Try total = rs.getInt(1);
>
>Best regards,
>--
>Constantin Teodorescu
>FLEX Consulting Braila, ROMANIA
>

Hello all and Constantin
Thanks for your big patience with me :)
I have the documentation, and i got the answer by myself.
ahh..Another thing. You gave me the wrong answer to get the count value i
have to use:
    total = rs.getInt("count");
Cya all...
Hugs...Robson!





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [INTERFACES] ResultSet....
@ 1999-07-21 19:46  Robson Martins <robson@netalfa.com.br>
  0 siblings, 0 replies; 5+ messages in thread

From: Robson Martins @ 1999-07-21 19:46 UTC (permalink / raw)
  To: pgsql-interfaces

-----Mensagem original-----
De: Constantin Teodorescu <teo@flex.ro>
Para: Robson Martins <robson@netalfa.com.br>
Data: Quarta-feira, 21 de Julho de 1999 15:24
Assunto: Re: [INTERFACES] ResultSet....


>Robson Martins wrote:
>>
>> ahh..Another thing. You gave me the wrong answer to get the count value i
>> have to use:
>>     total = rs.getInt("count");
>
>You're wrong !
>Both of them work :-)
>
>See JDBC documentation bellow:
>
>
>public int getInt(int columnIndex)
>           throws SQLException
>
>Gets the value of a column in the current row as a Java int.
>Parameters:
>  columnIndex - the first column is 1, the second is 2, ...
>Returns:
>  the column value; if the value is SQL NULL, the result is 0
>Throws:
>  SQLException - if a database access error occurs
>
>
>               and also
>
>
>public int getInt(String columnName)
>           throws SQLException
>
>Gets the value of a column in the current row as a Java int.
>Parameters:
>  columnName - the SQL name of the column
>Returns:
>  the column value; if the value is SQL NULL, the result is 0
>Throws:
>  SQLException - if a database access error occurs
>
>Best regards,
>Teo
>

Thanks for the help man....
Hugs...Robson!




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~1999-07-21 19:46 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-07-21 13:23 ResultSet.... Robson Martins <robson@netalfa.com.br>
1999-07-21 10:57 ` PostgreSQL <postgres@sys.com.mx>
1999-07-21 14:08 ` Constantin Teodorescu <teo@flex.ro>
1999-07-21 17:26 Re: [INTERFACES] ResultSet.... Robson Martins <robson@netalfa.com.br>
1999-07-21 19:46 Re: [INTERFACES] ResultSet.... Robson Martins <robson@netalfa.com.br>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox