Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javabeans

 
mano Shetty
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I started learning now about javabean concept.Can anyone help me to write jsp using javabean to do insert,update,delete operations in database .
 
Rao Raghu
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This should guide you.
 
mano Shetty
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
10qs 4 advice.It is ok but at present i need only a simple procedure to write jsp code for doing operations on database using java beans
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by mano mano:
10qs 4 advice.


Please use real words when posting to the forums. Words like "thanks" and "for". Please read this for more information.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"mano mano",

Additionally, there aren't many other rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

bear
JavaRanch Sheriff
 
Rao Raghu
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

10qs 4 advice.It is ok but at present i need only a simple procedure to write jsp code for doing operations on database using java beans


You can write the JDBC code in a java class to connect to your DB and place it under WEB-INF/classes. Remember that javabeans dont have a main() method. You have to write the getter and setter methods in the javabean, in which you will be setting those properties which you desire to persist to the DB. When the user submits the fields to be entered, the control has to go to another jsp or a servlet, wherein you will be retrieving those fields with req.getParameter(). Now in the same jsp/servlet you have to use the jsp action <jsp: useBean id="" class=""> and call the setter methods and the method that makes JDBC connection.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic