CallableStatement Woes

Hello all...hopefully someone out here can square me away.
I recall being able to pass an array of Strings to a stored procedure via CallableStatement's setObject method (inherited) at one point in my career (just over a year ago). At the time, the shop I was working for used SQLServer on the backend and a driver from inet. Now I'm at an Oracle shop and it seems like I can't get away with the same syntax (using a 9i driver)...
Ideally, I'd like to be able to write something along the lines of...
CallableStatement cst = conn.prepareCall("{call mypackage.proc(?)}");
cst.setObject(1, new String[] {"foo", "bar"});
cst.execute();
The first requirement is that I be able to use setObject to pass an array into PL/SQL. I can do this with Oracle-specific code but the purist in me won't have it.
The second requirement is that the size of that array be flexible. I'm up for bending on proprietary-ness here.
When I try to pull this off today, I'm told that I'm passing in the wrong type - I believe PL/SQL is expecting a VARRAY. That could be right, it could be wrong...I'm looking for any sort of feedback as to how to pull this off with Oracle on the backend.
Thanks guys/girls.

Just curious, what was the SQL Server type of the parameter?
Alin,
The jTDS Project.

Similar Messages

  • Continual Mac woes (no question, just a rant)

    It's Tuesday, and I am having terrible problems with my Mac. But then, why should Tuesday be different from any other day of the week.
    Here is a typical day for me. The computer appears to be working OK. I need to watch a DVD for my work. I turn on DVD player, and put one in. The machine can't read the disc. It clicks and whirls, but the icon does not show up on the desktop. Meanwhile, so distressed is the machine that it freaks out. What was up until now was a fluidly operating machine suddenly reverts back to its old ways (i.e., its ways of two days ago). The hold ups and spinning pinwheels begin to eat of hours of my work day. (Remember the old days when computers made life easier?) The machine becomes sticky, gummy. Oh, I can move the curser and it seems to work for a second but then gets stuck in the dock, which explodes in icons and then freezes for five minutes. Yes. Five minutes.
    Would love to use Force Quit, but the cursor is spinning, and nothing is responding. Funny about that old Mac. You can't force quit Force Quit. I guess I need to leave it open all the time.
    Of course, FQ usually works on Safari. I have never just "quit" Safari. It always requires Force Quit, otherwise I can't turn off my computer. It stalls shut down.
    Now I have a DVD trapped in there and can't get it out. [But I just got an answer from another posting.]
    In the old macs, there used to be a pin hole you could stick a needle into ... can't find one on my flatpanel iMac.
    I bought my Apple flat panel iMac in August of 2002. Yes, I know that that is a long time to have a computer, but I am not rich nor attached to a corporation that can splurge on computers. The first weekend I had the machine, I had three kernal panics.
    Among the other problems I have documented are the following: the dock hiding itself unbidden and other features checking and unchecking themselves (Aug 2002); bus errors connected with OS 9 (Sept); some problems that inspired the tech person (Eric)) to talk me through deleting my user i.d., resulting in the loss of two months worth of e-mail (Thursday, 12 September); Preview problems (September); a bizarre box with an unmovable and undeletable red stop sign in it that no tech person or other Mac user I know had ever hear of (Monday 30 September); printing problems; computer won't shut down, numerous disconnection errors, which turned out to be caused by an OS X update (beginning December, 2002, or later); Kernel panics (Feb); computer won't shut down (March); Faxstexx problems, program won't allow me to set it up, finally just deleted the software (April); keys like "V" freeze and repeat endlessly (May 21); DVD Player freezes (May); Safari and Mail begin quitting unexpectedly (May); cursor begins to blink and fade out, plus odd sounds come out of the speakers, a constant error beeping (Sept 9); DVD Player problems (Oct 4).
    I called AppleCare while I had it about once a week (the total between August 2002 and the time it ran out was about 155 calls). Naturally, some of these calls are motivated by user error. On the other hand, many of the issues I have called about were unprecedented as far as the Tech person was concerned, such as the blinking mouse, the red stop sign, and the DVD Player woes.
    Things improved with Panther, but in Tiger many of the same old issues have returned.
    I have been having so many problems with my Mac that I once wrote a letter to the company asking when do I qualify for a new replacement machine. I never received an answer, but I felt better for about a day. Then I turned on my Mac again.

    The spinning ball of death as we used to call it is often caused by a lack of RAM, it is hard to be sure as I am not working on your machine, but sometimes things can be improved with additional RAM, it makes it seem like a whole new computer.
    A lot of your problems sound like stuff that can be fixed easily enough, and although frustrating things happen here and there with updates. It sounds like you are in fairly good spirits with it all, I would suggest just researching a bit more into maintenance you can do to help maintain the computer and educate yourself a bit more (sounds like you already have learned quite a bit along the way) and you will find a lot of these issues take you a few seconds to rid yourself of. I would start by making sure you are repairing permissions regularly and running the most up to date software. If a lot of problems persist, try creating a second user that is a "test" user to see if the problem is replicated on that user (don't delete your other one, but if you do find the problem not on the other user, you might have a corrupt user, however you don't have to lose all your emails there are plenty of ways to back it up and import it in, or even just bring the entire Mail folder from your library over to the new user). Another thing you can do if you find a lot of system problems is archive and install the OS, it takes a bit of time, but doing it overnight shouldn't be an issue, and you won't lose any of your stuff.

  • Unable to execute an update statement using CallableStatement

    Hi there,
    I'm trying to run an update statement from JUnit using java.sql.CallableStatement and oracle.jbo.server.DBTransaction.
            String updateSql =
                "update footable set barcol=TO_DATE('12-SEP-09','dd-MM-yy') where bazcol = 505";
            try {
                statement =
                        applnModule.getDBTransaction().createCallableStatement(updateSql,
                                                                               2);
                int executeUpdate = statement.executeUpdate();
                AppsLogger.write(this,
                                 "# records UPDATED ------------------>" + executeUpdate,
                                 AppsLogger.SEVERE);
            } catch (SQLException s) {
                s.printStackTrace();
                Assert.fail("Encountered SQL Exception: " + s);
            } finally {
                try {
                    if (statement != null)
                        statement.close();
                } catch (SQLException s) {
            }Below is the exception I get when I run the above code. There is no problem with the SQL - it works fine from SQLDeveloper.
    java.lang.AssertionError: Encountered SQL Exception: java.sql.SQLDataException: ORA-01858: a non-numeric character was found where a numeric was expected
         org.junit.Assert.fail(Assert.java:91)
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:597)
         org.junit.internal.runners.TestMethod.invoke(TestMethod.java:66)
         org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:105)
         org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:86)
         org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:94)
         org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:84)
         org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49)
         oracle.apps.common.applicationsTestFramework.junit.internal.AtfJUnit4JTestCaseClassRunner.invokeTestMethod(AtfJUnit4JTestCaseClassRunner.java:362)
         oracle.apps.common.applicationsTestFramework.junit.internal.AtfJUnit4JTestCaseClassRunner.runMethods(AtfJUnit4JTestCaseClassRunner.java:272)
         oracle.apps.common.applicationsTestFramework.junit.internal.AtfJUnit4JTestCaseClassRunner$1.run(AtfJUnit4JTestCaseClassRunner.java:265)
         org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34)
         org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44)
         oracle.apps.common.applicationsTestFramework.junit.internal.AtfJUnit4JTestCaseClassRunner.run(AtfJUnit4JTestCaseClassRunner.java:262)Edited by: 911023 on Oct 2, 2012 11:28 AM
    Edited by: 911023 on Oct 2, 2012 11:30 AM

    Using case statement.
    UPDATE gor_gold_post
       SET hoov_flag = CASE WHEN TRUNC (ADD_MONTHS (rec.loyalty_date, rec.loyalty_period) - SYSDATE) < 304
                                   OR
                                   (TRUNC (ADD_MONTHS (rec.loyalty_date, rec.loyalty_period) - SYSDATE) IS NULL
                                AND (SYSDATE - TO_DATE (rec.contract_date, 'YYYYMMDD')) > 91.2)
                           THEN 1
                           ELSE 99
                         END,
           b49n      = CASE WHEN TRUNC (ADD_MONTHS (rec.loyalty_date, rec.loyalty_period) - SYSDATE) < 121.6
                             OR
                             (TRUNC (ADD_MONTHS (rec.loyalty_date, rec.loyalty_period) - SYSDATE) IS NULL
                                AND (SYSDATE - TO_DATE (rec.contract_date, 'YYYYMMDD')) > 91.2)
                           THEN 1
                           ELSE 99
                         END
    WHERE tariff_code IN (169, 135, 136);Note: Code not tested.

  • CallableStatament for selection stored procedure

    hello,
    i write a jsp page where there are inputs. when i click on a button i want to search elements in my sql server database. to do that, i call a stored procedure :
    CREATE PROCEDURE PS_ELTS
    @param0 VARCHAR(40),
    @param1 VARCHAR(10),
    @param2 VARCHAR(6),
    @param3 VARCHAR(6),
    @param4 VARCHAR(40)
    AS
    SELECT ELTS.NAME,
    ELTS.TEL,
    ELTS.ADR1,
    ELTS.ADR2,
    ELTS.SERV
    FROM ELTS
    WHERE (ELTS.NAME LIKE @param0 OR @param0 IS NULL)
    AND (ELTS.TEL LIKE @param1 OR @param1 IS NULL)
    AND (ELTS.ADR1 LIKE @param2 OR @param2 IS NULL)
    AND (ELTS.ADR2 LIKE @param3 OR @param3 IS NULL)
    AND (ELTS.SERV LIKE @param4 OR @param4 IS NULL)
    ORDER BY ELTS.NAME, ELTS.TEL
    i have a java class elts as business object. in the class, there is a method search which takes an elts event, connects to the database and gets elements which are ok. if all parameters are null, i get every lines of ELTS table. it's ok. if one or more of the parametre is not null, i don't get any line. this is the method :
    public void search(UtilBean bean) throws Exception {
    int i = 0;
    Class.forName(driver);
    Connection connection = DriverManager.getConnection(url, login, password);
    if (connection != null) {
    connectionOk = true;
    this.setNAME(beanrecherche.getNAME());
    this.setTEL(beanrecherche.getTEL());
    this.setADR1(beanrecherche.getADR1());
    this.setADR2(beanrecherche.getADR2());
    this.setSERV(beanrecherche.getSERV());
    String aProc = "{call PS_ELTS(?,?,?,?,?)}";
    CallableStatement aStatement = connection.prepareCall(aProc);
    aStatement.setString(1, fmt_sqlChaineLike(this.getNAME()));
    aStatement.setString(2, fmt_sqlChaineLike(this.getTEL()));
    aStatement.setString(3, fmt_sqlChaineLike(this.getADR1()));
    aStatement.setString(4, fmt_sqlChaineLike(this.getADR2()));
    aStatement.setString(5, fmt_sqlChaineLike(this.getSERV()));
    aStatement.execute();
    ResultSet rs = aStatement.getResultSet();
    while (rs.next()) {
         i++;
    UtilBean util = new UtilBean();
    util.setNAME(rs.getString("NAME"));
    util.setTEL(rs.getString("TEL"));
    util.setADR1(rs.getString("ADR1"));
    util.setADR2(rs.getString("ADR2"));
    util.setSERV(rs.getString("SERV"));
    listUtil.add(util);
    do i do something wrong ? is there a solution to this problem ?

    i found what's wrong. in my stored procedure, i defined parameters like this :
    @param0 VARCHAR(40),
    @param1 VARCHAR(10),
    @param2 VARCHAR(6),
    @param3 VARCHAR(6),
    @param4 VARCHAR(40)
    when i use :
    aStatement.setString(1, this.getNAME());
    java sends a 40 characters long string to the stored procedure so if i write 'hello', the stored procedure gets 'hello '. any element is like that in the database so i must change the stored procedure :
    (ELTS.NAME LIKE @param0 OR @param0 IS NULL) became (ELTS.NAME LIKE rtrim(ltrim(@param0)) OR @param0 IS NULL)

  • ICal woes - any help please

    Hi everyone, I am having some major iCal woes that I hope someone has the answer to.
    Ok this is how I handle my workflow. I have numerous calendars such as "call", "viewing", "meeting", "work misc", "personal" etc. All colour coded and I use the month view as standard.
    Under SL I would double click the day I add an event go through the boxes (name, location, time, etc) click save and job done.
    Now under Lion when I double click a day I get an event box but only the header. So I have to type the header hit return then double click on the event again to get the box up so I can assign the event the right time and calendar to use. This is taking twice as long as it did before under SL and is a pain when you have a client on the phone. Am I missing something here? Why is it now so hard? - and I have tried that quick entry business but it doesn't work for me, I simply want the whole calendar entry box when I double click in month view.
    Next problem is all new events go in as a all day event. Again another click I didn't need to do in SL. Then untick all day and enter a time LionCal doesn't set the end time 1 hour later anymore it sets it hours later for me, sometimes into the next day so I have to click into the date box and type the end date, again a massive slow down in my workflow.
    Finally and most annoyingly in month view I cannot for the life of me get a 12 hour clock with AM/PM. I checked my international page in sys prefs and all is ok but LionCal is not playing ball.
    Any help would be appreciated as I love iCal and run my life with it over MobileMe.

    If you want to Commit changes at every record level in a Multi-Record Block, you may have to write the following triggers at the block level :-
    1) Key-Down
    2) Key-Up
    3) You will also have to handle Mouse Events
    i.e When-Mosue-Click etc
    In each of these triggers, issue a commit statement :-
    i.e.
    Trigger Name :- KEY-DOWN [ Defined at Block Level ]
    Trigger Code
    Commit_Form;
    Next_Record;
    The Commit_Form statement will display a message for the user to COMMIT transaction to the DB.
    Shailender

  • Airport express "G" - My woes and some thoughts. . .

    I got the airport about this time last year. it worked great and i loved it. In December 2007 I moved to an apartment. I got the local cable co's internet, ran it to my ax and all was well. 6 weeks ago, due to our wonderful economy, i had the cable shut off as I talked to one of my neighbors who has wireless internet running unprotected (no password)..i asked him if i could leech for a bit till i got things sorted. he said cool and all was.....hmmm. SO in my airport menu i select his network and my internet works, sometimes drops then comes right back but no biggie. I reset my ax to just do airtunes and join his network, it restarted and voila, airtunes. problem is that in the last month i get a lot more drop outs and if i go more than 2 days with out streaming by ax disappears and i have to do a hard reset to get it to show up in the utility. The light is green but nothing...sometimes the amber light blinks and it never come on line at all....grrrrrr.
    could all my newfound ax woes be due to the fact i am adding it to his network? i had no issues at all when i created my own one with my internet and airtunes.....
    anyone?
    EDIT: let me ask this then...when i am streaming music from my mbp to the ax, am i doint it dorectly or am i using his network? If I am sending music from my MBP to the ax via his network then that would basically answer all my questions, if the mbp goes direct then I have no clue....
    edits as i am brainstorming

    EDIT: let me ask this then...when i am streaming music from my mbp to the ax, am i doint it dorectly or am i using his network?
    It goes from your MacBook Pro to his wireless base station... then from his base station to the AX. So it depends on the performance of his base station and network.

  • SQL Injection on CallableStatement

    I will try to post this all in one line, as the tags are not working today. I know that one should use PreparedStatement over Statement to obviate the thread of a SQL injection attack. Is CallableStatement vulnerable as well? For reference, this would be running against an Oracle RDBMS. Thanks!
    - Saish

    I guess there is no hard-and-fast rule.Well, I guess the hard and fast rule is "only use
    bound variables". If you've got a sane database
    design then that shouldn't cause you any problems.
    Dave.I agree. I was approaching the issue mainly from a security perspective in locking down a legacy system against SQL injection attacks. Using Eclipse, I was able to zero-in on usages of Statement fairly easily. But the more I looked into CallableStatement, the more I realized that I woud have to inspect each invocation manually. (Just in case someone did not bind variables or built a dynamic SQL string).
    - Saish

  • Hp Warranty Woes & Hard Drive Heartache

    HP – Warranties Woes & Hard Drive Headaches.
    Dear Internet Community (I.C)
    I need your help.
    I would like to know if I’m being unreasonable in my expectations or is Hewlett Packard (HP) not living up to its both moral & legal obligations as a good corporate citizen & what it alleges to be – a Customer Focused Global Computer Services company.
    Apologies if this is a little long winded but in the interests of fairness I need to put as many HP comments in as possible – to give you a clear picture.
    So bear with me, you will not be disappointed & there are a couple of questions you might like to answer & feedback to the appropriate parties.
    Keep in mind at all times we are talking about approximately a $200 (NZD) fix – less than the lost profit on one lost sale for an HP PC ( you might think twice about HP products after reading this).
    There are two parts to this problem :
    Part 1 :
    I purchased an HP Touch Smart a few years ago, I registered the product & warranty with them & over the years have received have received numerous emails stating “buy this, upgrade now”.
    But I don’t recall ever receiving an “WARNING – Critical Failure Issue (CFI) apply attached patch immediately” email while under warranty. Why is this relevant?
    Ø Seagate makes Hard Drives – in this case a Barracuda 7200.11
    Ø HP buys said HD’s from Seagate
    Ø Seagate finds a problem with firmware in HD’s & advises HP & supplies a fix
    Ø HP knows which Customers have these HD’s, because you know what goes into your machines – right ? - see below
    Ø HP FAILS to send email to Customers with the fix (a simple email with attachment would solve problem) or issue recall.
    Ø HP even offers previously to fix problem FOC & puts fix on its Website - but only if the Customer knows somehow of the problem.
    Ø Should the Customer intuitively& telepathically know of problems in HP Products in advance before it fails, because of course HP is not telling their Customers.
    Problem or Outcome: My HD has bricked itself & will not operate as I never received notice of the firmware fix at any time either in or out of warranty.
    Paul Boshoff - G M -Personal Systems Group- HP NZ (PB- GMPSG) says
    “It would be very difficult, if not impossible, for any computer vendor to proactively notify it’s customers of component-level updates”
    “Failures of the kind you’ve experienced are usually related to a specific batch of serial numbers and often those component serial numbers aren’t available when the user is registering that particular computer.”
    Now let me know if you think I’m wrong, but it sounds like HP does not know what goes into its machines or at the very minimum does not keep track of this.
    HP, a Global Computer Services company cannot possibly be expected to track what goes into its machines. HP apparently does not record or match the serial number of the HD with the machine it goes into.
    If Ford & Toyota can track & record what tyres go on which make & model of their cars which are in the millions each year & can recall cars dating back 8-10 years just case of a manufacturers component malfunction why can’t HP link & record the HD details.
    I can just hear it now “I’m sorry we don’t know which engine we put in your car”.
    And let’s be real clear here – we are not talking about some small screw at the back of a PC – Along with the CPU & the RAM, the Hard Drive is pretty much up there in the top 3 of important components of any computer.
    I.C – Do you feel
    ü That fills you with confidence in HP products & services ?
    ü Should HP be required to tell its customer of CFI’s with its products – particularly while under warranty?
    ü Has HP tried to limit their liability & cost by directly NOT telling Customers of CFI’s while under warranty?
    Part 2 :
    When your HD bricks itself – apparently all is not lost – some very clever person has found a solution so you can get the HD going long enough to apply the firmware fix & then your HD is a good as new – Here is the link that spells it out with pics http://www.overclock.net/t/457286/seagate-bricked-firmware-drive-fix-with-pics)
    You’ll see the relevance of this shortly.
    After much messing about I received the following email from PB- GMPSG : “I have escalated your issue and have just received the go-ahead to repair your unit at our cost. We will be utilizing our own, authorized service provider to re-install the original hard-drive and to run the software fix on that unit.” (This guy most likely earns a six figure salary & isn’t able to sign off $200 fix).
    NOTE : it does not limit or restrict what type of fixes will be used & also at this time HP was aware of both the Seagate fix & above fix.
    I delivered the PC & bricked HD into the HP Authorised Repair Centre (ARC) as requested –their ticket instructions read “do firmware update…HP to incur costs. NO COST to customer”.
    Obviously it’s not rocket science but you need the HD going before you can apply any firmware fix including this one – HP knew that to get the HD going they would need a special fix to enable them to apply the Seagate fix.
    After all this is not an isolated case & I did point out to HP that they would need the fix I supplied (or something similar HP approved or designed if that made them more comfortable) prior to their offer of fixing the HD.
    HP said their ARC’s had all the right software for fixing their machines. In addition I have been told on several occasions, the ARC’s are the bee’s knees, the cat pajamas, the whiz kids of the PC service world “The first port of call for the repair centre agent is to download all the latest service advisory notices and updates. This is a very fundamental part of the repair process and one that we spend a great deal of time emphasizing with our authorised repair centres” Keep this in mind.
    A week later I received a call from Peter Gasporaratos, HP CS Melbourne (poor guy – caught in the middle) & stated “there is nothing else we can do for you”. When I asked if they had applied the fix he said “its not our responsibility.. its not part of our guidelines.. the ARC does not practice unauthorised methods..& this ARC will not go down this path”
    Ironically the day before, Barry from the ARC said “we can attempt it, but we will charge you too”. So HP’s own ARC will do it, but there will be a cost – but hang on a minute, didn’t PB- GMPSG say “to repair your unit at our cost. We will be utilizing our own, authorized service provider to re-install the original hard-drive and to run the software fix on that unit” & HP CS put on the instructions “HP to incur costs. NO COST to customer”.
    I.C – Do you feel
    ü HP have said they will fix it at NO COST to me, regardless of what the fix entails ?
    ü Should HP honour this commitment ?
    ü Would you do business with a company that says one thing & does another & does not honour its commitment ?
    ü That given the bricking fault did not need to happen if HP had been proactive in letting their customers know of the firmware issue & this is not an isolated case– shouldn’t they then be responsible in finding or developing a fix for getting the HD going long enough to apply the firmware fix if they are not going to use other recognised fixes.
    Abstract
    So that’s it – what do you think I.C. ?
    Would you want HP computers & servers controlling the Traffic Lights, Air Traffic Control, Patient records & Medications at Hospitals knowing that HP will not tell these organisations that there is CFI with their products & they could suddenly lose everything. All dead while they try to find a back up computer with all the data – god forbid if President Obama’s “football” is powered by an HP – Nuclear War before we know it.
    But seriously – I would love your feedback – Am I being unreasonable in asking them to honour their commitment for a $200 fix ?
    And of course HP being a Customer Focused Global Computer Services company, would welcome your feedback.
    Here are a couple of the players contact details who would love to hear from you :
    ü Keith Watson – CEO –HP NZ -I initially contacted him & he thanked me for bringing it to his attention, then nothing.
    Email : [email protected]
    ü Paul Boshoff - G M -Personal Systems Group- HP NZ – well of course you now know who he is now – he would love feedback.
    Email : [email protected]
    ü Jessica Rangi – She’s the Spokes person/PR/Marketing for HP NZ & has just help launch HP new PC range in NZ – She would love your feedback as it might impact on her marketing & she is quoted as having helped out in warranty situations before & has worked at HP head office.
    Email : [email protected]
    ü Meg Whitman - President and Chief Executive Officer of HP Global
    Email : [email protected]
    They would all like to hear from you J
    I.C
    J Thanks for being patience & reading through to the end – now it’s up to you
    L buy HP Products & Services or not.
    L Do HP deserve your hard earned money if you now believe they aren’t going tell you about problems with their Product & Services.
    Be kind to one another & take care.
    Regards
    Smithie
    P.S - I sent this blog to HP for fact & quote checking prior to uploading (I gave them over a week to reply) – the silence was deafening from HP.

    When requesting assistance, please provide the complete model name and product number of the HP computer in question. HP/Compaq makes thousands of models of computers. Without this information it may be difficult or impossible to assist you in resolving your issue.
    The above requested information can be found on the bottom of your computer or inside the battery compartment. Please do not include your serial number. Please enter the model/product information into HP's Online Consumer Support page and post it here for our review.
    I doubt the hard drive would be covered by buying an extended warranty after the fact. There is also no reason to buy a new hard drive from HP. Almost any 2.5" hard drive on the market will work in your computer. You will need your personal HP Recovery Disc set to return the computer to a factory like state. If you didn't create these discs, you will need to order a set.
    If you have any further questions, please don't hesitate to ask.
    Please click the white KUDOS star to show your appreciation
    Frank
    {------------ Please click the "White Kudos" Thumbs Up to say THANKS for helping.
    Please click the "Accept As Solution" on my post, if my assistance has solved your issue. ------------V
    This is a user supported forum. I am a volunteer and I don't work for HP.
    HP 15t-j100 (on loan from HP)
    HP 13 Split x2 (on loan from HP)
    HP Slate8 Pro (on loan from HP)
    HP a1632x - Windows 7, 4GB RAM, AMD Radeon HD 6450
    HP p6130y - Windows 7, 8GB RAM, AMD Radeon HD 6450
    HP p6320y - Windows 7, 8GB RAM, NVIDIA GT 240
    HP p7-1026 - Windows 7, 6GB RAM, AMD Radeon HD 6450
    HP p6787c - Windows 7, 8GB RAM, NVIDIA GT 240

  • Help needed in debugging callablestatement changing performance

    Looking for some help debugging a performance problem.
    We are in the process of converting an ASP web application running on IIS to a java web application running on OAS. We have java code using a CallableStatement that calls an Oracle PL/SQL Procedure that runs inserts and updates as needed and does not return anything.
    When the Java application calls the procedure using the same parameters and doing the exact same work the execution time is either 3 minutes or 30 minutes. We have narrowed down the location of the slowdown and when it takes 30 minutes to execute it appears to be hanging during a cursor execution. What would cause the execution times to vary so much?
    Here's another piece to the puzzle. When the procedure is called from IIS with the exact same parameters that were used from OAS the procedure ALWAYS runs in 3 minutes. Why would IIS performance be so consistent and OAS so inconsistent?
    Any debugging suggestions would be greatly appreciated.
    Thanks,
    Bob

    user4908334 wrote:
    We are in the process of converting an ASP web application running on IIS to a java web application running on OAS. We have java code using a CallableStatement that calls an Oracle PL/SQL Procedure that runs inserts and updates as needed and does not return anything.
    More information is needed on that.
    There is one proc or 50?
    The proc is being called one time or 50 times?
    You are not using Batching right?
    When the procedure is called from IIS with the exact same parameters that were used from OAS the procedure ALWAYS runs in 3 minutesYou are running the java server on exactly the same box as IIS?
    The java code is using exactly the same database as IIS? (Did you verify this?)

  • How to use CallableStatement  for StroredProcedure in java?

    I've successfully created storedProcedure for select comment in mysql.but how implement in java code with using of CallableStatement.Pls help me
    Message was edited by:
    SKVenkates

    try this in main:
    try {UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}
    catch (Exception exc) {System.err.println("Eroare la incarcarea look & feel" + exc);}

  • Getting error in cursor variable in CallableStatement

    Hi,
    I am trying to retrieve result set from PL/SQL procedure using cursor variable.
    but I getting error sometime.
    this is code in my program...
    CallableStatement pstmt=null;
    pstmt = con.prepareCall("{call Crms2.SearchRNameTime(?,?,?,?,?,?)}");
    pstmt.setString(1, uid);
    pstmt.setString(2, strBookingDate);
    pstmt.setInt(3, roomid);
    pstmt.setInt(4, lngStartTime);
    pstmt.setInt(5, lngEndTime);
    pstmt.registerOutParameter(6, oracle.jdbc.driver.OracleTypes.CURSOR ); // error accured in this line
    pstmt.execute();
    rs = (ResultSet)pstmt.getObject(6);
    error was accrued at line : pstmt.registerOutParameter(6, oracle.jdbc.driver.OracleTypes.CURSOR );
    error is: orable.jdbc.driver can not resolve tha symbol..
    but it some time executing , some time giving error.
    it is require any package to import?
    please help me on this problem.
    regards
    Narru

    990187 wrote:
    i have created a cursor to return only 5th row from a table .
    declare
    cursor cur is select * From(select last_name,salary,rownum rn from employees where rownum<=50)) where rn=5;
    just a side note, (others have helped with the actual error already), using "rownum" like you do isn't very consistent. Not really sure about the requirment of "5th row", but no matter. Just keep in mind that the way Oracle assigns a rownum, and the fact you have no sorting/order ... you are - effectively - getting a random row. That is, with no data changing, Oracle may very well retrieve things in a different order due to index, new oracle version, whatever.
    If you do actually need the 5th row where you have some sorting (ie 5th largest salary, or 5th record by last name, etc. ), then you may want to consider something like:
    select * from (select last_name, salary, row_number() over (order by salary desc) rn from employees) where rn = 5;
    or whatever your sort criteria is. Do a search for "Top N" queries if you need more info.
    It'll work a bit more consistently.

  • Does callableStatement.SetNull() work fine with ojdbc5.jar in oracle 11gr2

    Hello,
    CallableStatement.setNull(1, Types.ARRAY) throws java.sql.SQLException: Invalid column type: sqlType=2003
    and
    CallableStatement.setNull(1, Types.ARRAY, "SOMEARRAYTYPE") throws java.sql.SQLException: ORA-06531: Reference to uninitialized collection
    ORA-06512: at "SYSTEM.SOMEARRAYTYPE", line 6
    ORA-06512: at line 1
    Is this a problem with the driver? Is there any other way of setting null value for a parameter of ARRAY type?
    Thanks.

    user8915609 wrote:
    But setNull(..) itself means that we are setting a null value. doesn't it?I dunno.. what does the Java docs say?
    I am using setNull(..) instead of setObject(..) because i want to set a null value for an array parameter of the stored procedure.Well, that does not seem to be working, does it? So it is reasonable to assume that your are not correctly using/understanding what the setNull() call does.
    For example (following on from the sample code I posted above), it depends on what one attempts to set to null in a collection:
    SQL> declare
      2          variable        TStrings;
      3  begin
      4          --// a variable can be null
      5          variable := null;
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> declare
      2          variable        TStrings;
      3  begin
      4          --// a collection item cannot be null if the
      5          --// collection itself has not been instantiated
      6          variable(1) := null;
      7  end;
      8  /
    declare
    ERROR at line 1:
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at line 6
    SQL>
    SQL> declare
      2          variable        TStrings;
      3  begin
      4          --// instantiate with 2 items/strings in the collection
      5          variable := new TStrings('1','2');
      6 
      7          --// now we can set an existing item to null
      8          variable(1) := null;
      9  end;
    10  /
    PL/SQL procedure successfully completed.
    SQL> If you code a command in ANY language, then you need to know EXACTLY what the command does, and why you are using it.
    If not - then it is a fail on your part.

  • JDBC - CallableStatement - Error in Accessing Stored Procedure of MS SQL

    Dear Friends,
    The following is the code to access a stored procedure of MS SQL Server 7.0 sp4,
              try
                   CallableStatement cstmt;
                   ResultSet rst;
                   cstmt = connection.prepareCall("{call backupdb[?,?]}");
                   cstmt.setString("db_name","SBIREMITLIVE");
                   cstmt.setString("path", "c:\testing.bak");
                   cstmt.executeQuery();
                   System.out.println("Stored Procedure called successfully");
              catch(SQLException se)
                   System.out.println(se.toString());
    when i execute this i am getting the error as " MS ODBC-MS SQL Server Syntax error or Access Violation "
    What's the problem exactly ? anybody came across this issue..if so...kindly help me....
    Here is my MS SQL Server stored procedure.....for reference
    create procedure backupdb(@db_name varchar(40), @path varchar(100)) as
    Backup database @db_name to disk = @path
    Regards,
    V.Prasanna

    Dear DigitalDreamer,
    Yes, as per your suggestion, it's working fine...thanks a lot...
    here is the code...
                   CallableStatement cstmt;
                   ResultSet rst;
                   cstmt = connection.prepareCall(" exec backupdb ?,? ");
                   cstmt.setString(1,"SBIREMITLIVE");
                   cstmt.setString(2, "c:\\testing.bak");
                   cstmt.execute();
    Regards,
    V.Prasanna

  • Java.lang.NullPointerException when using DataSource connection and executing CallableStatement

    Hi Guys
    I am having some problem as I am using a DataSource for connections and randomly
    the CallableStatements and PreparedStatements created from this DataSource becomes
    null and everytime I get NullPointerException with this message.
    java.sql.SQLException: java.lang.NullPointerException
         at weblogic.jdbc.rmi.SerialPreparedStatement.setString(SerialPreparedStatement.java:210)
         at .........
    Help will be appreciated..

    Hi Guys
    I am having some problem as I am using a DataSource for connections and randomly
    the CallableStatements and PreparedStatements created from this DataSource becomes
    null and everytime I get NullPointerException with this message.
    java.sql.SQLException: java.lang.NullPointerException
         at weblogic.jdbc.rmi.SerialPreparedStatement.setString(SerialPreparedStatement.java:210)
         at .........
    Help will be appreciated..

  • Null pointer exceptions in CallableStatement

    Hi,
    Has anyone seen this problem before? I have an app that needs to invoke a stored proc on a SQLServer 2000 database, using the MS SQLServer 2000 JDBC drivers.
    We were doing this via CallableStatement classes, but unless we specify implicit transactions in the stored proc itself, this fails with a null pointer exception at the point at which we try to retrieve the resultset from the CallableStatement, after calling CallableStatement.execute.
    If I re-factor the code to use just plain Statement classes, and an SQL string that executes the stored proc (as if I were typing the SQL in query analyzer) then it works perfectly without needing to have implicit transactions turned on in the proc?
    Any ideas?
    Many thanks....

    Ok, broadly it's as follows:
    CallableStatement stmt = conn.prepareCall("{Call MyStoredProc(?,?)}");
    stmt.setString(1, null);
    stmt.setString(2, "Test Value");
    stmt.execute;
    ResultSet rs = stmt.getResultSet();
    if (rs.next()) {
    System.out.println("RS1=" + rs.getString(1));
    }That falls over at rs.next() unless the underlying stored proc has implicit transactions turned on. The stored proc can be executed through SQL Query Analyzer with the values used in my code successfully, also by just using 'normal' Statement classes and calling stmt.execute(sql) where sql is the string containg the sql I would use in query analyzer.

Maybe you are looking for

  • Backing up Ipod touch

    I have not been able to do a backup on my Ipod touch 4th generation since installing the new update....my Iphone 4 is fine but not the ipod. Any ideas on how to fix would be greatly appreciated.

  • Re-Issue Sales Return Material

    Hi, Can anyone help me to address the following scenario in SAP B one. I have Finished Item say "A". the customer returns this item after few days. For this i have to enter the Sales Return document which is standard functionality. This return FG ite

  • Formatting Number in PHP

    Hi, I wish to format the ISBN number retrieved from database as below: 983295648x -> 983-295-648-x 9789673204793 -> 978-967-320-479-3 I would like to place a dash '-' in every 3rd digits. How could I do it in PHP? If I cannot do it in PHP, is it poss

  • Handling timeout issues

    I saw in a previous post that it was recommended to use a try/catch block when a timeout is expected to occur. I have 2 issues with that approach: 1) Does now allow accurate timing of how long a certain step takes. 2) If there's a dependency that tha

  • VISA Find resource function regular expression

    Hi guys, I've been trying to get which Serial port is a GPS receiver connected to using the VISA Find Resource Function with no luck. The idea is to use a regular expression similar to ASRL?*INSTR{VI_ATTR_ASRL_BAUD == 9600} but instead of looking for