Solved

Java Bean

Posted on 2003-10-21
7
269 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
By reading this blog, MSPs will gain insight into how to improve communications with their clients as well as establish a more profitable business.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

739 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