[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Java Bean

Posted on 2003-10-21
7
Medium Priority
?
282 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 240 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Working from home is a dream for many people who aren’t happy about getting up early, going to the office, and spending long hours at work. There are lots of benefits of remote work for employees.
Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

656 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