Solved

Java Bean

Posted on 2003-10-21
7
239 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
  • 2
  • 2
7 Comments
 
LVL 3

Accepted Solution

by:
applekanna earned 60 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Problem with Pie chart in Jsp 20 180
what is stuck threads? 3 96
Help with LDAp login using jsp 6 109
dynamic reloading of jsp in jetty 2 114
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now