• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Beans  RSS feed

 
Ruchi Yadav
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the use of java beans in any project?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37465
538
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this has nothing to do with JDBC, I'm moving it to a more general forum.
 
Janeice DelVecchio
Bartender
Posts: 1812
12
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaBeans is a development tool (Integrated Developing Environment?). It's used for a number of reasons.

I kind of relate it to the way someone would use MS Frontpage or Adobe GoLive to create websites. It can help with GUIs, keep track of applications you've made, and help with the debugging process. It has a built in compiler that can help you figure out where you've made errors. The part I like about it is you can make your application run line by line and see what values of variables are. This is helpful if you don't know how loops work.

Personally, as a n00b myself, I like to do my coding in Notepad++ and compile from the command line. I feel I have a better understanding of how to find/fix compiler errors. I don't feel like my learning is watered down because I have an IDE doing part of the work for me.

I'm using the HeadFirst Java 2nd ed book.... it has a chapter about IDEs and JavaBeans.

--Janeice
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might be thinking of NetBeans.

JavaBeans is a convention for Java objects, not an IDE.
 
Janeice DelVecchio
Bartender
Posts: 1812
12
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... they should name things more differently so I can keep up

Sry.
Janeice
 
Muhammad Khojaye
Ranch Hand
Posts: 449
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaBeans are reusable software components for Java. They are classes written in the Java programming language conforming to a particular convention. A JavaBean is a Java Object that is serializable, has a nullary constructor, and allows access to properties using getter and setter methods.

Conventions are

The class must have a public default constructor
The class properties must be accessible using get, set, and other methods
The class should be serializable.
 
M K Rayapudi
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Muhammad Ali Khojaye wrote:
A JavaBean is a Java Object that is serializable,


is it must? are you sure?
 
Muhammad Khojaye
Ranch Hand
Posts: 449
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rayapudi Murali Krishna wrote:
Muhammad Ali Khojaye wrote:
A JavaBean is a Java Object that is serializable,


is it must? are you sure?


Yes. The Convention say so. It needs to implement the serializable or externalizable interface either directly or through inheritance. This allows applications to reliably save, store, and restore the bean's state.
 
M K Rayapudi
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Muhammad Ali Khojaye
Can you please, suggest me some article/link to know much on Javabeans.
thank you.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rayapudi Murali Krishna wrote:
Can you please, suggest me some article/link to know much on Javabeans.


Do you have access to Google or similar search engines?
I do. I searched for "java beans" and got this as the very first result.
Piece of cake.

http://faq.javaranch.com/java/SearchFirst
http://faq.javaranch.com/java/ShowSomeEffort
 
Ruchi Yadav
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but i wanted to ask how a java bean can be used to connect the front end toh the backend database??
its giving an error.....
 
Rahul P Kumar
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be specific. Provide some code where error is coming.
Normally, as a web page is submitted, values after validation are set in java beans. From there on you can process on the values and send the values to database or you can directly send those values to database. In your sql query, values for database field can be taken from beans.
Error may be during setting the values from bean and inserting in the query or making the connection itself.
 
Billy Korando
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope this helps:
http://www.turnleafdesign.com/?p=52
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!