Using Resultsets in Oracle without being Proprietary

Suns tutorial path for returning resultsets from stored procedures indicates that the following should work...
CallableStatement cs = con.prepareCall("{call SHOW_SUPPLIERS}");
ResultSet rs = cs.executeQuery();
Thats if you build your stored procedure something like this ...
String createProcedure = "create procedure SHOW_SUPPLIERS " + "as " + "select SUPPLIERS.SUP_NAME, COFFEES.COF_NAME " + "from SUPPLIERS, COFFEES " + "where SUPPLIERS.SUP_ID = COFFEES.SUP_ID " + "order by SUP_NAME";
We are using oracle 8.1.6. However I've been told that with oracle procedures when you return a result set from a called procedure you return a p_cursor variable. Somthing like this
(p_cursor in out SHOW_SUPPLIERS.SHOCurTyp)
is
begin
open p_cursor for
select * from suppliers
In which case the above mentioned sun code doesn't work.
We want to use jdbc to call a stored procedure that returns a resultset that does not require us to import any proprietary oracle objects...
Is there another way to write these stored procedures, rather than using this cursor construct? Are we missing something in the way we invoke them?
null

Note the following remarks that prefix the sample code you quote from JavaSoft:
As previously stated, the syntax for defining a stored procedure is different for each DBMS. For example, some use begin . . . end or other keywords to indicate the beginning and ending of the procedure definition. In some DBMSs, the following SQL statement creates a stored procedure: [sample code]
In the future a good bet for writing stored procedures in a portable way will be to use ANSI SQLJ part 1 specification. (Unfortunately, at this point in time Oracle supports only the functionality of SQLJ part 1 but not yet the syntax.)
In the meantime, you may want to apply good old encapsulation to abstract away each vendors' specific SQL syntax and JDBC usage.
One more note: putting queries into stored procedures and returning them as ref cursors (rather than executing them at the top level) will decrease your query performance.

Similar Messages

  • When I open a pdf file, after a few seconds, it hides the toolbar and I don't know how to get it back.  I use multiple monitors and, without being able to grab the toolbar, I am unable to move the pdf file to a different monitor.  How do I stop this?

    When I open a pdf file, after a few seconds, it hides the toolbar and I don't know how to get it back.  I use multiple monitors and, without being able to grab the toolbar, I am unable to move the pdf file to a different monitor.  How do I stop this?

    Does Firefox switch to full screen if you press F11 ?
    You can also try the F10 key to see if that brings up the menu bar.
    * If the above steps didn't help then see http://kb.mozillazine.org/Corrupt_localstore.rdf
    Note: Do not delete localstore.rdf in the program folder (Windows: "C:\Program Files\Mozilla Firefox\defaults\profile\") (Mac: "/Applications/Firefox.app/defaults/profile/")

  • Can Time Capsule be used just for backups -- without being connected to a wireless network?

    I have a second-generation Time Capsule that I no longer need as a wireless router. However, I'd like it to wirelessly (and automatically) backup our family's iMac and MacBook Pro. Is that possible? 

    Thanks very much, Bob and LaPastenague,
    I ended up replacing the wireless Netgear Router (which Time Warner installed last May) with my older (second-generation) Time Capsule -- and it works flawlessly.
    I guess I was afraid that since it's a few years old that it wouldn't work -- or work as well, as the new Netgear wireless router.
    In fact it works better - the range is much better. And the issue my new iMac had, of losing connection with the network (though the little wifi icon never indicated it had in fact dropped) has evaporated.
    Thanks for the help! Just shows that Apple rocks in every way.

  • HT201250 can a time capsule be used as just a backup for data without being connected to a home network?

    This is the explanation for my my question about whether a time capsule can be used as a backup without being connected to a network.  I had to disconnect my time capsule when I upgraded my landline to a wireless home phone in order to go to a wireless security system that would work with my 2WIRE router. The time capsule blocked the usage of my camera on my security system, not allowing the camera to connect to the 2WIRE router. Once I disconnected the time capsule,  the camera was able to connect wirelessly to the 2WIRE.

    Welcome to Apple Support Communities
    See > https://discussions.apple.com/message/16717724#16717724
    As you can read, you can do what you want. You just have to set up the Time Capsule network in AirPort Utility without connecting it to the router and ignoring the messages, and connect to the Time Capsule network. You will have to switch between the Time Capsule and the other router's networks

  • Using the TimeCapsule disk without internet

    Hi!
    We have a wireless setup with the main provider being an Airport Extreme (connected to the router) and and Airport Express (n) that extends the signal. We have however also a 1TB timecapsule directly connected to two different macs. Can we use the Timecapsule disk without being connected to the wireless spot (airport extreme). In some cases the Airport Extreme goes down and doing so it also drags the TC downs with it. We just want to use the TC as a shared disk connected to two/three computers via the ethernet ports on the TC. How can we do this? When we turn of the wireless the TC disk does not show up and the TC goes yellow...Im posting a screenshot (Norwegian). Hope someone understands what we are trying to achieve:
    http://bildr.no/view/311772
    Many thanks in advance!
    Tom - Norway

    I think you can just go to the wireless tab and turn it off in wireless mode. It should continue to work fine over ethernet. You won't be able to control it from a wireless computer then unless you have the ethernet tied to one of your other ports.
    Here's what I would do. Set up the TC in "bridge" mode. This way, all ports then become ethernet switch ports (no WAN-LAN) function. Turn the wifi off. Then connect an ethernet cable from the Airport Extreme BS to the TC. Then you'll be able to see the TC from any wireless connected computer but if the WiFi network goes down then you'll be OK.

  • Can I use the Airport Time Capsule Wirelessly without being connected to my router/mac by ethernet?

    Hey
    I've recently bought a 3TB Airport Time Capsule, with the sole intention of being able to perform wireless backups.
    Is it possible to perform these wireless backups without being connected by ethernet to my modem/existing router?  I don't want to use the time capsule as a replacement for my existing router (at this stage) - just for wireless backups of my Macs.
    If this is not possible, or practicable, are there other alternatives that I should explore? (non-cloud)
    Thanks in advance
    Steven
    PS
    Boring background:
    I'm in a rental property with a woefully inadequate number of plugs in practical places. In addition there is only one phone socket. The result being insufficient safe space to have the existing router, and the Airport TC along with the existing electrical items.

    Unfortunately, Apple designed the Time Capsule to connect to a modem or modem/router using an Ethernet connection.
    If you do this, you do have the option of turning off the wireless on the Time Capsule and using your existing wireless for backups. Backups will be automatic this way, in the background. The Time Capsule could be located anywhere an Ethernet cable will reach.....up to 300+ feet or about 100 meters.
    The other option.....not recommended and not convenient at all.....is to set up the Time Capsule......without an Ethernet connection and then have the Time Capsule provide a wireless network that would not have Internet access.
    So, when you wanted to back up, you would have to manually "switch" to the Time Capsule network for that process, then once the backup was done, manually "switch" back again to your normal wireless network for normal operations.  A real mess, not to mention the possibility of wireless interference between the networks that may create other issues.

  • How to get resultset from oracle procedure use ejb3

    how to get resultset from oracle procedure use ejb3
    i know oracle procedure should like this
    Create or replace PROCEDURE resultset_test(
    aaa IN NUMBER,
    bbb OUT sys_refcursor) ....
    but what s the ejb3 scripts looks like? please give me an example or link~
    ths

    - there are no EJB3 scripts, only compiled application code
    - the part of the EJB spec that deals with databases is called the Java Persistence API, but likely you are just looking for the JDBC API.
    Now you should know what to Google to get your "example script": "java jdbc oracle procedure"

  • Can anyone please help? Every time I start up my imac OSX 10.6 desktop my Aperture 3 programme opens up without being requested. Is it possible to stop this from happening and only open by using the desktop icon? Thank you for any assistance.

    Can anyone please help? Every time I start up my imac OSX 10.6 desktop my Aperture 3 programme opens up without being requested. Is it possible to stop this happening and only allow Aperture to open by using the desktop icon? Thank you for any assistance anyone may be able to give.
    Best regards, John.

    because there is absolutely no mention in my System Preferences of either Users & Groups nor Start Up Items.
    John,
    William's solution was much easier - just for completeness sake: The preferences panes to edit your startup items moved between the Mac OS X updates: I forgot that the "Users&Groups" preference pane used to be called "Users" in Mac OS X 10.6; it is the panel that you use to create new User accounts; and earlier systems had a separate preferences panel "Login" to enable and to disable the applications that are launched at login. Both are now combined in "Users&Groups". Sorry for sending you on a wild goose chase with the wrong Preferences panel.
    Regards
    Léonie

  • How fast text search field in Oracle without using Intermedia?

    How fast text search field in Oracle without using Intermedia? Thank you, Paul.

    yes,it is overriden in VOImpl
    public void executeQuery()
            setQuery((new StringBuilder()).append(selectStmt).append(" order by ").append(getOrderByClause()).toString());
            OAApplicationModuleImpl oaapplicationmoduleimpl = (OAApplicationModuleImpl)getApplicationModule();
            OAApplicationModuleImpl _tmp = oaapplicationmoduleimpl;
            if(oaapplicationmoduleimpl.isLoggingEnabled(1))
                OAApplicationModuleImpl _tmp1 = oaapplicationmoduleimpl;
                oaapplicationmoduleimpl.writeDiagnostics((new StringBuilder()).append(getClass().getName()).append(".executeQuery").toString(), (new StringBuilder()).append(" Query:").append(getQuery()).toString(), 1);
            super.executeQuery();
    But I have extended VO and substituted the VO . In the substituted VOImpl, instead of executeQuery(),I have written
    public void customExecuteQuery()
              setQuery((new StringBuilder()).append(selectStmt).append(" order by ").append(getOrderByClause()).toString());
              executeQuery();
    Will this work,or do I need to do any changes?
    Thanks,

  • Can I use indesign without being online

    can I use indesign without being online.

    Creative Cloud aplications are installed on and run from your computer. You must have an internet connection to activate, and CC will "phone home" periodically to verify that your subscription is valid, but otherwise no network connecton is required. If CC is unable to make a connection to verify subscription status you should still have 30 days grace period to work.
    As far as the file being too large, I'm not a Publisher user so I don't know haow it handles images, but the correct method in InDesign would be to Place the images which creates a link to the original of only a few bytes in the file, and it would not be unusual to have a document with hundreds of pages and hundreds of linked photos.

  • Can I use my Leopard (OS 10.5.8) to write a downloaded Windows file to a cd without being able to read the file?

    Can I use my Leopard (OS 10.5.8) to write a downloaded Windows file to a cd without being able to read the file?

    Thanks, Zombaby.
    I was trying to drag and drop the file out of the download file instead of where the actual file was stored.
    This it doesn't do.
    All these little twists between the brain and  success. 
    Thanks again.
    ghopper

  • I'm using my new imac and now my safari is redirecting me to a russian search engine which is "yandex.ru" !! I can only enter a few websites without being redirected... !!! is that a virus and if yes how can I delete it and get! Do I have to have AV !

    I'm using my new imac and now my safari is redirecting me to a russian search engine which is "yandex.ru" !! I can only enter a few websites without being redirected... !!! is that a virus and if yes how can I delete it and get! Do I have to have Anti virus !
    Please help me ASAP!
    Thanks
    Dee

    safari is redirecting me
    Dee....
    It's not a virus.
    Your ISP (Internet Service Provider) is redirecting your browser. Use Open DNS to avoid that. Open DNS adds security and anti phishing filters and it's free.
    Open System Preferences / Preferences then select the Network tab. Click the Advanced tab then click the DNS tab.
    Click +
    Enter these numbers exactly as you see them here.
    208.67.222.222
    Click +
    208.67.220.220
    Then click OK.
    More about OpenDNS here.
    Topic : Manually provided DNS server addresses are higher priority than DHCP's
    http://www.opendns.com/newsletter

  • How to reset the iphone without being able to use the screen?

    how to reset the iphone without being able to use the screen?

    What do you mean by reset?
    Reset: Hold the Sleep/Wake and Home buttons and don’t let go until the screen goes dark and the Apple logo appears (no data will be lost)
    or wipe and restore?

  • How to reset the iphone without being able to use the screen or the sleep and awake button?

    how to reset the iphone without being able to use the screen or the sleep and awake button?

    Hey einsoccerstar,
    Thanks for the question. You can restore your iPhone in recovery mode utilizing the home button:
    If you can't update or restore your iPhone, iPad, or iPod touch
    http://support.apple.com/kb/ht1808
    Thanks,
    Matt M.

  • HT201303 using a new computer, and cannot download music without being able to answer security questions.  Is there a way to reset these or get the answers sent to you for one's security questions.

    using a new computer, and cannot download music without being able to answer security questions.  Is there a way to reset these or get the answers sent to you for one's security questions.

    If you have a rescue email address set up on your account then you can try going to https://appleid.apple.com/ and click 'Manage your Apple ID' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you might see an option to send security question reset info to your rescue email address.
    If you don't have a rescue email address set up then go to Express Lane  and select 'iTunes' from the list of 'products' in the middle of the screen.
    Then select 'iTunes Store', and on the next screen select 'Account Management'
    Next choose 'iTunes Store Account Security' and fill in that you'd like your security questions/answers reset.
    You should get an email reply within, I think, about 24 to 48 hours (and check your Spam folder as well as your Inbox)

Maybe you are looking for

  • How do I add an effect to a SmartShape on hover?

    How do I add an effect to a smartshape on hover. For example, I've created a green rectangle which is a smartshape and is being used as a button. I have two instances of this button on a slide and am trying to do the following: 1) SmartShape A (Green

  • Problems printing PSD from Photoshop CS4

    My questions are: Does the PSD file have the printer information encoded? Also why has this just started to show up? My wife has work successfully under the same conditions, files moved and printed on different printers, with no problems in the past.

  • How can replace IF condition for a Select query in my reports?

    IF s_bukrs-LOW = '4312' OR s_bukrs-LOW = '4313' OR s_bukrs-LOW = '4349'  . ELSEIF s_bukrs-LOW = '4310' OR s_bukrs-LOW = '4311' OR s_bukrs-LOW = '4587'. ENDIF. What if I want to use select query in place of IF condition, in my report for a Z -table in

  • Vast Apple Conspiracy! (iPod Not Working When Formatted for Windows)

    Alright, I know this isn't the place to make the claim of an Apple conspiracy, but as a mac user who proudly has an apple sticker on his car who has experienced the events below first hand - I feel there is only one explanation one can come to. VAST

  • DW cs6 flash swf nobroder embed cropping

    I have a bottom cropping issue with a swf embed "noborder" which from what I understand according the specs is an issue when using noborder. I'm wondering if anyone knows of a work around or perhaps the problem is between the keyboard and chair. I've