How to use Getter and Setter functions of Data Transfer Object and Data Access Object.
1. Open NetBeansIDE
2. In a project make a class(DTO) file say 'FileDTO'
3. In FileDTO

 3.1. Here I have declared two private String type variables 'name' and 'hobby'

 3.2. Right click on source area in netbeans and goto
  
  insert code..-Getter and Setter..
 3.3. Choose required variables for which you want to generate Getter and Setter methods
 3.4. Click Generate
4. Make another class(DAO) file say 'FileDAO'
 4.1. In this file, make a 'static function' & write the code for connection and query       (insert, delete, update, etc)
 4.2. Get values of the variables of 'FileDTO' by making an object and calling 'getter'
      function
5. Make a JFrame Form say 'NewForm'
 5.1. Add JTextFields and a JButton
 5.2. For JButton Action-actionPerformed event type the code for 'setting' values to the
      DTO variables and make a call to the function of DAO
6. Run NewForm.java
7. Finish


Like My Facebook Page for more video updates:
https://www.facebook.com/pages/Raks/335960303097841

Comments

Popular posts from this blog

How to Perform DES Encryption and Decryption of TXT file in JAVA with NetBeansIDE

How to Detect CapsLock key using Java in NetBeansIDE.

How to insert Image in MySQL Database with Java in NetBeansIDE