LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to pass Resultset rs object as parameter to Thread (http://www.linuxquestions.org/questions/linux-software-2/how-to-pass-resultset-rs-object-as-parameter-to-thread-4175458731/)

snehal89 04-19-2013 01:35 AM

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

pan64 04-20-2013 09:57 AM

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


All times are GMT -5. The time now is 04:48 AM.