mysql_fetch_row() in Java.
Dear my friends.... I did make a connection to MySQL with Java through JDBC. Also executing the query (select * from customer). But I don't know how to use the result of the query. in PHP I use : " $row=mysql_fetch_row($result); list($customerid, $fullname)=$row; " Please give me the example to extract the result into the variables those I can use in my furthere code. Here is the result: " patrixlinux@patrix:~/arsip/My/comadmin> java customer Here is customer menu Connection established com.mysql.jdbc.ResultSet@1aaa14a " Thank you very much in advance. __________________________________ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/
On Monday 08 December 2003 15:01, Prabu Subroto wrote:
I did make a connection to MySQL with Java through JDBC. Also executing the query (select * from customer). But I don't know how to use the result of the query. in PHP I use :
*snip* Look here for a short tutorial: http://java.sun.com/developer/onlineTraining/Database/JDBC20Intro/JDBC20.htm... You'll have to be using ResultSet.next() or get the Iterator from it. Regards, -- tinus.
On Mon, Dec 08, 2003 at 06:01:40AM -0800, Prabu Subroto wrote:
Dear my friends....
I did make a connection to MySQL with Java through JDBC. Also executing the query (select * from customer). But I don't know how to use the result of the query. in PHP I use : " $row=mysql_fetch_row($result); list($customerid, $fullname)=$row; "
You need to call the next() method on the result set. Then you can use the appropriate get() methods to get the data. When you are ready for the next row, call next() again. Victor
participants (3)
-
Martijn Houtman
-
Prabu Subroto
-
Victor R. Cardona