How to list the datasources without use a tnsnames.ora file?

Hi,
I want to use the OracleDataSourceEnumerator class of ODP.Net to list the datasources on which the user can connect.
It's work with a tnsnames.ora on the local station, so good.
But I want use the easy connect naming methode so i have edited the sqlnet.ora file with this:
NAMES.DIRECTORY_PATH= (EZCONNECT, TNSNAMES)
then i have deleted the content of the tnsnames.ora
so my code don't work : none datasource is returned by the OracleDataSourceEnumerator
So my question : is it a way to list the datasources without use a tnsnames.ora file?
Edited by: user13499556 on 17 déc. 2010 08:21

You can check
DataConnectionFile.EnumerateDependants method
This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

Similar Messages

  • How to define a DSN without using a tnsnames.ora on the PC client machine

    Hi,
    Client : Windows XP with Oracle9i ODBC driver
    Server : Oracle 10 on Solaris
    I need to define a DSN which does not rely on tnsnames.ora on the client machine.
    I tried to use a file dsn, but without success, because I don't know the parameters to use.
    I used these params in the file.dsn :
    [ODBC]
    DRIVER=Oracle9i ODBC Driver
    UID=testuser
    PWD=testpw
    SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=9999))(CONNECT_DATA=(SERVICE_NAME=testSID)))
    It does not work ....

    Hrm, interesting. It always used to be DBQ but it seems it might have changed to SERVER at some point.
    Anyway, I tried this and it worked fine for me (using 10204)
    TESTFILE.DSN
    ================
    [ODBC]
    DRIVER=Oracle in OraDb10g_home1
    server=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=gdarling-pc2)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))
    TEST.VBS
    ==========
    set con = createobject("adodb.connection")
    con.open "filedsn=testfile;uid=scott;pwd=tiger;"
    set rs = createobject("adodb.recordset")
    rs.open "select user from dual",con
    msgbox rs.fields(0).value
    Note also that unless you really want to create a file dsn, you could also just use a dsnless connection string and pass that directly too:
    set con = createobject("adodb.connection")
    con.open "driver={Oracle in OraDb10g_home1};uid=scott;pwd=tiger;server=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=gdarling-pc2)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))"
    set rs = createobject("adodb.recordset")
    rs.open "select user from dual",con
    msgbox rs.fields(0).value
    Hope it helps,
    Greg

  • How to send the email without using server side (Php, java)

    How to send the (Run time image or file) Email & Attachment in Flex web application. without using php, java.

    Well, at some point your email needs to be handed over to an SMTP server. It's a fair amount of work, but if you want to just send an email you could open a socket to a mail server's SMTP port and follow the SMTP protocols to send your email.
    ActionScript sockets: http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9 b90204-7cf7.html
    SMTP protocol: http://tools.ietf.org/html/rfc821
    -- Tom

  • How to update the datasource 0CRM_LEAD_H using the BWA1 t-code from CRM

    Hi all,
    I would like to know how I can update the extractor 0CRM_LEAD_H from BWA1 t-code in CRM.
    If I see the datasource thru RSA5 the extract structure doesn't have the STATUS_LEAD field. but thru BWA1 I see the field in the extract structure, and the field has an "A" in the Selection column and I can't change it, the values could be:
    Field Attribute     Short Description
    A          Field in OLTP and BW Hidden by SAP
    M          Selection Required, Visible
              No Selection Possible, Visibility Set
    P          Selection Adjustable, Visibility Set
    X          Selection Adjustable, Visibility Set
    1          Pure Selection Field, Selection Set
    2          Pure Selection Field, Selection Set
    3          Selection Adjustable, Visibility Adjustable
    4          No Selection Possible, Visibility Adjustable
    The field is not In the Mapping tab.
    Do you know how I can include the field in the extraction?
    Regards, Federico

    In CRM badis are only used to do enhancement either for EEWB or enhancements (with filter or non filter).
    Still the standard exits (EXIT_SAPLRSAP_001,..004) can be used for populate the appened extract structure.
    How ever you can apply some tricks to make a dynamic call to function module.. or class methods (as the subroutine call are not advisable in OOPs concept)..
    Thanks,
    -J

  • How to send the email without using SOST

    Hiiiiii Every1,
    What i m usiing is SO_NEW_DOCUMENT_SEND_API1 FM to send the email to internet add. as well as SAP User.
    The Problem is that i have to go to SOST to send the  Pending mails. and send the jobs manually.
    Then it works all right.
    What i want that i don't wnat to send this jobs/ emails mannually by going to SOST..
    Is it possible to do it without using SOST.

    hi
    i am not sure but give this code a try
    REPORT YEMAIL.
    TABLES: USR02.
    DATA: C(15).
    DATA: SENT LIKE SONV-FLAG.
    DATA: EMAIL_ID LIKE SOFOLENTI1-OBJECT_ID.
    DATA: BEGIN OF EMAIL_DATA.
            INCLUDE STRUCTURE SODOCCHGI1.
    DATA: END OF EMAIL_DATA.
    DATA: BEGIN OF EMAIL_SEND OCCURS 10.
            INCLUDE STRUCTURE SOMLRECI1.
    DATA: END OF EMAIL_SEND.
    DATA: BEGIN OF EMAIL_TEXT OCCURS 10.
            INCLUDE STRUCTURE SOLISTI1.
    DATA: END OF EMAIL_TEXT.
    PARAMETERS: ALL__CLI RADIOBUTTON GROUP RADI.
    PARAMETERS: THIS_CLI RADIOBUTTON GROUP RADI.
    PARAMETERS: SELECT__ RADIOBUTTON GROUP RADI.
    SELECT-OPTIONS SEND_TO FOR C NO INTERVALS.
    SELECTION-SCREEN SKIP.
    PARAMETERS: SUBJECT(30).
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN COMMENT /1(20) TEXT-999.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: L1(84).
    SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: L2(84).
    SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: L3(84).
    SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: L4(84).
    SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: L5(84).
    SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: L6(84).
    SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: L7(84).
    SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: L8(84).
    SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: L9(84).
    SELECTION-SCREEN END OF LINE.
    EMAIL_TEXT-LINE = L1.
    APPEND EMAIL_TEXT.
    EMAIL_TEXT-LINE = L2.
    APPEND EMAIL_TEXT.
    EMAIL_TEXT-LINE = L3.
    APPEND EMAIL_TEXT.
    EMAIL_TEXT-LINE = L4.
    APPEND EMAIL_TEXT.
    EMAIL_TEXT-LINE = L5.
    APPEND EMAIL_TEXT.
    EMAIL_TEXT-LINE = L6.
    APPEND EMAIL_TEXT.
    EMAIL_TEXT-LINE = L7.
    APPEND EMAIL_TEXT.
    EMAIL_TEXT-LINE = L8.
    APPEND EMAIL_TEXT.
    EMAIL_TEXT-LINE = L9.
    APPEND EMAIL_TEXT.
    EMAIL_DATA-OBJ_NAME = 'MESSAGE'.
    EMAIL_DATA-OBJ_DESCR = SUBJECT.
    EMAIL_DATA-OBJ_LANGU = 'E'.
    EMAIL_DATA-SENSITIVTY = 'P'.
    EMAIL_DATA-OBJ_PRIO =  '1'.
    EMAIL_DATA-NO_CHANGE = 'X'.
    EMAIL_DATA-PRIORITY = '1'.
    BREAK-POINT.
    IF SELECT__ = 'X'.
      LOOP AT SEND_TO.
        EMAIL_SEND-RECEIVER = SEND_TO-LOW.
        EMAIL_SEND-REC_TYPE = 'U'.
        EMAIL_SEND-EXPRESS = 'X'.
        APPEND EMAIL_SEND.
      ENDLOOP.
    ELSEIF THIS_CLI = 'X'.
      SELECT * FROM USR02.
        IF USR02-USTYP = 'A' AND USR02-BNAME NE 'SAP*'
        AND USR02-BNAME NE 'DDIC'.
          EMAIL_SEND-RECEIVER = USR02-BNAME.
          EMAIL_SEND-REC_TYPE = 'U'.
          EMAIL_SEND-EXPRESS = 'X'.
          APPEND EMAIL_SEND.
        ENDIF.
      ENDSELECT.
    ELSEIF ALL__CLI = 'X'.
      SELECT * FROM USR02 CLIENT SPECIFIED.
        IF USR02-USTYP = 'A' AND USR02-BNAME NE 'SAP*'
        AND USR02-BNAME NE 'DDIC'.
          EMAIL_SEND-RECEIVER = USR02-BNAME.
          EMAIL_SEND-REC_TYPE = 'U'.
          EMAIL_SEND-EXPRESS = 'X'.
          APPEND EMAIL_SEND.
        ENDIF.
      ENDSELECT.
    ENDIF.
    BREAK-POINT.
    EXIT.
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
         EXPORTING
              DOCUMENT_DATA              = EMAIL_DATA
              DOCUMENT_TYPE              = 'RAW'
              PUT_IN_OUTBOX              = 'X'
         IMPORTING
              SENT_TO_ALL                = SENT
              NEW_OBJECT_ID              = EMAIL_ID
         TABLES
              OBJECT_CONTENT             = EMAIL_TEXT
              RECEIVERS                  = EMAIL_SEND
         EXCEPTIONS
              TOO_MANY_RECEIVERS         = 1
              DOCUMENT_NOT_SENT          = 2
              DOCUMENT_TYPE_NOT_EXIST    = 3
              OPERATION_NO_AUTHORIZATION = 4
              PARAMETER_ERROR            = 5
              X_ERROR                    = 6
              ENQUEUE_ERROR              = 7
              OTHERS                     = 8.
    regs
    Arun

  • How to enhance the datasource 0SRM_TD_PO using table BBP_PDIHP

    In R3 when any PO is deleted at the header/item level the field LOEKZ is populated in tables EKKO(Header)/EKPO(item level).
    Similarly in SRM when any PO is deleted at the header/item level the field DEL_IND is populated in tables BBP_PDHGP(Header)/BBP_PDIHP(item level). In current situation we have standard datasource 0SRM_TD_PO, this has a field as ITM_DEL_IND which is coming from table BBP_PDIHP(item level) and its always blank and its not getting populated , so we are not able to eliminate the deleted PO's in BW.
    To overcome this, I have a following approach :
    =====================================
    Enhance the datasource 0SRM_TD_PO to include a "ZZDELIND" field and populate this field via CMOD from tables BBP_PDHGP(Header)/BBP_PDIHP(item level). The issue is I'm not able to determine the relation/join/data model between the datasource and the tables. The datasource 0SRM_TD_PO has a PO#(OBJECT_ID) but the tables BBP_PDHGP(Header)/BBP_PDIHP(item level) dont have a PO# instead these tables have a key as "GUID"which is HEXA decimal.
    Can someone please help me out.

    two ways:
    1. call FM bapi_po_getdetail and pass the PO number, you will get all your details
    2. pass PO number to CRMD_ORDERADM_H to get the the GUID and use this GUID on BBP_PDHGP(if version control is active then you need to consider the active version only)
    and for item guid, pass the GUID picked from CRMD_ORDERADM_H to CRMD_ORDERADM_I-HEADER, you will get all the item guids as CRMD_ORDERADM_I.
    this can be passed to BBP_PDIGP.
    there are beautiful views as well joining these tables(BBP_PDVIEW*).. which you can use as well

  • How-to list the contents of a Data Pump Export file?

    How can I list the contents of a 10gR2 Data Pump Export file? I'm looking at the Syntax Diagram for Data Pump Import and can't see a list-only option.
    Regards,
    Al Malin

    use the parameter SQLFILE in the impdp which writes all the sql ddl's to the specified file.
    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14215/dp_import.htm
    SQLFILE
    Default: none
    Purpose
    Specifies a file into which all of the SQL DDL that Import would have executed, based on other parameters, is written.
    Syntax and Description
    SQLFILE=[directory_object:]file_name
    The file_name specifies where the import job will write the DDL that would be executed during the job. The SQL is not actually executed, and the target system remains unchanged. The file is written to the directory object specified in the DIRECTORY parameter, unless another directory_object is explicitly specified here. Any existing file that has a name matching the one specified with this parameter is overwritten.
    Note that passwords are not included in the SQL file. For example, if a CONNECT statement is part of the DDL that was executed, it will be replaced by a comment with only the schema name shown. In the following example, the dashes indicate that a comment follows, and the hr schema name is shown, but not the password.
    -- CONNECT hr
    Therefore, before you can execute the SQL file, you must edit it by removing the dashes indicating a comment and adding the password for the hr schema (in this case, the password is also hr), as follows:
    CONNECT hr/hr
    For Streams and other Oracle database options, anonymous PL/SQL blocks may appear within the SQLFILE output. They should not be executed directly.
    Example
    The following is an example of using the SQLFILE parameter. You can create the expfull.dmp dump file used in this example by running the example provided for the Export FULL parameter. See FULL.
    impdp hr/hr DIRECTORY=dpump_dir1 DUMPFILE=expfull.dmpSQLFILE=dpump_dir2:expfull.sql
    A SQL file named expfull.sql is written to dpump_dir2.
    Message was edited by:
    Ranga
    Message was edited by:
    Ranga

  • How to define the application to use for opening each file type (pdf, jpg,...)

    I installed an external application, and this new application has been configured by defect that it will be used to open all files with extensions like jpg, pdf, etc...
    I want to revert this situation and define again the proper application I want to use for opening each file type. How can I do this in Lion?
    Thanks,
    Azaldier

    Pick a representative file.
    Get info. (Command-i)
    There you will see a place "Open with" where you can select the application for that file.
    Hit the "Change all..." button to do this for all files of this type.
    charlie

  • Portege R100: Solution how to restore the unit without using a CD-ROM drive

    I have just re-stored my Toshiba R100 after nearly 3 years of owning it without a single format due to the complexities of getting a working bootable CD-ROM drive.
    This won't help those of you who have a non booting laptop but if yours is booting I used the following method to re-store my laptop with zero problems.
    1. Put the restore CDs into another computer and extract the Ghost image files "01131000.GHO" and "01131000.CRC" from disk 1 and "01131001.GHS" from disk 2.
    2. If your laptop has a second partition then transfer these files to a directory on your non windows partition. If not you will have to use partition magic to create one.
    3. Create a Norton Ghost boot disk from a retail version of Norton ghost and a Windows 98 Boot disk.
    4. Boot the Laptop from the Windows 98 Floppy disk, then swap disks and run Ghost.
    5. Select Local>Local Disk>From Image
    And select the 01131000.GHO file.
    6. Select the only image offered to you, then select the R100?s drive, and finally select the main boot partition.
    7. Hit go!
    8. Re-boot and follow the windows configuration and you're done.

    Hi George.
    Thanks for your useful description.
    I'm sure it will help other users here in our community.

  • How to list the active Alerts used within a tab(report) within a Document

    Hello
    We have a number of tabs/reports within a single webi document. There are a couple of alerts within the webi document but only one is used within a given tab/report.
    Is there an API around that will help me query the alerts that are enabled within each tab/report within a given document instance?
    There is an IReportProcessingInfo class that is around for it looks like its not applicable for Webi documents.
    Regards
    Madhu
    BO XI R2 SP2 on Windows 2003

    Hi Madhu,
    Below is a sample code to traverse through the ReportStructure and get the Alerters from the cells.
    Hope this helps.
    Regards,
    Dan
    Main:
                /************************** RETRIEVING PARAMETERS **************************/
                // Retrieve the logon information
                String username = "username";
                String password = "password";
                String cmsName  = "cms name";
                String authType = "secEnterprise"; 
                // Retrieve the name of the Web Intelligence document to be used in the sample
                String webiDocName = "WebI Alerter Test";
                /************************** LOGON TO THE ENTERPRISE **************************/
                // Logon to the enterprise
                IEnterpriseSession boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( username, password, cmsName, authType);
                /************************** RETRIEVE INFOOBJECT FOR THE WEBI DOCUMENT **************************/
                // Retrieve the IInfoStore object
                IInfoStore boInfoStore =(IInfoStore) boEnterpriseSession.getService("InfoStore"); 
                session.setAttribute("SAMPLE.InfoStore", boInfoStore); 
                // Build query to retrieve the universe InfoObjects
                String sQuery = "SELECT * FROM CI_INFOOBJECTS WHERE SI_KIND='" + CeKind.WEBI + "' AND SI_NAME='" + webiDocName + "'";
                // Execute the query
                IInfoObjects boInfoObjects = (IInfoObjects) boInfoStore.query(sQuery);
                // Retrieve the InfoObject for the Web Intelligence document
                IInfoObject boInfoObject = (IInfoObject) boInfoObjects.get(0);
                /************************** RETRIEVE DOCUMENT INSTANCE FOR THE WEBI DOCUMENT **************************/
                // Retrieve the Report Engines
                ReportEngines boReportEngines = (ReportEngines) boEnterpriseSession.getService("ReportEngines");;
                // Retrieve the Report Engine for Web Intelligence documents
                ReportEngine boReportEngine = boReportEngines.getService(ReportEngines.ReportEngineType.WI_REPORT_ENGINE);
                // Retrieve the document instance for the Web Intelligence document
                DocumentInstance boDocumentInstance = boReportEngine.openDocument(boInfoObject.getID());
                ReportStructure boReportStructure = boDocumentInstance.getStructure();
                out.print(traverseReportStructure(boReportStructure));
                out.print("<HR>Process Complete!<HR>");
                boDocumentInstance.closeDocument();
                boReportEngine.close();
                boEnterpriseSession.logoff();
    Functions:
    String traverseReportStructure(ReportStructure boReportStructure) {
                String output = "";
                for (int i=0; i<boReportStructure.getReportElementCount(); i++) {
                            output += traverseReportElement(boReportStructure.getReportElement(i), 0);
                return output;
    String traverseReportElement(ReportElement boReportElement, int level) {
                String output = "";
                String padding = getPadding(level);
                if (boReportElement instanceof ReportContainer) {
                            output += padding + "Report Name: " + ((ReportContainer) boReportElement).getName() + "<BR>";
                } else if (boReportElement instanceof PageHeaderFooter) {
                            if (((PageHeaderFooter) boReportElement).isHeader()) {
                                        output += padding + "Report Header<BR>";
                            } else {
                                        output += padding + "Report Footer<BR>";
                } else if (boReportElement instanceof ReportBody) {
                            output += padding + "Report Body<BR>";
                } else if (boReportElement instanceof Cell) {
                            output += padding;
                            output += "Cell ID: " + ((Cell) boReportElement).getID() + " - ";
                            output += getAlerters(((Cell) boReportElement).getAlerters(), level+1);
                } else if (boReportElement instanceof ReportBlock) {
                            output += padding + "Block Name: " + ((ReportBlock) boReportElement).getName() + "<BR>";
                            output += traverseReportBlock((ReportBlock) boReportElement, level+1);
                } else {
                            output += padding + boReportElement.getClass().getName() + "<BR>";
                for (int i=0; i<boReportElement.getReportElementCount(); i++) {
                            output += traverseReportElement(boReportElement.getReportElement(i), level+1);
                return output;
    String traverseReportBlock(ReportBlock boReportBlock, int level) {
                String output = "";
                String padding = getPadding(level);
                Representation boRepresentation = boReportBlock.getRepresentation();
                output += padding + "Block type is [" + boRepresentation.getClass().getName() + "].<BR>";
                if (boRepresentation instanceof SimpleTable) {
                            SimpleTable boSimpleTable = (SimpleTable) boRepresentation;
                            output += padding + "Processing SimpleTable...<BR>";
                            output += padding + "Block Header<BR>" + traverseCellMatrix(boSimpleTable.getHeader(null), level+1);
                            output += padding + "Block Body<BR>" + traverseCellMatrix(boSimpleTable.getBody(), level+1);
                            output += padding + "Block Footer<BR>" + traverseCellMatrix(boSimpleTable.getFooter(null), level+1);
                } else {
                            output += padding + "Unhandled Block Type...<BR>";
                return output;
    String traverseCellMatrix(CellMatrix boCellMatrix, int level) {
                String output = "";
                String padding = getPadding(level);
                if (boCellMatrix.getRowCount()>0) {
                            TableCell boTableCell = null;
                            for (int i=0; i<boCellMatrix.getColumnCount(); i++) {
                                        boTableCell = (TableCell) boCellMatrix.getCell(0, i);
                                        output += padding + "Column: " + i + " - " + boTableCell.getText() + " - ";
                                        output += getAlerters(boTableCell.getAlerters(), level+1);
                } else {
                            output += padding + "No Cells.<BR>";
                return output;
    String getAlerters(Alerters boAlerters, int level) {
                String output = "";
                String padding = getPadding(level);
                if (boAlerters.getCount()<=0) {
                            output += "No alerters.<BR>";
                } else {
                            output += "Alerters found!<BR>";
                            Alerter boAlerter = null;
                            for (int i=0; i<boAlerters.getCount(); i++) {
                                        boAlerter = boAlerters.getAlerter(i);
                                        output += padding + "<B>" + boAlerter.getName() + "</B><BR>";
                return output;
    String getPadding(int level) {
                String output = "";
                for (int i=0; i<level; i++) {
                            output += "     ";
                return output;
    Edited by: Dan Cuevas on May 25, 2009 9:45 PM

  • How to reset the iphone without using restriction passcode, how to reset the iphone without using restriction passcode

    The phone is showing restriction passcode on, but i have not set it and even after 15 attempts i could not get what this passcode is. I want to reset my phone as i have forget the Apple ID password and unable to reset again. please help

    Are you saying that not only do you not know the restrictions passcode, you also don't know the Apple ID/Password that was originally used to activate this phone?
    If so, you won't be able to do anything with that phone but look at it, & Apple can't/won't help you with this.

  • Multiple Layers Export in Clipping Mask (Without using Layer comp to files script)

    Man, Actually I am designer and create mobile case design. I have done mobile cover design preview in psd. so many layers created. Top layer-group Camera & button.  Second Layer-group different mobile  cover designs in clipping mask.. I want to export the preview (without using Layer comp to files). Means Single design to export without hiding the layers.... 30 design preview in single click....

    Mine don't even work.

  • How do I transfer music from one iPhone to the other without using a laptop and will I be billed?

    How do I transfer music from one iPhone to the other without using a laptop and will I be billed?

    Download Past Purchases
    http://support.apple.com/kb/HT2519
    Or do you mean this...
    Old Phone to New Phone
    http://support.apple.com/kb/HT2109
    Also...
    It should be Noted that anything Downloaded with a Particular Apple ID is tied to that Apple ID and Cannot be Merged or Transferred to a Different Apple ID

  • How to reference a class without using the new keyword

    I need to access some information from a class using the getter, but I don't want to use the new keyword because it will erase the information in the class. How can I reference the class without using the new keyword.
    ContactInfo c = new ContactInfo(); // problem is here because it erases the info in the class
    c.getFirstName();

    quedogf94 wrote:
    I need to access some information from a class using the getter, but I don't want to use the new keyword because it will erase the information in the class. How can I reference the class without using the new keyword.
    ContactInfo c = new ContactInfo(); // problem is here because it erases the info in the class
    c.getFirstName();No.
    Using new does not erase anything. There's nothing to erase. It's brand new. It creates a new instance, and whatever that constructor puts in there, is there. If you then change the contents of that instance, and you want to see them, you have to have maintained a reference to it somewhere, and access that instance's state through that reference.
    As already stated, you seem to be confused between class and instance, at the very least.
    Run this. Study the output carefully. Make sure you understand why you see what you do. Then, if you're still confused, try to rephrase your question in a way that makes some sense based on what you've observed.
    (And not that accessing a class (static) member through a reference, like foo1.getNumFoos() is syntactically legal, but is bad form, since it looks like you're accessing an instance (non-static) member. I do it here just for demonstration purposes.)
    public class Foo {
      private static int numFoos; // class variable
      private int x; // instance varaible
      public Foo(int x) {
        this.x = x;
        numFoos++;
      // class method
      public static int getNumFoos() {
        return numFoos;
      // instance method 
      public int getX() {
        return x;
      public static void main (String[] args) {
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ();
        Foo foo1 = new Foo(42);
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ("foo1.numFoos is " + foo1.getNumFoos ());
        System.out.println ("foo1.x is " + foo1.getX ());
        System.out.println ();
        Foo foo2 = new Foo(666);
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ("foo1.numFoos is " + foo1.getNumFoos ());
        System.out.println ("foo1.x is " + foo1.getX ());
        System.out.println ("foo2.numFoos is " + foo2.getNumFoos ());
        System.out.println ("foo2.x is " + foo2.getX ());
        System.out.println ();
    }

  • How do i install opensolaris without using the virtual box??

    hi.
    i am new to solaris
    i am currently using a windows XP OS
    i got down the opensolaris cd from SUN
    how do i install opensolaris without using a virtual box ?

    The OpenSolaris CD is a "Live CD". You can boot off of the CD, and either run the OpenSolaris operating system directly, or you can select the "Install" icon on the LiveCD desktop. You can find full instructions here: http://dlc.sun.com/osol/docs/content/IPS/getst1.html
    Do you want to keep your Windows OS on the disk? If so, then you want to follow the instructions for partitioning your disk (unless you already have a spare partition).
    -- Alan

Maybe you are looking for

  • File- rfc- soap- rfc

    Hi I have a scenario  File to rfc it has to update the rfc table & the same file request has to call soap after updating the rfc table & the response from soap has to update rfc again.... I have designed bpm 1)Receive step asyc to receive the file 2)

  • Unable to 'Verify Disk'...Needs Repair

    Good morning. I have a late 2008 MacBook Pro. About a month ago I installed Snow Leopard 10.6.3. After the install I noticed things running a little more sluggishly than Leopard 10.5.8. I went to verify the disk and noticed some needed repairs. See t

  • Rounding stroke thickness to nearest decimal?

    I have a project where many objects have been scaled up and down during the creation of the artwork. And I'm left with some lines that are .9581 pts and some that are 1.039 pts. Just because I'm a neat freak, is there a script that would round the st

  • Signature on the print checks

    hi folks, I have a question related to printing signature on the checks, I need to find how it is done, In the sap script under the signature window, I found the following code for the text elements, 'INCLUDE ZHEX-MACRO-PPC-SIGNATURE OBJECT TEXT ID S

  • PE 9;  is there a way to click and drag a clip to Organizer?

    Is there a way to click and drag a clip from the timeline or sceneline to the organizer to keep it intact and use l, or in another project?   Thanks.