Why JavaBean is called "JavaBean"

i'm just wondering why JavaBean is named like that....?!?

Any javabean that's going to be halfway useful probably is going to do signficantly more than just provide a no-arg constructor. Providing a no-arg constructor is a minimum (and only) requirement for a class to qualify as a bean, but "JavaBean" shouldn't be seen as just a synonym for "class with a no-arg constructor" -- it ignores the context of how they're meant to be used.
That's why I think that "a class that Introspector knows how to make sense of" is a more useful definition. If you hand a class with a no-arg constructor to Introspector, it doesn't barf, so yes, technically it's a bean -- but if you can then do something useful with that class, then not only technically but practically it's a bean.
Once I had to fix code where a "bean" didn't follow the conventions correctly, and so although technically it was still a bean, Introspector couldn't use it (following a JDK upgrade -- long story) and code died. The fact that it technically qualified as a bean was irrelevant. The important part was that the "bean" was supposed to behave in certain beanish ways given its purpose, and it didn't.

Similar Messages

  • Why cant I call a getResultSet method more than 1

    Why cant I call the getRSS method more than 1 time from my page?
    I have a class called methods class, here is the code:
    public class methodsClass {
        public java.sql.Connection objConn = null;
        public String query = null;
        public java.sql.PreparedStatement statement = null;
        public java.sql.ResultSet objRS = null;
        /** Creates a new instance of methodsClass */
        public methodsClass() {}
         public ResultSet getRSS(String sql)
            String strSQL = sql;
            try
                Class.forName("oracle.jdbc.driver.OracleDriver");
                objConn = java.sql.DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:CCD","system", "Abcd1234");
                statement = objConn.prepareStatement(strSQL,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
                objRS = statement.executeQuery();
            catch (Exception e)
                System.err.println("Error in getRSS method");
                e.printStackTrace();
            return objRS;
        public void killConn()
            try
                    objRS.close();
                    System.out.println("Resultset is closed");
                    statement.close();
                    System.out.println("Statement is closed");
                    objConn.close();
                    System.out.println("Connection is closed");
                catch(Exception e)
                System.err.print("Unable to kill all objects");
                e.printStackTrace();
    //END OF CLASS***************************************** I call the method from the following jsp:
    <%
    String eqCat = "Tracked Vehicle";
    String strSQL = "SELECT DISTINCT * FROM robert WHERE eqcategory = '"+eqCat+"'";
    methodsClass mc = new methodsClass();
    ResultSet objRS = mc.getRSS(strSQL);
    java.lang.System.out.println(strSQL);
    %>
         <select name="selectBox">
         <% while(objRS.next()){
             out.println("<option value='"+objRS.getString("eqtype")+"'>"+objRS.getString("eqtype")+"</option>");
               mc.killConn();
    %> The above works fine.
    If I try to call the getRSS function again on this page I get the following error:javax.servlet.ServletException: Exhausted Resultset
    I tried to call it like so:
    newNameSQL = "Select * from robert where eqtypes = 'someVariable'";
    newNameRS = mc.getRSS(strSQL);
    <%=newNameRSS.getString("something");%>I cant understand why I get this error, I am closing the rs,conn and statement in the killConn method.
    TIA!

    I did that but still the same error. The problem is when I attempt to open up another resultset on the same page I get the Exhausted ResultSet error. I have even eliminated the class file altogether by doing this:
      String eqCat = "Tracked Vehicle";
      String strSQL = "SELECT DISTINCT eqtype FROM robert WHERE eqcategory = '"+eqCat+"'";
      Class.forName("oracle.jdbc.driver.OracleDriver");
      Connection objConn = java.sql.DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:CCD","system", "Abcd1234");
      PreparedStatement statement = objConn.prepareStatement(strSQL,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
      ResultSet objRS = statement.executeQuery();
      System.out.println(strSQL);
    //The above works fine and then below I add this and the error comes back
         <select name="cs_popup_name_1" onchange="CSURLPopupShow(/*CMP*/'cs_form_name_1', /*CMP*/'cs_popup_name_1', 'Main');">
         <% while(objRS.next()){
            String eq = objRS.getString("eqtype");
             out.println("<option value='"+eq+"'>"+eq+"</option>");
    objRS.close();
    objConn.close();
    statement = null;
    strSQL = null;
    strSQL = "SELECT * FROM robert";
      Class.forName("oracle.jdbc.driver.OracleDriver");
      objConn = java.sql.DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:CCD","system", "Abcd1234");
      statement = objConn.prepareStatement(strSQL,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
      ResultSet rs = statement.executeQuery();
      System.out.println(strSQL);
    //If I leave the field below commented out I get no errors, but if I comment it out I get the error
    <a href="#" onmouseover="showImg('<%=rs.getString("img1")%>')">                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Why java is called java2

    why java is called java2 and another thing that i would like to know is why it was renamed to java from its previous name OAK
    Thanx
    Manish

    why java is called java2Not to sure about this one, but I think it was a marketing decision - I guess 'Welcome to the Java 2 platform' sounds better than saying 'Welcome to the JDK 1.2.1 platform' :=)
    and another thing that i
    would like to know is why it was renamed to java from
    its previous name OAKThere was already a patented product named 'OAK', so they had to rename it to something else to avoid the law.
    >
    Thanx
    ManishA brief history of Java:
    http://java.sun.com/features/1998/05/birthday.html
    http://www.ils.unc.edu/blaze/java/javahist.html

  • Why JNDI is called an Interface?

    Why JNDI is called as Java Naming and Directory Interface, question is why
    interface ? when it is not a interface ?

    It is an interface because it is defined as an abstract set of APIs, not actually implementation. The actually implementation is done by service providers.
    Defining an abstract set of APIs without actually implementation can isolate the implemenation of service provide and client application code, thus make them more independently from each other. i.e, a client application would not need to know what changes made by any particular vendor.
    Hope this helps.

  • Why doesn't calls to my iPhone ring through to my Mac?

    Why doesn't calls to my iPhone ring through to my Mac?

    The following have the requirements and settings and some troubleshooting information:
    Connect your iPhone, iPad, iPod touch, and Mac using Continuity - Apple Support
    Get help using Continuity with iOS 8 and OS X Yosemite - Apple Support

  • HT1245 Why does my caller I.D. photos show as a small thumbnail in the upper right corner and not full screen? I have used both photos I have synced and photos I have taken, yet others have full screen photo I.D.'s.

    Why does my caller I.D. photos show as a small thumbnail in the upper right corner and not full screen? I have used both photos I have synced and photos I have taken, yet others have full screen photo I.D.'s. I have looked onlime at several threads and there are no real answers as to what I need to do or am doing wrong.

    I am also having this issue.
    I've just spoken to someone in the Apple Support Centre who advised me that since the product is in beta, he is unable to assist. I wanted to find out whether someone was able to delete the data for me, or 'reset' the photos app somehow. This apparently cannot be done. He suggested I provide feedback via the feedback page, which I will do, but to be honest doesn't fill me with a lot of confidence in the issue being fixed.
    I also deactivated the service and waited the 30 days for the pictures to be deleted - this should have been completed in mid-January. Instead, my iCloud.com Photos page is now showing the photos that should have been deleted as grey squares, just as you described. I am also unable to delete these photos; every time I try, I get the same message about a server error.
    I am also unable to disable the service by enabling and then disabling it on my iPhone. Each time I have tried this it hangs on uploading for several hours, with the progress bar not moving at all. When I disable it on my iPhone, the web app remains unchanged.
    If anyone has had this issue and has managed to fix it, PLEASE share your wisdom. I am out of patience!

  • Why do we call Enterprise Manger 10.2.0.3 "EM 10g R3" ?

    Why do we call Enterprise Manger 10.2.0.3 "EM 10g R3" ?
    I think it is ok "EM 10g R2" is Enterprise Manager 10.2.0.x. and
    "EM 10g R3" is Enterprise Manager 10.3.0.x.
    Your opinion?

    If it is a mistake/typo, then it will be Oracle's fault.
    There was Enterprise Manager 10g Grid Control Release 2 (v10.2.x). Which to me is 10g R2
    Now they are referring EMGC 10.2.0.3 as Enterprise Manager 10g Grid Control Release 3 (10.2.0.3). So that to me is 10g R3 because of the Release 3.
    If you remember, there were Oracle products named Oracle xxx 10g Release x(9.x.x). So, I think we are seing the same here.
    So, do not be surprised if you see 11g Release 1 (10.2.x.x).

  • Why do we call an ABAP Runtime error a "Short Dump"

    Hi All,
    I was just working on one of the ABAP runtime errors with my technical counterpart and a question came to my mind "Why do we call an ABAP Runtime error a "Short Dump"?".
    I tried asking a few friends of mine working in the technical space in SAP and they were not able to answer.
    So, some one of you experts help me getting answer to this question.
    Thanks in Advance.
    Nitin.

    ABAP Runtime error is a generalized term .......... meaning the error occured while runtime.
    wheare as short dump.
    Short -  means brief.
    dump - error information from the memory
    Short dumps (also called ABAP memory dumps). Short dumps occur when an ABAP program fails.
    Short dumps provide basic information about which program failed and what the error was.
    hope this helps.

  • Why ProfileAdapterRepository is called so? where is the Adapter in it?

    Does anyone know why ProfileAdapterRepository is called so. You won't see the word Adapter in any other repository name. Do we have an implementation of adapter pattern in ProfileRepository?
    /atg/commerce/claimable/ClaimableRepository
    /atg/commerce/inventory/InventoryRepository
    /atg/commerce/invoice/InvoiceRepository
    /atg/commerce/order/OrderRepository
    /atg/commerce/order/processor/AddOrderToRepository
    /atg/content/media/MediaRepository
    /atg/dynamo/security/AdminSqlRepository
    /atg/dynamo/service/jdbc/SDSRepository
    /atg/dynamo/service/jdbc/SQLRepository
    /atg/dynamo/templates/HTMLRepository
    /atg/dynamo/templates/XMLRepository
    /atg/multisite/SiteRepository
    /atg/sitemap/SitemapRepository
    /atg/userprofiling/PersonalizationRepository
    /atg/userprofiling/Profile*Adapter*Repository

    Sanju,
    in ATG, you can maintain separate profile repositories for external and internal users. There are separate repository definition files for internal users and external users. The external profiles are stored in the /atg/userprofiling/ProfileAdapterRepository, defined by the userProfile.xml file located in <ATG10dir>\DPS\config\profile.jar. Internal profiles are stored in the /atg/userprofiling/InternalProfileRepository, defined by the internalUserProfile.xml file in <ATG10dir>\DPS\InternalUsers\config\config.jar.
    Other repositories will not be having different categories within them. for example for inventory we do not have sub types and hence the generic term InventoryRepository. In case of profile to identify whether it is an external profile repository or internal profile repository we have additional attribute attached to the name of the repository.
    Also since Repository concept is basically built on Adapter design pattern we see this Adapter in ProfileAdapterRepository instead of something like ExternalProfileRepository

  • Why are regional calls not in Five Cents plan, but instead are 21 cents/min.?

    Why are "regional calls" not included in Five Cents/minute calling plan, but instead billed at 21 cents/minute !??!
    "Local" calls are 9 cents/Call, everywhere else in the U.S. It is 5 cents/minute on the plan.  So regional calls are much more expensive than calls to Hawaii!!
    Also how do I find what is the "regional" area (for Manhattan, New York City), and what is the "local" area?  Is there a link  somewhere on the Verizon site to enable finding your own regional area versus local or long distance?

    Sorry you are having difficulty, an agent with access to your account will reach out to you directly by email, private message in the Forums and/or the billing telephone number on your Verizon account for more information to help you resolve your issue.Please remember to check your spam/junk folder if you do not hear from an agent.

  • Why is the call history time on the printout different than the phone?

    Why is the call history time on the printout different than the phone?

    How much different is it? A minute or two??
    Calls are triggered the minute you hit send, not answered. And the same when ending a call. So if off a minute or two for a call that is why.

  • Why JVM is called a machine??????

    Hello All,
    i want to know why JVM is called a machine.
    does it have a memory or processor in it,thats why
    or some other reason pls explain
    -thanks in advance
    upasna

    to be exact a java virtual machine, think of it this way, currently right now your machine thinks in "native code" aka binary, this is a "hardware" version of all software on your machine, most software is in "binary" format, next you have the java virtual machine which thinks in "bytecode" format, the virtual machine does not have a "hardware" version built onto your PC, so Sun had to make their own "software" version that converts "bytecode" into binary, this is why it is called a virtual machine because it sits on all operating systems and does this conversion so since it is not hardware, aka a "real" chip that does this conversion, it is "virtual" or software...

  • Why SOA is called Service Oriented??

    why SOA is called Service Oriented??
    what is basic difference between OOPS and SOA??

    Just google and you will get thousands of links which will answer your question. Few which I got are -
    http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html
    http://en.wikipedia.org/wiki/Service-oriented_architecture
    http://bexhuff.com/so-vs-oop
    http://www.xml.com/cs/user/view/cs_msg/3296
    Regards,
    Anuj

  • Why java is called pure object oriented.

    i know that java is called as pure object oriented language.
    why it is called so even though it has primitive datatypes and also it doesnot support multiple inheritance completely. it only supports in the case of interfaces but not in the case of classes. then why it is called pure object oriented.

    Its because you cannot write an executable java program without creating an object. Well, you can:
    public class a
      public static void main( String a[] )
    }In contrary to C++, there can be no variables or functions in the wild (outside a class).
    You can not create an executable java program without creating a class (but not forcibly its instance, an object.)
    The "pure object oriented" wording in this sense has not really much importance, it is rather a marketing ploy.

  • Why java is called as true object oriented language?

    HI Friends,
    Though few oops concepts is not supported , why java is called as truly object oriented language and C++ as not a purely object oriented language???? Please, if any one know , give me the answer.
    Thanks to all.

    few oops concepts is not supportedwhich concepts?
    as far as i know...to be OO, you must supports
    encapsulation, abstraction, inheritancxe, composition (aggretration, et all) and polymorphism. Java supports all those comcept..now..Java is a hybrid due to what Jverd has pointed out.
    the only pure OO language that i know of is SmallTalk. they have Meta class that can create Class object. and all their primitaives are object.
    C# comes close, but their Class are not object.

Maybe you are looking for

  • Airdrop is not working after upgrading to IOS 7.1

    Hi does anyone have the similar issue of Airdrop ? The airdrop was working in my iphone 5s, but never worked when I upgraded to IOS7.1, and the same to my ipad mini. I tried to reset network setting, hard reboot the IOS, turn off / on Airdrop and WIF

  • Help in simple creation of table

    hi could some one please correct this simple create command.... CREATE TABLE NEW_FPRI_200501 AS (SELECT GIP_GXP_FULL, TRADING_DATE, TRADING_PERIOD, RUN_TIME, PRICE , MARGINAL_LOSS, CREATED_DATE FROM MISSING_FPRI_200501) DEFAULT TABLESPACE LOB_COMIT_D

  • Multiple batches for a production order and mapping with components

    Hello Gurus, Our business requires to create multiple batches for one production order + they want to trace which component in the production order has been issued to the main equipment. For example, I am creating production order for 'A' equipment f

  • Does anyone know how to fix the crash problem for Photoshop CS3 & for Mac OS X 10

    Process: Adobe Photoshop CS3 [2065] Path: /Applications/Adobe Photoshop CS3.app/Contents/MacOS/Adobe Photoshop CS3 Identifier: com.adobe.Photoshop Version: 10.0.1 [10.0.1x20071012 [20071012.r.1644 2007/10/12:09:30:00 cutoff; r branch]] (10.0.1) Code

  • How to use CSS option in Answers

    Hi, I have around 5 Dashboards, which includes close to 20 Reports. I would like to learn how I can format column name (like Font, Size) and data appearance in each report. Currently am doing it manually, one column by one column. I would like to kno