Reputation: 37
I´ve got a question, I´m working on a app that shows some data in a jtable, but I have a little problem, here is the thing, I have 2 data databases to show in the same jtable, and I don´t know how to show both in the same table, one of the tables give me info about a product, like stock and price, but the other one give me the components that make the full product. some idea?
this are my two databases: BMAEFOL1 and BMAEMAL1
I use another one to show other info but it´s in Jlabels. BMAEPRL1
so..this is my code for the part of the jtable:
if(BSC.getText() != " "){
String ST = BSC.getText();
aux=1;
String SSQL="SELECT * FROM BMAEPRL1 WHERE NMPROD ="+ST+" ORDER BY NMPROD"; /*BMAEMAL1*/
try{
Class.forName(driver);
cn = DriverManager.getConnection(url2, user, pass);
st = cn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_READ_ONLY);
rs = st.executeQuery("Select CODMAT, DESCRI, CANTID, PTOPED, PREULT from BMAEMAL1 WHERE CODMAT ="+ST+" ORDER BY CODMAT");
rs.next();
the CODMAT and DESCRI need to be from BMAEFOL1 and the others from BMAEMAL1.
thanks!
Upvotes: 1
Views: 40
Reputation: 64
If I understand what you want to do (since it's not really explicit) :
Is this what you want to achieve ?
Upvotes: 1