LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,658

Rep: Reputation: 1252Reputation: 1252Reputation: 1252Reputation: 1252Reputation: 1252Reputation: 1252Reputation: 1252Reputation: 1252Reputation: 1252
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration