Can I use ' ', ' ', '= ' and ' =' with java.sql.Timestamp objects in EJB-QL

ie. Is this valid?
<query>
<description>Find data between dates</description>
<query-method>
<method-name>findMetricsByDate</method-name>
<method-params>
<method-param>java.sql.Timestamp</method-param>
</method-params>
<method-params>
<method-param>java.sql.Timestamp</method-param>
</method-params>
</query-method>
<result-type-mapping>Local</result-type-mapping>
<ejb-ql>
SELECT OBJECT (o) FROM MetricResults AS o WHERE MetricResults.date > ?1 AND MetricResults.date < ?2
</ejb-ql>
</query>

No. Not with current EJB 2.0 CMP specs at least. Later revisions are supposed to fix this, but for now, this seriously limits the usefulness of EJB-QL.
.P.

Similar Messages

  • Ejb-ql and java.sql.Timestamp object

    Hi, I have a mySql database table that has a column containing a Timestamp object. I need a finder method for my ejb's that will allow me to query the table for rows between certain dates.
    In other words, I need to query for entries that have a Timestamp object between 2 specified dates.
    One solution is to change the column type from Timestamp to long (date in milliseconds). That way I can use the BETWEEN clause to search between 2 longs. I would rather not do that. Does anyone know of a way that I can search between 2 Timestamp objects?

    You can use the SQL BETWEEN clause with dates, just use it like this:
    WHERE OrderDate BETWEEN '1998/5/1' AND '1998/5/31'

  • Can not create WebService with java.util.Locale object why?

    I am unable to create a WebService which contains a Locale Object in the request.  I assume its because the java.util.Locale object is not Serializable.  Can anyone tell me if there is a work around for this?

    Hi,
    Make sure your strings for Locale follow these rules...
    The language string should be lower-case, two-letter codes as defined by ISO-639.
    http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt
    The country string should be upper-case, two-letter codes as defined by ISO-3166.
    http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html
    Or try with some constant Locales like
    Locale.CANADA
    Locale.US
    regards,
    Uma

  • How can I use tomcat with Java ServerFaces

    Is there a tutorial on Java ServerFaces using tomcat?

    the JWSDP1.3 download includes Tomcat
    Follow links from here - http://java.sun.com/webservices/index.jsp
    NOTES
    #1 JWSDP1.3 includes a Beta release of Tomcat 5
    So you may want to also download the latest version from the apache/Tomcat websites
    http://jakarta.apache.org/tomcat/index.html
    #2 JWSDP1.3 contains JSF EA4 - JSF 1.0 Beta is now available
    follow the link on the JWSDP web site above

  • Usage of java.sql.Timestamp with classes12.zip and ojdbc14.jar  ?

    Hi all,
    If i'm using java.sql.Timestamp with classes12 it is functioning perfectly,
    if i'm using ojdbc14 and java.sql.Timestamp it is functioning in different way and failing to do the action..
    Example : update set xxx=yy where time = my Timestamp object set in Prepared statement
    Hope to see the answer

    http://forum.java.sun.com/thread.jspa?threadID=460615&messageID=2116517
    Timestamp insert problem
    Using the "classes12.zip" file that comes with the distribution for Oracle versions 8.1.6.x and 8.1.7.x, Oracle's DATE datatype is mapped to the "java.sql.Timestamp" class. However, the "ojdbc14.jar" driver maps DATE to "java.sql.Date", and "java.sql.Date" only holds a date (without a time), whereas "java.sql.Timestamp" holds both a date and a time.

  • Java.sql.Timestamp creation with value -4712.01.01 (oracle min timestamp)

    How can I create ajava.sql.Timestamp with the value -4712.01.01?
    Trying Timestamp timestamp = new Timestamp( -210863523208000l );leads to the date 4713-02-08 00:06:32.0.
    Or what is the minimal java.sql.timestamp value in Java?
    Edited by: bejq on 17.03.2009 08:56

    bejq wrote:
    Thanks for your quick answer.
    Yes it is 1st January 4712 BC.
    Timestamp timestamp = new Timestamp( -4712, 1, 1, 0, 0, 0, 000 );//deprecated Method
    System.out.println( timestamp ); // returns 2813-02-01 00:00:00.0
    System.out.println( timestamp.getTime() );// returns -150904688400000Thats not what I want.You have lost me then. Unless of course you want to use SimpleDateFormat with an appropriate TZ to parse the date to a java.util.Date and then construct a java.sql.Timestamp from the java.util.Date using the java.util.Date#getTime() method to construct the java.sql.Timestamp .
    Edited by: sabre150 on Mar 17, 2009 10:41 AM

  • A silly question about oracle.sql.timestamp and java.sql.timestamp

    Hi,
    I'm looking at a method that takes objects of type Object and does stuff if the object is really a java.sql.timestamp. If it is not then an error is flagged. In my case it flags an error when an object of type oracle.sql.timestamp is passed to it. Not really entirely comfortable with java (i'm still learning it), here's my stupid question :- why isn't oracle.sql.timestamp a subclass of java.sql.timestamp? Also in various books it indicates that java.sql.timestamp maps to oracle.sql.timestamp. Does that mean you have to physically do the mapping:
    i.e.
    java.sql.Timestamp t = new Timestamp( new oracle.sql.Timestamp( CURRENTTIMESTAMP ).timestampValue() );
    or is there something else to it.
    Thanks.
    Harold.

    The best forum for this is probably Forum Home » Java » SQLJ/JDBC
    Presumably you are refering to oracle.sql.TIMESTAMP. While this is intended to (and does) correspond to java.sql.Timestamp it can't be a subclass because it needs to be a subclass of oracle.sql.Datum.

  • EJBQL, MIN and java.sql.Timestamp

    I am trying to create a new finder method for a cmp bean which returns me the date of the oldest bean available.
    the ejbql query looks like this:
    select MIN (a.receiveDate) from AssetSchema as a
    receiveDate is defined as a java.sql.Timestamp field in the bean. I am getting the following error:
    Bean: Asset
    Method: clover.AssetLocal findOldestDeleted()
    EJBQL: select MIN (a.receiveDate) from AssetSchema as a
    Error: JDO75334: Invalid type 'java.sql.Timestamp' of select clause expression for finder method.
    anything wrong with the query or .....

    Instead of using a finder, use an ejbSelect method. You can then use the aggregate function MIN. Wrap the ejbSelect in a home method.
    In remote Home interface, define home method:
    public java.lang.String selectMinSingle() throws RemoteException;
    define the ejbSelect method in EJB class:
    public abstract java.lang.String ejbSelectMinSingle() throws FinderException;
    The ejbSelect is wrapped in a ejbHome method:
    public java.lang.String ejbHomeSelectMinSingle()
    try {
    String s = ejbSelectMinSingle();
    return s;
    } catch(Exception e) {
    throw new EJBException("ejbHomeSelectMinSingle: " + e);
    Call home method from client:
    String s1 = beanHome.selectMinSingle();
    Not sure if this is what you're looking to do.
    There is also the ORDER BY clause; i.e.,
    <ejb-ql>Select p.quantity from ProductBean p ORDER BY p.quantity</ejb-ql>
    use the ASC or DESC keyword:
    <ejb-ql>Select p.quantity from ProductBean p ORDER BY p.quantity ASC</ejb-ql>
    For finder:
    query>
    <description></description>
    <query-method>
    <method-name>findProductsByHighestQuantity</method-name>
    <method-params />
    </query-method>
    <ejb-ql>Select DISTINCT OBJECT(p) From ProductBean p ORDER BY p.quantity DESC</ejb-ql>

  • RQL Error - JQuery Datepicker and java.sql.Timestamp

    Hello everyone,
    I am using JQuery Datepicker to select start and end date range.
    Both start date and end date are successfully passed as like this. 10/01/2013 and 10/31/2013
    It has java.sql.Timestamp mapping in both startDate and endDate.
    Property name in component browser is transactionTimestamp.
    It gives me following error when i passed both parameters.
    <dsp:droplet name="/atg/dynamo/droplet/RQLQueryForEach">
        <dsp:param name="repository" value="/atg/commerce/order/OrderRepository" />
        <dsp:param name="itemDescriptor" value="inStorePaymentStatus" />
        <dsp:param name="queryRQL" value="transactionTimestamp>=:startDate AND transactionTimestamp<:endDate" />
    **** Error    Wed Oct 02 16:07:21 IST 2013    1380710241490    /atg/dynamo/droplet/RQLQueryForEach    unable to parse/execute query due to RepositoryException    CONTAINER:atg.repository.RepositoryException; SOURCE:java.sql.SQLException: java.sql.SQLDataException: ORA-01843: not a valid month
    It gives NO error when i passed single parameter.
      <dsp:param name="queryRQL" value="transactionTimestamp>=:startDate"/>
    can anyone suggest me a solution.
    Thanks
    saminda konkaduwa

    Hi all,
    Found the solution. We have to use parameter converter tools as well. that is the additional parameter called "date" where we passed date format.
    <dsp:param name="startDate" param="10/12/2012" date="MM/dd/yyyy"/>
    <dsp:param name="endDate" param="10/12/2015" date="MM/dd/yyyy"/>
    Explanation :
    JSP FILE ( testing.jsp)
    =================
    <dsp:page>
    <head>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    <script type="text/javascript" src="merchant_portal_ajax_agent_report.js"></script>
    <script type="text/javascript">
        $(function() {
            $("#startDate").datepicker();
        $(function() {
            $("#endDate").datepicker();
    </script>
    </head>
    <body>
    <table>
                        <tr>
                            <td>Start Date</td>
                            <td><input type="text" id="startDate" class="picker" name="sDate" /></td>
                            <td>End Date</td>
                            <td><input type="text" id="endDate" class="picker" name="sDate" /></td>
                            <td><input value="Find" type="submit" class="atg_button" onclick="loadAgentReport()" /></td>                       
                        </tr>
                        <tr>
                                    <div id="agentReportTable"></div>
                        </tr>
    </table>
    </body>
    </dsp:page>
    JAVA SCRIPT FILE (merchant_portal_ajax_agent_report.js)
    ============================================
    function loadAgentReport() {
        var startDateValue = $("#startDate").val();
        var endDateValue = $("#endDate").val();
            $(document).ready(function() {
              $.ajax({
                    type : "POST",
                    url : "merchant_portal_view_agent_report.jsp",
                    data : {
                       startDate : "" + startDateValue + "" , endDate : "" + endDateValue + ""
                    success : function(result) {
                        $("#agentReportTable").html("");
                        $("#agentReportTable").html(result);
    JSP File ( This invoked by Jquery ) merchant_portal_view_agent_report.jsp
    =======================================================
    <dsp:page>
                                <dsp:droplet name="/atg/dynamo/droplet/RQLQueryForEach">
                                    <dsp:param name="repository" value="/atg/commerce/order/OrderRepository" />
                                    <dsp:param name="itemDescriptor" value="inStorePaymentStatus" />
                                    <dsp:param name="queryRQL" value="agentId=:agentId AND transactionTimestamp>:startDate AND transactionTimestamp<:endDate" />
                                    <dsp:oparam name="output">
                                       <dsp:valueof param="element.transactionId"/>  <dsp:valueof param="element.transactionStatus"/>
        </br> 
                                    </dsp:oparam>
                                    <dsp:oparam name="empty">
                                             No data found
                                   </dsp:oparam>
                               </dsp:droplet>
    </dsp:page>
    Thanks
    saminda konkaduwa

  • How can I use LCCS with ActionScript 3 and Flash CS4?

    Hi,
    Using Stratus I was able to create an an application using Action Script 3 and Flash CS4.  The sample code on the Adobe site was quite straight forward and easy to understand.  I now want to switch over to  LCCS but can't find anything any where on how to use Action Script 3 and Flash CS4 with LCCS.  Do I need to know Flex to be able to use LCCS?  Everything was quite simple and easy to understand with Stratus and makes complete sense.  But LCCS is really confusing.  Is there any sample code on how to establish a connection in Action Script 3 and then stream from a webcam to a client.  There is nothing in the  LCCS SDK that covers Flash and Action Script 3.  Please help!  I found the link below on some forum but it takes me nowhere.
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=75 9&threadid=1407833&enterthread=y

    Thanks Arun!
    Date: Thu, 29 Apr 2010 11:44:10 -0600
    From: [email protected]
    To: [email protected]
    Subject: How can I use LCCS with ActionScript 3 and Flash CS4?
    Hi,
    Welcome to the LCCS world.
    Please refer to the SDK's sampleApps folder. There would be an app called FlashUserList. The app demonstrates how LCCS can be used with Flash CS4. Its a  pretty basic app, but should help you moving.
    We are trying to improve our efforts to help developers in understanding our samples. Please do let us know if we can add something that would help others.
    Thanks
    Arun
    >

  • How can i update my old 2006 iMac Intel core 2 duo running 10.6.8 to OSX Lion so that I can sync using iCloud with my newer devices?  Mountain Lion is not an option for my older model and Lion is no longer available at App store.

    How can i update my old 2006 iMac Intel core 2 duo running 10.6.8 to OSX Lion so that I can sync using iCloud with my newer devices?  Mountain Lion is not an option for my older model and Lion is no longer available at App store. 

    Call Apple's online store's telesales agents: 1-800-MY-APPLE (1-800-692-7753) or Customer Service and Sales Support at 1-800-676-2775. For Lion you'll get a redemptions code via e-mail and need to DL from the Mac Apple Store (requires SL 10.6.6+).

  • Java.sql.Timestamp and the Epoch

    Hello all
    according to the JavaDoc for Timestamp, the long parameter of the constructor represents "milliseconds since January 1, 1970, 00:00:00 GMT". However, running
    class Main
      public static void main (String [] args)
        System.out.println (new java.sql.Timestamp (0l));
    } produces 1970-01-01 01:00:00.0, which is 3.6 million ms since the time stated in the doc.
    My box is set to GMT. Does anyone know of an explanation for this?
    Cheers

    I'd say that extra hour is the daylight savings hour.
    The GMT timezone uses it, but UTC ( Universal time coordinates ) doesn't.
    regards,
    Owen

  • Hello Apple. Iphone6 ios8.0.2. I have problem with activation imsg and fctm. My number doesnt display on both apps. I can only use them with my apple ID. How can i fix this problem. Country:Azerbaijan. Number:  *********

    Hello Apple. Iphone6 ios8.0.2. I have problem with activation imsg and fctm. My number doesnt display on both apps. I can only use them with my apple ID. How can i fix this problem. Country:Azerbaijan. Number:  *******
    <Edited by Host>

    Hello Khayalh,
    You should be able to link your phone number by following the steps in the article below. From your iPhone, sign out of FaceTime and iMessage and then sign back in and it should link. Check in the Start Conversation With and I Can Be Reached at section in iMessage and FaceTime respectively. 
    iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/HT5538
    Regards,
    -Norm G. 

  • I am using iPhoto '09 Version 8.1.2 but can not use iCloud with it. I've looked for updates in iPhoto and iLife'11 but no luck. Suggestions very welcome.

    I am using iPhoto '09 Version 8.1.2 but can not use iCloud with it. I've looked for updates in iPhoto and iLife'11 but no luck. Suggestions very welcome.

    No you won't necessarily lose your photos when upgrading but it's very very unwise not to back up first. Backing up is like using a seat belt in a car. You can drive without one for years and have no issues, but if you do have a problem the outcome will be a lot worse. So, too, with back ups. And upgrading is one of those times when the risks of a problem are higher.
    Most Simple Back Up:
    Drag the iPhoto Library from your Pictures Folder to another Disk. This will make a copy on that disk.
    Slightly more complex: Use an app that will do incremental back ups. This is a very good way to work. The first time you run the back up the app will make a complete copy of the Library. Thereafter it will update the back up with the changes you have made. That makes subsequent back ups much faster. Many of these apps also have scheduling capabilities: So set it up and it will do the back up automatically.
    Example of such apps: Chronosync - but there are many others. Search on MacUpdate or the App Store

  • ABAP interfaces build using BDC and BAPIs can be used/replaced with the XI?

    Hi,
      We have develeloped our interfases using BDC and BAPIs. Now our client has decited to implement XI. Now could you please help in finding whether these interfaces can be used/replaced with the XI.
          If yes, please let us know how?
    Thanks and Regards,
    Shweta

    Singh,
    Check this threads where they have discussed on how to use them with XI:
    import BAPI into XI
    Re: interface of xi with bapi
    Re: BDC
    Regards,
    ---Satish

Maybe you are looking for

  • WHAT VERSION IS MY 500GB TIMECAPSULE

    Hi, im a little confused at what version I have of my 500GB TimeCapsule, on the box it says:MB764B/A Model No = A1302, is this the late 2009 model? Thankyou

  • How to turn off iphone when display issue

    HOw can i turn off the iphone 4S when there is an issue with the screen and i cannot get to swipe it off

  • VA01. userexit for contract create

    Hi all, I have a requirement in which while creating contract thru va01i have to show a popup after the credit limit exceeded message so that user can edit the values and save it.my problem is i have coded a popup in the userexit_save_document to sho

  • BAPI'S to activate for Funds managment

    Hi All, While creating purchase order we have an error related to Funds managment. in the program we have the FM 'FM_ACCOUNT_DERIVE'.we have got an error like funds centre value as taken Current date. Through this FM only we got the current date valu

  • Will I lose everything if I upgrade?

    Forgive me if this is a stupid question, but if I run the upgrade to Yosemite (I'm currently on Mountain Lion), will I have to reinstall all my software? Will I lose everything on my hard drive? I've backed up to Time Machine but can it restore stuff