hi,
lets say i have 2 classes 1 is to process the data and another 1 is to connect to mysql.
P.java to process the data and Connection.java to connect to mysql.i use JDBC to connect and pass the data through constructor P way=new P(String side).after process the data, i want to pass the output result to Connection.java and the output is in String too.how can i do that?

lets say i want to count the area of triangle.i get the data from database and after count the area in P.java, i want to pass to Connect.java so that i can send it to database.im sorry if my prob annoys you....

What do you have in mind?? Do you have any sample code for this??

What do you have in mind?? Do you have any sample code for this??

no.i dont have any idea.actually,in P.java, i use ArrayList to store the data.
its a really long process.d rough thing is like this:
Connection.java:
connect to mysql;
query data;
P gen=new P(sides);
gen.finish();

P.java:
ArrayList<String> suite_list = new ArrayList<String>();
public P(String sides_value)
{ //data from database }
public void finish()
{ //do process and create suit_list here}

i really zero in mind...please!!!

do you mean:

1. Connect to DB and get the sides.
2. Pass this query to a process.java to calculate area.
3. After that you will connect to db and update(?) the area.

Correct me if Im wrong.

do you mean:

1. Connect to DB and get the sides.
2. Pass this query to a process.java to calculate area.
3. After that you will connect to db and update(?) the area.

Correct me if Im wrong.

yes, that is what i wanna do.i think the main prob is how to pass ArrayList<String> to other class.if this possible?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.