Solved

Java Bean

Posted on 2003-10-21
7
273 Views
Last Modified: 2010-04-01
Anyone hav examples of java bean. Or any source for Java Bean. Can any 1 tell me more about Java Bean Bcoz i am still new in it.
0
Comment
Question by:UnluckyXIII
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 3

Accepted Solution

by:
applekanna earned 60 total points
ID: 9596522
Java bean in 2 lines.

it is a normal class with get and set methods and other public methods and  does have intializations in it constructor and usually access the backend db.

eg bean to set username and pwd in a dbd

public class LoginBean{
//instance variables
private String login;
private String pwd;

//get method
public String getLogin()
{ return login; }
//set method
public void setLogin(String newVal)
{ this.login = newVal }

//other mthods connecting to db etc
public String getPwd()
{
  //connect to db and retireve pwd
  return pwd;
}


}//end class

does this help?
0
 

Author Comment

by:UnluckyXIII
ID: 9596636
wht code is use to retrieve a file from database, any example?  Need help, example retrieving files from database containing gif,jpg and midi files.
0
 

Author Comment

by:UnluckyXIII
ID: 9596640
wht code is use to retrieve a file from database, any example?  Need help, example retrieving files from database containing gif,jpg and midi files.
0
 
LVL 3

Expert Comment

by:applekanna
ID: 9596705
If u store an image as a BLOBs in my database, then use getBinaryStream to retrieve the value

see this http://www.jguru.com/faq/view.jsp?EID=159

this thread has code
http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_20602681.html


code snippet to upload into db
http://forum.java.sun.com/thread.jsp?thread=315523&forum=45&message=1993302

an easy way would be store all the images in a folder and store their path in the db and link them form your page , this is the best way to do it instead of storing images in the db.

for eg store http://www.yoursire.com/images/bulb.gif in the db and

in the page just refer to it
<img src = "http://www.yoursire.com/images/bulb.gif">

does it help
Cheers!
0
 

Expert Comment

by:chainreaction
ID: 9605310
my dear friend... trust me, you will not figure out what is the Javabean in here... if you do, you will have another question such as how to connect JSp to JavaBean... or how to put the javabean with your JSP and so on.

Get a book, the JSP for dummy is the best for beginner.. because all beginner are dummy, including me once upon a time.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here's how to start interacting with our community through Post.
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question