With this tutorial you can make four programas wich can connect to a database and with queries , like delete, update , insert or select , manage this information and use it in your aplication .
First of all you need to a databe with at least one table . This time we are going to work with mysql . This is my table :
GRAN ALL ON hereyourdatabase. * TO hereyouruser IDENTIFIED BY “hereyourpass”;
Now go NetBeans , first of all we need add the controller you our Project :
After this we can start to write code , we need to import java SQL tolos::
Everytime you want to manage information in a database from java you need 3 things:
A Connection to our database
A Statement with the query
A Resulset to retrieve the information and show it
The only thing that changes will be the sentence , the query.