Servlet deleting updating searching a row from table
Click "Add JAR/Folder..." button near the "Classpath for Compiling Source" setting , so you can search the location of the JDBC jar file.
Adding JDBC jar file to classpath Then I prepared a cusomized Table Model for the JTable to use in this app. To write this code I used some nice tools of Net Beans.
I expect that the readers already have a suitable environment of My SQL database server working, having a database with an enough grant to a given user. Operation of database in Java is very complicated, requiring connection, statement, resultset and many try&catch. get Connection() method is to be called after init()method, to give to the other class the established connection.
To use this file, classpath to the JDBC driver must be set for this project.Edit manually the class declaration to extend "Abstract Table Model" class.The editor soon show the red and waved underline to show errors.Select "JFrame" node in the Inspector window to show its properties. I decided Grid Layout is the best to set these locations.Change "Form Size Policy" from default "Generate pack()" to "Generate Resize Code". The default layout on JPanel is Flow Layout in Net Beans. they could be moved by drag and drop on the form, If you are not satisfied with the location. The component might escape to a very wrong position, as a different panel.Each column's name is also known and can be set directly. The first two should be located on each JPanel, and the JTable on a JScroll Pane. I mean, data Panel, send Panel and table Pane are located to North, Center and South of Border Layout, respectively.