Problem in date comparing with db2 database,query is not executing

hi everyone
i have one jsp page two text box
1. one for start date
2.second for end date
and for date selection have used datepicker
user selects the start date and end date .then clicks on view button
then i am retrieving these two dates on next jsp page .uptp here is ok
here i want display related data from db2 databse between these two dates(start date and end date)on next jsppage
but it is giving error my db2 dtabse uses the format of YYYY-MM-DD
the query i am not able execute
String strsql ="select voucher_master.VOUCHER_TYPE,voucher_master.VOUCHER_NO,dd_master.CHQ_DD_NO,dd_master.DD_DATE from voucher_master,dd_master Where voucher_master.VOUCHER_ID = dd_master.VOUCHER_ID and dd_master.DD_DATE >=" + fromdate + " and dd_master.DD_DATE <=" + todate + "";
it is giving error
please help me

Mutlipost: http://forum.java.sun.com/thread.jspa?threadID=5224616
Why aren't you checking your earlier posts for replies? Don't multipost, it's irritating and wastes times and energy.
People on the forum help others voluntarily, it's not their job.
Help them help you.
Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
(Yes I know it's on JavaRanch but I think it applies everywhere)
----------------------------------------------------------------

Similar Messages

  • Problem finding data in an Oracle Database using CMP beans

    I am having a problem retrieving data from an Oracle database that has a date as
    part of the key. This data was loaded into my database via a batch process writing
    in java using java.sql.Date to store the date information. When calling the findByPrimaryKey
    method of a CMP Entity Bean I continued to get the FinderException. I know this
    data is in my database because I can view the data via SQLPlus and Microsoft Access.
    Has anyone ever experience problems with CMP beans accessing data from an Oracle
    database that had a date as part if the key or with accessing data in the database
    that insert via another method outside of your CMP bean. I desperately need some
    answers.

    Hi Dave,
    You should probably post this type of question in the CMP or JDBC section
    for best results. Chances are that the date is suffering from a rounding
    problem (it could be a date/time in the database with a different time zone)
    or is not the date that you think it is (wrong century or millenium). I've
    seen both. You need to write a quick piece of code that loads in those
    values as both Java timestamps and dates and makes sure that they are what
    you think they are.
    Peace,
    Cameron Purdy
    Tangosol Inc.
    Tangosol Coherence: Clustered Coherent Cache for J2EE
    Information at http://www.tangosol.com/
    "Dave White" <[email protected]> wrote in message
    news:3c1a4ac3$[email protected]..
    >
    I am having a problem retrieving data from an Oracle database that has adate as
    part of the key. This data was loaded into my database via a batchprocess writing
    in java using java.sql.Date to store the date information. When callingthe findByPrimaryKey
    method of a CMP Entity Bean I continued to get the FinderException. Iknow this
    data is in my database because I can view the data via SQLPlus andMicrosoft Access.
    Has anyone ever experience problems with CMP beans accessing data from anOracle
    database that had a date as part if the key or with accessing data in thedatabase
    that insert via another method outside of your CMP bean. I desperatelyneed some
    answers.

  • Setting up Secure connection with DB2 database on IBM iSeries

    We have requirement to setup Secure connection with DB2 database on IBM iseries system. currently we are using ODBC type of connectivity which is not secure. Can anyone help how to set up Secure connectivity. below are the system details . . Application - IDQ - 9.6.0 Database - DB2 on IBM iSeries AS400

    We have requirement to setup Secure connection with DB2 database on IBM iseries system. currently we are using ODBC type of connectivity which is not secure. Can anyone help how to set up Secure connectivity. below are the system details . . Application - IDQ - 9.6.0 Database - DB2 on IBM iSeries AS400

  • I have problems with photoshop CS5, it is not executed, it remains looking for plugi

    I have problems with photoshop CS5, it is not executed, it remains looking for plugin

    Please read these and proceed accordingly (restoring Preferences after making sure all customized presets like Actions, Patterns, Brushes etc. have been saved might be of special interest):
    http://blogs.adobe.com/crawlspace/2012/07/photoshop-basic-troubleshooting-steps-to-fix-mos t-issues.html
    http://forums.adobe.com/docs/DOC-2325

  • My query is not executing properly after applying patches(bi.7

    iam working bi.7 support package 13
    after applying patches
    my query is not executing properly in production my problem with FI queries
    the query is executing properly but ihav created newformula using formulavariable that fields are not getting data in report if i click on currency conversion iam getting popup but currency translation coversion list is not coming and currency type(target currency also not dispalying)
    but if i execute same query in development its working properly newformula fields are getting data and currency conversion also working in development
    can u please help me in this issure
    i hope as soon i will get solutions from bw gurus

    That currency conversion problem is solved
    i checked TCODE:RSCUR IN PRD its not showing any details
    again i checked in dev and moved all currency types dev to production
    now its wokring
    i hope check with this it will work

  • Run a SQL procedure with multi database querying from Excel

    I'm using SQL Server 2008 Enterprise. I created a procedure in one database. The procedure is composed of several queries to different databases and the final combined result set is being displayed.
    I try to execute it via Excel, so the results will appear automatically in Excel sheet, but I'm getting the error:
    "The query did not run, or the database table could not be opened. Check the database server or contact your DBA. Make sure the external
    database is available and hasn't been moved or recognized, then try the operation again".
    I created a simpler procedure that queries only one database, and the results displayed at the Excel sheet with no issues.
    I suspect that, the original procedure failed due to the fact that I'm querying several databases in the procedure, when in the connection details of the "External Data Properties", only one database is mentioned.
    My question is - can it be solved? Can I use multiple databases in the procedure and see it in the Excel?
    Thanks, Roni

    Use Global Temporary table(##) instead of Local Temporary table(#).
    The scope of the temp table is limited to one database and it dispose automatically when jump to another database.
    No, that is not correct. From where did you get that idea?
    USE tempdb
    go
    CREATE TABLE #a(a int NOT NULL)
    INSERT #a(a) VALUES(9)
    go
    USE master
    go
    SELECT a FROM #a
    go
    USE msdb
    go
    SELECT a FROM #a
    go
    DROP TABLE #a
    And Roni's stored procedure does not even change database.
    ...however, the temp tables may very well be the problem, but for a completely different reason. Excel may ask SQL Server for the shape of the result set before it runs the procedeure, and this does not work with the temp tables. For this reason, using a
    table variable my save the show.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Database.LoadDataSet() method throwing error while retriving data from IBM DB2 database

    Database.LoadDataSet() method is throwing error during retriving data from empty table of IBM DB2 database. It is giving error code "SQL0100W".
    “Error Message: 0NO_DATA [02000] [IBM] [DB2 / NT] SQL0100W FETCH, whether there is a line to be UPDATE or DELETE, or of the query result is an empty table .
    SQLSTATE = 02000”

    Hello SharayuPandit,
    For issues regarding DB2, i suggest that you could post it to DB2 related forum:
    https://www.ibm.com/developerworks/community/forums/html/forum?id=11111111-0000-0000-0000-000000000842
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Creating Data Server with DB2

    Hello Experts,
    I am creating data servers with database DB2 in xMII 12.1
    This is the details:
    Connector : IDBC
    Connector type : SQL
    JDBC driver : com.inet.tds.TdsDriver
    Server Package : com.sap.xmii.Illuminator.connectors.IDBC
    Server Url : jdbc:inetdae:BGC125:5912?database=MD1&sql7=true
    When I am checking the status, it is coming stopped
    I had checked in NWA, and JDBC driver is green.
    Please help me on that.
    Regards,
    Dipak

    Thanks for the quick reply John. I am trying to get user and group information, and also doing some complex manipulation. I need this to verify user access and some other stuff. I will not always have access to HSS and cannot always export the information, thus the need to use the HSS java API.
    I'm trying to pull it out of HSS and put it into an Oracle table in a standard format where I'll use the information and do reporting off of it. I've developed a java class that does migrates the data over, but its crude and I'd like to move it into ODI with some of our projects that are currently doing the same thing with other ERP such as Ebiz and Peoplesoft.
    If I can recode some of the java in ODI, how would I go about doing that. Where would I include the libraries, etc.? is there a tutorial or a place where I can get started on that.
    Thanks for all the help.

  • Problem formatting date labels with DateTimeAxis and parseFunction

    I'm working with a line chart that gets its data from a MySQL
    database and
    I'm using a DateTimeAxis to try to display the date on the
    x-axis. The date
    is formatted in the database as "YYYY-MM-DD" - however when I
    run the
    application I am only seeing the date displayed as MM/YY. I
    am using a
    parseFunction as follows:
    public function myParseFunction(s:String):Date {
    var a:Array = s.split("-");
    var newDate:Date = new Date(a[0],a[1]-1,a[2]);
    return newDate;
    I was trying to experiment with setting dataUnits to days or
    weeks but it
    doesn't seem to change. Can anyone figure out what I'm doing
    wrong?
    Thanks,
    -Dan
    The code for the line chart is:
    <mx:LineChart x="10" id="linechartHist"
    dataProvider="{dataProvider1}"
    showDataTips="true" width="100%" height="100%" y="10">
    <mx:horizontalAxis>
    <mx:DateTimeAxis displayName="Date" title="Date (Month)"
    parseFunction="myParseFunction" dataUnits="days"/>
    </mx:horizontalAxis>
    <mx:horizontalAxisRenderer>
    <mx:AxisRenderer canDropLabels="true"/>
    </mx:horizontalAxisRenderer>
    <mx:verticalAxis>
    <mx:LinearAxis title="Price" id="vAxis"
    labelFunction="vLongLabels"
    interval="10"/>
    </mx:verticalAxis>
    <mx:series>
    <mx:LineSeries displayName="MSFT" yField="MSFT"
    xField="date"/>
    <mx:LineSeries displayName="PG" yField="PG"
    xField="date"/>
    <mx:LineSeries displayName="NTDOY" yField="NTDOY"
    xField="date"/>
    </mx:series>
    </mx:LineChart>

    Hi
    Try using "sv_SE" locale.

  • How make connection using data source with db2

    hiiiiii,
    please tell me the procedure to connect with db2 through data source (driver should support updatable ResultSet)

    Read the documentation of the application server used how to create a datasource. Once done that, you can obtain it in your Java code by JNDI. After retrieving the DataSource instance from JNDI, you can just use DataSource#getConnection() to acquire a connection from that datasource.

  • Date compare with system date

    Given date time is in yyyyMMddHHmmss format, want to compare with system date time.
    ie given date time is greater than zero then go inside if block otherwise else block.

    I am using below code which always greater than zero. But I want to use compare to method to compare given date with system date and goto if or else condition:
    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
             String delaytimeFormat = sdf.format(new Date("10/10/2009"));    
             System.out.println("delaytimeFormat: "+delaytimeFormat);
             long timeDiff = Long.parseLong(delaytimeFormat) - System.currentTimeMillis(); 
             System.out.println("timeDiff->"+timeDiff);
             String newCallbackUrl = null;
            if(timeDiff > 0){
                 s = s+" new URL"+"test" ;
                 System.out.println("if:->"+s);
            else{
                 System.out.println("else");
            }

  • Multi-suggestions/questions/problem: (1)garageBand: working with cycle regions; (2) ToS note;  (3) apple user accounts

    (1) GarageBand:  "Working with Cycle Regions"
    Preamble:  Cycle regions are very nice.  Thank you for recycling the concept.  That'd probably be great (unless you argue it'd be 'enabling') to include libraries of scripts that work with cycle regions  ('such as' note 1).  Thank you for cycle regions in GarageBand.
    "'such as' note 1"   if C[i] is a cycle region, C[1] is the first take, C[2] the second take...
    The ability to select/program different values of i for C[i] emplacements from a controller box, that could accomodate basic scripts that select i values from libraries, or generate them by simple formulas, or generate them by taking values from an "input text document" that could be easy output from basic custom software.  
    Issue:  Basic improvements to cycle region management.  Currently, if I want to know what music is in C[i], I have to set the i value from a drop down menu by clicking on the region.  If I want to search for that passage, I have to maximially do that n many times (n = the number of cycles per cycle region).  One faster way to search would be to allow pasting of sequential +1 iteration-wise cuts from that cycle region, and fast forwarding through that, or whatever.  Another way, is that while recording, some visual notification could be present, telling me which take # is being recorded.  (Maybe die-hard musicians used to counting don't worry about it.)
    (2) Terms of Service  Issue
    An "email Terms of Service" button would be nice.
    Also, a "readers digest" cliff notes version of practical center points would be nice.  Such could come with disclaimers that the notes don't necessarily reflect views of apple, although could be popularized "3rd party watchdog sides" that rate applicability of such disclaimers.
    (3) Apple User Account
    Some third party algorithm generated this user name.  I never wrote that in myself.  What is that about?  Is my account security in some crisis?
    Thanks!

    Please reply and let me know i if this was helpful or I am missing something. this worked for me and it has been about a week and my backups are still running.

  • The SQL query is not executing

    Hi
    I have the following situation: In a project we designed our reports calling a stored procedure the exits in a MS SQL Server 200 database. The Stored Procedures works fine and when they are used in the report everything works perfectly.
    The reports are being made with CR DEsigner 11, when the designer ends them, ha pass them to me and we put them in our java web application. I open them and even preview them since the Crystal Reprots Perspective of Eclipse and I can see the data, so everything to this point is OK.
    The problem comes when I change of connection, I'm trying to connect every report to the same host and database, and when the reprot is displayed in the browser there is no data. I profile the SQL commands that are executed when the report is requested and I found that the reprot is not executing the stored procedure.
    I guess because i'm connectring the report to the same database and host that was used when the report is created and i'm also passing exactly the same parameters of the stored procedure, then report thinks that it doesn't have executing again becuase it will be the same information.
    SO, i wonder if there is a way to request to the report to execute the sql query every time i have to display it.
    thanks for any help.

    What happens when you try to view the report using a simple viewer.jsp?without changing the connection?
    2009-05-25 14:06:09,250 ERROR com.businessobjects.reports.sdk.JRCCommunicationAdapter -  detected an exception: Error de conexión: [SQLServer 2000 Driver for JDBC]Error establishing socket.
    But the database server is ok, so i think the rpt needs more information to be connect to the database.
    Also what happens if you dont use the data bean and give everything there only?
    The same, the rpt is not executing the stored procedure.
    Did anything change on the RDBMS side? Additional packages, changes to the schema, ownership, etc?
    No, the server is ok and the database is ok.
    If you configure Log4J logging to DEBUG, you should see the database invokes from the Crystal Java engine, specifically the queries sent and the number of rowsets returned. Do you notice any errors?
    I have a problem here with log4j. In my project i'm using spring and with the help of spring i configure log4j, basically with spring is easier to configure log4j.
    I'm telling you this because i have log4j working but when my application reaches the code to change the connection to the rerport, log4j dies and stop sending any message to the stdout or to a log file. I haven't since this behavior in any other app o library. So i want to guess i have something wrong with my log4j or maybe with log4j+spring.
    So, i remove all the code of spring referring to log4j, but the problem with log4j wasn't solved.
    What i will try now is to remove spring from the project.
    This is my log4j.properties:
    log4j.rootLogger=DEBUG, stdout
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n

  • Query is not executing on Multiprovider.

    Hi Bw xpertz
    Could any one clarify me. I have added a infocube to the existing multiprovider.I had taken all the selection in the identification tab like chars,time chars and keyfigs.
    When i am looking the data via listschema its showing the data .How ever when i generated a new query on the multiprovider with new keyfigure which i added via new cube is not displaying.
    Evry thing is ok up to cube level i checked with a query on cube too.
    How ever ther is a problem with multiprovider.
    I dint get what xact reason behind this.Could any one help me in this aspect.
    When i am trying to execute the other queries on the same multiprovider they are working fine.
    I had gone through some of the earlier postings too. but i didnt get the answer..
    When i am trying to execute the newly generated query its not working ..and taking more than 1 hr even the data is not displaying.
    Any suggestions would be appreciable.
    Thanx in advance
    RMK
    *No need to say good answers can get full pointz**
    **Sharing is the only way to improve the knowledge**

    Are you filtering by any char not contained in your new cube or by any char tha althoug contained in your cube the ID is not marked in multiprovider definition?
    Check if any modification to any cube in multicube had deactivated the multicube.
    Try to do a query only for your new cube, filtering by infoprovider, the data must be there.

  • Select query is not executing

    Hi Friends,
    my code is :
    itab-vbeln = bseg-vbeln.
    if not itab-vbeln is initial.
    select single vbeln inco1 inco2 into ( itab-vbeln itab-inco1 itab-inco2)
    from vbrk where vbeln = itab-vbeln.
    appned itab.
    note : here inco1 inco2 are incoterms
    my question is  can we direct move the values of bseg-vbeln into itab-vbeln. ???
    and i am generating the report with one varient , when i debug this report the
    there is no value in bseg-vbeln. it is showing null value.thats why my select query is not working..but i want execute this select query final.
    in output i want display the inco1 inco2 data.(incoterms)
    any help please.
    urgent.
    regards,
    vijay.

    Hi Vijay,
    First you need to check it out whether <b>itab-vbeln = bseg-vbeln</b> is in with in LOOP or not (<b>if ITAB is intenal table</b>)
    if itab is internal table you should write above statement with in loop, and also check it out in debug mode why bseg-vbeln value is not coming.
    and one more thing you need to make small correction in ur code use ',' .
    select single vbeln inco1 inco2 into ( <b>itab-vbeln, itab-inco1, itab-inco2</b>)
    from vbrk where vbeln = itab-vbeln
    Note: when ever use select single u should pass values into work area, dont use internal table .
    <b>if you have more doubts just send your entire code then i will rewrite it.</b>
    <b>Reward with points if useful.</b>
    Regards,
    Vijay Krishna

Maybe you are looking for

  • Unit Cost of non stock material - Hubwoo Catalogue

    Hi Team, There is one requirement to transfer the the cost of matrial from SAP PM to ArcFM. Here the materials are assigned to the operations in the PM order. Here we want to transfer the service cost and material cost of the particular operation to

  • How to create a file in application data local folder which is not hidden in windows store app?

    I want to create a log file in ApplicationData local folder.      m_StorageFile = await ApplicationData.Current.LocalFolder.CreateFileAsync(m_Name.Replace(" ", "_") + ".log",                           CreationCollisionOption.OpenIfExists); First time

  • I bought new Ipad mini, wifi Cellular. problem with Apple ID

    I bought new Ipad mini, wifi Cellular. And created Apple ID, its asking VISA card number to register payment method, I given my ICICI VISA card details but Its showing as, "Payment method declined". Anybody can help me?

  • Saving Forms

    I am currently using Adobe Acrobat X Pro, and I am creating a form that allows the user to fill in certain fields.  I would like the user to be able to save their own copy, but not actually replace the original form. Is this possible and if so, how d

  • Error message in vao1

    i am creating an order for the service items , and i am getting the error message in vao1 like customer 27823738 has been assigned order block , please guide me how to overcome this.