Got confused!! MDSYS.SDO_WITHIN_DISTANCE (8.1.7),

I used the following query to select GID whose GEOM is within some distance from a point, circle, polygon and rectangle. It works well in 8.1.6 version.
When I upgrade from 8.1.6 to 8.1.7, only rectangle one works and other shapes end with a message of "ORA-03113: end-of-file on communication channel"(disconnected with my lovely orcale:(
(1)Select lines within some distance from A Rectangle(works both in 8.1.6 and 8.1.7)
SELECT L.LINE_ID
FROM LINE L
WHERE
MDSYS.SDO_WITHIN_DISTANCE(L.Geom, mdsys.sdo_geometry(2003,NULL,NULL, mdsys.sdo_elem_info_array(1,1003,3), mdsys.sdo_ordinate_array(1,5,8,15),'distance = 1') = 'TRUE';
(2) Select lines within some distance from a Polygon.(ONLY works in 8.1.6)
SELECT L.LINE_ID
FROM LINE L
WHERE
MDSYS.SDO_WITHIN_DISTANCE(L.Geom,MDSYS.SDO_GEOMETRY(2003, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 2), MDSYS.SDO_ORDINATE_ARRAY(1,3,1,1,4,1, 4,4, 1,3)),'distance =1') = 'TRUE';
(3) Select lins within some distance from a point.(ONLY work in 8.1.6)
SELECT L.LINE_ID
FROM LINE L
WHERE
SDO_WITHIN_DISTANCE(L.Geom,mdsys.sdo_geometry(2001,NULL,NULL,
mdsys.sdo_elem_info_array(1,1,1),
mdsys.sdo_ordinate_array(3,3)),'distance =1') = 'TRUE';
(4) Select lines within some distance from a Cirlce(ONLY works in 8.1.6)
SELECT L.LINE_ID
FROM LINE L
WHERE
MDSYS.SDO_WITHIN_DISTANCE(L.Geom,MDSYS.SDO_GEOMETRY(2003, NULL, NULL,
MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 4),
MDSYS.SDO_ORDINATE_ARRAY(1,3, 2,1, 3,3)),'distance = 0.01') = 'TRUE';
Anyhelp?
Thanks in advance!
Jerry.
null

Thank you, Dave.
It is good to know 8.1.7 have SRID work.
I think it is also safe to stay that field 'NULL' if we don't want to use these new coordinate system functions.
We check the error 'ORA-03113:end of file..' and find it is likely related to an R-tree index bug. After runniing the 8.1.7 patch, the problem is sloved.
Someone also saw that problem happened in sdo_relate statement several days ago.
Thanks for your help.
Jerry
null

Similar Messages

  • Why does firefox hang up and say it "got confused", when I try to switch from using facebook as myself to using facebook as a page I manage?

    firefox hangs up and says it "got confused", when I try to switch from using facebook as myself to using facebook as a page I manage.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")
    In Firefox 4 you can use one of these to start in <u>[[Safe mode]]</u>:
    * Help > Restart with Add-ons Disabled
    * Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows)
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Hi there, I got confused... which product is most suitable for me to use and i urgently have to send the file to someone. Please give me an advice.

    Hi there, i got confused.. which product is most suitable for me to use. Please advise.

    Hi hanachan1,
    If you're looking to send and track files, then Adobe Send is a great way to go. For more information, please see Send Large Files Easily - Select, Send, & Confirm & Track| Adobe Send
    Best,
    Sara

  • Error with MDSYS.SDO_WITHIN_DISTANCE

    Hi all,
    i'm trying to retrieve all the geometries in one table whose coordenates are around a point within a certaing distance. I'm using this spatial operator: MDSYS.SDO_WITHIN_DISTANCE. The table is a table with a spatial column that contains Point geometries and a correct index.
    I think there is something wrong in the sintax of my query:
    This is my query:
    SELECT ID,KBT_CODE,OBJECTCODE,PLS_ID,PRECISIE_LOCATIE
    FROM ROP_PUNTEN WHERE MDSYS.SDO_WITHIN_DISTANCE(LOCATIE
    ,MDSYS.SDO_GEOMETRY(2001,90112,MDSYS.SDO_POINT_TYPE(NULL,NULL,NULL),MDSYS.SDO_ELEM_INFO_ARRAY(1,1001,1),MDSYS.SDO_ORDINATE_ARRAY(157318.4730528, 553203.0114006))
    ,'distance=2 querytype=FILTER layer_gtype=POINT') = 'TRUE';
    this is the error i get:
    ERROR at line 1:
    ORA-29902: error in executing ODCIIndexStart() routine
    ORA-13011: value is out of range
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 84
    ORA-06512: at line 1
    I've tried with other query, this one:
    SELECT ID,OBJECTCODE,PLS_ID,PRECISIE_LOCATIE FROM (select * from rop_punten)
    WHERE (MDSYS.SDO_WITHIN_DISTANCE
    (LOCATIE,MDSYS.SDO_GEOMETRY(2001,90112,MDSYS.SDO_POINT_TYPE(157318.4730528,553203.0114006,NULL),NULL,NULL) ,'distance=35.5 querytype=FILTER layer_gtype=POINT') = 'TRUE');
    with this the error i get is worse, cos i'm not further connected to the DB.
    Any ideas?
    thank you,
    Laura.
    null

    Hi,
    Try changing:
    MDSYS.SDO_ELEM_INFO_ARRAY(1,1001,1)
    to:
    MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1)
    as far as I know, there is no element type of 1001.
    Hope this helps,
    dan

  • Got confused by Runtime.gc()

    Hi,
    if Runtime.gc() only suggests that JVM does garbage collection
    rather than guarantee that garbage collection will happen,
    what's the point of making this method? i mean, even if i don't
    have such a method in my program, garbage collection will
    be done sometime when JVM deems appropriate. On the other hand,
    even if i include this method in my program, i still can't
    guarantee it will happen. so why do i need this method after
    all?
    eileen2

    hi eileen,
    the garbage collection is somewhat confusing, that's right. There is really no guarantee, the gc will start, if you say. But it always depends on the implementation of the vm. Some vm's ignores the command, some do it rapidly.
    Normally the gc has time-intervalls in which it will start, for example every 5 msecs's or it starts if it comes near to "Out of memory". But you can restart it, if you know, you will construct a real big object, which needs much memory or stack. in this case(while creating) the gc will not run and is not able to see, if you have enough memory).
    The guarantee is really never given, but if you invoke it, a normal vm (not so m$) will start the gc. In the most cases this is not really useful, because the most vm has very short gc-intervalls.
    Here is a case, where it is very useful to invoke gc:
    Create a very, very long string (about 5.000.000 characters) and do some things with this string(splitting, reversing, substrings, ...) and do this with and without gc. Stop the time You need for a complete run of all your operations and you will see.
    Christian

  • I just got  new screen put on my 13in macbook pro when i opend it up there is no data on it? how do i get my data back

    I just got to school after getting a new screen put on my 13in macbook pro. when i opend up my macbook there was only a apple simble and the loading sing with a bar at the botton it took fovere to load, one it loaded and opend up there was a few options to pic from saying i could get all my datata back, i got confused and called the tec support where they wanted me to spend 90$ to back up my data, i feel as if they fixed my screen my data should be there when i go on it. I am a broke colage studend and need to get my work done. To sum it all up How do i get all my data back that happend to get lost while my screen was being repaird at the apple store?

    Apple has a 90 warranty warranty on all of their repairs.  You should take your computer back to the repair shop.  Or call Apple Customer Relations (800) 767-2775.  Wait for a human to come on the line and ask politely and firmly that you want to be transferred over to the Customer Relations department.  Tell them your issue.
    pakoning wrote:
    I am a broke colage studend
    Hard to believe with all the typos in your post!

  • TS1702 I downloaded from the Apps.store a game named 'Ninja Run'. When I was playing this game, I got out and then received a message,'"Do you want to buy 5 revivals for Rs.170/-?". When I clicked the "Buy"

    I downloaded from the Apps.store a game named,"Ninja Run". When I was plkaying the game, I got out and a message appeared, asking me whether I would like to buy 5 revivals for Rs.170/-. When I hit the,"Buy"button, I was asked to confirm my Credit card details. I confirmed it and was asked to enter the Security Code. When I did so,, a message appeared telling me that the Security Code was invalid and the purchase could not be completed. When I continued the game and got out again, the message appeared again asking me whether I wanted to buy. Thinking that my purchase was not completed, I again hit the,"Buy" button. Nothing happened. I continued the game and when I got out, I received the same message and obliged accordingly. This went on for three or more times. By this time,however I got confused and quit the game. All these things happened on 6th September 2013. The next day,I was shocked to see 5 receipts from the Apple Apps.store in the In Box of my email account,each for Rs.170/-
    totalling Rs850/. Worse still, when I played the game the next day and got out and asked for a revival, would you believe it, I was again asked whether I would like to buy 5 revivals for Rs.170/-.
    Thus,I ended up buying a game for Rs.850/- while the actual price is only Rs.170/-,and not even able to play the full game.
    Could anyone please tell me whether I can get a refund of Rs.680/-,the extra amount I  paid for this game.
    I will be much thankful to anyone who can guide me and help me claim the refund. Thank everyone.

    For customer service issues, go here...
    https://expresslane.apple.com/Issues.action

  • My Macbook Pro (15" early 2011) got blue screen every i normally booted it. It only can enter the OS when it's in safe boot. Solution please.

    My Macbook Pro (15" early 2011, Mountain Lion, but after reinstall i change it to snow leo) got blue screen every i normally booted it. It enter the OS only when it's in safe boot.
    I've tried any solution that i got from the internet, such as:
    -Reinstalling the OS X (normal install & clean install)
    -Reset PRAM and SMC
    -Repair Disk Permissions and Repair Disk from Disk Utility (the result is OK. There's no problem)
    -Repair Disk Permissions manually (with Command + S at the beginning of booting)
    -Checking Hardware from Application Installer DVD (result is OK)
    -Checking from Mac Resource Inspector/MRI (result OK)
    -Booting from Recovery Disk is same problem, blue screen
    All of that solution is not working. My Macbook still got light blue screen and sometimes blue screen with lines after apple logo and spinning wheel is shown.
    HDD is in good condition because when it's checked on the other macbook it can be booted. But if you must know, other HDD can't be booted when its plugged to my macbook (blue screen again). If i do safe booting, it works but can't play video and music also photobooth. I got confused with this case.
    Any solution or comment? Thank you very much by the way

    Hi. I'm not trying to rush things, you may have a different problem, but your issue looks quite familiar to me. I recently had a problem with the discrete graphics card (the Radeon GPU) due to overheating, all because a faulty application of the thermal compound in the factory.
    In my case, the problem started slowly and intermittently, a few days after a gaming session (Quake 3) of about three hours (at the moment, I didn't realized that could be linked to the problem).
    This issue is being actively discussed in another threads in this forum, but so far there's enough evidence that it's been causing similar problems for 2011 MBPs owners: screen corruption, black/blue screens, and in some cases, a total inability to boot. Some of the threads I'm talking about:
    https://discussions.apple.com/message/13150366#13150366
    https://discussions.apple.com/message/21110132#21110132
    So far, and since the problem seems to affect only the discrete GPU (that's why you can boot in safe mode) a possible solution is to disable it by removing some extensions which prevent OS X from loading the Radeon drivers. This post describing the process (there are different files involved depending of your GPU version, so make sure you are moving the right ones):
    https://discussions.apple.com/message/22521574#22521574
    In the case your discrete GPU survived and is not permanently damaged, I personally had success by changing the thermal compound myself, which completely fixed the problem (at least for now). I've posted about it here:
    https://discussions.apple.com/message/22630561#22630561
    I hope you can find a solution, believe me I know the feeling when you see your expensive machine turning into a brick and it *****.
    Good luck!

  • Secure Link for iTunes store failed... Got anything?

    Every time I try to open up iTunes store, it wouldn't open. I ran the diagnostics report and it said the ( for first time ) that "Secure link for iTunes store failed". The second time I ran it, just to make sure, said that "secure link for iTunes store is successful. I got confused. So I copied the successful report for you guys to see if there's a problem. **NOTE** I never had or downloaded Norton, or Proxyserver, I even checked to see if it was on the computer. I have Windows Firewall, and Verizon Security, and my computer is a Window's 7. Here's the successful report of the diagnostics so you techies out there could figure what the problem is:
    Microsoft Windows Vista Home Premium Edition Service Pack 2 (Build 6002) Gateway GM5472 iTunes 10.4.1.10 QuickTime 7.7 FairPlay 1.12.20 Apple Application Support 2.0.1 iPod Updater Library 10.0d2 CD Driver 2.2.0.1 CD Driver DLL 2.1.1.1 Apple Mobile Device 3.4.1.2 Apple Mobile Device Driver 1.57.0.0 Bonjour 3.0.0.2 (333.2) Gracenote SDK 1.9.1.485 Gracenote MusicID 1.9.1.102 Gracenote Submit 1.9.1.133 Gracenote DSP 1.9.1.43  iTunes Serial Number 002AB3A80C24F3E8  Current user is not an administrator. The current local date and time is 2011-09-23 15:44:30. iTunes is not running in safe mode. WebKit accelerated compositing is enabled. HDCP is not supported. Core Media is supported.  Video Display Information  NVIDIA, NVIDIA GeForce 6150SE nForce 430    **** External Plug-ins Information ****  No external plug-ins installed.  Genius ID: 65223df73745471fc22c8ff8db2564bf  iPodService 10.4.1.10 is currently running. iTunesHelper 10.4.1.10 is currently running. Apple Mobile Device service 3.3.0.0 is currently running.  **** Network Connectivity Tests ****  Network Adapter Information  Adapter Name:     {B6520BEA-A816-49F2-892A-F840F59F28D0} Description:     Marvell Yukon 88E8039 PCI-E Fast Ethernet Controller IP Address:     192.168.1.2 Subnet Mask:     255.255.255.0 Default Gateway:     192.168.1.1 DHCP Enabled:     Yes DHCP Server:     192.168.1.1 Lease Obtained:     Fri Sep 23 13:00:09 2011  Lease Expires:     Sat Sep 24 13:00:09 2011  DNS Servers:     192.168.1.1  Active Connection:     LAN Connection Connected:     Yes Online:          Yes Using Modem:     No Using LAN:     Yes Using Proxy:     No SSL 3.0 Support:     Enabled TLS 1.0 Support:     Disabled  Firewall Information  Windows Firewall is off.  Connection attempt to Apple web site was successful. Connection attempt to browsing iTunes Store was successful. Connection attempt to purchasing from iTunes Store was successful. Connection attempt to iPhone activation server was successful. Connection attempt to firmware update server was successful. Connection attempt to Gracenote server was successful. Last successful iTunes Store access was 2011-09-23 15:36:29.     Sooooo, help please? Thanks!

    I have the same problem and I'm beyond frustrated. I just want iTunes 10.5 to work properly so I can download iOS 5 to my iPad. I've uninstalled, rebooted, and reinstalled iTunes (and all other apple programs) a dozen times.  I've uninstalled Norton since I read that might be causing the block. I've checked my firewall and have done a "flush". I'm out of ideas!!!

  • Flat file as a source - now more confused then before.

    Sorry to open this topic again - i just got confused to what needs to be done (i did read all of the posts on previous topic - honest!) got confused to who did what and how it needs to be done. it's hard to be stupid sometimes :(
    here is what i have:
    OWB server (target + runtime repository) = RHEL 4
    Source (the location of the flat files) = shared drive/folder on Windows
    OWB client (my machine) = Windows (unfortunatelly)
    I followed the steps described in
    http://download-uk.oracle.com/docs/cd/B31080_01/doc/owb.102/b28223/def_flatfiles.htm#CHDHBECD
    created samba mount point from OWB server to the Source files:
    /mnt/folderA/folderB/source_file.txt
    mapped shared drive from the source onto my machine
    Z:/folderA/loderB
    created location for the flat files in OWB:
    TEST_LOCATION = \\windows\folderA\folderB\
    imported flat files into OWB (had to go through the sample)
    created the map 'TARGETLOAD' - simple load the data from the flat file into the table
    validation produced the following message:
    VDL-2398: No data file specified. Generated code will use the sampled file name and the file location 'TEST_LOCATION'
    --which is fine isn't it? it should be using this file in that location
    generation went OK.
    deployment produced this error:
    SQL*Loader-500: Unable to open file (/u01/app/oracle/product/10.2.0/owb_1/owb/bin/unix/\windowsfolderAfolderBTARGETLOAD.ctl)
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    i checked this directory - there are 2 files there that were created by OWB:
    \\windows\folderA\folderB\TARGETLOAD.ctl
    \windowsfolderAfolderBTARGETLOAD.log
    Could anyone please enlighten me on what is going on? What do i have to change/amend/edit/tweak in order to solve this? all i want is to be able to load the data from flat file on the source windows box into the table in OWB server.
    Any help/thoughts would be greatly appreciated.

    Hi GB
    Thank you very much for your reply.
    I cannot use external tables - my superiors decided agains it, so i am lambered with external files (even jedi mind trick didn't work!).
    What i do is import external files from windows box. The location is specified as \\windows\forlderA\folderB
    --Mount the drive onto unix then register the files location as the unix path.
    i have a samba mount point from unix box to this windows location. But what i can't do is to select is as a location. i even tried to mapping this mount point onto windows box, so that it looks like \\unix\mnt\folderA\folderB - and of cause when i execute - i get the same error.
    I even tried configuring the sql loader (right click on map and select configure -- create), but i cannot do it even that way. coz everytime i try to create - OWB automatically assigns windows path to it.
    IT told me to let them know what i need and they will create it (map the drive etc) the problem is - i can't think of how to do it! and i do not have a priveleges to start 'trying things out'... well they say if i break their security one more time -i am in trouble!
    I know it sounds sad, but could you please let me know what i need to have/to do in order to make it work.
    Hope you do not mind my request and thank you very much for all your kind help and advise
    Kind Regards
    Vix

  • Result of sdo_within_distance

    Hello everyone,
    I use following select to get the shortest distance from a point to different geometry objects in a table:
    SELECT /*+ ORDERED INDEX( p SK_2006_SPA_SX */
    sdo_geom.sdo_distance(p.geom, center.geom, 0.5, 'unit=METER') distanceToReferencePoint
    FROM protection_area.sk_2006_spa p,
    (SELECT SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(19.427215576171875, 48.815730794270834, NULL), NULL, NULL) geom FROM dual) center
    WHERE MDSYS.SDO_WITHIN_DISTANCE( p.geom, center.geom, 'distance=2000 unit=METER') = 'TRUE'
    ORDER BY distanceToReferencePoint
    The distance is set to 2000 meter, but the resultset shows 2999,78 meter?
    How can be the result greater than 2000 meter?
    The geom object that failed has an 2004 gtype - other objects works correctly.
    Thanks for your help,
    Matthias
    Message was edited by:
    Matthias Reining
    P.S. I use Oracle 10.2.01.0 running on RedHat

    Hi,
    This post helped me a lot once.
    Re: SDO_WITHIN_DISTANCE
    Hope it helps,
    Luiz

  • ODI - Confusion Continues.! Details About Connectivity Required

    Hi ,
    I clearly Explain my Queries in ODI ............( to be frank I got confused now ...... )
    1.I have my ODI installed.
    2. Source : Oracle ( different Server present in a diff Location).
    Target : Oracle which I have in my same server where ODI is installed.
    3. I have created 2 schemas for Master and Work Repository in my Target Oracle DB.
    4. Then I created an Master Repository.
    In this Step whether I need to give the Username and Password as
    My schema name and password which I have created for my Master Repository or Should I need to give User name and password of my Database.
    While creating the Work repository whether I need to give Schema user name and Password or Database User name and password......
    Because When I was trying it was showing successful connection for both.........KINDLY CLARIFY.
    5. Then In Topology after successful creation of master and work repo..........
    While defining.....
    While mentioning the Database connections (Master Repository)
    Which User name password I need to give...........
    Is it ....Schema User and Password of the Master Repository or Database(source) user and password......
    6. And For Designer when we r first creating ........
    Which User name password we need to give...........
    Is it ....Schema User and Password of the Master Repository......
    7.Regarding Dataserver Creations
    I tried creating a Dataserver in Oracle Technology .....In the Definition Tab it has username and Password....
    Which User and Password I shud give...?
    Whether I shud give Source schema user name and password......orelse just the source Database user and password....
    8. Physical Schema for the Dataserve..........
    In the Definition Tab it has...
    Schema(Schema) : In this whether I shud give Schema name of my Master Repository.
    Schema(work) : Whether I need to give Work repo schema Name.
    9. ODIPARAMS FILE CONFIGURATION:
    set ODI_SECU_DRIVER=? ( Driver Name of the Master Repository)
    set ODI_SECU_URL=? ( URL of the Master Repo)
    set ODI_SECU_USER=sa ( What shud I need to give )....Master Schema User Name:
    set ODI_SECU_ENCODED_PASS=
    set ODI_SECU_WORK_REP=? ( Is it work repo Name)
    set ODI_USER=SUPERVISOR
    set ODI_ENCODED_PASS=LELKIELGLJMDLKMGHEHJDBGBGFDGGH
    10. Can I use Local Agent to run all my interfaces........always ....during data migration is it rite ..........
    First Exp in installing and configuring ...............Thats why these many questions I got
    Kindly anyone clarify ............................
    Thanks
    AK

    Hi Cezar,
    Thanks Cezar....for ur comments
    I am jus Explaining:
    If run thru an Local agent ......it does not take any details from ODIPARAM file correct.......
    It jus runs like a DEMO......
    So whenever I want to run a Package or Interface........I shud Launch my agent then run thru that agent .........
    For this case ........I need to mention all the Parameter in ODI PARAMS file
    Am I correct ..............
    Thanks
    AK

  • Polymorphism , Dynamic Binding, Widening and I'm totally confused

    class Fruit
         private String name;
         public String getName()
              return this.name;
    class Apple extends Fruit
         private String typeOfApple;
         public void setTypeOfApple(String type)
              this.typeOfApple=type;
         public String getTypeOfApple()
              return this.typeOfApple;
    class Banana extends Fruit
         private String typeOfBanana;
         public void setTypeOfBanana(String type)
              this.typeOfBanana=type;
         public String getTypeOfBanana()
              return this.typeOfBanana;
    public class ExceptionTesting
         public static void main(String args[])
              Fruit obj=new Apple();
              obj.setTypeOfApple();  // ??? Why can't I do this ???
    }how can I achieve something like underneath by modifying above code ???
    Fruit whateverFruit=new Apple();
    whateverFruit.setTypeOfApple();
    whateverFruit=new Banana();
    whateverFruit.setTypeOfBanana();
    whateverFruit=new Orange();
    whateverFruit.setTypeOfOrange();
    ...

    Harry_lynn_17 wrote:
    I do apologize if it's become sound like stupid or something . I know somehow it's not very suitable to think in that way but I was just thinking of the object reference variable as a pointer becauseA reference is like a "filtered" pointer to an object: it will only show that part of the object that corresponds with the type of the reference. So after "Fruit whatever = new Banana();", the "whatever" reference only shows the "Fruit" part of the "Banana" object. This means you can only call methods that are defined in Fruit, not those defined in Banana.
    Dynamic binding means the JVM will decide at runtime which method implementation to invoke based on the class of the object. So, I thought
    Fruit whateverFruit=new Banana(); and then if i tried to invoke whateverFruit.yellowBanana(); then the compiler will try to find the method out and executed automatically.That's not what it means. It means when you have "Fruit whatever = new Banana()" and you call "whatever.getName()", it will call the getName() method from Banana, if Banana overrides the implementation of Fruit. You can still only use methods that are defined in Fruit through a reference of type Fruit. In this case, it doesn't seem that the behaviour of setTypeOfApple() is different from setTypeOfBanana(), so ejp's recommendation to just create a setType() method in Fruit is correct.
    Polymorphism means a variable of a superclass type to hold a reference to an object whose class is the superclass or any of its subclasses. So, I thought Fruit whateverFruit is somehow capable to hold the reference of its subclasses and can be used to reference of its subclasses. That's basically correct. However, the variable will only expose the superclass part of the subclass object.
    I got confused with all those stuff and kinda lost. There's one more thing. What's the point of doing something like this Fruit apple=new Apple() if I can't reference to an instance of apple object ?? I mean I could just simply write like this Fruit aFruit=new Fruit(). Sorry, if i've become sound like a fool but i'm really confused. Please help me out of this and thanks in advance.The point of having any superclass/subclass combo is that your problem domain demands that you make the distinction: sometimes you need to be able to treat an object as Fruit, sometimes you need to be specific and treat it like an Apple. For example, if you sell fruit and need to calculate the total price of a fruit basket, all you need to know is that each piece of Fruit has a getPrice(), you don't need to know that one piece is an Apple and another piece is a Banana. However, if a customer demands a kilogram of apples, you need to make sure you give him only Apples and not Banana's.List<Fruit> fruitBasket = new ArrayList<Fruit>();
    fruitBasket.add(new Apple("Granny Smith"));
    fruitBasket.add(new Banana("Chiquita"));
    fruitBasket.add(new Apple("Golden Delicious"));
    int priceOfBasket = 0;
    for(Fruit pieceOfFruit:fruitBasket) {
      priceOfBasket += pieceOfFruit.getPrice();
    Set<Apple> appleScale = new HashSet<Apple>();
    appleScale.add(new Apple("Granny Smith"));
    appleScale.add(new Apple("Golden Delicious"));
    appleScale.add(new Banana("Chiquita")); // ERROR

  • J2EE confusion in EJB Docu example!

    I installed the j2ee beta and following the track in the documentation to learn EJB. the sample works fine. But after observing the interfaces and EJB class, I got confused by the following facts:
    1. the EJB class ConverterEJB does not 'implements' the remote interface Converter, although it does implement the two methods defined in that interface: dollarToYen() and yenToEuro()
    Q: then who 'implements' Converter?
    2. EJB Home ConvertEJB defines a single method create(),
    Q: where is it implemented.
    I can imagine sth between the EJB and its container must be doing sth, but it seems very foggy for me.
    Can any expert clarify this a little bit?
    thank you
    Benjamin

    Each session bean has a home interface, a remote interface and an implementation class.
    In your case, that is probably ...
    ConverterEJBHome is the home interface - it defines all the create() methods that can be used to establish the bean
    ConvertEJBSession is the remote interface that defines all the methods on the bean that the client can call
    ConverterEJBBean is the implementation class which contains all the create() methods and all the remote methods

  • Final Cut Studio Academic Version - confused buyer.

    Hello,
    I am about to buy Final Cut Studio 2 using the Academic Discount Program. I know that by purchasing the academic version I will not be able to upgrade. When I access the page (viewing it as a student) where I can see the different types of "Pro Design" softwares that I can buy, I see two "Final Cut Studio 2". One is Final Cut Studio 2 and the other one is Final Cut Studio 2 Academic. Both cost the same $699. When I select Final Cut Studio 2 it does not say that this is an upgrade version.
    I'm afraid of selecting the one that does NOT have the word Academic because it might be an upgrade version even though it doesn't say.
    Help!
    Thank you...
    A humble confused customer....

    Hi DH,
    Thanks for your response. I would easily get the one that says academic, but if I have the option of buying the non-academic version for the same price as the academic I rather buy the non-academic one. I am confused because the website does not say that the non-academic one is an upgrade version, but when I called 1-800-MY-APPLE, the guy told me that is an upgrade version. I told him the website does not say it is and that is why I got confused.
    Thanks again...

Maybe you are looking for

  • Can't Edit AutoCAD Drawings (Error 1415)

    I like to copy AutoCAD drawings directly from AutoCAD model space and paste them into Visio.  Usually I can edit the drawing in AutoCAD by double clicking on the drawing in Visio.  However, certain drawings keep giving me the "1415" error stating tha

  • Removing my itunes account from a laptop

    I have an iBook 12in which, now that I have upgraded to a new Macbook, I wish to sell. However, how do I remove all of my itunes account details, etc. so that anyone who buys my old Mac won't have access to my account details (I know you still need t

  • Multiple annotations found at this line, the method  ......

    There, I got an error when I used sql tag lib. Error Message: Multiple annotations found at this line, the method getStartdate() is undefined for the type map. Before, I used JSTL 1.0, it worked fine, after I upgraded it to 1.1, I got the problem. An

  • WSDL Published to Managed Instances (Changes Values)

    It appears that when you create a WSDL resource within ALSB, the WSDL that is viewable through the managed instance is different from the WSDL that exists on the ALSB. For instance, when I register a WSDL with the following port: <s0:service name="fo

  • Open PDF with Bookmarks pane open?

    Is there any way you can set up a PDF so that the document automatically opens with the Bookmarks pane open? Thank you, A.