What's new

Closed Mysql,java,netbeans, help boss,programming,programmer,pd

Status
Not open for further replies.

SHUBIDI

Addict
Joined
Apr 16, 2017
Posts
19
Reaction
4
Points
70
Help po sa code java netbeans bali poang gusto kong mangyari pag mag search ako ng data sa jtable lalabas yung data(okey na po to) gusto ko sanang pagka click ng data sa jtable eh mapapasa yung data papunta sa textfield na nasa kabilang jframe. TIA
 

Attachments

gamit ka onlick listener sa jtable, so ganito yung logic niya.
make sure na yung jtable mo nag display rin ng id or primary key of each record
pag nag click yung user
kukunin niya yung primary key of the row
and then dun ka mag query
then yun na extract mo na lang yung result ng query mo
 
gamit ka onlick listener sa jtable, so ganito yung logic niya.
make sure na yung jtable mo nag display rin ng id or primary key of each record
pag nag click yung user
kukunin niya yung primary key of the row
and then dun ka mag query
then yun na extract mo na lang yung result ng query mo
Pagkakuha ng primary key madidisplay yung ginet na data papunta sa textfield ganun ba paps?
 
1) paglabas ng data, you store that data in an static object (or static variable).
- take note, "static" para accessible ng second jFrame.
2) then sa second jFrame textField, kunin mo na yung static object or static variable ng data.
- tapos ipa-populate mo na yung laman ng data object sa mga textfields ng second jFrame.

that's it para isang "query" lang ang gagawin mo. Hindi yung paulit ulit na query. Unless you want to query again sa second jFrame, ok lang din.
 
Kulang pala yung tanong.....ganto po sana pag click ng user sa jtable magdidisplay sa textfiele (okey na to, yung data na to primary key) tapos ant gusto ko sana yung kung ano yung na display sa jtextfield eh madidisplay niya yung data sa jtable ng naka foreign key... normalization po ito..
 
Kulang pala yung tanong.....ganto po sana pag click ng user sa jtable magdidisplay sa textfiele (okey na to, yung data na to primary key) tapos ant gusto ko sana yung kung ano yung na display sa jtextfield eh madidisplay niya yung data sa jtable ng naka foreign key... normalization po ito..
Tama ba pag kakaintindi ko? Textfield to jtable?
 
Ganto yung query ko select * from records inner join user on user.id=records.id where user.id='"+jtextfield.getText()+"'";

Kaso ayaw ma display nung data ng nasa textfield ko
 
Ganto yung query ko select * from records inner join user on user.id=records.id where user.id='"+jtextfield.getText()+"'";

Kaso ayaw ma display nung data ng nasa textfield ko

hindi ko pa rin makuha yung gusto mo.
pero kung problema sa query string ito, the suspect is this (user.id='"+jtextfield.getText()+");

Code:
String tftext = jtextfield.getText();
select * from records inner join user on user.id=records.id where user.id=tftext
 
hindi ko pa rin makuha yung gusto mo.
pero kung problema sa query string ito, the suspect is this (user.id='"+jtextfield.getText()+");

Code:
String tftext = jtextfield.getText();
select * from records inner join user on user.id=records.id where user.id=tftext

Ayaw po ma get. Pero salamat po
 

Attachments

Ayaw po ma get. Pero salamat po
ok, start debugging.

1) yung String idname..... i-System.out.println() mo nga lang siya (para lang ma verify kung may value)
2) then kung may value, concentrate sa query string.
3) doon sa query, instead na *, can you just get mayde the id and name? (select id, name, from.......)
4) then yung result, i-System.out.println() mo lang sila.

i am just curious, mukhang tama naman yung codes mo..... sometimes nandyan yung error pero ayaw lang magpa-ramdam... lol
 
Status
Not open for further replies.

Similar threads

Back
Top