Passing date to another form and use the date in sql statement

hello! to all programmers
i have some small problem that need some help.
i want to use date value parameter from the first page in the second page sql statement but i get invalid cursor state error so if anyone can solve this problem or give me a better solution to do this process.
thanks in advance
p/s
EBDATE is define as date data type in my database.
this is part of my jsp code...
<---------------------------------------------------------------------->
SimpleDateFormat sdfInput = new SimpleDateFormat( "yyyy-MM-dd" );
SimpleDateFormat sdfOutput = new SimpleDateFormat ( "dd/MM/yyyy" );
String date= request.getParameter("date");
Date date1 = sdfInput.parse(date);
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:wtmis_db","","");
Statement stmt=con.createStatement();
ResultSet set=stmt.executeQuery("select * from ELECTRICBIL where EBDATE="+sdfOutput.format(date1));
if (set!=null)
set.next();
     Date bildate =set.getDate ("EBDATE");
     Date sdate =set.getDate ("EBSTARTDATE");
     Date edate =set.getDate ("EBENDDATE");
     int kw =set.getInt ("EBKILOWATT");
     int maxdemand =set.getInt ("EBMAXIMUMDEMAND");
     int days =set.getInt ("EBDAYS");     
<---------------------------------------------------------------------->

Try this
<%
while(set.next())
Date bildate =set.getDate ("EBDATE");
Date sdate =set.getDate ("EBSTARTDATE");
Date edate =set.getDate ("EBENDDATE");
int kw =set.getInt ("EBKILOWATT");
int maxdemand =set.getInt ("EBMAXIMUMDEMAND");
int days =set.getInt ("EBDAYS");
%>
<tr>
<td width="211"><div align="left"><b>Bill Date :</b></div></td>
<td width="573"><%=sdfOutput.format(date1)%></td>
</tr>
<tr>
<td width="211"><div align="left"><b>Bill From :</b></div></td>
<td width="573"> <input type="text" name="textfield" value="<%=sdate%>"></td>
</tr>
<tr>
<td width="211"><div align="left"><b>Bill To :</b></div></td>
<td width="573"> <input type="text" name="textfield2" value="<%=edate%>"></td>
</tr>
<tr>
<td width="211"><div align="left"><b><b>kiloWatt Use (Rm)</b>: </b></div></td>
<td width="573"> <input type="text" name="textfield2" value="<%=kw%>"></td>
</tr>
<tr>
<td width="211"><div align="left"><b>Max Demand kiloWatt (Rm):</b></div></td>
<td width="573"> <input type="text" name="textfield2" value="<%=maxdemand%>"></td>
</tr>
<tr>
<td width="211"><div align="left"><b>Days In Billing :</b></div></td>
<td width="573"> <input type="text" name="textfield2" value="<%=days%>"></td>
</tr>
<%
%>
i hope. Now u wouldn't get any error message...but...u wouldn't get results as well...Check ur date format with access date format....
Revert back

Similar Messages

  • Taking the data from interactive forms and load the data into SAP system?

    hi all,
    I want to know how to take the data from interactive forms and load the data into sap system?
    if u have any sample scenario, explain with that.
    thanks in advance
    Raja

    Hello,
    Check the program...
    SAPBC480_DEMO.
    Check the below threads
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/88e7ea34-0501-0010-95b0-ed14cfbeb85a
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/bfbcd790-0201-0010-679d-e36a3c6b89fa
    Thanks
    Seshu

  • How do I take two separate non numeric fields in a acrobat form and combine the data to display in a third separate field?

    How do I take two separate non numeric fields in a acrobat form and combine the data to display in a third separate field?

    You have to use custom JavScripting to concatenate the first 2 fields. You cannot use the first 2 calculation options because they force the values of the fields to a numeric value or ignore string values.
    Possible scripts for the 3rd field are:
    event.value = this.getField("Text1").valueAsString + " " + this.getField("Text2").valueAsString;
    or
    event.value = this.getField("Text1").valueAsString.concat( " ",  this.getField("Text2").valueAsString);
    If you do not want change the separator or not show the separator when on or the other field is empty, you will need to add more code to adjust for change.
    The above scripts will also concatenate number because the field values are read as strings and not numbers.
    There is also a generalized user written function to concatenate up to 3 fields with a separator that adjust for missing data.

  • Do I need to purchase an iPad with cellular to use imaps or can I purchase an iPad with wifi only and use the data connection on my iPhone.

    Do I need to purchase an iPad with cellular to use imaps or can I purchase an iPad with wifi only and use the data connection on my iPhone.
    My aim is to have maps on the bigger iPad screen.

    the wifi version don't have an gps chip

  • Command to display only the latest modified directory within another directory and display the date of the last modify

    Okay I want to be able to run a .cmd file from my workstation to query a certain folder on remote clients. I want the command to find the specific folder within another folder and display the current date modified of that folder. I was
    able to use a command prompt to list the subdirectory that I was looking for on a specific computer by using the
    DIR command. It was something like this:
    dir C:\ParentFolder\ChildFolder /ad /o-d /b
    This shows a list of directories within the "ChildFolder" directory. The output would be something like:
    dir C:\ParentFolder\ChildFolder /ad /o-d /b
    folder1
    folder2
    folder3
    folder4
    So what I need now is a way to just show the folder in this group that had the most recent modification. For example if "folder2" was the most recently modified folder in the group, I would like my command line to just display "folder2 04/08/14
    04:13 PM
    Any help would be greatly appreciated.
    Cheers!

    Thanks Mike! This is what I was looking for! Much appreciated!
    I would like to run this as a script from my admin workstation that will query clients that have the "ChildFolder" directory. Is there a way to output the results to a .log/.txt file? I was working on .cmd that looked like this:
    {REM Verify current folder on remote clients
    del current-folder.log
    ECHO WorkStation-1 >> CurrentFolder/current-folder.log 2>&1
    ECHO ---------------- >> CurrentFolder/current-folder.log 2>&1
    DIR \\WorkStation-1\C$\ParentFolder\ChildFolder /ad /o-d /b >> CurrentFolder/current-folder.log 2>&1
    ECHO ---------------- >> CurrentFolder/current-folder.log 2>&1}
    My results looked something like this:
    " WorkStation-1
    Folder1
    Folder2
    Folder3
    I know it's ugly, but it was working (somewhat). I just needed to list only the most recently modified folder. Anyway, I've rambled enough.
    Is there a way to get my desired results using the PS command that you provided me?

  • How can i read all the lines from a text file in specific places and use the data ?

    string[] lines = File.ReadAllLines(@"c:\wmiclasses\wmiclasses1.txt");
    for (int i = 0; i < lines.Length; i++)
    if (lines[i].StartsWith("ComboBox"))
    And this is how the text file content look like:
    ComboBox Name cmbxOption
    Classes Win32_1394Controller
    Classes Win32_1394ControllerDevice
    ComboBox Name cmbxStorage
    Classes Win32_LogicalFileSecuritySetting
    Classes Win32_TapeDrive
    What i need to do is some things:
    1. Each time the line start with ComboBox then to get only the ComboBox name from the line for example cmbxOption.
       Since i have already this ComboBoxes in my form1 designer i need to identify where the cmbxOption start and end and when the next ComboBox start cmbxStorage.
    2. To get all the lines of the current ComboBox for example this lines belong to cmbxOption:
    Classes Win32_1394Controller
    Classes Win32_1394ControllerDevice
    3. To create from each line a Key and Value for example from the line:
    Classes Win32_1394Controller
    Then the key will be Win32_1394Controller and the value will be only 1394Controller
    Then the second line key Win32_1394ControllerDevice and value only 1394ControllerDevice
    4. To add to the correct belonging ComboBox only the value 1394Controller.
    5. To make that when i select in the ComboBox for example in cmbxOption the item 1394Controller it will act like i selected Win32_1394Controller.
    For example in this event:
    private void cmbxOption_SelectedIndexChanged(object sender, EventArgs e)
    InsertInfo(cmbxOption.SelectedItem.ToString(), ref lstDisplayHardware, chkHardware.Checked);
    In need that the SelectedItem will be Win32_1394Controller but the user will see in the cmbxOption only 1394Controller without the Win32_
    This is the start of the method InsertInfo
    private void InsertInfo(string Key, ref ListView lst, bool DontInsertNull)
    That's why i need that the Key will be Win32_1394Controller but i want that the user will see in the ComboBox only 1394Controller without the Win32_

    Hello,
    Here is a running start on getting specific lines in the case lines starting with ComboBox. I took your data and placed it into a text file named TextFile1.txt in the bin\debug folder. Code below was done in
    a console app.
    using System;
    using System.IO;
    using System.Linq;
    namespace ConsoleApplication1
    internal class Program
    private static void Main(string[] args)
    var result =
    from T in File.ReadAllLines(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TextFile1.txt"))
    .Select((line, index) => new { Line = line, Index = index })
    .Where((s) => s.Line.StartsWith("ComboBox"))
    select T
    ).ToList();
    if (result.Count > 0)
    foreach (var item in result)
    Console.WriteLine("Line: {0} Data: {1}", item.Index, item.Line);
    Console.ReadLine();
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my webpage under my profile but do not reply to forum questions.

  • I want to transfer my data to new computer and use the new computer for iPhone 5. Have anyone can recommend the best way for me?

    I have some problem to transfer my data via home sharing. (Maybe my internet connection is poor)
    I tried to transfer all the apps and music via home sharing. When it's done, it showed the internet connection is time-out. (So sad )
    So I want some people to help me about the methods to transfer datas from old computer to the new one.
    Then I can use the new one with new iphone 5.
    PS. I use iPhone 3gs with iOS 4.3.5.
    Old computer uses Microsoft WIndows XP.
    New one uses Microsoft Windows 7.
    Thank you

    you can't recover iOS crypted backup password, for security purposes. your backup is useless. sorry.
    if you still have your old iPhone, make a new back-up

  • How to measure voltage changes using a NI-9219 with strain gauges and use the data in labview

    I am updating an old LabView/Data Acquisition system that uses strain gauges to measure two forces (normal and axial) as well as two moments (Pitch and Roll). I am having trouble reading the voltage changes over my strain gauges using my NI-9219 as well as filtering the data with both a lowpass and smoothing filter. The program attached has the project and should have all the sub-vi's used in the program. This program was written on LabView version 8.5 and is being updated to a 2013 version of LabView. Also, the hardware previously used was a combination of a NI SCB-68 and NI USB-6251. If anyone could help me it would be greatly appreciated! 
    Attachments:
    New SSWT.zip ‏751 KB

    Hi Coffeyfj, 
    Did you ever had this set up working? The first thing that I would do as I mentioned in the previous comment would be to use one of the LabVIEW examples. I recommended to you using the (strain - Continuous Input.vi). If you can read any voltage changes with the example vi, then we will know the problem we are having is in your code. If you cannot read any voltage changes using the example I mentioned, we can start trouble shooting the hardware connections. Are you connecting the excitation voltage? If yes, Are you making the right connections. Please refer to page 19 of the following document (half and full bridge modes)
    NI 9219 Operating Instructions and Specifications - February 2009
    http://digital.ni.com/manuals.nsf/websearch/4197ED4BD126E0B486257546005851CA
    Regards,
    William Fernandez
    Applications Engineer 
    National Instruments 

  • How to parse and use the data that is coming as XML using DAL script

    Hi,
    I am trying to implement a solution where we are getting a doPublish request using EWPS webservice call which just contains a transaction id. I need to read a table using transaction id to get the xml. I know how to read the xpath and implement the solution if the XML is coming as input. If it stored on a table where Documaker should read and get the XML, how can we implement that?

    If you are saying that your XML is stored in a table, I'm not sure there is any method, using DAL or rule, that would know how to load XML from there. I can be wrong, but I think it has to load the XML from disk only - either as the extract file or as an external file referenced from the extract - using a Rule or DAL to go after the external file.
    Perhaps you could clarify the situation a little more and someone might offer a suggestion.

  • Schedule job in background and ftp the data to non-sap system

    Hello All,
    I have a requirement where in i have to write a program(with selection screen) to download 2 files into application server(frequency: end of each day i.e daily at 23:59), and then in turn i need to put those two files into FTP server using FTP script.
    i guess my flow of the code should be
    1. write the program with selection screen and
    2. get the data from corresponding tables and put it into internal tables.
    3. then i have download the data into application server
    my question is : how i will schedule the job in background to download the data into application server daily? using job_open, job_submit, job_close?
    4. then how i need to move the files from application server to FTP server using FTP SCRIPT?
    Also my doubt is once i execute the program ONLY, the background job is triigred (because i wrote job_open, job_submit and job_close inside my program). then how will i input the data into screen daily and download the data into application server in background automatically???? i am confused ...
    Please help me to solve the above issues
    thanks
    sangeetha

    >
    sangeetha s k wrote:
    How my data in application server will be transfer to another system using above FM? Because i am not passing application server file path in SAP to that FM. Could you please explain ?
    So the path name and the file name are always the same? In that case you could simply create a SM49 entry with hard coded file & path name.
    An easy example for the COPY command under WINDOWS OS:
    Create a command in SM49 called ZCOPY with following data:
    Operating System = Windows NT
    OS command: cmd
    Parameters for os command: /C copy  "C:\tmp\my_file.txt" "z:\tmp\my_file_copy.txt"
    Additional parameters allowed: (leave blank)
    In this case you would call SXPG_COMMAND_EXECUTE by filling this 2  parameters:
         commandname                  = 'ZCOPY'     
         operatingsystem               = 'Windows NT'
    In the case that the file name and the path are not fixed you would set the following in the SM49 definition:
    Additional parameters allowed: X
    In this case you would call SXPG_COMMAND_EXECUTE by filling this 3  parameters:
         commandname                   = 'ZCOPY'     
         operatingsystem                = 'Windows NT'
         additional_parameters       = params  "<== fill in the path and file name during run time into this variable

  • Can it be possible that a user insert data by a form and then create a PFD?

    Can it be possible that a user insert data by a form, then store the data in the Data Base and finally create a PFD?
    If this is possible with BI Publisher, what do i have to do to link the form with the BIPublisher interface?
    Regards

    Hi
    If you just have a PDF form and do not need to pre populate data then all you need do is:
    1. Add a submit button to the PDF - you can use the full Adobe product or a BIP API
    2. Load the PDF as a template with a dummy data source.
    The user can then run the "report" as usual. When they have completed the form they can hit the Sumit button on the form. Adobe will then scrape the data out of the form in an XML format and post it to the URL you added. At the other end of the URL you need a servlet to accept and process the XML data.
    If you need to prepopulate the form you can attach a datasource to the PDF template but ensure the fields are preserved after running the form for the user through the config options.
    BIP does have APIs to populate drop lists, etc but these are not exposed thru through the BIP UI.
    I'll try and write this up for the blog and OTN soon
    Regards
    Tim

  • Receive POST data from another URL and process using Struts

    Hi there
    We have a website and as of now we are receiving some data from another URL which is received as an appended part of the URL. My application uses Struts and we process the received data and send back a response.
    Now my question is, I have been asked to change this behavior because there are more parameters now which cannot be passed through the URL. I am supposed to get the data from the other URL as POST data (as a form) and I have to create a new Struts action to receive this data, process it and send the response back to the requesting URL.
    Please explain me how to do this using some example code snippets.
    Thanks a lot

    Lookup in XI is used to call the target data storage system and get data from there to your mapping programme.
    In XI you can do Lookup in Message Mapping, Java Mapping and in XSLT Mapping. Previously Lookup in XI was system dependent. But now what ever the system are i.e. SAP system or non-sap system(Oracle,MS SQL etc) lookup API are same.
    Overview of Lookup
    - Lookups are used to identify/request the data from mapping program.
    - It interrupt the process and looking for data which was stored in target system.
    - It get that data and comeback to process and continue with that data.
    Types of Lookups in XI
    - JDBC Lookup: JDBC lookup is used for accessing data from database (non SAP).
    - RFC Lookup: RFC lookup is used for accessing the SAP Data.
    - SOAP Lookup: SOAP lookup is used for accessing data from Webservice
    Steps to perform Lookup in Mapping
    Import package com.sap.aii.mapping.lookup.*;
    Create connection to the target Database system.
    // Determine communication channel created in ID
    Channel channel = null;
    channel = LookupService.getChannel("DB-SYSTEM-NAME","DB-CHANNEL-NAME");
    // Get system accessor for the channel.
    DataBaseAccessor accessor = null;
    accessor = LookupService.getDataBaseAccessor(channel);
    Build the Query String.
    Getting Result
    // Execute Query and get the values.
    DataBaseResult resultSet = null;
    resultSet = accessor.execute(Query);

  • SharePoint 2010 and InfoPath 2010 - Load data from another form

    Hello,
    I have two questions on this topic.
    Is it possible to open an empty InfoPath form and give the user the option of loading it with data from a previously submitted form?  They want the ability to save some time of filling in some fields that were entered in an earlier form.  Any description
    of how or a link would be appreciated.
    Also, if I create an InfoPath form template in a SharePoint Form Library like above, the user would like to be able to have multiple forms associated with each other.  There would be some key that packaged them with each other.  Then from within
    one of the form, there would be an option to submit the whole "package" at once.  All the forms associated with that one key.  Again, any examples or links would help.
    Thank you!

    You can use InfoPath Query Data connection to point to a library / list where your data is located.
    For loading data, you should be using Form Load event, and then populate ID's to a Drop down list.
    when the user selects the ID from the Drop Down list, you can write another rule to query data based on the ID's from the list and store the values in your current form.
    For the second question, you should try creating a single form with multiple views. and show hide views based on user or business logic.
    You can write multiple submit rules to submit Form data to different different library / list.
    here are some links for your reference -
    Add, delete, and switch views (pages) in a form
    http://office.microsoft.com/en-us/infopath-help/add-delete-and-switch-views-pages-in-a-form-HA101732801.aspx
    Add a data connection to a SharePoint document library or list
    http://office.microsoft.com/en-us/infopath-help/add-a-data-connection-to-a-sharepoint-document-library-or-list-HP010093160.aspx
    Automatically query by using a data connection
    http://office.microsoft.com/en-us/infopath-help/automatically-query-by-using-a-data-connection-HP001100271.aspx
    SharePoint List Data Connections in InfoPath 2010
    http://blogs.msdn.com/b/infopath/archive/2010/05/06/sharepoint-list-data-connections-in-infopath-2010.aspx
    Hope this helps!
    MCITP: SharePoint 2010 Administrator
    MCTS - MOSS 2007 Configuring, .NET 2.0
    | SharePoint Architect | Evangelist |
    http://www.sharepointdeveloper.in/
    http://ramakrishnaraja.blogspot.com/

  • HT201250 how can i pass information from one mac to another mac by using the time capsule

    how can i pass information from one mac to another mac by using the time capsule

    If you want to transfer files, settings, etc., you must open Migration Assistant (Applications > Utilities) in the Mac that you want to transfer the files and follow the instructions

  • How Do i create a list that will show in a dropdown box with the list being pulled from another tab and not the cell data format junk?

    How Do i create a list that will show in a dropdown box with the list being pulled from another tab and not the cell data format junk?
    I currently run OS X 10.10.1
    Now i have been trying to work on this for a while now and what i want to do should be simple but its apparently not.
    Here is an example of what i want to happen.
    I will have 2 tabs: Contact | Sales
    Now Contacts will have the list of names and various information about a customer, While Sales will have one drop-down box for each Cell Row that will show the names of the person in tab contacts
    for what i am wanting to do i cant use the data format pop-up menu because the list is edited everyday several times a day.
    Now how do i do this, Excel can do this so how can numbers do it?

    Hi Shegra,
    Paste this into a applescript editor window and run it from there. In the script you may need to adjust the four properties to agree with your spreadsheet. Let me know if you have any questions.
    quinn
    Script starts:
    -- This script converts column A in one table into an alphabetized list of popups. It copies the last cell in that column. Then reverts the column to text. It then refreshes popups in column A of a data table starting with a user defined row.
    property DataEntrySheet : "Sheet 1" --name of sheet with popups to be refreshed
    property DataEntryTable : "Sales" --name of table with popups to be refreshed
    set copyRange to {}
    property PopValueSheet : "Sheet 1" --name of sheet with popup values table
    property PopValueTable : "Contacts" --name of table with popup values
    set PopStartRow to {}
    tell application "Numbers"
      set d to front document
      set ps to d's sheet PopValueSheet
      set pt to ps's table PopValueTable
      set s to d's sheet DataEntrySheet
      set t to s's table DataEntryTable
      set tf to t's filtered --this records filter setting on data Entry Table
      display dialog "Start from row #..." default answer "" with icon 1 -- with icon file "Path:to:my.icon.icns" --a Week # row
      set PopStartRow to {text returned of result}
      tell pt --convert list to alphabetized popups
      set ptRows to count rows
      set copyRange to ("A2:" & name of cell ptRows of column "A")
      set selection range to range copyRange
      set selection range's format to text
      sort by column 1 direction ascending
      set selection range's format to pop up menu
      -- popupsmade
      set selection range to cell ptRows of column 1 of pt
      set v to value of cell ptRows of pt
      end tell
      activate application "Numbers"
      tell application "System Events" to keystroke "c" using command down
      tell pt
      set selection range to range copyRange
      set selection range's format to text
      end tell
      tell t
      set filtered to false
      set tRows to count rows
      set pasteRange to ((name of cell PopStartRow of column "A") & ":" & (name of cell tRows of column "A"))
      set selection range to range pasteRange
      tell application "System Events" to keystroke "v" using command down
      set filtered to tf
      end tell
    end tell

Maybe you are looking for

  • Simple button script not working

    I am using AS2 and need help figuring out why this simple button script is not working: stop(); buttonWS1.onRelease = function(){                     gotoAndStop("Stage1and2_Boss",4); buttonWS2.onRelease = function(){                     nextFrame();

  • HELP! Keyboard -lowercase 'stuck'-no caps, no Shift key-Can't 'select all'

    HELP! I have tried all sorts of things, like: - removed syst prefs to desktop then restarted - un-done, re-done, re-booted - tried various options in International and Keyboard & Mouse - run disk utility, both from startup CD AND in target disk mode

  • Modify unbounded task flow for login process

    I wonder if I can use the unbounded task flow for login process. I have a login page, a home page and a change password page. As per the requirements, I need to show the login page first, if user password is expired, I need to show change password pa

  • Order by and minus in char fields

    I have a test query that i have ordered by the expected result order. select t from ( select cast('1' as nvarchar(20)) as t union all select '1---qa' union all select '1q' union all select '1q1' union all select '1qz' union all select 'a' union all s

  • Problem converting any AP to LAP - Cert not yet valid

    All, I have a problem trying to convert APs to LAP. I have the following scenario: - 2 WLC 5508. - For the WLC the image is 7.0.220.0 - 10 APs registered. 7 Cisco 1310 and 3 Cisco 1242. - Time on the WLC indicates is July 4th 2013 - 19:20:00 I have 5