Is there a way to dynamically determine the number of parameters to a procedure side Server?

Hello

This is a helper method used to call a server-side function that traverses the bindVars parameter to fill the PARAMETERS of the function. Is there a way to dynamically determine the parameters input/output based on the procedure name in the stmt parameter? No member of the CallableStatement class looked promising, but the getParameterMetaData() in the PreparedStatement class method seemed it might be useful lead. However, I have not found any (yet) a detailed description of how to use it.

protected Object callStoredFunction (int sqlReturnType, String stmt,

Object [] bindVars) {}

CallableStatement st = null;

try {}

// 1. Create a JDBC CallabledStatement

St = getDBTransaction () .createCallableStatement)

("" start?: = '+stmt+ ";" end; ", 0);

// 2. Register for the first variable binding for the return value

st.registerOutParameter (1, sqlReturnType);

If (bindVars! = null) {}

// 3. Loop on values for the bind variables passed, if any

for (int z = 0; z < bindVars.length; z ++) {}

// 4. Set the value of vars binding provided by the user in the stmt

st.setObject (z + 2, bindVars [z]);

}

}

// 5. Set the value of vars binding provided by the user in the stmt

st.executeUpdate ();

// 6. Returns the value of the first variable binding

Return st.getObject (1);

}

catch (SQLException e) {}

throw new Aexception.getLocalizedMessage (e);

}

{Finally

If (st! = null) {}

try {}

// 7. Close statement

St.Close ();

}

catch (SQLException e) {}

}

}

}

James

PreparedStatement.getParameterMetaData () subject is exactly what you need for this task.

Once you have the ParameterMetaData you can ask how many parameters are present, and how they are. Parameters are numbered from 1 to n, and you can use ParameterMetaData.getParameterMode (1); to get the function of parameter 1. The modes are defined as static values of the ParameterMetaData object. Check out the doc at http://docs.oracle.com/javase/7/docs/api/java/sql/ParameterMetaData.html

Timo

Tags: Java

Similar Questions

  • Is there a way to dynamically determine the SSO API vCenter server info / PowerCLI?

    Just started looking into this, but the idea is that SSO/PSC on its own virtual machine while vCenters and Web client are on separate virtual machines.

    Is it possible to see which server SSO/PSC vCenters associated to?  I want above all this information, so I can record a daily SSO/PSC situation where there problems that prevent me from logging into vCenter.

    Addedalanrenouf and LucD for attention.

    Working specifically 5.5.

    Post edited by: Chris Nakagaki

    Figured this out.

    Basically, it's this:

    ($Global: DefaultVIServer |) Get-AdvancedSetting | WHERE-object {$_Name - match "config.vpxd.sso.admin.uri"}) .value

    If you are a connected to more than one via the cmdlet Connect-VIServer vCenter, so it is going to be slightly different.

  • Is there a way to programmatically determine the use of the 64-bit computer?

    I need to work with files in the path C:\Program Files\ [...].  However, when I run my LV application on a 64-bit machine, the path is C:\Program Files (x 86)-[...].  Is there a way to automatically determine if the application is running on a 64 bit system?  I use LV v.2012 SP2.

    Thank you

    DJ

    dj143 wrote:

    I need to work with files in the path C:\Program Files\ [...].  However, when I run my LV application on a 64-bit machine, the path is C:\Program Files (x 86)-[...].  Is there a way to automatically determine if the application is running on a 64 bit system?  I use LV v.2012 SP2.

    If you want the correct folder, the number of bit OS will not really help you. What to do if windows is installed to X:\Program files id... » ??

    Take a look at "get system directory". In particular, use the entry "application files. See if it meets your needs.

  • Is there a way to dynamically calculate the values for the IN operator?

    I want to know if there is a way to dynamically calculate the criteria to include within an IN operator in the WHERE clause. "For example when I try to run the following I get an Oracle error message ' OR!-01722: invalid number." The script below is just an example to help illistrate the problem, I don't want to hardcode the values assigned to the v_test directly within the IN operator because the values of v_test will change from user to user.

    DECLARE

    v_test VARCHAR2 (10): = '1,15,25,55';
    v_tmp VARCHAR2 (50): = NULL;

    BEGIN
    SELECT d.metric_title IN the tbl_health_metric_definition v_tmp d
    WHERE d.metric_status = 'Active' AND d.metric_id IN (v_test);
    END;

    You can convert the string "1,15,25,55" online like this

    SQL> select regexp_substr('1,15,25,55' ,'[^,]+', 1, level) list
      2    from dual
      3  connect by level <= NVL( LENGTH( REGEXP_REPLACE( '1,15,25,55' , '[^,]+', NULL ) ), 0 ) + 1
      4  /
    
    LIST
    ----------
    1
    15
    25
    55
    

    and use this selection in your IN clause.

  • find the number of parameters in a procedure

    Hello

    I have a package_test package

    It contains a few procedures, one is "procedure_test (number, number b, c number).

    I am oracle 11g 2.0 version of work and SQL * more.

    whenever I am trying to execute the procedure with a correct number of parameters it gives me the error:
    PLS-00306: wrong number or types of arguments in the call to 'PROCEDURE_TEST '.

    Question is how we can know the number of the parameter set for this object.

    as

    Select * from user_procedures where procedure-name = "PROCEDURE_TEST";

    Please suggest me

    Thank you

    Sorry I misread the question.

    Use $user_arguments

    Published by: Oracle_Monkey on January 10, 2013 03:42

  • Search for "blackle". Is there a way to auto-noir the bottom of each page visited?

    I like the idea of using a black background instead of white on my devices. I'm saving the planet and my eyes. Is there a way to display all the origins of the auto-noir site? And I suppose that, by extension, the white of the text? I understand the images on the page would remain in their original colors, and that's fine. I see a blank page and I want to paint it black.

    People have experimented with modules in this direction over the years. Some who always seem to be maintained are:

    https://addons.Mozilla.org/firefox/addon/night-mode-Pro/

    https://addons.Mozilla.org/firefox/addon/aniverto/

    https://addons.Mozilla.org/firefox/addon/eyeguard/

    This allows you to switch between different color profiles and is probably a little more of "brute force":

    https://addons.Mozilla.org/firefox/addon/color-toggle/

  • Is there a way to globally disable the cache of Firefox?

    I run a computer lab with several linux PC (Ubuntu LTS 14.04 / latest version of Firefox). The users homedirectories are located on a file server central and limited by a diskquota. Unfortunately, Firefox takes an important part (if not all) of this quota with its cache. Is there a way to globally disable the cache?

    EDIT:
    Add the following lines to /etc/xul-ext/ubufox.js helped...

    Pref ("browser.cache.disk.enable", false);
    Pref ("browser.cache.disk.smart_size.enabled", false);
    Pref ("browser.cache.disk.capacity", 0);

    Add the following lines to /etc/xul-ext/ubufox.js helped...

    Pref ("browser.cache.disk.enable", false); Pref ("browser.cache.disk.smart_size.enabled", false); Pref ("browser.cache.disk.capacity", 0);

  • I bought an Apple Store Gift card by mistake instead of a gift card to iTunes. Is there a way I can swap the card?

    I bought a gift card from Apple Store by mistake - I was intending to buy an iTunes gift card. Is there a way I can exchange the Apple Store Gift card for iTunes card?

    You must ask to whom he sold.

  • The applications listed under Launchpad, is there a way I can delete the ones I don't use on my MAC Air?

    The applications listed under Launchpad, is there a way I can delete the ones I don't use on my MAC Air? I hope that I can free up space.

    Start the LaunchPad and hold the option key. The icons will start to shake and an X will appear in the upper corner of some but not all. Click the X to remove the application. Programs that have an X are only purchased/downloaded from the App Store. Integrated programs in Mac OS (like Safari) or programs you have downloaded/purchased elsewhere will not be a X. You should not delete (or move) programs such as Safari and Mail (built-in programs) because the update from Apple guess they were be on your computer in their installation location. Weird things happen if they are moved or deleted.

    Programs you don't purchase/download from the App Store can be deleted without the help of the dashboard, but you must be careful about this. Third party programs can be installed in different ways: some come in disk images and are trained in your application forms. These can be moved without danger in the trash. Some are installed using an installation program, and these require a little care to remove. In some cases, they set up items in addition to the program and require a special uninstall program, but this is not true in all cases. I always do the note of programs using a Setup program, so I can make sure I have properly uninstall.

  • Publication in FCPX settings... IS THERE A WAY TO MAKE EDITING THE PARAMETERS EASIER TO HAVE FCP TO PUBLISH EACH SCHOOL SETTING? IS THERE A WAY TO "PUBLISHED IN THE WORLD" A WHOLE PROJECT OR AT LEAST PARAMETERS?

    IS THERE A WAY TO MAKE EDITING THE PARAMETERS EASIER TO HAVE FCP TO PUBLISH EACH SCHOOL SETTING?

    IS THERE A WAY TO "PUBLISHED IN THE WORLD" A WHOLE PROJECT OR AT LEAST PARAMETERS?

    Is it wise to publish all THE settings of a plugin?

    I prefer to reduce the options, for example I'm rigging 'size' to distribute only one of them-in my eyes - range 'useful '; or create by rigging the drop-down menu 'plans', for example for the color selections...

    In any case...

    'Major settings' as Transform or filling or 3D can be published, just click Reset arrow, and all the "sub menu" get published too... can't imagine how to make the publication easier...

    BTW: CAPS means YELLING on the boards...

    be nice... what goes around, comes around ...

  • Is there a way to tell when the bin was emptied last?

    Is there a way to tell when the bin was emptied last?

    Open a new Finder window. The display in the FInder menu, select Customize toolbar... Drag / move the icon to get information from the right toolbar on the left of the existing action button. Click done in the personalization Control Panel and close the window of the Finder. This Get Info button will also be useful for selections of files.

    OS X does not connect to an event to empty the trash. You can click on the trash icon in your Dock, and if the Recycle Bin has been emptied recently, you'll be watching an empty Finder window. Now, you can click on this button to obtain information about the toolbar, and the displayed change date will be when the Recycle Bin has been emptied. If you add more items to the trash, this date modifed will be when the last element has been added.

  • Is there a way to manually activate the built in FLASH on my Canon Rebel T3i?

    Is there a way to manually activate the built in FLASH on my Canon Rebel T3i? I can't find the place to do this.
    Thank you.

    You can also use the "Programming" mode  Program mode allows the camera to choose the initial settings, but unlike the automatic mode where you cannot override the decisions of the exhibition, you CAN override the decisions of the exhibition in programming mode if you wish.

    If you choose the programming mode, press the button to bring up the flash and then don't bother to circumvent the decisions of exposure of the camera then it will work a lot like automatic mode.

  • age of empires 3 product lost key.is there a way I can get the key.i have the box and cert of authenticity and all code cd

    age of empires 3 product lost key.is there a way I can get the key.i have the box and cert of authenticity and all code cd

    Hi barryholt,

    You can see the following article for more information on the same.

    How to get a new product key for Microsoft Games for Windows, Streets & Trips, or MapPoint

  • External hard drive does not work. Is there another way I could solve the problem without formatting the external hard drive?

    My external hard drive works. I tried to plug and when I tried to open it, it says to format the drive until I could use it. Everything works well as when I plugged the USB icon shown on the screen. When I check the disk management, it showed that the partition of the drive is there.

    I tried to change the drive letters, but still having the same problem. I also tried to run the disk check on the command prompt and the properties of the drive, but it still can not because there is error popping up saying that the disk check cannot be performed because Windows cannot access the disk.

    Is there another way I could solve the problem without formatting the external hard drive?

    I tried the first step in troubleshooting the hard drive, but it gives a
    error in saying that "hardware changes might not have been detected.

    So I tried the second method, and when I click on the "Check now" button his
    gives an error saying that "the disk check cannot be performed because .
    Windows can not access the disk".".

    So is there any other way or option?

    Thank you

    Jason

  • My Visa has temporarily suspended my account; is there another way of payment as the cheque?

    Original title: billing

    My Visa has temporarily suspended my account; is there another way of payment as the cheque?

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_other-windows_programs/Windows-phone-number-for-billing-Dept/e35c95d4-2746-E011-9BAC-78e7d160ad4e

    UTC/GMT is 19:37 Tuesday, December 6, 2011

Maybe you are looking for