LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-19-2013, 01:35 AM   #1
snehal89
LQ Newbie
 
Registered: Nov 2012
Posts: 27

Rep: Reputation: Disabled
How to pass Resultset rs object as parameter to Thread


Hello Everyone,

I am new to Java thread.I am not getting how to pass Resultset object which contain all records in it.

So that each thread should take each record and do the other processing.

The program is:

public class dataimport
{

public dataimport()
{
connect();//this function will connect to database and execute query
}
private void connect()
{
/* Connect database
str="SELECT * FROM tablename";
rs1=statement.executeQuery(str);

while (rs1.next())
{
/* here each record will pass to each thread */
}

}

Please can any one help me one this .

thank you in advance
 
Old 04-20-2013, 09:57 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
you can find a lot of tutorials about threads on the net, here is a link about parameter passing:
http://stackoverflow.com/questions/8...-a-java-thread
 
  


Reply

Tags
java, thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can i pass an entire Array into a function parameter by value? (no pointer pass) esgol Programming 26 07-31-2012 11:34 AM
How to pass a Kernel Parameter? brian.wright Linux - Newbie 3 02-24-2009 04:03 PM
how to change and pass thread parameter back to main dragondad Programming 3 09-19-2005 01:58 PM
how do I pass a module parameter? maerong Debian 2 02-07-2005 07:33 AM
send parameter from thread to thread marek Programming 2 09-08-2003 05:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration