0

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....

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by ubi_ct83
0

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!!!

Edited by ubi_ct83: n/a

0

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.

0

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?

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.