Тёмный

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

ProgrammingKnowledge
Подписаться 1,8 млн
Просмотров 52 тыс.
50% 1

-----------------Online Courses to learn---------------------------
Java - bit.ly/2H6wqXk
C++ - bit.ly/2q8VWl1
AngularJS - bit.ly/2qebsLu
Python - bit.ly/2Eq0VSt
C- bit.ly/2HfZ6L8
Android - bit.ly/2qaRSAS
Linux - bit.ly/2IwOuqz
AWS Certified Solutions Architect - bit.ly/2JrGoAF
Modern React with Redux - bit.ly/2H6wDtA
MySQL - bit.ly/2qcF63Z
---------------------Follow--------------------------------------------
My Website - www.codebind.com
My Blog - goo.gl/Nd2pFn
My Facebook Page - goo.gl/eLp2cQ
Google+ - goo.gl/lvC5FX
Twitter - / programmingknow
Pinterest - goo.gl/kCInUp
Text Case Converter - goo.gl/pVpcwL
------------------------Stuff I use to make videos ------------------
Stuff I use to make videos
Windows notebook - amzn.to/2zcXPyF
Apple MacBook Pro - amzn.to/2BTJBZ7
Ubuntu notebook - amzn.to/2GE4giY
Desktop - amzn.to/2zct252
Microphone - amzn.to/2zcYbW1
notebook mouse - amzn.to/2BVs4Q3
-----------------Facebook Links ---------------------------------------
Programmi...
AndroidTu...
Programmi...
CppProgra...
JavaTutor...
SQLiteTut...
UbuntuLin...
EasyOnlin...
netbeans java tutorial
How to Advanced search a particular data in java netbeans table
MySQL and NetBeans Search Button
Java & MySQL Searching your database NetBeans
Retrieving database records using netbeans
iit Learn java netbeans
java tutorial netbeans
How to search a particular data in java netbeans table
netbeans search data from database

Опубликовано:

 

30 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 35   
@cyn0suretarun
@cyn0suretarun 12 лет назад
what happen when there are two two person with the same name or two person with same surname. I hope you understand my question...
@dutchman121
@dutchman121 8 лет назад
how to show the search result in Table
@mukeshsuthar8378
@mukeshsuthar8378 7 лет назад
what if user have many entry with same name?
@khaledsale7
@khaledsale7 9 лет назад
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(); . .. . . . }
@xvAnnGvx
@xvAnnGvx 8 лет назад
+khaled saleh thank you
@khaledsale7
@khaledsale7 8 лет назад
+Anna Galler welcome
@emiecellibunao4791
@emiecellibunao4791 11 лет назад
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.
@ChaminNalinda
@ChaminNalinda 12 лет назад
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.
@andreyv7402
@andreyv7402 9 лет назад
Bad practice, why cloning code, what about 'OR' using in the query?
@waqarjamali
@waqarjamali 7 лет назад
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
@ashishalex10
@ashishalex10 6 лет назад
Doesnt work for me
@XiiaoBenZaii
@XiiaoBenZaii 11 лет назад
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
@teobais
@teobais 11 лет назад
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());
@lestonyearwood3160
@lestonyearwood3160 12 лет назад
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 =?"
@javazaljava5978
@javazaljava5978 11 лет назад
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
@ikhwansaputera80
@ikhwansaputera80 10 лет назад
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
@advancetechnology760
@advancetechnology760 6 лет назад
How search data record in text field from directly below make a jtable1with already take data from database am dawood pls sir make tutrl
@IndraRachman
@IndraRachman 12 лет назад
just replace if with while in the code that you use to search name and surname
@duus001
@duus001 11 лет назад
Yes. That would also work. Just remember to add: pst.setString(2, txt_search.getText()); pst.setString(3, txt_search.getText());
@asifhalde6485
@asifhalde6485 11 лет назад
how you took that button group for those buttons ??? please reply..
@trisetyadarmawan902
@trisetyadarmawan902 9 лет назад
thanks :)
@srikirank9846
@srikirank9846 8 лет назад
how to add autocomplete while searching.
@dutchman121
@dutchman121 8 лет назад
how to show the search result in Table
@therealslinky62
@therealslinky62 8 лет назад
+dutch man Hi, Did you find an answer to this? please share if you did. Thanks.
@therealslinky62
@therealslinky62 8 лет назад
+dutch man I changed the KeyReleased method on a jTextFeild to filter the table for name only. I added this as a separate jTextFeild called txt_filter as it works differently to the search. It works more like the update_table method. Code is... try{ String sql = "SELECT * FROM Employeeinfo WHERE name LIKE '" + txt_filter.getText() + "%'"; pst = conn.prepareStatement(sql); rs = pst.executeQuery(); Table_Employee.setModel(DbUtils.resultSetToTableModel(rs)); } catch(Exception e){ JOptionPane.showMessageDialog(null, e); } Hope this helps.
@mikael2135
@mikael2135 8 лет назад
+therealslinky62 i dont understand about (DbUtils.resultSetToTableModel(rs)), can you explain to me ? i used xampp mysql
@therealslinky62
@therealslinky62 8 лет назад
+mikael 21 As I undersatand it DButils is a set of classes that help display the database table into the jTable. This is the command that shows the filtered results (rs) onto the jTable. Not best explanation but a google search will help you as well.
@qannoufoualid
@qannoufoualid 11 лет назад
& what if we have 2 or more similar data ?
@meljane_abogar
@meljane_abogar 11 лет назад
what is the source code of this program??
@Gajenzask
@Gajenzask 9 лет назад
How to put the searched data to jtable? Help please
@therealslinky62
@therealslinky62 8 лет назад
+Tonberry I changed the KeyReleased method on a jTextFeild to filter the table for name only. I added this as a separate jTextFeild called txt_filter as it works differently to the search. It works more like the update_table method. Code is... try{ String sql = "SELECT * FROM Employeeinfo WHERE name LIKE '" + txt_filter.getText() + "%'"; pst = conn.prepareStatement(sql); rs = pst.executeQuery(); Table_Employee.setModel(DbUtils.resultSetToTableModel(rs)); } catch(Exception e){ JOptionPane.showMessageDialog(null, e); } Hope this helps.
@HassanShahzadAheer
@HassanShahzadAheer 11 лет назад
what is pst
@denzpatricio4749
@denzpatricio4749 9 лет назад
what is pst? i seem to have problem with it. it doesnt recognize when i type it and gives error
@joshuabarola217
@joshuabarola217 5 лет назад
Denz Patricio preparedstatement
Далее
OYUNCAK DİREKSİYON İLE ARABAYI SÜRDÜ 😱
00:16
Просмотров 2,1 млн
Java - Search Suggestions With MySQL Database
18:02
Просмотров 7 тыс.
Java JDBC Search using Mysql Database
5:49
Просмотров 32 тыс.
7 Database Paradigms
9:53
Просмотров 1,6 млн
SQL Databases with Pandas and Python - A Complete Guide
16:59