Is there a way to dynamically determine the number of out parameters for a server side procedure?

Hi,
Below is a helper method used for calling a server-side function which loops through the inbound bindVars parameter to populate the function's IN parameters. Is there a way to dynamically determine the IN/OUT parameters based on the procedure name in the stmt parameter? No members of the CallableStatement class seemed promising, but the getParameterMetaData() method in the PreparedStatement class seemed like it could be helpful lead. However, I have not found any detailed descriptions (yet) 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(
  "begin ? := "+stmt+";end;",0);
  // 2. Register the first bind variable for the return value
  st.registerOutParameter(1, sqlReturnType);
  if (bindVars != null) {
  // 3. Loop over values for the bind variables passed in, if any
  for (int z = 0; z < bindVars.length; z++) {
  // 4. Set the value of user-supplied bind vars in the stmt
  st.setObject(z + 2, bindVars[z]);
  // 5. Set the value of user-supplied bind vars in the stmt
  st.executeUpdate();
  // 6. Return the value of the first bind variable
  return st.getObject(1);
  catch (SQLException e) {
  throw new JboException(e);
  finally {
  if (st != null) {
  try {
  // 7. Close the statement
  st.close();
  catch (SQLException e) {}
James

The PreparedStatement.getParameterMetaData() object is exactly what you need for this task.
Once you have the ParameterMetaData you can ask it how many parameters are present and which mode they are. The parameters are numbered from 1 to n and you can use ParameterMetaData.getParameterMode(1); to get the mode of the 1st parameter. The modes are defined as static values in the ParameterMetaData object. Check out the doc at http://docs.oracle.com/javase/7/docs/api/java/sql/ParameterMetaData.html
Timo

Similar Messages

  • Dynamically determining the number of cols in Select stmt

    Hi,
    I was wondering if it is possible to dynamically determine the number of cols in Select stmt.
    For example:
    If it had:
    Select empno, lname from emp where empno = 32
    then I'd like it to return 2.
    Thanks in advance.
    Sincerely,
    Nikhil Kulkarni

    Hi,
    I was wondering if it is possible to dynamically determine the number of cols in Select stmt.
    For example:
    If it had:
    Select empno, lname from emp where empno = 32
    then I'd like it to return 2.
    Thanks in advance.
    Sincerely,
    Nikhil Kulkarni

  • Is there any way i can get the number of people who subscribe and download our podcast contents?

    is there any way i can get the number of people who subscribe and download our podcast contents?
    give me the answer via email.
    thank you

    iTunes does not provide this information. Their documentation suggests a couple of things you may be able to do:
    http://www.apple.com/itunes/podcasts/specs.html#tracking
    No-one is going to answer you by email - this is a forum - and if you ever feel tempted to include your email address you shouldn't as it's an invitation to spam.

  • I'm getting harrassed by another Ipod touch user, however I do not know who it is. Is there a way to look up the number of who is harrassing me?

    My friend has been recieving lewd texts from someone posing as me with an Ipod Touch. I do in fact have an Ipod touch, however, it's not even a few weeks old and I do not have an interenet connection on it so therefore I cannot get the texting application. I would just like to know if there is a way I can look up the phone number I have from said person, and see who it is so I could possibly block them and prove to my friend that is in fact not me. I have looked it up on google on phone reverse websites, but it comes up as a marked land line number, so it must be an Ipod number.
    Thank you,
    Sadie.

    Actually, there are at least a couple free texting apps for the iPod Touch...  my son has one of them.  Whether they support MMS, I don't know, but sounds like they might.
    In any case, though, you're right that it's not going to be directly traceable.  However, the phone company and the creator of whichever texting app is being used might be able to help track down the IP address of the sender.  And then you'd have to trace the IP to the individual, which would require cooperation of the ISP.  It won't be easy to do.  Since what the texter is doing is illegal, it might be best to report this incident to the police, who will have the authority to investigate.

  • Is there a way to turn on the mobile hot spot function for a day from the phone?

    I have an unlimited data plan.  It costs $30 a month to add the mobile hot spot feature which I only need a day or two a month.  I know that it can be turned on and off via Custom Service and that I would only pay for the time it was on at roughly $1.00/day.  Unfortunately, going through custom service is time consuming.  Ideally I would like an app that lets me turn the mobile hot spot feature on and off from the phone.
    There are two components to a mobile hot spot.  First you need to active the feature through customer service at which point billing starts and then you need to enable it on the phone.  The problem is activating and deactiving the feature.
    Is there an app to do this?

    FWIW, I'd love to turn off passcodes *permanently* on my five iOS devices running iOS 8.1.
    Is this possible anymore?
    So far, iOS 8.1 insists (after awhile) that I *must* re-implement a passcode.
    (FWIW, with iOS 7 I could turn off passcodes permanently, sending iPads to sales prospects secure in the knowledge they could easily operate the iPad over the course of several weeks, reviewing media devoted to their projects, and not finding themselves locked out.)
    Advice much appreciated.

  • During diction, is there any way to differentiate between the number "2" and the word "to ?

    :

    Well, what you have just been witness to is the lack of A.I.  Without AI, a computer cannot properly comprehend certain convesational criteria.
    Humans and other animals do not take actions or words at basic face value.  They apply learned data from past experiences to better match the context of the actions or words presented to them.  Once their brain settles on a % of correctness, it spits out a response value for it.  Computers don't currently do that... at least not yet and those that have wannabe AI logic on them still have a hard time making the right decision.  For the most part, they go with face value based on programmed parameters that are always applied the same way.
    It's like the thermostat in your house.  It's been told that if it's below a certain temp it needs to kick the heater in, if it's above a certain temp, it needs to kick in the AC.  But, if the temp is below a certain value and you just happen to have a sweater on which is keeping you warm, the termostat won't know that it's OK for it not to turn the heat on to warm you up.  It's a crude example, but you get the idea.

  • Is there a way I can control the resolution of the photos I transfer to the iPad?

    Is there a way I can control the resolution of the photos I transfer to the New iPad? I just received the new iPad and would like to reduce the size of the resolution of the pictures I am transferring.
    I have storage capacity issue and I am only able to transfer about half the number of pictures I had on original Ipad with the same storage capacity. I upgraded to the New Ipad and I am transferring all the pictures I had in the original Ipad. I do not know why they are not all transfering since the New Ipad got full before all the pictutres where transfered. I used Itunes to transfer the pictures I have in Iphoto .  I assume this is because the New Ipad has a higher resolution screen and is allowing the pictures to be transfered automatically to the New Ipad at a higher resolution than the original Ipad?
    Any thoughts?
    Ed

    edgodoy wrote:
    However, is there a way I can increase the number of pictures I can transfer to the New Ipad using Itunes?
    I have a Canon 7D and the picture are large.
    Step my step instructions, would be great if it is at all possible.
    What you as is difficult without knowing your exact circumstances, i.e. what format pictures are you sending, do you shoot in .jpg or shoot in RAW and convert to .jpg, etc.  However, I don't see a way to quickly reduce the size of your image files without reprocessing your files in some manner.
    You could export all of the images to be loaded onto your iPad in JPEG format using Lightroom or Aperture and greatly lower the quality setting in the .jpg export.  If you do this make sure you export to a new folder. Lowering the quality can have a huge impact on the size of the image files.  If this worked it would give you the advantage of still having the largest amount of pixels allowable on the iPad 3.  I found that on my iPad 2 I could 'get away' with setting the quality to around 50 without seeing any obvious changes.  A higher quality setting may or may not be required on the iPad 3, time will tell and as my iPad 3 is going back I've not taken the time to put more than a few sample (800 or so) images on it.  They were exported at a quality setting of 60 and look as well as can be expected considering my defective iPad 3 display.
    If you images are already exported at a lower quality setting and are still too large the next step would be to reduce the dimensions of the image.  Lightroom has this capability.  I don't know about Aperture, but I assume it does.
    My normal workflow with my 7D:
    Take picture in RAW.
    Transfer to Lightroom 4 converting the Canon RAW files to Adobe's DNG format.
    Process images in Lightroom.  If any need further processing then export to Photoshop and/or Nik plug-ins.
    Export processed images that I wish to have on my iPad to my Pictures folder in .jpg format using a quality setting of 60.  I do not reduce the dimension of the image as I want the maximum sized images my iPad will allow.  As I only transfer a couple of thousand size is not an issue.
    Use iTunes to Sync photos to iPad.
    As was mentioned by a previous poster you could use Photoshop to bulk process the photos but that requires both Photoshop and a knowledge of creating a bulk action.  Not hard, but very confusing if you haven't used both Photoshop and the bulk process before.
    There may be other methods that could work for you but I am not aware of them.  With the breadth of experience of the members of this forum perhaps someone else could chime in with suggestions.

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

    I am looking to see if there is a way to dynamically calculate the criteria to include inside 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 do not want to hardcode the values assigned to v_test directly within the IN operator becasue the values in 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 INTO v_tmp FROM tbl_health_metric_definition d
    WHERE d.metric_status = 'Active' AND d.metric_id IN (v_test);
    END;

    Hi Jason,
    When ever you use IN operator your values should be either seperated by a comma. If the column is of type number then your values should not enclosed in single quotes.
    Eg: Wrong - '1,2,3,4,5'
    Correct - 1,2,3,4,5
    If your column is of type varchar then your values should be seperated by a comma and each value should be enclosed in single quotes.
    Eg : Wrong - '1,2,3,4,5'
    Correct - '1','2','3','4','5'
    Correct - 'sam','boy','girl'
    So correct you query so that the values in the IN operator are with out single quotes.
    DONOT USE IN OPERATOR IN PL/SQL BLOCK WITH OUT A CURSOR._
    If you use IN Operator and fire a query with out a cursor, it throws an error multiple rows returned. If at all you want to use in operator then use cursor.
    Regards,
    Rajesh
    Edited by: Rajesh Gudipati on Jun 23, 2009 9:49 PM

  • Is there a way of just changing the text to the main menu..but not the submenus?

    Is there a way of just changing the text to the main
    menu..but not the submenus?
    Also i have looked at in the browser and when i glide over
    the menu catergories or click on them they dont show the
    submenu...what can i do to solve this?

    Does the example described at
    http://labs.adobe.com/technologies/spry/articles/menu_bar/index.html
    work for you?
    What are you doing that's different from the example?
    When you say you just want to change the text of the main
    menu without changing the submenus, do you mean you want to do so
    dynamically, at some later stage after the page has loaded?
    If so, you could try retrieving the main menu elements you
    want to update from the DOM and updating them from your script's
    event handler for whatever event it is that you want to update them
    in response to. This presumes the widget will detect this and
    update appropriately, which I can't say for sure since I haven't
    actually tried it.
    Hope that helps!
    Rob

  • I have converted a number of songs to mp3 format on my iMac, is there a way to view just the songs that have been converted in iTunes?

    I have converted a number of songs to mp3 format on my iMac, is there a way to view just the songs that have been converted in iTunes?

    You can view tracks in a given format by selecting to show the Kind column. If you mean you want to determine which specific MP3 tracks you have that were converted by iTunes as opposed to being imported in MP3 format, Get Info on a track and look at the "encoded with" field.
    Regards.

  • Is there a way to completely write the  response of a JSP file to another

    Is there a way to completely write the response of a JSP file to another file...? say for example as a new html file..??!!
    Ofcourse, the client side resultant response page of a jsp will be an HTML; so can anybody tell me of a way to do the file wring task?
    i know of one very very lengthy way... using FILE I/O and write each and every HTML tag and dynamic data using Java/JSP... i dont need that..
    any other direct way??

    Yes. u can forword to some other location by using http URL.
    ragards
    DRA

  • Dynamically determining the port number of a deployed application

              Hi
              How do I dynamically determine the port number of a deployed web application ?
              I know HttpRequest.RequestURL() returns us the entire URL but I wanted to just
              know the port number .
              Is there any API do that ??
              Thanks
              Kar
              

    kar piyush wrote:
              > Hi
              >
              > How do I dynamically determine the port number of a deployed web application ?
              > I know HttpRequest.RequestURL() returns us the entire URL but I wanted to just
              > know the port number .
              >
              > Is there any API do that ??
              >
              kar,
              Here's what I do under WL 7 SP2:
              import javax.management.AttributeNotFoundException;
              import javax.management.DynamicMBean;
              import javax.management.MBeanException;
              import javax.management.ReflectionException;
              import javax.naming.Context;
              import javax.naming.NamingException;
              import weblogic.jndi.Environment;
              import weblogic.management.MBeanHome;
              String domainName,
              serverName,
              serverPort,
              serverUrl;
              // Getting the initial context
              Environment env = new Environment();
              try
              Context ctx = env.getInitialContext();
              if (ctx == null)
              // unable to retrieve a JNDI context
              return;
              // Retrieving the server-specific MBeanHome interface
              MBeanHome home =
              (MBeanHome) ctx.lookup(MBeanHome.LOCAL_JNDI_NAME);
              if (home == null)
              // unable to retrieve the local server MBean
              return;
              // Get the domain & server name
              domainName = home.getDomainName();
              serverName = home.getMBeanServer().getServerName();
              // The server port and address are a little trickier to extract...
              Object mbeanArray[] =
              home.getMBeansByType("ServerConfig").toArray();
              DynamicMBean mbean = (DynamicMBean) mbeanArray[0];
              try
              serverPort =
              Integer.parseInt(
              mbean.getAttribute("ListenPort").toString());
              serverUrl =
              mbean.getAttribute("ListenAddress").toString();
              catch (AttributeNotFoundException thrown)
              // caught a AttributeNotFoundException
              catch (MBeanException thrown)
              // caught a MBeanException
              catch (NullPointerException thrown)
              // caught a NullPointerException
              catch (ReflectionException thrown)
              // caught a ReflectionException
              catch (NamingException thrown)
              log.debug("caught a NamingException", thrown);
              

  • I want to buy a new apple tv but it used hdmi cables and my house is only wired for analog.  Is there any way I can use the apple tv on analog cables?

    I want to buy a new apple tv but it used hdmi cables and my house is only wired for analog.  Is there any way I can use the apple tv on analog cables?

    Welcome to the Apple Community.
    It's do-able, but I don't think it's a great idea.
    DVI
    Some users with DVI have managed to get their TV's to work with DVI-HDMI cables. DVI carries no audio, so alternative connections need to be explored to enable audio. DVI doesn't necessarily support HDCP as well as other standards used by HDMI (which may or may not be an issue)
    Analogue
    There are hardware converters that will convert HDMI to various other types of output, however there are some issues with doing so that you should be aware of.
    HDCP
    HDCP compliant converters will not allow you to watch HDCP protected content such as that from the iTunes Store. Non compliant converters exist but we cannot discuss them under the Terms of Use for these communities.
    Resolution and aspect ratio
    I'm not aware of any converters that will scale the output from the Apple TV, any TV or projector which is used will need to be widescreen and support resolutions of 720p (Apple TV 2), 720p/1080p (Apple TV 3)
    DAC
    DAC (Example Only - Not a recommendation or suggestion that this is suitable in your circumstances)

  • How do I save and import my bookmarks from another hard drive? When I try to open the installed Firefox on the old drive, it (obviously) opens a browser from the new main drive, free of bookmarks. Is there a way I can save the bookmarks on the old drive w

    How do I save and import my bookmarks from another hard drive? When I try to open the installed Firefox on the old drive, it (obviously) opens a browser from the new main drive, free of bookmarks. Is there a way I can save the bookmarks on the old drive without opening a browser?
    The guts of my computer were rearranged and I got a new main hard drive. My old one is still in there and I can get stuff from it, but when I go to the Mozilla folder on the old one, I can't figure out if there's anything I can do to get all my bookmarks from that drive to my new one, where Firefox is newly installed.

    If you open Firefox then Firefox will always use the default profile folder as found via profiles.ini on your system drive.
    You either need to import the file in your current default profile or copy the file to your current profile folder while Firefox is closed.
    Firefox 3 stores the bookmarks and the browser history in [http://kb.mozillazine.org/places.sqlite places.sqlite] and no longer creates an HTML backup by default.
    There are also (five) JSON backups in the bookmarkbackups folder within the Firefox profile folder.
    You can either copy the file places.sqlite to your [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder] or import the most recent JSON backup from the bookmarkbackups folder of that old profile.
    See:
    http://kb.mozillazine.org/Backing_up_and_restoring_bookmarks_-_Firefox
    http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
    See http://kb.mozillazine.org/Profile_folder_-_Firefox
    "Application Data" in XP/Win2K and "AppData" in Vista/Windows 7 are hidden folders.
    See http://kb.mozillazine.org/Show_hidden_files_and_folders
    Go to: Control Panel > Folder Options > "View" tab > under "Hidden files and folders", select "Show hidden files and folders".
    You may want to un-check the box "Hide extensions for known file types" to see the file extensions of all files.

  • Is there a way to automatically insert the filename in the footer of a spreadsheet using iWork's numbers 3.2?

    Is there a way to automatically insert the filename of a spreadsheet into the footer when using iworks numbers 3.2?  iworks 09 had this feature and I can't find this feature in the new version of numbers.

    Hi rhyolite,
    In Numbers 3.x, The Print View and Layout View have gone (for now at least). Page Headers and Footers can only be reached under Menu > File > Print... to open Print Preview. Hover the cursor to reveal the Page Header and Footer fields.
    The only inserts that I can get to work in Print Preview are Page Number, Page Count and Date & Time. Filename is no longer in the Insert menu.
    Regards,
    Ian.

Maybe you are looking for

  • Duplicate records for Sale Order Cycle Report(excluding item level detail)

    I have posted this issue in number of forums but till today no one is able to answer it correctly.Here it is: I need to create a report which I think most of the sd consultants have also done it.It basically covers sales order cycle without item lvel

  • Win 8 and 8.1 client showing shared printer server as offline

    Hi, we have a problem with our print environment (HP and Ricoh printers). We have some Windows 8 and 8.1 clients and a Windows Server 2008 R2 printserver. Windows 8 and 8.1 is showing the printers as offline. Its seems the problem described here -> h

  • Commodity code & does not exist

    Hi Experts, We modify the length of your commodity codes (from 11 to 8). So I decided to add all new commodity codes (length 8) in the T604 / T604t, and to keep all existing commodity codes (length 11) until we modify all Master Data with new commodi

  • Where is View Source? How can the source code of a website be viewed?

    Where is View Source? How can the source code of a website be viewed? View Source used to be accessed via a drop-down menu, but no longer. Why? I'm using Firefox 24.0.

  • HELP!!! N91 Backup Error!!!!!

    Hi there, I have a nokia N91 4GB, I kept getting the message Memory low delte data, so I started going through file manager & deleting qiute alot of files & I think I might have deleted a file which affects the funtions on the phone! I cant open any