You can not just print the result set, you need to retreive the value using
one if its get()-methods. In this case, it looks like you need to call
getInt().
Try to print rs.getInt(1) and see what you get (rs being a result set).
[ Matthias Carlsson ]
[ Programmer (Java, XML/XSL, CGI/Perl, HTML/JS) ] [ Web Designer ]
[ E-Mail : [EMAIL PROTECTED] ] [ ICQ: 1430647 ]
-----Ursprungligt meddelande-----
Från: A mailing list for discussion about Sun Microsystem's Java Servlet API
Technology. [mailto:[EMAIL PROTECTED]]För Neeta Patil
Skickat: den 28 mars 2001 15:43
Till: [EMAIL PROTECTED]
Ämne:
Hi all,
I am trying to execute a query ( in sybase) The Query is as follows
String Query2="select datediff(dd,recdt,aretdt) from Book_Trans where
acc_no="+accno;
I am trying to get the difference between two columns which contain dates.
According to sybase it returns an integer value i.e. the two dates are
substracted and the result is an integer.
Now if i print the ResultSet it gives me following results.
com.sybase.jdbc2.jdbc.SybResultSet@63a656c6
Can anybody help me? I want to know how to interpret this result. All I want
is the difference between two dates and print it. How is the result stored?
Please help
Thanks,
-Neeta
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST". Archives:
http://archives.java.sun.com/archives/servlet-interest.html Resources:
http://java.sun.com/products/servlet/external-resources.html LISTSERV Help:
http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html