Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java Databases
|
Java Databases Discussion specific to working with Java Databases. For other Java topics, please see related Java forums. For database discussions not specific to Java, please see the Database category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 2nd, 2004, 10:55 AM
Registered User
 
Join Date: Apr 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Find a particular data using ResultSet

Dear Friends,

I'm using JDBC-Thin Driver to connect with Oracle, so is it possible that I can find a particular record by using ResultSet Object. For Example, I want to serach a record of student bearing registration # 45, so can I move the resultset cursor directly to 45. Please note that I also using the same resultset object as a scrolling one, mean I can move forward and backward too.

Looking forward to your reply..

Thankyou in advance

 
Old April 5th, 2004, 06:34 AM
Authorized User
 
Join Date: Aug 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

use a proper select statement..

like ;

select record from table where registration=45

 
Old August 5th, 2004, 12:54 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 345
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to gokul_blr Send a message via Yahoo to gokul_blr
Default

If you want the single row output use HAVING or WHERE clause to the SQL
"Don't forget to move to hasNext()"
as mentioned above.

otherwise
get the resultset :: rs = executeQuery("Select * Student");

put in loop till u find the reg# = 45
while (rs.next()){
   if (#==45)
.
.
.
}











Similar Threads
Thread Thread Starter Forum Replies Last Post
Find out N/A data zeroffzero Excel VBA 3 August 25th, 2008 08:40 AM
Resultset error madhucm JSP Basics 0 August 4th, 2005 12:08 PM
Question in ResultSet.TYPE_FORWARD_ONLY viks Java Databases 1 March 27th, 2005 05:18 AM
Where will I find the data costorceroy BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 October 26th, 2004 05:23 AM
Find Common Data nbryson SQL Language 4 December 19th, 2003 05:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.