JDBC - Optional support for certain methods

According to the notes on http://java.sun.com/products/jdbc/driverdevs.html (Section A.2.1) a method that is inappropriate for the underlying DBMS may throw SQLException. Presumably the text associated with this exception would indicate that the method is not supported. However, the actual text used is not defined. Indeed, how can it be if full internationalisation is to be accounted for?
And so to my dilemma...
Let's say I want to write a generic wrapper for any JDBC driver and somewhere in my code I want to invoke PreparedStatement.setBigDecimal(). This method must be implemented but isn't necessarily supported. [ The JDBC driver supplied by SAS Institute is an example of this. ] When invoked, this method throws SQL Exception unconditionally.
What I want to be able to do is to determine in advance whether or not this method, or indeed any of the optional methods, is supported.
There are certain useful methods available in the implementation of DatabaseMetaData but nothing to help me in this particular case.
It's no good catching the exception because there's no well-defined way to interrogate the exception's message String to determine how or why it was generated.
Am I missing something here or is this really a "hole" in the standard?

Am I missing something here or is this really a "hole"
in the standard? You are missing something.
You are assuming that there is some sort of real standard compliance for JDBC drivers.
There is not.

Similar Messages

  • JDBC 10g - Support for TNS name entries

    Hello,
    I found the following statement:
    JDBC-Thin support for TNSNAMES.ORA Lookup: similar to JDBC-OCI, both client-side and server-side JDBC-Thin can now read the local TNSNAMES.ORA file to resolve service name or TNS alias. Consequently Java in the database will also be in position to reference external Oracle database, using service name. See the JDBC documentation for more details.
    in the Oracle white paper "What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g". However, I have found several statments/notes in the accompanying 10g JDBC documentation that appear to directly contradict the statement above. For example, the following note:
    Note:
    Because the JDBC Thin driver can be used in applets that do not depend on an Oracle client installation, you cannot use a TNSNAMES entry to set up a Thin driver connection.
    Does anybody know if the JDBC Thin driver supports connection via a TNSNAMES entry? If so, can you direct me to the documentation on how to use it.
    FYI, I have managed to establish a connection using a TNS alias and JDBC-OCI as follows:
    OracleDataSource ods = new OracleDataSource();
    ods.setTNSEntryName("MyTNSAlias");
    ods.setUser("scott");
    ods.setPassword("tiger");
    ods.setDriverType("oci8");
    Connection conn = ods.getConnection();
    However, if I set driver type to "thin" instead of "oci8", I get the following error:
    Exception in thread "main" java.sql.SQLException: Io exception: SO Exception was generated
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:404)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:140)
    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:169)
    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:108)
    at prototype.TNSTest.main(TNSTest.java:36)
    Thanks in advance.

    Hi,
    I wrote the white paper in question and am in position to confirm that in 10.2, JDBC-Thin does indeed support tnsnames.ora; you need to specify the location (i.e., directory) of the tnsnames.ora file in the oracle.net.tns.admin system property
    java -Doracle.net.tns_admin=$ORACLE_HOME/network/admini have working examples in my book.
    I'll have it fixed in the online doc, our printed doc is sometimes out of sync.
    Kuassi http://db360.blogspot.com

  • Optional implemenation for interface methods?

    hi, is there a way of putting several methods of a interface to optional implemenation? such as one method name but different parameters, and put all of them to optional implemenation for classes that implements the interface? thanks :D

    hi, is there a way of putting several methods of a
    interface to optional implemenation? such as one
    method name but different parameters, and put all of
    them to optional implemenation for classes that
    implements the interface? thanks :DNo.
    If a class implements that interface, then it must either implement all the methods, or declare itself abstract.
    You can do like the various XxxAdapter classes to in Swing. Create a concrete class that implements the interface, and give all its methods empty bodies. A subclass then overrides only those methods that it wants to actually do something with.
    Note that I don't think this approach is usually a good one. If there are some methods that are optional, then maybe they should be in different interfaces, and classes can implement various combinations of your interfaces.

  • Confusion with JDBC Optional Package for CDC.

    I am somewhat confused as to where this optional package fits.
    1. Is the implementation of this optional package to be COMPLETELY supplied by the database vendor(e.g. hsqdb, Oracle)?
    OR
    2. Is there an implementation available from Sun?
    OR
    3. Has Sun simply not released an implementation yet?
    OR
    4. Am I completely missing something here and losing my mind :)
    OR
    Is the JVM supposed to supply the implementation?
    Thanks for any enlightenment.
    J

    The actual specification can be written without actually talking to a database (the spec is mostly interfaces). However, you are write in that along with these classes (which must pass the TCK) the database vendor must provide the rest. Unlike normal java.sql where there is a DriverManager class, that is not the case in JSR-169.

  • Jax-rpc handler for certain Web methods

    Hi, all
    Is there any way to deploy a handler for certain method of the web service?
    For example, I have a web service calls testService. This testService has two methods (A and B) which can be accessed by the client. How could I specify the handler is only for method A? How the WSDD will look like?
    Thanks for your help. /dan

    Hi,
    I am facing a similar kind of problem. If maybe I could look at your wsdl and wsdd files, maybe we could come up with a solution. Also my email id is [email protected]
    Feel free to mail me and maybe we can exchange ideas. Thanks.

  • Support for HTML and CSS properties

    My biggest frustration with Acrobat Pro 9 is that it dropped support for certain HTML and/or CSS properties that were available in Acrobat Pro 8. In particular, the page-break-before attribute no longer works, nor does colspan. When I convert an HTML table with some colspans into a PDF, the table looks okay to the naked eye, but the structure behind the table (PDF tags) is incorrect.
    I can live without the page breaks, but I need colspan. I need to do this for hundreds of tables, so opening the Acrobat Table Editor and fixing the colspan by hand is not an option. A scripting/programming solution is required. Has anyone found a workaround? Does Acrobat X fix this problem?

    hello
    not trying to hijack the thread but needed some clarification
    your very short tutorial
    http://alt-web.blogspot.com/2012/11/primer-for-using-jquery-plug-ins.h tml
    was really informative. Just have a couple quick questions:
    you state:
    "the core code library which you ref in your <head> tags,"
    the below code just has to be declared ONCE at the beging in your head section, correct?
    <!-- jQuery latest core library from CDN-->
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js">
    </script>
    then any number of jquery plugin scripts can be placed in ANY order in your head section following the above code, correct?
    "the function code inside <script> tags to invoke the plug-in."
    so then in the body, does the functions code have to come RIGHT AFTER the place it is being used?
    example
    <body>
    <div class="slideshow1"
    </div>
    <!--Plug-In Function Code1-->   
    <script type="text/javascript">
    </script>
    <div class="slideshow2"
    </div>
    <!--Plug-In Function Code2-->   
    <script type="text/javascript">
    </script>
    </body>
    or can you take all the function codes and paste them in the end outside of the respective divs that are using the code?
    ie does the position of the code matter?\
    thanks guys
    Nancy O. wrote:
    Try jQuery Fancybox
    http://fancybox.net/
    If you're new to using jQuery plugins, see this primer:
    http://alt-web.blogspot.com/2012/11/primer-for-using-jquery-plug-ins.h tml
    Nancy O.

  • What video cards are supported for os X?

    What video cards are supported for os X? besides the one apple sells.

    There is no official list from Apple, since they don't support hardware besides what they will install. YOu can look up support for certain cards, since people have used 3rd party ones. YOu should be able to come up with a particular cards compatability.

  • New Linux distributi​on with support for VT-d on W520

    I just released Centrych, which is a productivity oriented desktop. It's based on Ubuntu and has kernels that are optimized for desktop use.
    Being a W520 owner, I've added a patch that allows you to enable VT-d in the 64bit version. It also supports UEFI, if you're interested in using that.
    There's quite a few other features as well, the website is http://www.centrych.org.
    Hope you like it.
    Jack Radigan

    I would recommend Ubuntu.
    No OS is likely to have drivers for everything straight out of the box.
    Even windows would need to have drivers supplied for some hardware if you were to reinstall with a retail copy of XP.
    The oem distribution that comes installed on your notebook has these drivers installed already - that's the biggest part of an oem windows distribution.
    For Ubuntu, typically you have to edit a line in a config file to make the sound work.
    I had to also install the proprietary firmware for my wireless.
    Both work great now.
    The reason that you don't have mp3 capability in linux distribution is for legal reasons.
    I'm sure someone here who is more gpl literate could give you chapter and verse on exactly why, but the bottom line is that you have to install support for certain av formats manually, usually by selecting the Restricted Extras package.
    To my limited knowledge, that won't change with a different distribution.

  • Design Studio 1.3 SDK - Are script contributions for SAPUI5 method functions supported?

    All of the SAPUI5 SDK component examples provided with the Design Studio Samples demonstrate how to expose property getter/setter functions as script contributions.  Indeed, the SDK Developer Guide also just focuses on this.  However, UI5 controls may also include method functions that allow certain actions to be performed on the control.  In this context, I have the following questions:
    1)  Is it possible to expose method functions via script contributions in the contribution.ztl file?  If yes, what is the correct syntax for doing so?  Based on my experimentation so far, it seems like method functions cannot be exposed directly via script contributions;
    2)  If method functions are not supported for script contributions, are there any recommended approaches as a workaround?  One possible approach that comes to mind is as follows:
    i)  Define an invisible "dummy" property of type boolean to correspond with each method function that we want to expose as a script contribution;
    ii)  Define invisible properties to correspond to the parameters required by the method functions;
    iii) In the contributon.ztl code, perform the following tasks:
    (a) Set the invisible parameter property values that correspond to the desired method function;
    (b) Invoke the dummy property getter or setter function by getting or setting the boolean value of the dummy property in the contribution.ztl code;
    iii).  Override the corresponding dummy property getter or setter function in the component.js code with additional logic to read the invisible parameter property values and then call the method function.
    Any feedback would be appreciated.
    Thanks,
    Mustafa.

    Hi Mike,
    Thanks very much for your suggestion.  Your mind-bogglingly creative solutions never cease to amaze me .
    Reviewing the code, yes I did wonder about the use of the Math.random() function.  Then when I subsequently read your explanation about the state saving, the penny dropped as to the issue I was experiencing with the approach I had previously tried (as described in point form in my question), whereby I could not invoke the setter function multiple times from the BIAL script.  So I added a call to the fireDesignStudioPropertiesChanged() function, which has partially solved my issue but the parameter properties are out of sync.
    I'll describe what I've implemented and hopefully you can shed some more light on how to resolve the issue:
    In the contribution.xml file I've defined invisible properties for the method function and it's parameters as follows:
    <component id="ActionLabel"
           title="Action Label"
           icon="res/com.infovizi.prototypes.actionlabel/icon.png"
           handlerType="sapui5">
          <jsInclude>res/com.infovizi.prototypes.actionlabel/js/component.js</jsInclude>
           <cssInclude>res/com.infovizi.prototypes.actionlabel/css/component.css</cssInclude>
           <property id="text" type="String" title="Text" visible="true" />
           <property id="showAlert" type="boolean" title="Show Alert" visible="false" />
           <property id="alertText1" type="String" title="Alert Text 1" visible="false" />
           <property id="alertText2" type="String" title="Alert Text 2" visible="false" />
           <initialization>
                <defaultValue property="SHOWALERT">false</defaultValue>
                <defaultValue property="TEXT">"Hello"</defaultValue>
           </initialization>
      </component>
    In the contribution.ztl file I've defined a script method to invoke a method function for displaying an alert as follows:
    class com.infovizi.prototypes.ActionLabel extends Component {
      /* Displays an alertbox */
      void showAlertBox(/* Text 1 */ String alertMsg1, /* Text 2 */ String alertMsg2) {*
      this.alertText1 = alertMsg1;
      this.alertText2 = alertMsg2;
      this.showAlert = true;
    In the component.js file, to keep things simple I've chosen the UI5 Label control to extend with a custom method function that I want to invoke via the script contribution as follows:
    sap.ui.commons.Label.extend("com.infovizi.prototypes.ActionLabel",{
      metadata : {
         properties : {
          "showAlert" : "boolean",
            "alertText1" : "string",
            "alertText2" : "string"
      initDesignStudio: function(){
      renderer:{},
      // Override ShowAlert setter to perform action
      setShowAlert: function(alertState){
      if(alertState == true) {
      this.displayAlert(this.getAlertText1(),this.getAlertText2());
      // Reset showAlert property value to "false" and call fireDesignStudioPropertiesChanged()
      // to allow setShowAlert function to be invoked multiple times via BIAL script
      this.showAlert = false;
      this.fireDesignStudioPropertiesChanged(["showAlert"]);
      return this;
    // Alert method
      displayAlert: function(alertMsg1, alertMsg2){
      alert("Message: " + alertMsg1 + " " + alertMsg2);
    I then created a DS app with the following script in the click event of a button to invoke the method function in the custom Label control:
    ACTIONLABEL_1.showAlertBox("Hello", "World!");
    After launching the application and clicking the button for the first time, the alert display function is displayed as expected but the parameters have not been updated, even though they are updated in the script contribution function, so the parameters are not displayed, as follows:
    After the alert is dismissed and the DS button is clicked again, this time the parameters are passed correctly as follows:
    So the parameter updates for alertText1 and alertText2 seem to be out of sync for some reason.  I'm sure I'm missing a nuance here.  Any ideas?
    Conceptually, I'm just trying to achieve what Leandro Cardoso has done with the script contribution action function calls in his Notify component.  The only difference is that I'm implementing HandlerType "sapui5" instead of "div".
    Any thoughts about the parameter syncing issue would be appreciated.

  • HT1657 Have a $15.00 credit and wish to rent a movie on Ipad but am being asked for payment method and redemption is not an option.

    Have a $15.00 credit and wish to rent a movie on Ipad but am being asked for payment method and redemption is not an option. Any suggestions?

    To Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • I have problem with fonts for my site, i have used "Lucida sans unicode " family for certain texts. it shows perfect in mozilla 3.5 and mozilla 4. But the font not supporting in mozilla 5.0? please help me

    i have problem with fonts for my site, i have used "Lucida sans unicode " family for certain texts. it shows perfect in mozilla 3.5 and mozilla 4. But the font not supporting in mozilla 5.0? please help me

    i have problem with fonts for my site, i have used "Lucida sans unicode " family for certain texts. it shows perfect in mozilla 3.5 and mozilla 4. But the font not supporting in mozilla 5.0? please help me

  • I am at Ramstein AB Germany.  My iphone screen was smashed badly on the flight to Germany this morning.  WHEN I access apple support for this subject it gives me 3 options call now, call me now or call me later.  As I am in Germany with no coverage and no

    I am at Ramstein AB Germany.  My iphone screen was smashed badly on the flight to Germany this morning.  WHEN I access apple support for this subject it gives me 3 options call now, call me now or call me later.  As I am in Germany with no coverage and no working phone none of those options will work.  Can you get this e-mail to someone who can help.  My iphone serial # is C38xxxxxx. 1) I need to know where and how I can get a replacement somewhere nearby in Germany 2) If 1 is not an option I need to set up an appt to get a to get a new iphone at an apple store in Atlanta GA in the evening of 11 July.
    Thank you very much, Phil Edelen
    <Edited By Host>

    Thanks, my wife is the one serving I am retired and trying to follow her as much as I can. 
    I will schedule an appt for my next time stateside.  I have spent too much time on many Apple web sites trying to get an e-mail to communicate with anyone at Apple to no avail, only phone numbers. I guess if you are overseas with no international access you are out of luck communicating with them.  I did find one e-mail address but the reply was computer generated and provided useless links.
    If anyone has any e-mail address for anyone at Apple I would appreciate it.
    Thanks again,
    Phil

  • Select-options for OO Methods

    Hi all,
    How can I define select-options for a method in a global class.
    And how can I pass these select-options from a report.
    Thanks & Regards
    Eshwar

    Hi all,
    How can I define select-options for a method in a global class.
    And how can I pass these select-options from a report.
    Thanks & Regards
    Eshwar

  • How to add support for new JDBC Drivers in WebLogic Server?

    Hi!
    I am using WebLogic Server 10.
    As we know,WebLogic Server contains some jdbc drivers itself,but if we want to use another drivers besides them,what can we do?(I am using Oracle 11g,but WebLogic Server 10 doesn't contain JDBC support for it.)
    Just copy the .jar files of the drivers to the directoty "WL_HOME/server/lib" or need to configure something else?
    Thanks!
    Huang

    Hi!
    I am using WebLogic Server 10.
    As we know,WebLogic Server contains some jdbc drivers itself,but if we want to use another drivers besides them,what can we do?(I am using Oracle 11g,but WebLogic Server 10 doesn't contain JDBC support for it.)
    Just copy the .jar files of the drivers to the directoty "WL_HOME/server/lib" or need to configure something else?
    Thanks!
    Huang

  • Is there any support for JDBC

    Hey All,
    I've started working JDBC since few days and already had early hiccups !!!
    I installed Oracle * into my PC and wrote a simple code to connect to the database unfortunately it didn't connect
    Now I am not sure whether there is any support for JDBC in Oracle 8 or not
    I wonder how can I make sure that my Oracle 8 installed supports JDBC or not
    I use Oracle 8 , jdk1.4, and Winxp as my OS
    Messy

    Oracle supports JDBC at least as far back as 8.1.something; the Oracle JDBC driver is built on a private protocol that existed in at least 8.0, so I'd expect all 8x versions to support JDBC, more or less.
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.html
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/index.html
    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
    However, you may want to consider using a newer version of the Oracle database; you can download the latest, and a single-user-for-development-only license is free.
    http://www.oracle.com/technology/software/products/database/oracle10g/index.html

Maybe you are looking for

  • Vertical dzen statusbar? [SOLVED]

    this started out as a let's-see-if-it's-possible sort of thing, and now it's driving me mad that I can't figure this out. I'm attempting to make dzen + conky act as a statusbar, positioned vertically on the left side of my screen. my current .xinitrc

  • Qn on SWCV and Technical System

    Hi All, My scenario was R/3-XI-JDBC. While creating the scenario, I figured there are no outbund interfaces listed for the Business System for R/3, though I have imported the IDOC inot IR and created all the required mapping. Hence I was not able to

  • Dynamic default bind variable

    Hi! I have a bind variable in a view object, where i want the default variable to be a text version of now (timestamp) in the format 'dd-mm-yyyy HH:mm'. I have tried to look at a solution using Groovy Expression, but I cannot figure out how to do it.

  • Color Calibration Issues

    My office has two iMacs for digital photography editing. We have a 24" iMac from 2008 and a new 27" iMac. We are using a Spyder 2 with ColorEyes Display Pro software. We have tried multiple settings color/gamma settings and have tried alternate softw

  • Load Plan logging and environment variables

    Hi all. Do think it is possible to log in an external table each load plan step details (such as step name, step duration, etc..) ? I'm wondering if there are some environment variables that contain all typical step information. Thanks