Help understanding objects

I have a netclass object:
public class netclass {
          public String     net="x";
          public String     clineL="x";
          public String     Sxy="x";
          public String      Exy="x";
          public netclass ( String net, String clineL, String Sxy, String Exy) {
               this.net=net;
               this.clineL=clineL;
               this.Sxy=Sxy;
               this.Exy=Exy;
I want to create space for 1000 of these objects so I tried:
netclass[] N = new netclass[1000];
When I try to assign a value to the object :
N[0].net = "debug";
I get a null pointer exception.
I am trying to define a structure and then create an array of structures.
Any help would be great.

This is your problem.
N[0].net = "debug";
At this stage you have an array that has space for 1000 netclass objects, but doesn't actually contain any objects yet.
So before you try to set the "net" field of N[0], you actually have to create an object at N[0];
N[0] = new netclass(...);
Now N[0] contains a netclass object. the rest(1...999) are still null.

Similar Messages

  • I need help understanding how the Apple components integrate to create a system across all my devices?

    I need help understanding how the Apple components connect to create a whole system across all my devices?
    Is there a resource that describes current system and associated functionality?
    For example:
    Buy A, B, C to achieve "X" 
    You will need:
    an internet provider which supports <specs>
    add D to achieve "Y"
    You will need:
    an internet provider which supports <specs>
    add "E" to achieve "Z"
    You will need:
    an internet provider which supports <specs>
    For example, I am looking at the Gen 6 Airport extreme.  For intended performance do I need broadband? if so what are the specs, or will basic internet service suffice?  Do I need the internet provider's modem or does the Airport extreme replace that?  And then I think, if I am doing this, I should also look at Apple TV....What do I need and Why?  Then I look at the New Desk top coming out in the fall, and I think well, if I wait and get this, what does this component do for the system, and what becomes redundant? What does this awesome desktop do for my ability to sit and use a new macbook air when I travel  or sit on the couch in my PJs?
    If there was a place that plainly stated "if you buy the new dektop you can configure a system including only these components and achieve <this result> and by adding <additional components> you will achieve this result.
    I have been to the genius store a few times, but I come out of there more confused unless I have SPECIFIC questions or already know what to buy. 
    A "System Configuration App" would be a really great sales tool--Just saying.

    I have no idea what "fully optimized" means.
    No Apple device will let you watch broadcast TV. The Apple TV is a good option for watching streaming TV from iTunes, NetFlix and Hulu. If you want to watch from other sources, you may need to look at other devices.
    Any Mac computer or iPad will allow you to surf the web.
    What business software?
    Time Capsule is a good option for back ups.
    Update what across all devices?
    For accessing documents from all devices, a service like Dropbox is your best bet.
    I have no idea what "step as far away from an internet provider as possible" means. If you want Internet access, you need an Internet provider.
    Lighting fast speed for what? Processor? The specs are listed for all devices in the Online Store. Internet? We're back to the service provider.
    Technology changes. The only way to keep pace with it beyond a couple of years is to buy new stuff.
    The bottom line is you need to look at the specs for devices availble and at your budget and decide what best meets your needs. If you are unable to do that on your own, there are lot of technology consultants out there who will, for a fee, look at your exact situation, make recommendations and even handle the purchase and set up. Perhaps that would be the best route for you.
    Best of luck.

  • Guidelines to help center objects and text in pages

    Where are the guidelines to help centre objects and text in the new pages?

    well YMMV.  https://discussions.apple.com/thread/5472111?tstart=0
    You have to do it manually.  Also can be in the accomplished in the right hand column Format>Select your image>Arrange

  • Import finished with few errors...Help understanding it!

    Hi all,
    Yesterday, I finished to do an import in oracle. I used the impdp command and got few errors after the import was done. Here are some bits from my log. It was very long but I shortened it with the most common errors. I would appreciate your help understanding what does each error mean, and whether there's a solution available.
    Thanks!
    El sql que falla es:
    CREATE TABLESPACE "SYSAUX" DATAFILE SIZE 125829120 LOGGING ONLINE PERMANENT BLOCKSIZE 16384 EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT NOCOMPRESS SEGMENT SPACE MANAGEMENT AUTO
    ORA-39083: Fallo de creación del tipo de objeto TABLESPACE con el error:
    ORA-02236: nombre de archivo no válido
    El sql que falla es:
    CREATE TABLESPACE "IN_SGC_BD" DATAFILE '+DISKGROUP_BD/sgtc/datafile/rsgtc_in_sgt_bd1' SIZE 132120576 LOGGING ONLINE PERMANENT BLOCKSIZE 16384 EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT NOCOMPRESS SEGMENT SPACE MANAGEMENT MANUAL
    Procesando el tipo de objeto DATABASE_EXPORT/PASSWORD_VERIFY_FUNCTION
    ORA-31684: El tipo de objeto PASSWORD_VERIFY_FUNCTION ya existe
    Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/SEQUENCE/GRANT/OWNER_GRANT/OBJECT_GRANT
    ORA-39111: Se ha saltado el tipo de objeto dependiente OBJECT_GRANT:"SYSTEM", ya existe el tipo de objeto base SEQUENCE:"SYSTEM"."SDE_LOGFILE_LID_GEN"
    ORA-39083: Fallo de creación del tipo de objeto SYNONYM con el error:
    ORA-00995: falta el identificador de sinónimos o no es válido
    BEGIN
    dbms_resource_manager.create_consumer_group('AUTO_TASK_CONSUMER_GROUP','System maintenance task consumer group','ROUND-ROBIN');COMMIT; END;
    Procesando el tipo de objeto DATABASE_EXPORT/SYSTEM_PROCOBJACT/POST_SYSTEM_ACTIONS/PROCACT_SYSTEM
    ORA-39083: Fallo de creación del tipo de objeto PROCACT_SYSTEM con el error:
    ORA-29393: el usuario JAIMESP no existe o no está conectado
    El sql que falla es:
    BEGIN
    dbms_resource_manager.create_plan_directive('PLAN_DIA','SGTC_USR','',30,NULL,NULL,NULL,NULL,NULL,NULL,NULL,30,600,5,'SGTC_SWITCH',NULL,TRUE,NULL,10240,1800,900,1800);
    dbms_resource_manager.create_plan_directive('PLAN_DIA','SGTC_EDITOR','',40,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,600,10,'SGTC_SWITCH',NULL,TRUE,NULL,512000,1800,600,3600);
    dbms_r
    ORA-39083: Fallo de creación del tipo de objeto PROCACT_SYSTEM con el error:
    ORA-06550: línea 2, columna 72:
    PLS-00103: Se ha encontrado el símbolo "CHECK" cuando se esperaba uno de los siguientes:
    in like like2 like4 likec between member submultiset
    Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/TABLE/TABLE
    ORA-39151: La tabla "OUTLN"."OL$" existe. Todos los metadados dependientes y los datos se saltarán debido table_exists_action de saltar
    Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
    . . "SIGELEC"."SDE_BLK_37" 4.976 KB 0 filas importadas
    . . "SIGELEC"."SDE_BLK_38" 4.968 KB 0 filas importadas
    . . "SGC_BD"."BDE_CRECOBJE" 5.234 KB 0 filas importadas
    . . "SIGELEC"."D418" 4.851 KB 0 filas importadas
    . . "SYSTEM"."DBM_TOPSQL" 6.125 KB 0 filas importadas
    . . "SIGELEC"."F100" 5.562 KB 0 filas importadas
    . . "SIGELEC"."F101" 5.593 KB 0 filas importadas
    . . "SIGELEC"."F102" 14.77 KB 11 filas importadas
    Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/PROCEDURE/ALTER_PROCEDURE
    ORA-39082: El tipo de objeto ALTER_PROCEDURE:"SYSTEM"."GEN_ROLE_SGTC" se ha creado con advertencias de compilación
    ORA-39083: Fallo de creación del tipo de objeto PACKAGE_BODY con el error:
    ORA-04052: se ha producido un error al consultar el objeto remoto ENLACE.ELPQ_DATOPROY@CRE
    ORA-00604: se ha producido un error a nivel 4 de SQL recursivo
    ORA-12154: TNS:no se ha podido resolver el identificador de conexión especificado
    ORA-39082: El tipo de objeto TRIGGER:"SIGERED"."TR_CTRL_ENERGIZA" se ha creado con advertencias de compilación
    ORA-39083: Fallo de creación del tipo de objeto TRIGGER con el error:
    ORA-04052: se ha producido un error al consultar el objeto remoto ENLACE.ELPQ_DATOCONS@CRE
    ORA-00604: se ha producido un error a nivel 4 de SQL recursivo
    ORA-12154: TNS:no se ha podido resolver el identificador de conexión especificado
    El sql que falla es:
    ALTER TRIGGER "SIGERED"."TR_CTRL_ENERGIZA" COMPILE PLSQL_OPTIMIZE_LEVEL= 2 PLSQL_CODE_TYPE= INTERPRETED PLSCOPE_SETTINGS= 'IDENTIFIERS:NONE'
    ORA-39082: El tipo de objeto TRIGGER:"SIGERED"."TR_CTRL_CONCLUYE" se ha creado con advertencias de compilación
    El sql que falla es:
    BEGIN SYS.DBMS_IJOB.SUBMIT( JOB=> 165, LUSER=> 'SYSTEM', PUSER=> 'SYSTEM', CUSER=> 'SYSTEM', NEXT_DATE=> TO_DATE('2012-05-02 01:00:00', 'YYYY-MM-DD:HH24:MI:SS'), INTERVAL=> 'TRUNC(SYSDATE+1)+1/24', BROKEN=> FALSE, WHAT=> 'dbms_stats.gather_schema_stats(ownname => ''SIGERED'',options => ''GATHER'',estimate_percent => null,method_opt => ''FOR ALL COLUMNS SIZE 1'',cas
    ORA-39083: Fallo de creación del tipo de objeto JOB con el error:
    ORA-00001: restricción única (SYS.I_JOB_JOB) violada
    El sql que falla es:
    BEGIN SYS.DBMS_IJOB.SUBMIT( JOB=> 47, LUSER=> 'SIGERED', PUSER=> 'SIGERED', CUSER=> 'SIGERED', NEXT_DATE=> TO_DATE('2012-05-02 01:00:00', 'YYYY-MM-DD:HH24:MI:SS'), INTERVAL=> 'TRUNC(SYSDATE+1)+01/24', BROKEN=> FALSE, WHAT=> 'SIGERED.RDPQ_PROYECTOS.PR_PROCESAR;', NLSENV=> 'NLS_LANGUAGE=''AMERICAN'' NLS_TERRITORY=''AMERICA'' NLS_CURRENCY=''$'' NLS_ISO_CURRENCY=''AMERI
    Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/POST_SCHEMA/PROCACT_SCHEMA
    Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/PASSWORD_HISTORY
    ORA-39083: Fallo de creación del tipo de objeto PASSWORD_HISTORY con el error:
    ORA-01858: se ha encontrado un carácter no numérico donde se esperaba uno numérico
    El trabajo "SYS"."SYS_IMPORT_FULL_01" ha terminado con 2249 error(es) en 17:21:02

    Hello people,
    I just run for the second time a full import, and it said it finished correctly.
    The first time I run it, there was a message which said that the import had finished with 2249 errors (I checked my log and not all of them were errors but messages). I checked each single message and only had to solve a couple of things.
    I first created a user in response to an ora-29393: user string does not exist or is not logged on.
    The second thing I did was to run the utlrp.sql file in response to an ORA-39082. I did this according to this blog.
    I know oracle is taking precedence each time I run an import. I don’t know if what I have done is okay or perhaps not all data was imported after all. This is the thread which I posted initially when errors came out.
    Any reply is a supply.
    Thanks loads

  • Help understand how this works

    Hows everyone doing, i need some help understand this. This is my first time using Lulu. From the reviews i'v read about it they tell me this is the #1 place to come to to get my books printed. Here the question,  i have all 3 of my books ready to be uploaded do i just sent that in, then they send me the prints ? or so they self them for me. Sorry if this seems like a dumb question, but its my first time using this particular site.

    Here's a quick overview:
    You start the new book wizard. Click "Create," pick a book type and size (hardcover, paperback, etc.; 6x9, 8.5 x 11, etc.), and click "Make this book."
    Hint: If you want the widest distribution for your book, pick a size / type that has a green checkmark next to it.
    The wizard will guide you to name your book, apply an ISBN (or get a free one), upload your contents, and upload your cover or design a cover. It will guide you to set pricing and distribution, and many other options.
    When you've done all that, your book will be available to order. You will see two prices: the one you pay, and the one other people pay. The one you pay is the printing cost per book. It may be anywhere from $2.50 to $20.00 or more, depending on options you pick -- probably coser to the low end.
    On that first page, where it says "Create," there is a calculator that will figure roughly what your book will cost (printing costs), so you can plan your options around that calculator.
    So you order as many books as you want, pick shipping, pay with a credit card, and in a few days, the books are on your doorstep.
    I hope that helps.

  • Help understanding ABAP Proxies

    Can someone point me to documentation to help understand ABAP proxies?  What they are, why I would use them and what are the considerations in using them over BAPI's or IDOCS?  I had a recent discussion with someone who is choosing to not use them because of security considerations.

    Hi Rick,
    For ABAP proxy documentation refer...
    http://help.sap.com/saphelp_nw04/helpdata/en/ab/585f3c482a7331e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/14/555f3c482a7331e10000000a114084/content.htm
    For considerations in using proxy over BAPI's or IDOCS Refer...
    /people/ravikumar.allampallam/blog/2005/08/14/choose-the-right-adapter-to-integrate-with-sap-systems
    Regards
    Anand

  • F help for objects

    Hi all,
          can any body tell to get F4 help for object attributes in table controls.
      actually i got f4 help for object using SWO_DIALOG_OBJTYPE_VAL_REQUEST.
    like this i want function module to get f4 help for attributes.

    Hello,
    Please check the roles related to the below authorization object.
    Authorization Object  
    S_WFAR_OBJ          
    Value  
    NV          
    Value  
    VBRK          
    Value  
    YP3INVOICE          
    Value  
    03          
    archiving Related role will give you access to View the billing document in PDF.
    Thank you
    Regards
    Bala

  • Need some help understanding the way materialized views are applied through

    Hi, I need some help understanding the way materialized views are applied through adpatch.
    In patch 1, we have a mv with build mode immediate. When applying it PTS hang due to pool performance of mv refresh.
    So we provide patch 2, with that mv build mode deferred, hoping it'll go through. But patch 2 hang too on the same mv.
    How does this work? Is that because mv already exists in the database with build immediate, patch 2 will force it to refresh first before changing build mode? How to get over this?
    Thanks,
    Wei

    Hi Hussein,
    Thank you for the response.
    Application release is 11.5.10.
    Patch 1 is MSC11510: 8639586 ASCP ENGINE RUP#38 PATCH FOR 11.5.10 BRANCH
    Patch 2 is MSC11510: 9001833 APCC MSC_PHUB_CUSTOMERS_MV WORKER IS STUCK ON "DB FILE SEQUENTIAL READ" 12 HOURS
    The MV is APPS.MSC_PHUB_CUSTOMERS_MV
    This happens at customer environment but not reproducable in our internal environment, as our testing data is much smaller.
    Taking closer look in the logs, I saw actually when applying both patch 1 and patch 2, MV doesn't exist in the database. So seems my previous assumption is wrong. Still, strange that patch 2 contains only one file which is the MV.xdf, it took 7 hours and finally got killed.
    -- patch 1 log
    Materialized View Name is MSC_PHUB_CUSTOMERS_MV
    Materialized View does not exist in the target database
    Executing create Statement
    Create Statement is
    CREATE MATERIALIZED VIEW "APPS"."MSC_PHUB_CUSTOMERS_MV"
    ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 10 MAXTRANS 255 LOGGING
    STORAGE(INITIAL 4096 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 4 FREELIST GROUPS 4 BUFFER_POOL DEFAULT)
    TABLESPACE "APPS_TS_SUMMARY"
    BUILD IMMEDIATE
    USING INDEX
    REFRESH FORCE ON DEMAND
    WITH ROWID USING DEFAULT LOCAL ROLLBACK SEGMENT
    DISABLE QUERY REWRITE
    AS select distinct
    from
    dual
    AD Worker error:
    The above program failed. See the error messages listed
    above, if any, or see the log and output files for the program.
    Time when worker failed: Tue Feb 02 2010 10:01:46
    Manager says to quit.
    -- patch 2 log
    Materialized View Name is MSC_PHUB_CUSTOMERS_MV
    Materialized View does not exist in the target database
    Executing create Statement
    Create Statement is
    CREATE MATERIALIZED VIEW "APPS"."MSC_PHUB_CUSTOMERS_MV"
    ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 10 MAXTRANS 255 LOGGING
    STORAGE(INITIAL 4096 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 4 FREELIST GROUPS 4 BUFFER_POOL DEFAULT)
    TABLESPACE "APPS_TS_SUMMARY"
    BUILD DEFERRED
    USING INDEX
    REFRESH COMPLETE ON DEMAND
    WITH ROWID USING DEFAULT LOCAL ROLLBACK SEGMENT
    DISABLE QUERY REWRITE
    AS select distinct
    from dual
    Start time for statement above is Tue Feb 02 10:05:06 GMT 2010
    Exception occured ORA-00028: your session has been killed
    ORA-00028: your session has been killed
    ORA-06512: at "APPS.AD_MV", line 116
    ORA-06512: at "APPS.AD_MV", line 258
    ORA-06512: at line 1
    java.sql.SQLException: ORA-00028: your session has been killed
    ORA-00028: your session has been killed
    ORA-06512: at "APPS.AD_MV", line 116
    ORA-06512: at "APPS.AD_MV", line 258
    ORA-06512: at line 1
    Exception occured :No more data to read from socket
    AD Run Java Command is complete.
    Copyright (c) 2002 Oracle Corporation
    Redwood Shores, California, USA
    AD Java
    Version 11.5.0
    NOTE: You may not use this utility for custom development
    unless you have written permission from Oracle Corporation.
    AD Worker error:
    The above program failed. See the error messages listed
    above, if any, or see the log and output files for the program.
    Time when worker failed: Tue Feb 02 2010 19:51:27
    Start time for statement above is Tue Feb 02 12:44:52 GMT 2010
    End time for statement above is Tue Feb 02 19:51:29 GMT 2010
    Thanks,
    Wei

  • Trying to understand object oriented programming

    Hi all,
    I'm new to programming and I'm trying to learn C and Objective-C to eventually write an iPhone/iPad app.
    I want to make sure I'm understanding some fundamental Object Oriented principles and so I'm starting with a very basic program.
    I've produced a class called CartesianPoint which has an x and y variable plus methods to set and return these variables and also a method to calculate the magnitude from the origin.
    What I would like to do now is to extend the program to have a CartesianVector class.
    I'm a little unsure as to whether a Vector is a subclass of a Point or whether a Point is a subclass of a Vector... or neither?
    Secondly, I'm a little unsure of how to implement the vector class to use two point objects. How should the header and implementation files be set up to receive point objects from the main.m program?
    I'd like to also try and extend the program to include other ways of defining a vector (i.e. origin, unity vector and magnitude).... and then use the vectors to build 2D shapes.
    Many thanks,
    Glyn
    Message was edited by: GlynC
    Message was edited by: GlynC

    Hi Glyn -
    I agree with William and would vote for "neither". I see a subclass as a specialization of its superclass, not, for example, something contained by its superclass. A container relationship might apply to a subview and its superview, yet the class of the superview could be a specialization of the subview's class so the subview's class might be the parent of the superview's class. The classic example of cat as a subclass of animal (cat:animal) can be misleading if we see the relationship as member:group. Cat is a subclass of animal because it's a specialization.
    Also ask, "What's accomplished by making a subclass"? Does the subclass want to use all or most of the parent's instance variables and methods? Could the job be done any other way? Are any of those ways simpler or do they lead to more reusable code?
    One of the best examples (from the Cocoa docs?) is about a programmer who needs a specialized array. A newbie might immediately attempt a subclass of NSArray (a rather tricky subclassing job as it happens). In most cases however, the correct solution would be a class which includes an NSArray* type instance variable.
    Hope some of the above is helpful!
    \- Ray

  • Help with object oriented concepts

    I am a senior highschool student and although I know Java syntax, I learned with Pascal and other procedural languages so I have a difficult time thinking in OOP concepts (which I will have to learn for college classes). So for practice I went to my college's website and found an assignment on the intro course to programming: [Here are the assignment instructions.|http://www.cs.gsu.edu/knguyen/teaching/2009/spring/csc2010/proj.pdf]
    My question is, how can I make my program illustrate more object oriented concepts?
    Links:
    ode-help.110mb.com/javaproject.java_

    Just a few comments (not necessarily about OO and in no particular order):
    It's probably not worth it to make constants for the letter A or the plus sign. Make constants for values people would not understand:
    // Ok
    public static final int ANSWER_TO_THE_UNIVERSE = 42;'
    // Probably overkill
    public static final int FORTY_TWO = 42;
    Good job on having DecimalFormat as a regular instance variable rather than static (since it is not thread-safe)
    Good job initializing your object in a consistent state (via the ctor). Now, make as many variables final as you can. Immutable objects are good:[www.javapractices.com/topic/TopicAction.do?Id=29]
    Not sure why you declared repeat() to return the boxed version of boolean, just use a primitive
    You have a run() method but are not implementing Runnable. Not that it is required, but usually when I see run(), I think of threading
    This is a matter of style, but you don't need to name the arguments in the ctor differently than the instance variables that get assigned. You can very easily say:
    // Note that it is final.  Make things immutable when you can.
    private final String bar;
    public Foo(final String bar) {
       // Note:  I don't need a different name here.  This is purely a matter of personal style.
       this.bar = bar;
    Consider a while loop in run() rather than a do-loop. What happens if you get no input the first time around?
    Java naming conventions dictate that classes start with a capital letter. Generally, an underscore is not used, camel-case is. So, your class should be JavaProject.
    Consider making an object for the arguments that are passed into input. Maybe call it GradeCategory, or whatever.
    That new object GradeCategory can have the output() method.
    For method names, also follow conventions using camel case. So get_double should be getDouble().
    Consider reworking such that you use an array or a collection of GradeCategory. You might want to then have an add method in your JavaProject. The add method should ensure the total weight of grades does not exceed 100%.
    You can rework the output method of JavaProject to iterate over your GradeCategory objects, calling their own output() methods. Perhaps it also first checks that the weight of all grades equals 100%.Just a few thoughts.
    - Saish

  • Need help understanding an example in Flex 4 Language Reference: flash.data.sqlstatement

    I don't understand how to use the example in Flash Builder. I read the link concerning this, but it's still unclear.
    1) Is this example a single file, or should the class definition be separate? I ask because I don't see any import statements at all, which makes me wonder how it would work.
    2) does init() act as the automatic entry point for this code, or is this function called from some unseen event?
    3) does dbStatement.itemClass = Employee represent the link between the main app and the class file?
    I've been looking all over for a solution to my problem in that I have 8 or 10 querries to a sqlite db in my main application and I would really like to move each to their own file, but I don't understand how to reference them from the main app, or how to share the results with the main app. I was hoping this was what I'm looking for.
    // Employee class definition
    package
        public class Employee
            public var name:String;
            public var ssn:String;
            public var id:uint;
            public override function toString():String
                return "id: "+ id.toString() + " name: " + name + " ssn: " + ssn;
    // using the Employee class as SQLStatement.itemClass
    var conn:SQLConnection;
    var dbStatement:SQLStatement;
    function init():void
        conn = new SQLConnection();
        conn.addEventListener(SQLEvent.OPEN, connOpenHandler);
        dbStatement = new SQLStatement();
        dbStatement.sqlConnection = conn;
        dbStatement.text = "SELECT id, name, ssn FROM employees";
        dbStatement.itemClass = Employee;
        var dbFile:File = new File(File.separator + "employee.db");
        conn.open(dbFile);
    function connOpenHandler(event:SQLEvent):void
        dbStatement.addEventListener(SQLEvent.RESULT, resultHandler);
        dbStatement.execute();
    function resultHandler(event:SQLEvent):void
        var result:SQLResult = dbStatement.getResult();
        if (result != null)
            var emp:Employee;
            var numRows:int = result.data.length;
            for (var i:int = 0; i < numRows; i++)
                emp = result.data[i];
                trace(emp.toString());
    Thanks
    Kristin

    Hi Kristin,
    1020: Method marked override must override another method.
    -overridesObject.toString
    There is popular misconception among ActionScripters about toString() method - if one want to provide custom implementation method of super class "override" keyword is needed.
    But in case of Object "toString" is dynamic and it is attached at runtime negating the need of overriding - instead implementation is to be provided by developer so one is not created at runtime. So one needs to just write her own: toString():String method.
    Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, a subclass of Object implements function toString():String instead of using an override of the base class.
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Object.html#toString()
    hth,
    kind regards,
    Peter

  • Help understanding deadlock

    Hi all
    i need your help to find out what could lead to this deadlock
    Trace File (ora_orapd_2524.trc)
    *** 2006-07-11 12:45:58.484
    *** SERVICE NAME:(SYS$USERS) 2006-07-11 12:45:58.484
    *** SESSION ID:(326.278) 2006-07-11 12:45:58.484
    DEADLOCK DETECTED
    Current SQL statement for this session:
    INSERT INTO WFVIDA.DB_EVENTO_PROC (EP_EVT_ID, EP_PROC_ID) VALUES (:B2 , :B1 )
    ----- PL/SQL Call Stack -----
    object line object
    handle number name
    3FB31BB4 29 package body WFVIDA.RVIDA_EVENTO
    3DAB301C 1 anonymous block
    The following deadlock is not an ORACLE error. It is a
    deadlock due to user error in the design of an application
    or from issuing incorrect ad-hoc SQL. The following
    information may aid in determining the deadlock:
    Deadlock graph:
    ---------Blocker(s)-------- ---------Waiter(s)---------
    Resource Name process session holds waits process session holds waits
    TX-001e0028-00000814 68 326 X 70 266 X
    TX-00120005-0000452d 70 266 X 68 326 S
    session 326: DID 0001-0044-00000007     session 266: DID 0001-0046-00000002
    session 266: DID 0001-0046-00000002     session 326: DID 0001-0044-00000007
    Rows waited on:
    Session 266: obj - rowid = 0000C2D1 - AAAMLRAAQAAAmSpABd
    (dictionary objn - 49873, file - 16, block - 156841, slot - 93)
    Session 326: obj - rowid = 00017080 - AAAXCAAANAAABnUAAA
    (dictionary objn - 94336, file - 13, block - 6612, slot - 0)
    Information on the OTHER waiting sessions:
    Session 266:
    pid=70 serial=19 audsid=10641503 user: 59/<none>
    O/S info: user: oracle, term: unknown, ospid: , machine: bb-9ias
    program: JDBC Thin Client
    application name: JDBC Thin Client, hash value=0
    Current SQL Statement:
    UPDATE WF_ITEM_ACTIVITY_STATUSES SET ACTIVITY_STATUS = :B8 , ACTIVITY_RESULT_CODE = NVL(:B13 , ACTIVITY_RESULT_CODE), BEGIN_DATE = NVL(:B11 , BEGIN_DATE), END_DATE = NVL(:B12 , END_DATE), DUE_DATE = DECODE(:B11 , '', DUE_DATE, :B10 ), OUTBOUND_QUEUE_ID = :B9 , EXECUTION_TIME = DECODE(:B8 , :B7 , :B4 , :B6 , NVL(EXECUTION_TIME, :B4 ), :B5 , NVL(EXECUTION_TIME, :B4 ), EXECUTION_TIME) WHERE ITEM_TYPE = :B3 AND ITEM_KEY = :B2 AND PROCESS_ACTIVITY = :B1
    End of information on OTHER waiting sessions.
    ===================================================
    Object 49873 is table OWF_MGR. WF_ITEM_ACTIVITY_STATUSES
    Object 94336 is a Non-Unique, not Bitmap index called I_DB_CLIENTES on table WFVIDA.DB_CLIENTES
    Table WFVIDA.DB_EVENTO_PROC (the one session 326 is inserting in) has 2 references (Foreign Key) to the tables:
    WFVIDA.DB_EVENTO
    and
    WFVIDA.DB_PROCS_FILHO
    WFVIDA.DB_PROCS_FILHO references table DB_APOLICE wich refers to DB_PROCSPAI
    None of the tables in the database has Bitmap Indexes
    I cannot understand what is causing the deadlock
    Best Regards
    Rui Madaleno

    Hmm...this is a bit odd. One session is waiting on S mode the other on X mode. That's unusual.
    First off, both sessions are waiting on TX enqueues, so, forget about foreign keys. That's not your problem.
    The insert statement is waiting on 'S' mode, so, that means it's waiting cause there is a unique or primary key on the table, and the other session has already inserted but not committed a value which this session is now trying to insert.
    The update statement is waiting on 'X' mode. For an update, 'X' mode means simple row-level lock. So, there is a row that the session is trying to lock, that another session has already locked. So, this session waits on a TX enqueue in 'X' mode till the other session rolls back or commits.
    So, you've got two sessions. One session inserts into DB_EVENTO_PROC. The other session updates a row in WF_ITEM_ACTIVITY_STATUSES. Now, the first session attempts to update the same row in WF_ITEM_ACTIVITY_STATUSES that the second session just locked. It starts waiting on TX in 'X' mode. Now, the second session attempts to insert a row into DB_EVENTO_PROC with the same primary or unique key values as the first session already inserted. So, the second session starts waiting on TX in 'S' mode. Voila! Deadlock!
    So, that's what's happening here. If that's confusing, or doesn't make sense, here's a few more thoughts to ponder:
    - Are there triggers on tables? One or more of these DMLs caught in the deadlock may be coming from trigger code that you may not explicitly see in the code path.
    - You mentioned a non-unique index. Is there a unique or primary key constraint? Remember that unique and primary key constraints CAN be enforced by non-unique indexes.
    Hope that helps,
    -Mark

  • Need help understanding instanceof

    I understand that instanceof can be used to compare an object reference to see if it is of a particular class or interface. However, in creating the following test I was confounded as to why I would get the error I did. Can anyone help explain?
    class A implements Runnable {
       public void run() {
    class B extends A {
       public static void main(String args[]) {
          B barr[] = new B[5];
          if (barr instanceof B) System.out.println("barr is-a B");
          if (barr instanceof A) System.out.println("barr is-a A");
          if (barr instanceof Runnable) System.out.println("barr is-a Runnable");
          if (barr instanceof Object) System.out.println("barr is-a Object");
    }I got the following error while compiling:
    iof.java:10: inconvertible types
    found   : B[]
    required: B
          if (barr instanceof B) System.out.println("barr is-a B");
              ^
    iof.java:11: inconvertible types
    found   : B[]
    required: A
          if (barr instanceof A) System.out.println("barr is-a A");
              ^
    iof.java:12: inconvertible types
    found   : B[]
    required: java.lang.Runnable
          if (barr instanceof Runnable) System.out.println("barr is-a Runnable");
              ^
    3 errorsNow, shouldn't this be comparing the object being referenced (a B[] object) to the specified class/interface? Why would it complain? I know replacing barr with barr[0] will compile as it is comparing a specific object reference but why won't the array object refrence work?

    So, the comparison (barr instanceof A[]) will
    return true;Yeah, but the question is, why does "barr instanceof B" give a compile-time error. This surprised me also, as I thought you could put anything on both sides of instanceof (except primitives, and I guess not null on the right) and it would be fine.
    Change the declaration of barr to Object barr = new B[5]; and it will compile.
    Why?
    Well, I'm only guess here, but I imagine it's because, in your original code, the compiler knows that barr is a B[] (becuase that's what it's declared as), so it knows it can never be a B or an A. However, if you declare barr as an Object (or any superclass or superinterface of, say, A), then there is a possibility that barr could get a value that happens to refer to an A, and the compiler doesn't look at all the assignments, only the declared type.
    I bet if you look at instanceof in the JLS, it will tell you (in more precise language than I can) the the thing on the RHS has to be assigment-compatible to the thing on the LHS. (Or is it vice versa?)

  • Need help understanding a project please

    Hi, i just finished reading through this lab that i'm supposed to do, but have no idea what i am supposed to do. Could anyone here possibly help me understand it in an easier fashion? I would really appreciate it.
    Assignment:
    For this assignment, we will create a number class that can help us create classes for objects like clocks or angles. The number class will have to be general enough so that we can define different bases for it. Clocks need numbers of base 24 (or 12) and 60. Angles need numbers of base 360 and 60. For now, we are going to simplify things and only define constructors, a toString method, and an increment method. Of course, a complete number class would have many other methods, such as adding, subtracting, multiplying, comparing, and negating the numbers. Since a number is made up of digits, we will also define a digit class. The number and digit classes appear very similar because they have nearly the same methods. The differences are in the implementations of the methods.
    Write a number class that represents a number with a given base. The number class has two constructors. The default constructor sets the base at 10 and the value to 0. The other constructor accepts a decimal value and a base. The constructors will have to create all of the digits (as objects of the digit class) and store them in some kind of list. Create a toString method and an increment method. These two methods will use the corresponding methods of the digit class to do most of the work for them.
    Write a digit class that represents a single digit with a given base. The digit class has two constructors. The default constructor sets the base at 10 and the value to 0. The other constructor accepts a decimal value and a base. Create a toString method and an increment method. The increment method should return a boolean: true if there is a carry and false if not.
    For both classes, you can assume that the bases are restricted to binary, octal, decimal or hexadecimal and the values are non-negative.
    Instructions:
    Write a test driver that proves that your classes work.

    Myrdwin wrote:
    It's not that i didn't bother to ask him earlierSo, your teacher gave you the assignment, without giving you any opportunity to talk to him between when he assigned it and when it's due?
    I just finished the polymorphism lab with a bunch of farm animals last night. WHOAH! TMI!!! ;-)
    Am i just reading into the lesson to much and making it way more complicated than it actually is?Like I said, I'm not going to try to interpret the whole thing for you but a) It tells you what to do with the c'tors, and b) I would always assume that "create a method" or "define a method" or whatever he says means "create a *fully functional, correct* method", unless he explicitly states to leave it empty for now.
    My advice is to use your best judgment as to what's expected, and get started on that basis. At your first opportunity to speak to your teacher, explain your uncertainty and the assumptions you made.
    If you have specific questions along the way, post them here, along with your code or an SSCCE.
    When you post code, use the CODE button or [code] and [/code] tags to preserve formatting and make your code readable.
    Edited by: jverd on Oct 3, 2008 11:57 AM

  • Need Help Understanding EJB 3.0

    Hi,
    I am a bit of a novice when it comes to EJB 3.0 and I'm trying to make some sense out this interesting new approach to developing EJBs.
    Could anybody help me answer the following?
    1. Is an entity (as per the new Java Persistence API) the same as an entity bean (as per the EJB 3.0 specification)?
    2. Does an entity become an entity bean if run inside an EJB container?
    3. Does the EJB 3.0 specification define entity beans or are they supported only as part of the EJB 2.1 support required for any EJB 3.0 container?
    4. Would it be right to say that a bean in the EJB 3.0 sense is designed to run in an EJB container although it can be tested outside of it, whereas an entity will run inside or outside a container and behaves the same reagardless of where it is running from (i.e. does not become an EJB as a result of running inside a container)?
    5. It is my understanding entities (JPA) are not part of the EJB 3.0 specification. If this is correct why are they beeing referred to as entity beans instead of entities to clarify the difference? Is this simply a case of loosely used terminology?
    Thanks.
    Eric.
    Edited by: ericy on Feb 28, 2008 12:37 AM
    Edited by: ericy on Feb 28, 2008 12:41 AM

    You seem to be confusing EJB3 JPA with EJB2 EntityBeans.
    EJB2 had EntityBeans which were complex persistent objects that had complex rules such as having a Home, PrimaryKey, Local, Remote and Bean class. They had no standard persistence mapping.
    EJB3 simplified things greatly by replacing (entirely) the EntityBean model with JPA. JPA is part of EJB3, and EJB2 EntityBeans no longer exist, other than for backward compatibility sakes (the same as EJB1 EntityBeans still exist in the spec). JPA provides POJO (plain old java object) persistence, so has no complex requirement of the persistent classes.
    Persistent objects in JPA are called Entities (not EntityBeans), so there in lies your confusion.
    JPA supports persistence both inside a JavaEE, and in JSE and any other Java environment. Inside the server the JPA entities can be "managed", this just means that the JPA EntityManager is integrated with JTA, so follows its lifecycle. You can also use JPA in a non-managed mode inside a JEE server. Outside of JEE, JPA is always non-managed and has its own transaction API.
    see,
    http://en.wikibooks.org/wiki/Java_Persistence/What_is_JPA%3F
    for more info.
    -- James : http://www.eclipselink.org

Maybe you are looking for

  • Trying to programmatically set the data-source for a Crystal reports report.

    I've got the following existing procedure that I need to add to in order to programmatically set the data-source (server, database, username, and password) for a Crystal reports report.  I added the connectionInfo parts, but can’t figure out how to a

  • Installation Problem Developer 6i/Oracle 8/Windows NT4 Please help.

    Hi, I am trying to install Oracle Developer 6i and Oracle 8 under Windows NT platform. I had several kind of problem. Atlast I found the installation tips very help and followed it step by step. Still I am facing the problem. Let me explain what i di

  • About interfact mapping.

    can anybody tell me! how many types interface mapping according to the mode of both interface? sync 2 async sync 2 sync async 2 async async 2 sync the case above must be appeared? please describe them respectively via each concrete scenario! thanks a

  • Problem in stubbing out Soap Web Service

    Hi, I have a problem stubbing out a SOAP web service in Flash Builder 4.  The problem is that not all the classes are created.  This happens when a base class is referenced by a method in the schema.  The classes that extends the base class do not ge

  • Can't connect to Configuration Manager Service manager

    So after a failed upgrade to R2, I've had to restore the database as the R2 upgrade corrupted the DB. I am now working though the minefield of component errors. However I can't connect to the configuration manager service manager, I get this error: E