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
|