Java prog#21.Advanced search a particular data in SQLite (MySql) Database in Netbeans java jtable

Java prog#21.Advanced search a particular data in SQLite (MySql) Database in Netbeans java jtable

ProgrammingKnowledge

12 лет назад

52,232 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@teachdawood5887
@teachdawood5887 - 19.01.2018 21:23

How search data record in text field from directly below make a jtable1with already take data from database am dawood pls sir make tutrl

Ответить
@mukeshsuthar8378
@mukeshsuthar8378 - 16.08.2017 13:36

what if user have many entry with same name?

Ответить
@waqarjamali
@waqarjamali - 28.12.2016 12:55

st=con.prepareStatement("SELECT * FROM EmployeeInfo where Name=? or EmployeeID=? or Surname=? ");

st.setString(1, search.getText());
st.setString(2, search.getText());
st.setString(3, search.getText());


rs= st.executeQuery();
this ie enough

Ответить
@srikirank9846
@srikirank9846 - 05.10.2016 09:21

how to add autocomplete while searching.

Ответить
@dutchman121
@dutchman121 - 11.12.2015 09:18

how to show the search result in Table

Ответить
@dutchman121
@dutchman121 - 11.12.2015 09:18

how to show the search result in Table

Ответить
@denzpatricio4749
@denzpatricio4749 - 04.10.2015 06:35

what is pst? i seem to have problem with it. it doesnt recognize when i type it and gives error

Ответить
@andreyv7402
@andreyv7402 - 23.07.2015 11:42

Bad practice, why cloning code, what about 'OR' using in the query?

Ответить
@khaledsale7
@khaledsale7 - 15.06.2015 13:31

just you can do this :

try {
            String tmp = search.getText();
            String sql = "select * from Employeeinfo where name=? or employeeid=?"  ;
            pst = con.prepareStatement(sql);
            pst.setString(1, tmp);
            pst.setString(2, tmp);
            rs = pst.executeQuery();
           .
..
.
.
.

}

Ответить
@Gajenzask
@Gajenzask - 08.03.2015 11:49

How to put the searched data to jtable? Help please

Ответить
@trisetyadarmawan902
@trisetyadarmawan902 - 28.12.2014 21:48

thanks :)

Ответить
@ikhwansaputera80
@ikhwansaputera80 - 12.11.2014 15:29

Hi, I am very happy to see you about java tutorial video, I want to ask is how to find data on Form1 when in enter will appear form2 to find the data and returns the search results to Form1 back, thank you for, quest, and if it could vedio toturialnya

Ответить
@akshpatel6090
@akshpatel6090 - 29.10.2013 20:51

U dont need to copy paste the code code use following query "SELECT * FROM Employeeinfo WHERE employeeid = ' "+txt_search.getText()+" ' OR name = ' "+txt_search.getText()+" ' OR surname = ' "+txt_search.getText()+" ' OR age = ' "+txt_search.getText()+" ' OR age = ' "+txt_search.getText()+" ' ";

Ответить
@javazaljava5978
@javazaljava5978 - 28.09.2013 07:51

Hello .. im new in java. can you please make this program using gui? i cant understand this prog. coz its netbeans i dont know how to use netbeans. i want this prog in gui. please .. help me

Ответить
@lordgago09
@lordgago09 - 11.09.2013 16:44

what is the source code of this program??

Ответить
@HassanShahzadAheer
@HassanShahzadAheer - 06.09.2013 17:29

what is pst

Ответить
@qannoufoualid
@qannoufoualid - 11.08.2013 06:39

& what if we have 2 or more similar data ?

Ответить
@XiiaoBenZaii
@XiiaoBenZaii - 01.07.2013 19:47

Is there any search using keyword??? Like I type in "pa" instand of "paul" and every record start with "pa" will list in JTabel and let user to select which record they want

Ответить
@emiecellibunao4791
@emiecellibunao4791 - 04.06.2013 01:16

i think its better to use combobox for specific search then a search button. Like this put this to search button or the releasekey in the video if(combo.getSelectedItem().equals("ID")){ String sql="Select * FROM tbl_students where ID=?"; - - - - } else if(combo.getSelectedItem().equals("LAST NAME")){ String sql="Select * FROM tbl_students where LastName=?"; - - - - } i wish this come in handy.

Ответить
@teobais
@teobais - 07.04.2013 17:13

duus001 is right.Suppose the query below : select * from EmployeeInfo where name = ? OR surname = ? OR employeeID = ? Thus, our prepared Statement has to define 3 different parameters to search apparently in our database. So, the only solution is to separate seach field's content into 3 distinct values;tto do this, pass 3 distinct parameters into pst: pst.setString(1, searchJTextField.getText()); pst.setString(2, searchJTextField.getText()); pst.setString(3, searchJTextField.getText());

Ответить
@duus001
@duus001 - 17.03.2013 04:13

Yes. That would also work. Just remember to add: pst.setString(2, txt_search.getText()); pst.setString(3, txt_search.getText());

Ответить
@asifhalde6485
@asifhalde6485 - 13.02.2013 16:53

how you took that button group for those buttons ??? please reply..

Ответить
@lestonyearwood3160
@lestonyearwood3160 - 29.10.2012 23:54

Is there no shorter way to do this? like instead of: "select * from Employeeinfo where name =?" There could be: "select * from Employeeinfo where name =? or employeeid =? or surname =?"

Ответить
@IndraRachman
@IndraRachman - 07.10.2012 08:38

just replace if with while in the code that you use to search name and surname

Ответить
@ChaminNalinda
@ChaminNalinda - 01.08.2012 16:02

yes sir , we would be glad if you could give a solution for this problem, my problem is that what if there are multiple people with same name and we don't no their emloyeeid(unique id ) either . Thank you.

Ответить
@cyn0suretarun
@cyn0suretarun - 16.05.2012 03:50

what happen when there are two two person with the same name or two person with same surname. I hope you understand my question...

Ответить