Can I create a create a preparedStatement object with ResultSet.TYPE_SCROLL

Hi, I want to use timesten in an existing J2EE Application,and there are so much con.prepareStatement(sb.toString(),ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY) code,and the timesten jdbc driver will alert with:java.sql.SQLException: Driver not capable: Result set is TYPE_FORWARD_ONLY.
So I want to confirm that can I use TYPE_SCROLL_INSENSITIVE to create a timesten jdbc PreparedStatement?? or I must change the code because the timesten JDBC only support TYPE_FORWARD_ONLY...
thanks.

This should result in a warning on the Connection and the prepareStatement() should not fail. It may be that I am not understanding your exact context. You can try the following if you like:
try {
PreparedStatement pstmt = conn.prepareStatement("select 1 from dual", ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
SQLWarning wn;
if ((wn = conn.getWarnings() ) != null) {
do {
System.out.println("Yes there are warnings: " + wn);
wn = wn.getNextWarning();
} while(wn != null);
ResultSet rs = pstmt.executeQuery();
while(rs.next()) {
System.out.println("Value " + rs.getInt(1));
rs.close();
System.out.println("But the operation succeeds");
catch(SQLException ex) {
ex.printStackTrace();
You should see this:
Yes there are warnings: java.sql.SQLWarning: Driver not capable of result set type 1004, supports TYPE_FORWARD_ONLY
Value 1
But the operation succeeds

Similar Messages

  • JDEV 10.1.3: Using "Create" binding on BC view object with ADF Faces Table

    Hello,
    I am trying to get this to work, but to no avail:
    I've got a very simple page (ADF Faces - JSPX) created by dragging an iterator from the data control pallete on to my page and picking "ADF Table..." as my chose to create. This creates a table on my page that allows me to edit each row in place. Very nice.
    Now, I dragged the create operation for that iterator on to the page. What I had hoped to see is that when I click "Create," a new blank row appears in my table (well, at least a row that is blank except for any default values specified in the EO/VO and my overriden create() method).
    However, this doesn't happen. The page submits and refreshes, but no blank row shows up. I initially tried setting the Create button to do partial submit and setting the partialtriggers for the table to include the Create button, to no avail. I also tried it without the partial submit with the same results.
    So:
    1). Should this work, or is this behavior a bug.?
    2). If not, is there a different/better way of doing it?
    Regards,
    John

    G'day John
    I think I can give you a hint of what is occuring... I'm still trying to work out what is happening exactly.
    In JDev 10.1.2 UIX, when the user invoked the create action, they would see the blank record added to the underlying table. Under 10.1.3 Faces the functionality is somewhat different.
    When you the user clicks on the create action a blank record is created but not shown in the table control. To prove the blank record is there try this:
    1) Build an ADF Input Form based on the same VO iterator
    2) In your JSF navigation, create a navigation case between the existing page and the new page, and another back again,
    3) In the existing page, map the Create button's action attribute to navigate to the ADF Input Form
    4) In the ADF Input Form, map the Submit button's action attribute to navigate to the ADF Table page.
    Now when you run your app, notice when you create a new record in the ADF Table which automatically takes you to the ADF Input Form, note the blank record, and the details you enter into the record here and submit, are then visible in the ADF Table on the return.
    This is a long way of proving that the new record is in the table. It's just you can't see it.
    I have a theory which I'm trawling through the newly updated documentation to verify. This issues goes back to the VO createRow vs insertRow method calls that have been documented by Steve Muench a couple of times. I'm guessing the table control is now smarter and doesn't show createRow records, only insertRow records.
    Read one of Steve's posts here regards the createRow vs insertRow method calls:
    http://www.oracle.com/technology/products/jdev/tips/muench/blankrow/index.html
    If I find anymore info I'll endeavour to post it.
    Meanwhile this of course doesn't help you if you actually want to show the blank row in the ADF Table editable control, but I'd thought I'd give you an idea of what's happening behind the scenes.
    Hope this helps.
    CM.

  • Can a Servlet be used for Storing Objects with both JSP and JSF used on it?

    Hi,
    Pages I have:
    SearchEmployee.jsp
    This page has a search engine that search out the Employee. This Employee Object will be stored inside a Servlet(controller) for future references by other pages. I used JSP, html tags for forms, and request.getParameter() to built this search engine.
    Problem:
    I have a JSF Form that wants to DISPLAY the employee which I have found in my Search Engine. How can I get the JSF's value="#{Controller.employeeObj.name}" to get the value from the object?
    This seems logical as my JSF form is just retrieving the stored object in the Controller. I currently cant seem to output it

    The servlet shouldn't be used to store ANY data, let alone data to be accessed by other sevlets. Put the object into the Session object.

  • Can I use RMI to find an object with contructor with params?

    Does an RMI available object HAVE to be a parameter-less constructor?
    All the examples I see are:
    MyClass mc = (MyClass) Naming.lookup("/HelloServer");
    Is there any way to pass arguments to its constructor?

    RMI client invokes a remote method on the server object through proxy stub of the server object obtained via Naming service. Stub implements all remote interfaces exported by the RMI server object which basically marshals all the parameters of the remote method, sends the method request to server object skeleton residing in a different address space via TCP connection and finally receives the result from the server object if any, unmarshals and returns result to the caller.
    Server side RMI appilcation instantiates the RMI server class which implements all intended remote interfaces, exports it to the RMI runtime and finally registers itself with Naming service. RMI client only obtains a reference to the RMI server object through lookup method of the Naming service. Remember client does not instantiate a server object, client only knows about the remote interface implemented by the server object and does not have any idea about its implementation object details. On the server sice the Class which implements remote interfaces, can pass any number of arguments to its constructor.
    In your example, MyClass is the stub to the remote server object which implements "MyClass" remote interface. The stub only provides boiler-plate code for remote methods which marshalls params, sends request to RMI server object, receives the result object, unmarshals it and finally returns it to the caller. The stub only contains the necessary information details like remote object ID, host and port to contact the RMI server object which implements the remote interface.
    So client does not instantiate a server implementation objet, it only obtains a reference (stub) to the server object thru Naming service. Remote interface implementation object can declare a constructor which takes any number of arguments. RMI server side application only instantiates this implementation object and registers its stub with the Naming service.
    -- Srinath Mandalapu

  • Is it possible to create 2 Date objects with different hashcode.

    Hi,
    I want to create 2 java.util.Date objects with different hashcodes. Is it possible??
    Regards,
    Farooq

    import java.util.Date;
    import java.util.Calendar;
    public class TwoDates {
        public static void main(String[] args) {
            Calendar oneCal = Calendar.getInstance();
            oneCal.set(Calendar.YEAR, 1903);
            Calendar anotherCal = Calendar.getInstance();
            Date oneDate = oneCal.getTime();
            Date anotherDate = anotherCal.getTime();
            System.out.println(oneDate.hashCode() + " " +
                               anotherDate.hashCode());
    -14330615 -825112150

  • More than 1 preparedStatement  object using batch update

    Hey how can I execute more than 1 preparedStatement object using batch update..Pls explain with a code(java)
    Thanks

    // turn off autocommit
    con.setAutoCommit(false);
    PreparedStatement stmt = con.prepareStatement(
         "INSERT INTO employees VALUES (?, ?)");
    stmt.setInt(1, 2000);
    stmt.setString(2, "Kelly Kaufmann");
    stmt.addBatch();
    stmt.setInt(1, 3000);
    stmt.setString(2, "Bill Barnes");
    stmt.addBatch();
    // submit the batch for execution
    int[] updateCounts = stmt.executeBatch();
    search in google for more information

  • BW OLAP universe object with Aggregate

    How to create an BW OLAP universe object with Aggregate to a higher level than the underlying query?
    The objective is to synchronize 2 queries by Contract Agreement quantity range and part of the calculation is to obtain the contract total quantity in one of the queries that is by Year and Month. For that query I need the total quantity for the contract.
    Example;
    Contract #    Year    Month     Qty
    1             2011    1         230     
    6             2011    2          50
    14            2011    3         124
    u2026
    25            2011   12          87
                     Total Qty --> ?
    The following syntax gives the total quantity by contract / Year / Month, not the overall contract quantity. I could not find any MDX reference to use to solve this.
    The dimension is [0SALESDEAL].[LEVEL01]
    <EXPRESSION> AGGREGATE({[0SALESDEAL].CurrentMember:[0SALESDEAL].CurrentMember},[Measures].[DBKTD232QCONV8CVZYB17B5P0]) </EXPRESSION>
    Thanks,
    Marco
    Edited by: Marco R on Dec 6, 2011 3:25 AM
    Edited by: Marco R on Dec 6, 2011 3:27 AM
    Edited by: Marco R on Dec 6, 2011 3:31 AM
    Edited by: Marco R on Dec 6, 2011 3:33 AM
    Edited by: Marco R on Dec 6, 2011 3:35 AM

    Hi Andrew,
    Looking at your statement I get the feeling you want this as a dimension/characteristic.
    Since an expression has to be numeric and a characteristic in BW cannot be numeric, this will not work.
    Only measures/keyfigures are possible.
    The direction from SAP is to push any modeling to the BW query or even BW itself.
    Hope this helps,
    Marianne

  • New custom dimension objects with MDX

    Hi all,
    on my OLAP universe is possible to create a new custom dimension objects with MDX sintax?
    For example I need a dimesnion with this descriptions: "ACTIVE"; "INACTIVE", "NULL"
    I need thi description in universe because would like to use this inreport prompt
    then in report I use a variable: if "ACTIVE" then [import1] else if "INACTIVE" then [import2] else [import3]

    BEx: No.
    MSAS: Maybe, but I don't know how.
    Hope that helps!

  • Can we create objects with interface

    can we create objects with interface,if yes then where we implement the
    methods,can we type cast any object with inerface kind of object,if yes what kind
    of objects we can type cast

    can we create objects with interface,if yes then where we implement the
    methods
    Objects are created with classes, not interfaces, which are abstract.
    can we type cast any object with inerface kind of object,if yes what kind
    of objects we can type cast
    Objects may be cast to interfaces, but only if an object's class or one of its superclasses actually implements the interface.

  • How to print a message in the Window created out of a Frame Object

    Hello,
    I created a class extended from Thread class
    I want to print a message in Run method : in the Window created out of a Frame Object in the main function.
    I used System.out.println function, but nothing is printed on the screen
    what other function can I use, without using Drawstring method in ie public void paint(Graphics g)Thank you

    Erm...I don't know whether this is acceptable or not, but...if you want to create out of the main frame, why dun u you create a new frame with a button there, so it seems like a pop-up windows (***or like JOptionPane.showMessageDialog)
    P.F.Boy

  • Need Ideas for creating and using Custom Business Object

    Hello Guys,
    I am developing an application which uses a Request->Approve->Create approach for creating Purchase documents.
    Now I am a little puzzled about how to make use of the Business Object BUS2014.
    The application I am developing has its own unique 'Request Number'  (say REQID)  which will point to the Request for Creation of a purchase order.
    Whenever a Request is created (from a Z-Tcode) a workflow needs to be initiated and it has to be sent to the approver.
    The Purchase Document will be created once the approver approves.
    Now my confusion here is, if I use BUS2014, the object will be instantiated only during the final step of the workflow. But I need an instance during the beginning of the Requestor ->Approver negotiations as I am playing with events. These events needs an Object_key.
    How should I proceed here?
    Should I create a new logical Business Object like ZPOREQ where I have the above mentioned REQID as the key?
    And should I have an attribute of type BUS2014 inside the custom BO?
    How will I make use of the methods like BUS2014.Create etc which I may need to create the purchase document?
    Any small direction will be a huge help for me to get used to this wilderness.

    Hi,
    You should continue with the ABAP class idea. The business objects are kind of "obsolete" already, and if there is a need to create a new "object", ABAP classes are the way to go. Business objects are still useful, but I normally use them only when an existing standard business object fulfills the requirements (possibly with slight additions) which is almost never. 
    From my point of view you can use the existing class. Depending on the circumstances I normally have just one class that I use for both workflow and the possible other functionality that is required, but you have to understand that I have this goal in my mind already when starting the development process. As your class most probably has many useful features already (such as you have the header and item data as attributes etc. (if I understood correctly?), these are also useful in in workflow (class attributes will be available in WF container etc.). 
    If you are hesitant to use the same class directly in your workflow, you could also create a new class ZCL_REQUEST_FOR_WF (with the workflow interface), and then simply add your existing class ZCL_WF_REQUEST as an attribute to this new class. Then this new workflow class could include the pure workflow stuff, and your existing class the non-workflow stuff. But this most probably will not make much sense - just implement the if_workflow interface in your existing class (this is just one possibility that you might consider.)
    Regards,
    Karri

  • How to create XML string for an object matching the result of a marshal?

    I'm trying to create a XML string representation of an object which exactly matches the XML which results from marshalling the object into a request. I'm almost there except that the XML string I come up with is missing the attribute "standalone=\"yes\"" in the topmost xml element, and this attribute is present in the marshalled XML. I'm using the XML string to create a payload signature which must match exactly with the XML payload of the request, so the two XML representations of the object really do need to be identical.
    Here's what I'm doing to create the XML from the object:
       private String myObjectToXmlString (final MyObject myObject)
           throws Exception {
                 try {
               DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
               Document document = documentBuilder.newDocument();
               myObjectMarshaller.marshal(myObject, document);
               Source source = new DOMSource(document);
               StringWriter stringWriter = new StringWriter();
               Result result = new StreamResult(stringWriter);
               TransformerFactory factory = TransformerFactory.newInstance();
               Transformer transformer = factory.newTransformer();
               transformer.transform(source, result);
               return stringWriter.getBuffer().toString();
           } catch (Exception ex) {
               throw new Exception("Unable to convert a MyObject object to an XML String -- " + ex.toString(), ex);
       }The XML which is produced looks like this:
    <?xml version=\"1.0\" encoding=\"UTF-8\"?>
    <ns2:myObject xmlns:ns2=\"http://sunconnection.sun.com/xml\">
       <myObjectId>0</myObjectId>
       <objectType>1</objectType>
       <description>Test Object</description>
    </ns2:myObject>The payload object is marshalled to the request like so:
        // marshall the MyObject to the output stream
       OutputStream outputStream = myHttpUrlConnection.getOutputStream();
       myObjectMarshaller.marshal(myObject, outputStream);
       outputStream.flush();
       outputStream.close();When I view the XML payload of the request it looks like this:
    <?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
    <ns2:myObject xmlns:ns2=\"http://sunconnection.sun.com/xml\">
       <myObjectId>0</myObjectId>
       <objectType>1</objectType>
       <description>Test Object</description>
    </ns2:myObject>As you can see the two XML representations of the object are identical except for the standalone attribute in the xml element.
    It'd be a hack to make the assumption that the standalone attribute will always be there in the marshalled object and to just hard code it into the XML string returned by my object to XML method. Since I'm using the same Marshaller to create the XML string as I am to perform the marshalling to the request I assume that there's some way to make it give the same XML in both cases, and that I'm doing something wrong in my method which converts the object to an XML string. If anyone can see where I'm going wrong in that method (myObjectToXmlString() above), or can suggest a better way of doing this, then I'll certainly appreciate the insight.
    --James                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    It turns out that I was taking the wrong approach in my object to XML string method. A cleaner/better way to do it, which gives the correct result, is this:
        private String myObjectToXmlString (final MyObject myObject)
            throws Exception {
            try {
                ByteArrayOutputStream stream = new ByteArrayOutputStream();
                myObjectMarshaller.marshal(myObject, stream);
                return stream.toString();
            } catch (Exception ex) {
                throw new Exception("Unable to convert a MyObject object to an XML String -- " + ex.toString(), ex);
        }--James                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to create and instance of Java Object from an XML Document.

    Hi,
    How can we use a XML Document to create an instance of Java Object and do vice versa ie from the Java Object creating the XML Document.
    XML Document is available in the form of a String Object.
    Are there helper class available to achieve this.
    I need to do this in a Servlet.
    Regards
    Pramod.

    JAXB is part of JavaSE while Xmlbeans claims full schema support and full infoset fidelity.
    If the standard APIs do all that you need well then use them.

  • How do I create an effect on on object similar to this on Illustrator?

    How do I create an effect on on object similar to this on Illustrator?
    Please see the type show in the link provided : "CHIVAS"
    http://2.bp.blogspot.com/-F-lpKYp-QnE/UH8jwTkTmfI/AAAAAAAAOWQ/BuN9gm9Pe5U/s1600/Chivas+log o+2012.jpg
    Also if anyone knows what font this is, it would be much appreciated.
    Many thanks in advance,
    Nick

    Hello Ellie,
    This is what I do:
    First Create the brushes by selecting the shapes desired. Select the shape and place it into the burshes window.
    (Main Menu: Window + Brushes)
    Then A new window will show: Please select "New Scatter Brush"
    After you click OK, a new window will appear:
    In here I have selected Random Size, Spacing and Rotation. You may want to adjust the percentages to you design. The last thing to select is the Colorization Method; in this case "Tints" is selected because will allow me to change the color of the shape by using the color pallet window. After that click Ok and use the brush tool.
    This is the end result after using the Mask Feature:
    I know you can do something a lot better than this sample. I hope this helps!

  • How to create clone of exsiting Resource Object in OIM

    Hi..I need a help here.
    I have already one Resource object in OIM with all required mapping for Object reconciliation and Action rule.
    I want to create clone of the same resource object with diffrent name and keep same Object reconciliation and reconciliation Action mapping in OIM.
    How can i do that
    Thanks !!

    Take the export of this Resource Object.
    Do changes in the XML like resource Object Name, Form Names, Process Defintion, Email Template (if required)
    Save it and import it back into OIM.
    Note: Take export of independent Lookups or any configuration which you are using in existing Resource Object.

Maybe you are looking for

  • Enterprise Application and Web Portal Projects

    I know its possible to have one enterprise application that contains 2 web portal projects. The part Im unsure about is if it is possible to update one web project without having to bring down the other project. Supposedly through console you can do

  • Can't access anything in iMessage

    I don't know what I did with my imessage, but I can't log in anymore to my account and I can't access the Settings menu. Help please...

  • USB to RS232 Adapter and Driver Advise - Heeeeelllllllpppppp Please!!

    Hi All, Can someone please help me with an issue im having. I currently have a hl-340 usb to rs232 adapter for me to be able to Console on to cisco equipment (as i am a network engineer). I can not get this to work!! i have installed the pl2303 drive

  • Query Performance tuning and scope of imporvement

    Hi All , I am on oracle 10g and on Linux OS. I have this below query which I am trying to optimise : SELECT 'COMPANY' AS device_brand, mach_sn AS device_source_id,                        'COMPANY' AS device_brand_raw,                        CASE     

  • Does Foreign Currency Revaluation Post to an Account which is Open Item Man

    Hi, When running the FC revaluation, it is not posting to an account which is Open Item managed. I have read somewhere that FC Reval. does not post to accounts which are OI managed or the Recon accounts. Is this correct? If yes, what are the option f