Beruflich Dokumente
Kultur Dokumente
in MS SQL server
By Sumit Jayaswal
INTRODUCTION..........................................................................................................3
PROBLEM/CASE STATEMENT................................................................................4
PREVIOUS OPTIONS...................................................................................................5
PRAXIS SOLUTION.....................................................................................................6
IMPLEMENTATION....................................................................................................7
CONCLUSION.............................................................................................................10
To Create a POJO:
• Create a New Java class in NetBeans 6.5.
• Make the class implement serializable.
o public class NewClass implements
java.io.Serializable
• Make private variables for the columns which are returned
from the stored procedure.
o private String Emp_Name;
o private String Emp_Address;
o private Date Emp_DOB;
o private Double Emp_Sal;
• Press ‘Alt+Insert’ with the cursor in the scope of the class. This
command is to insert code in current class. This will open a
window as shown below
o
• Select Getter and Setter from the above. In the next pop up
window select all the private variables.
• Click Generate. This will generate all the getter and setters
which your code requires
• The class is almost done. But we still need the constructor. For
this, again do an ‘Alt+Insert’. Select Constructor in the dialog
box. It will open a window which is shown as below.
o
• Click Generate. This will generate a constructor for you. You
might as well add a default constructor in the code.
• With this your POJO is created.
This white paper will definitely ease down the effort of the
development team to find the correct way of implementing the problem
stated above.