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.
When you do things right, people won't be sure you've done anything at all.
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.
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.
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.
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.