How do i create objects of ordinary Classes from a javabean

I want to create a class Person below that I want to create an object from in my javabeans.
Look below Person class definition for continuation.
package data;
public class Person
private String name;
public Person()
name = "No name yet.";
public Person(String initialName)
name = initialName;
public void setName(String newName)
name = newName;
public String getName()
return name;
public void writeOutput()
System.out.println("Name: " + name);
public boolean sameName(Person otherPerson)
return (this.name.equalsIgnoreCase(otherPerson.name));
I run this bean class in the WEB-INF/classes/data folder creating a Person object in the deal() method below
When I compile the class it seems to fail. It does not recognise the Person class. Can you help me with a description of what to do to call
ordinary class objects from javabean class definitions.
What directories should the simple classes be put and what should I include in the javabean to be able to access them?
package data;
import java.sql.*;
import data.*;
public class Bean
{ private Connection databaseConnection ;
// private Person p;
public Bean()
super();
public boolean connect() throws ClassNotFoundException, SQLException
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String sourceURL = "jdbc:odbc:robjsp";
databaseConnection = DriverManager.getConnection(sourceURL);
return true;
public ResultSet execquery(String restrict) throws SQLException
Statement statement = databaseConnection.createStatement();
String full = "SELECT customerid,CITY,Address from customers " + restrict;
ResultSet authorNames = statement.executeQuery(full);
return (authorNames ==null ) ? null : authorNames;
public String deal() throws SQLException
{  Person p = new Person();
p.setName("Roberto");
return p.getName();
}

There is no "Copy File" function in Lightroom.
Lightroom was designed to eliminate the need to make duplicate copies of files. The organizational tools in Lightroom allow you to have one file categorized in many ways, you can assign multiple keywords to the photos (for example: Winery, Finger Lakes, Fall Foliage, Jessica). Similarly, you can have a file categorized in multiple Lightroom collections at the same time, all without making a copy of the photo. The benefit of this is that you don't need to make multiple copies of each photo, one copy suffices, and thus disk space is saved; and furthermore if you should edit a photo or add metadata, you only need to do this once, and the photo's appearance, or the photo's metadata is changed, and visible to you no matter how you choose to access the photo (pick any keyword or any collection and you will see the change)

Similar Messages

  • How to create object by getting class name as input

    hi
    i need to create object for the existing classes by getting class name as input from the user at run time.
    how can i do it.
    for exapmle ExpnEvaluation is a class, i will get this class name as input and store it in a string
    String classname = "ExpnEvaluation";
    now how can i create object for the class ExpnEvaluation by using the string classname in which the class name is storted
    Thanks in advance

    i think we have to cast it, can u help me how to cast
    the obj to the classname that i get as inputThat's exactly the point why you shouldn't be doing this. You can't have a dynamic cast at compile time already. It doesn't make sense. Which is also the reason why class.forName().newInstance() is a very nice but also often very useless tool, unless the classes loaded all share a mutual interface.

  • How can I create Object Tag which supports Sun and MS JVM both.

    Hi,
    I have created object tag as shown below
    <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    name = "TestApplet" height="0" width="0" >
    <param name="code" value="com.apps.TestApplet.class" />
    <param name="codebase" value="codes" />
    <param name="archive" value="TestApplet.jar" />
    </object>
    The above tag is working fine with the below JVM combinations in Windows XP.
    1) Only Sun JVM
    2) Only MS JVM
    3) Sun JVM & MS JVM
    But these conditions are not working with Windows 2000.
    How we can create object tag which will support for these two opertating systems?

    I am not able to understand the problem. From my understanding, you have an applet which you are trying to display in a browser using <object> tag. If that is the correct then all it matters is the browser and the JRE�
    For example the below code when put in a JSP or a HTML, will use JRE 1.6.0_01 that is available on the client machine. If that is not available on the client machine then it will try and download automatically in IE.
    This below code is for IE� if you are using Mozilla Firefox then you need to change the �classid� attribute to �java: com.foo.bar.ui.MyClass�
    <OBJECT ID="Gantt" classid = "clsid:CAFEEFAC-0016-0000-0001-ABCDEFFEDCBA"
                  codebase = "http://java.sun.com/update/1.6.0/jinstall-6u1-windows-i586.cab"
                  WIDTH = "980" HEIGHT = "495" ALIGN = "baseline">
                   <PARAM NAME="cache_option" VALUE="Plugin">
                  <PARAM NAME ="CODE" VALUE = "com.foo.bar.ui.MyClass" >
                  <PARAM NAME="MAYSCRIPT" VALUE="true">
                  <PARAM NAME ="cache_archive" VALUE = "Myjar.jar /" >
                  <PARAM NAME = "type" VALUE = "application/x-java-applet;jpi-version=1.6.0">
                  <PARAM NAME = "scriptable" VALUE = "false">
                  <strong>
                     This browser does not have a Java 1.6.0_01 Plug-in.
                     <br />
                     <a href="http://java.sun.com/update/1.6.0/jinstall-6u1-windows-i586.cab">
                       Get the latest Java Plug-in here.
                     </a>
              </strong>
            </OBJECT>

  • How do you created object level security in BI for roles.

    How do you created object level security in BI for roles.  For example if I want users to only execute reports in BI for a particular "object" report how would I do that.
    Thanks.

    Hi Maritza,
    Can you be more specific.
    If you are looking for BI Security concept, check this presentation:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1b439590-0201-0010-ea8e-cba686f21f06
    Regards,
    Zaheer

  • Create Object of "ObjectName" Class by giving only Domain Name.

    Hie,
    I want to create Object of "ObjectName" class without specifying its key value properties, but i want to only specify the domain name.
    For eg:
    ObjectName on=new ObjectName("jboss.ws4ee:*"); here jboss.ws4ee is the domain name and after colon(:) will come the key value properties.. i dont want to specify that because i want the list of all mbeans coming under this domain i.e. jboss.ws4ee
    So anyone can plzzz help me..
    Regards.

    Hi,
    What were you trying to do with that name?
    ObjectName on=new ObjectName("jboss.ws4ee:*");
    You cannot create an MBean with such an ObjectName. You can only
    use it as first argument to queryNames() and queryMBeans();
    If you want to get the attributes of all jboss MBeans then you will need to
    do something like that:
    final ObjectName pattern=new ObjectName("jboss.ws4ee:*");
    for (ObjectName o : server.queryNames(pattern,null)) {
        System.out.println("MBean:  " + o);
        for (MBeanAttributeInfo info : server.getMBeanInfo(o).getAttributes()) {
             final String attrname = info.getName();
             System.out.println("\t"+attrname+"="+server.getAttribute(o,attrname));
    }(disclaimer: this code was eyed-compiled)
    hope this helps,
    -- daniel
    JMX, SNMP, Java, etc...
    http://blogs.sun.com/jmxetc

  • How to pass the object of one class to the another class?

    Hello All,
    My problem is i am sending the object of serializable class from one class to another class but when i collection this class into another it is transfering null to that side even i filled that object into the class before transfer and the point is class is serializable
    code is below like
    one class contain the code where i collecting the object by calling this function of another class:-
    class
    lastindex and initIndex is starting and ending range
    SentenceStatusImpl tempSS[] = new SentenceStatusImpl[lastIndex-initIndex ];
    tempSS[i++] = engineLocal.CallParser(SS[initIndex],g_strUserName,g_strlanguage,g_strDomain);
    another class containg code where we transfering the object:-
    class
    public SentenceStatusImpl CallParser(SentenceStatusImpl senStatus, String strUserName, String strLanguage, String strDomain)
    *//here some code in try block*
    finally
    System.+out+.println("inside finally...........block......"+strfinaloutput.length);
    senStatus.setOutputSen(strfinaloutput);//strfinaloutput is stringbuffer array containg sentence
    fillSynonymMap(senStatus);
    senStatus.setTranslateStatus(*true*);
    return senStatus;
    Class of which object is serialized name sentenceStatusimpl class:-
    public class SentenceStatusImpl implements Serializable
    ///Added by pavan on 10/06/2008
    int strSourceSenNo;
    String strSourceSen = new String();
    String strTargetSen = new String();
    StringBuffer[] stroutputSen = null;
    HashMap senHashMap = new HashMap();
    HashMap dfaMarkedMap = new HashMap();
    boolean bTargetStatus = false;
    public SentenceStatusImpl(){
    public void setOutputSen(StringBuffer[] outputSen){
    stroutputSen = outputSen;
    public StringBuffer[] getOutputSen(){
    return stroutputSen;
    public void setTranslateStatus(*boolean* TargetStatus){
    bTargetStatus = TargetStatus;
    }//class

    ok,
    in class one
    we are calling one function (name callParser(object of sentenceStatusImpl class,.....argument.) it return object of sentenceStatusImple class containg some extra information ) and we collecting that object into same type of object.
    and that sentenceStatusImple classs implements by Serializable
    so it some cases it is returning null
    if you think it is not proper serialization is please replay me and suggest proper serialization so that my work is to be done properly (without NULL)
    hope you understand my problem

  • How to access private attribute of a class from its Friend Class

    Hi Experts ,
    I am coding in Method (DO_SAVE) of class /BOBF/CL_TRA_TRANSACTION_MGR.
    I need to access private variable ( MO_BOPF) of class /BOBF/CL_TRA_SERVICE_MGR ( Friend of /BOBF/CL_TRA_TRANSACTION_MGR ).
    Please help me to understand how can i access private attribute of one class from its friend class.
    Regards- Abhishek

    Hi Reny,
    You should be able to access by creating object of friend class.
    Sample:
    data lo_frnd     TYPE REF TO  /BOBF/CL_TRA_SERVICE_MGR.
    data lo_compl  type REF TO /BOBF/IF_TRA_TRANS_MGR_COMPL.
       create OBJECT lo_frnd
         exporting
                   iv_bo_key = '111'
                   IO_COMPL_TRANSACTION_MANAGER = lo_compl.
    "access the private object of friend class
       clear lo_frnd->MO_BOPF.
    Note: need to provide iv_bo_key & IO_COMPL_TRANSACTION_MANAGER while creating object.
    Hope this helps you.
    Regards,
    Rama

  • How can I create a java.awt.Image from ...

    Hi all,
    How can I create a java.awt.Image from a drawing on a JPanel?
    Thanks.

    JPanel p;
    BufferedImage image =
        new BufferedImage(p.getWidth(), p.getHeight, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = image.createGraphics();
    p.paint(g);
    g.dispose();

  • How can you create a writable PDF document from a PPT presentation ?

    How can you create a writable PDF document from a PPT presentation ? Upper part with the image , lower part with a free space in order to take notes for students during presentation or course.
    Thanks.
    B

    You can make a PDF file out of you notes and handouts but using the Adobe PDF printer.
    Open your PowerPoint Document then go to “File” “Print”
    Select ‘Adobe PDF” Printer
    Under slides, select which way you want to print. Note it will not print to a printer but to a PDF file.
    After then go into printer Properties and Setup PDF properties, do the following: (see second image below)
    Default: PDF/A 1-b
    Adobe Security: none (change as needed)
    Adobe Output folder: Prompt for Adobe file name
    Adobe Page size: Letter (change as needed)
    Check the following check boxes
    View Adobe PDf Results,
    Add Document Information,
    Rely on system fonts only,
    Delete Log files for successful jobs.
    Select OK
    A pop will ask you where you want to save the document. The file extension should be PDF. After giving the file name select okay and the file should popup as a PDF. Down side is if you want to speaker notes included then you will have to do another file, like wise with just screen shots then combine into one PDF document.
    I used Acrobat IX Pro. So to do this you need Acrobat IX or X Pro.
    Hope this will help.
    Tiger26

  • How do I create a single PDF Portfolio from an Outlook 2011 email with multiple non-pdf attachments?

    How do I create a single PDF Portfolio from an Outlook 2011 email with multiple non-pdf attachments?
    Email has 3 attachments--some are not pdf. I'd like all three converted into pdf files along with the email itself, and all appear in the email's pdf portfolio.

    I would also like an answer to this question. 
    I am trying to convert an Outlook email to a PDF, then all attachment are appended to the PDF as pages instead of attachments. 

  • How do i create a playlist in itunes from my iphone 4s?

    how do i create a playlist in itunes from my iphone 4s?

    denisefromnj wrote:
    On my iphone 4s I have 2 songs in the purchased category that I want to manually move into an existing playlist.  I can not figure it out.
    If the existing playlist is a regular (non-smart) playlist, then you can edit it directly on the iPhone. Just select the playlist and you should see an "Edit" button at the top, above the songs.  If you don't see that, then it must be a smart playlist since those can't be edited on the device. Once you tap the Edit button you would then navigate to the song you want to add and press the blue + sign to the right of the song, then press Done when you're finished.
    One caveat though, if you auto-sync your iPhone, the changes you make will not be preserved -- the playlist will revert to how it was next time you sync to iTunes.  So if you want to edit a playlist on your iPhone and then transfer it to iTunes, you have to create a new (empty) playlist on your iPhone, add the playlist that you wanted to edit to the new playlist, then add or delete more songs to the new playlist.  When you auto-sync, the new playlist will transfer to your iTunes library.
    But if you manually manage your iPhone, the playlist should remain in its edited state even if you connect to your library (but admittedly its been awhile since I tried manual mode).

  • How do i create a table of contents from bookmarks?

    How do I create a Table of Contents from the list of bookmarks?  How do I format a Table of Contents?

    Hi Brent!613,
    I think you may have landed in the wrong forum. Are you using Acrobat? If so, this thread from the AcrobatUsers.com may be useful: https://answers.acrobatusers.com/Create-Table-Contents-pdf-Bookmarks-q192651.aspx
    Best,
    Sara

  • How do I create. A single PDF from multiple files? PDF pack on iOS

    How do I create. A single PDF from multiple files? PDF pack on iOS
    The primary reason I signed up for. PDF Pack was to create a single PDF from multiple image files and other PDFs .
    Is this possible? If so how
    thanks in advance
    rich

    Hi Rich,
    The combine files feature isn't available when you're using Reader for iOS. However, you can log on to the web interface at Adobe Acrobat.com using your Adobe ID and credentials, and use the Combine Files feature there.
    Please let us know if you need further assistance.
    Best,
    Sara

  • How could I create a "Linked Server" link from SQL Server 2008R2 64-Bit to Oracle Database 11.2 64-Bit?

    How could I create a "Linked Server" link from SQL Server 2008R2 64-Bit to Oracle Database 11.2 64-Bit?
    Let's say the SQL Server and Oracle Database are in the same Company Internet Network.
    I have the code, but I do not know how to use it. Such as what is System DSN Name? Where could I get it. What does it look like?
    Do I need to install any Oracle Client Software in order to link from SQL Server to Oracle? Or SQL Server has the built-in drivers installed already that I can directly create a Linked Server from SQL Server to Oracle?
    I need to know details. Thanks.
    USE master
    go
    EXEC sp_addlinkedserver
         @server  = '{Linked Server Name}'
        ,@srvproduct = '{System DSN Name}'
        ,@provider  = 'MSDASQL'
        ,@datasrc  = '{System DSN Name}'
    EXEC sp_addlinkedsrvlogin
         @rmtsrvname = '{Linked Server Name}'
        ,@useself  = 'False'
        ,@locallogin = NULL
        ,@rmtuser  = '{Oracle User Name}'
        ,@rmtpassword = '{Oracle User Password}'

    You need an OLE DB provider for Oracle. There is one that ships with Windows, but it only supports very old versions of Oracle. Oracle has an OLE DB provider that you can use. I don't know if it's part of Oracle Client or how it is bundled.
    You should not use MSDASQL or any DSN.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How can one create a paint color generated from a photo using Kuler?

    How can one create a paint color generated from a photo using Kuler?

    The best way to remove a pattern is to use a Fast Fourier Transform.  There's a free plugin (as well as examples and instructions) here:
    http://dl.dropboxusercontent.com/u/6795661/4N6site/improc/fftplugin/examples.htm
    Using the plugin requires editing the individual colour channels, which PSE does not natively allow.  You'll need the reasonably-priced Elements+ addin:
    http://elementsplus.net/
    Here's a crop at 100% of the result I got:
    The pattern is much reduced.  With some experimenting, you can probably do a little better.
    Ken

Maybe you are looking for

  • Acomdata 500gb External FW Drive NOT BEING RECOGNIZED!!!

    I have been running an Acomdata 500gb FW External Hard Drive for my data intensive applications such as FCP and it has been working flawlessly for about the last year... Yesterday I powered up the Mac and turned on the drive along with my external US

  • Windows Application Starting Point

    Does a basic (and best practice) framework (or netbeans like project) exist for a java windows application that would include menuing and initial windows classes? I have decided to create a application in java and it will be a windows gui application

  • Oracle 10g Agent goes down itself

    I have been observing the Oracle 10g agent goes down by itself and in grid control it reports as Agent unreachable. where do I see the log why Agent is going down on target everytime.

  • Insert Table Content - Urgent

    Hi All,   I am getting weird error while Inserting record into Z-Table. It has 3 Key fields. 1st Key field is <b>Char</b> Type, 2nd Key field is <b>Date</b> Type & 3nd field <b>NUMC</b> Type. <u>Lets consider the following scenario:</u> Data Set 1: K

  • Problem in picking up the data from queries in QA and PRD

    Dear Experts We have upgraded our Development server from 3.5 to 7.I have used Role Menu web template.As this template is default for all users,When i execute these reports in DEV,it gives this URL and gives the data from Dev. http://cibdm.ncsbe.eu.j