Hi how are you, Thank you so much for the these tutorials. They are so helpful in my capstone project. May you please do lectures on how to create pie charts, bar graphs and line graphs fetching data from a database.
Hallo Sunita , I must say that you are a very good teacher and you explained it very well....Thanking you.. I will deffinatly follow you with your more vidios....Manohar
Thank you so much for the helpful video! I do have a question though. In your program, you knew the amount of columns before hand, so you were able to create the no, name, and makrs variables. Is there an alternate way to do this if you don't know what your column size will be?
Thank you for the helpful code tutorial. I'm having an issue with the column names not displaying properly though, they only show java.lang.String or java.lang.Integer. Could you help me with this please?
Hi ma'am May i know how do view table without clicking a button! Like an Example when i run the program automatically The records from the database should show
THanks for the video, every time i press show button, It makes duplicate and show it on table. Can we do something so that no duplicate record shows on table
So i'm using NetBeans and i seem to have a problem with the tblData read the comments and couldn't find a working solution how do get the tblData to work
another question respected mam. How do i know which commands to use in the action Listener method. like you wrote so many command, database connectivity etc.. I mean is there any good guide for beginners?
Hi, could you please tell me, where i can find the Table control name (in your case tblData)? Because when i use tblData and declare it in class, there is an error, which says: cannot invoke javax.swing.jtable.getmodel() because tblData is null... I dont know how to fix this. Could you please help me?
Hello, Mam. I want to display data in a table. The data are fetched from an excel.xlsx file stored in my local drive. How to do that preferably in IntellijIdea ?
@@CSCORNERSunitaRai suppose I am having 2 tables one with 4 cols and other with 5 then for the second table the 5th col will be empty in jtable as we are reading only 4 columns
Please help, my ‘rs.getMetaData()’ is error. It suggests that I add cast to ‘ResultSetMetaData’ or change type of ‘rsmd’ to ‘ResultSetMetaData’. And even though I followed the suggestions, the table data still doesn’t show.
Actually, I have another function in a different package that does the fetching part using a class in another package, How can I display data using that function, here are the functions: public ArrayList findAllStudent() { ArrayList al=new ArrayList(); conn=ConnectionPool.connectDB(); String query="select * from student"; try { Statement stmt=conn.createStatement(); ResultSet rs=stmt.executeQuery(query); while(rs.next()) { StudentBean sb=new StudentBean(); sb.setEnrollmentno(rs.getString("Enrollment")); sb.setName(rs.getString("Name")); sb.setAddress(rs.getString("Address")); sb.setBranch(rs.getString("Branch")); sb.setCollege(rs.getString("College")); sb.setSemester(rs.getInt("Semester")); sb.setGender(rs.getString("Gender")); sb.setSubject1(rs.getFloat("Subject1")); sb.setSubject2(rs.getFloat("Subject2")); sb.setSubject3(rs.getFloat("Subject3")); sb.setSubject4(rs.getFloat("Subject4")); sb.setGrade(rs.getString("Grade")); al.add(sb); } conn.close(); } catch (SQLException e) { e.printStackTrace(); } return al; } The connectionpool class: public class ConnectionPool { static Connection conn; public static Connection connectDB(){ try{ // register driver Class.forName("com.mysql.cj.jdbc.Driver"); // create the connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/studentdb","root","space"); System.out.println("Database connected"); } catch (ClassNotFoundException ex){ ex.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } return conn; } }
*_Got a question on the topic? Please share it in the comment section below and I will answer it for you._*
My codes didn't show anything 😢
Same think happened
@@iamnel3141
so far the only video that shows how to work with JTable and ScrollPane! Thank you so much!!
Glad to know👍Keep watching
Thank you ma'am! You just saved me from being stuck in a bug for a whole week. May you continue helping programmers, kudos!
Glad it helped! Yes, I will.
Thanks a lot!!!! You have just cleared my 2.5 years long confussion!
You're welcome👍 please subscribe
You deserve a medal for this. Thanks
Thank you ☺😊please subscribe
Madam Excellent Performance with great detail
So clearly explained ma'am 🙏
Thank you so much👍
you are an absolute lifesaver!! Thank you so much for sharing this!
Wish you very happy holidays and an amazing new year! 💞
That's great😊 keep watching and plz subscribe
Thank you so much maam, you're a life saver!!!
Happy to help!plz subscribe
Great video , straight to the point.
Thank you so much 👍
Glad you liked it👍☺plz subscribe
Thank you so useful for my uni project!
Glad to know that👍 stay connected✅
Easy Explained. This video made my knowledge++. Thank you
Wowww that's great 👍😊🔥keep watching
Great tutorial, thanks a lot! It´s of tremendous help for what I´m working on right now..
Glad my video helped you👍 keep watching😍
Amazing video, very helpful.
Glad you liked it👍 do explore my channel for more stuffs
thank you so much, your video just helped me learn a new concept, keep up the good work
Glad to hear that! Keep watching and plz subscribe
Thanks a lot!! You saved my day.
Glad it helped you👍Do explore my channel for more stuffs✅
OMG Mam you saved me!
You're welcome👍please subscribe😊
Thank you for clear demo mam
You're welcome👍
hello , please how can i solve this problem when I run i get : java.sql.SQLException: No value specified for parameter 1 ! thankyou .
Check out no, of? And r u providing value for all these ? Or not
Hi how are you, Thank you so much for the these tutorials. They are so helpful in my capstone project. May you please do lectures on how to create pie charts, bar graphs and line graphs fetching data from a database.
Glad my video helped you👍
I'll try
Hallo Sunita , I must say that you are a very good teacher and you explained it very well....Thanking you.. I will deffinatly follow you with your more vidios....Manohar
Thank you so for your kind words👍
Your comments motivates me for creating videos. Stay connected✅ God bless you
Thanks a million, Madam.
You're welcome👍 Do explore my channel for such more contents
Really Useful one....
Glad it was helpful!
Very useful information thank you
You're welcome👍
Thank you for the video 😊👍
You're welcome👍
Thanks you really helped me with this
Glad I could help👍☺plz subscribe
thanks worked like a charm
Glad it worked👍
Thanks a lot, you're the best
You're welcome!
Thank you so much for the helpful video! I do have a question though. In your program, you knew the amount of columns before hand, so you were able to create the no, name, and makrs variables. Is there an alternate way to do this if you don't know what your column size will be?
Yes you can use ResultSetMetaData interface.
It's having method through which you can get column count.
Refer my advanced java playlist. I have shown in one video
Outstanding
Thanks
Well explained 👍
Thank you so much👍
Thank you for the helpful code tutorial. I'm having an issue with the column names not displaying properly though, they only show java.lang.String or java.lang.Integer. Could you help me with this please?
Check lines again given in my video
Hi ma'am May i know how do view table without clicking a button! Like an Example when i run the program automatically The records from the database should show
Write code in constructor
Great video
Thank you so much👍
thank u very muchhhhhh, u helped me
very useful video...
Thank you so much
Could you tell me why I can't run JinternalFrame after extending it...
Do u hv main method?
Thanks a lot, v nice👍
Glad you liked it👍Do explore my channel for more stuff
Thank you mam .
Most welcome 😊
Well explained
Thank you so much
THanks for the video, every time i press show button, It makes duplicate and show it on table. Can we do something so that no duplicate record shows on table
Check addRow method.
Did you wrote it twice?
@@CSCORNERSunitaRai I wrote it one time but I press button twice or when you press button again and again, you get duplicate rows.
So i'm using NetBeans and i seem to have a problem with the tblData read the comments and couldn't find a working solution how do get the tblData to work
What error u r getting?
another question respected mam. How do i know which commands to use in the action Listener method. like you wrote so many command, database connectivity etc.. I mean is there any good guide for beginners?
This question is wrt to what ?
If u r asking related to jdbc then depending on buttons we hv to write code
@@CSCORNERSunitaRai yes mam, it is mainly related to jdbc
@@eshaesha9100 ok so when u click on add button write insert code, delete button write delete code and so on
Would it be possible to make a custom column header instead metadata?
model.setColumnIdentifiers() method is not displaying names of columns, no errors. Any solution?
Did you placed ur jtable control properly?
Follow the way I have shown. Delete and place again
I am getting this issue...
Unable to parse source.
WindowBuilder was not able to parse source private javax.swing.JTextField textField;.
Declare this variable in class not in constructor. Only Initialization in constructor
Hi, could you please tell me, where i can find the Table control name (in your case tblData)? Because when i use tblData and declare it in class, there is an error, which says: cannot invoke javax.swing.jtable.getmodel() because tblData is null... I dont know how to fix this. Could you please help me?
It's available in toolbox where u can see available controls just drag and drop
Thank you so much!
You're welcome👍
How to sort jtable data with the column?
Hello, Mam. I want to display data in a table. The data are fetched from an excel.xlsx file stored in my local drive. How to do that preferably in IntellijIdea ?
The code doesnt work if I want to retrieve from different tables
It works u need just modify according to your table design
@@CSCORNERSunitaRai suppose I am having 2 tables one with 4 cols and other with 5 then for the second table the 5th col will be empty in jtable as we are reading only 4 columns
Hello, the first row ( the topmost ) is not showing up on the table how can I fix?
Ok I'll check.. When I tried it was working
@@CSCORNERSunitaRai I can send you my code because mine is alittle different from yours. Great vid btw!
@@endmysuffering6847 ok u can share on my telegram @cscorner
@@CSCORNERSunitaRai I was able to fix it I had to add the table to a jscrollpane. Thank you for responding still :)
Thank you so much! =)
You're welcome👍 stay connected
respected mam, do we need any extension for the JFrame and the design view in Eclipse?
If u want to use eclipse u need to add window builder
Detailed tutorial on how to create swing in eclipse available on my channel under advanced java tutorial playlist
@@CSCORNERSunitaRai yes mam, i just watched that tutorial. You are legend mam
@@eshaesha9100 thank you so much dear👍please share
Thank you
You're welcome👍 please subscribe
Please help, my ‘rs.getMetaData()’ is error. It suggests that I add cast to ‘ResultSetMetaData’ or change type of ‘rsmd’ to ‘ResultSetMetaData’. And even though I followed the suggestions, the table data still doesn’t show.
Check your import. All jdbc related import should be from java.sql only
Hello maam can you help me mine says no sutiable driver found
Join my telegram and Please share screenshots of error. I will try to fix it
thanks♥
You're welcome👍
if i want to display only 1 row, how i can do that?
You can use following method:
jTable1.getModel().setValueAt(daya,row_index,col_index)
@@CSCORNERSunitaRai can you please tell me where exactly to put this line ?
Mem addrow is not found. What i can do?
Hmmm, check my video again
Actually, I have another function in a different package that does the fetching part using a class in another package, How can I display data using that function, here are the functions:
public ArrayList findAllStudent() {
ArrayList al=new ArrayList();
conn=ConnectionPool.connectDB();
String query="select * from student";
try {
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery(query);
while(rs.next()) {
StudentBean sb=new StudentBean();
sb.setEnrollmentno(rs.getString("Enrollment"));
sb.setName(rs.getString("Name"));
sb.setAddress(rs.getString("Address"));
sb.setBranch(rs.getString("Branch"));
sb.setCollege(rs.getString("College"));
sb.setSemester(rs.getInt("Semester"));
sb.setGender(rs.getString("Gender"));
sb.setSubject1(rs.getFloat("Subject1"));
sb.setSubject2(rs.getFloat("Subject2"));
sb.setSubject3(rs.getFloat("Subject3"));
sb.setSubject4(rs.getFloat("Subject4"));
sb.setGrade(rs.getString("Grade"));
al.add(sb);
}
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
return al;
}
The connectionpool class:
public class ConnectionPool {
static Connection conn;
public static Connection connectDB(){
try{
// register driver
Class.forName("com.mysql.cj.jdbc.Driver");
// create the connection
conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/studentdb","root","space");
System.out.println("Database connected");
} catch (ClassNotFoundException ex){
ex.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
return conn;
}
}
7:52 you said "tblData" is your table name, but isn't your table name is "student"?
I mean JTable control name.
Thanks
@@CSCORNERSunitaRai where can i find my JTable control name?
@@CSCORNERSunitaRai it shows me error in this line (under the "tblData" exactly ) DefaultTableModel model=(DefaultTableModel) tblData.getModel();
and one of the solutions the program tell me to create local variable to "tblData"
never mind, it work fine now, thanks, i just replaced "tblData" to "table" and it worked haha
Madam, please can I request for a demo on adding pagination on Jtable using eclips
I'll try
What is this eclipse ide version mam?
Send the comment box that link
Because that swing set that package not available mam in my ide
Eclipse IDE for Java Developers - 2021-06
If you want to get swing related stuffs you need to add WindowsBuilder.
Refer this video :ua-cam.com/video/lctZ-NAWgDU/v-deo.html
How to do it with date ?
U want to display date datatype?
how to get data from database to JTable in selected one column
mam pura code dekha diya hota toh kya ho jaat ?
Iski full video hai channel par.
Chk karo
Damaste or Thanks or Graciassssssssssss : ,}
You're welcome👍 keep watching
@Eduardoo sai do fake caraio
Java.awt . eventdispatchthread exception occurred
getModel() is not working on me
Is it showing any error
@@CSCORNERSunitaRai my compiler has some error so I re- installed it, its fine now. Thanks ♥️
@@babyph65 yes
maam i got a problem with tbldata.getModel() its showing that it can't be resolved please help
Declare tblData inside class. It's not able to find variable tblData