Generate date and ID in textboxes automatically

Hi,
  Can anyone send me the code to generate date and Id automatically in the textboxes.im using SAP NWDS.Should I write the code 4 this in the jsp or Servlet?
With Regards,
Jais.

Hi Jaisamma,
let me know , what u mean with this ID?.
  In JSP , you have two options,
1) You can use javascript to find out the Current date and format it.
2) You can use java code itself to find out current days date and format it.
In JSP
Using javascript
<b><html>
<script language="javascript">
function onLoadin()
d = new Date();
var date = d.getDate();//For getting date range 1-31
var month = d.getMonth()+1;//Value  range 0-11
var year = d.getYear();
for formatting it  to presentable format
var sydate = date + "/" + month + "/" +year;
document.myForm.datum.value= sydate;
</script>
<body onLoad="onLoadin()">
<form name="myForm">
<input name="datum" type="text" size="13" maxlength="10"/>
</form>
</body>
</html>
go through this.
http://www.javascriptkit.com/jsref/date.shtml
</b>
this contains details of javascript date object
http://www.w3schools.com/jsref/jsref_obj_date.asp
Using java code
<%@ page import="java.text.*" %>
<%@ page import="java.util.*" %>
<%
Format formater = new SimpleDateFormat("dd/MM/yyyy");
Date  syDatum = new Date();
<td><font SIZE="1">Date</FONT></td>
                    <td align="left"><i><%=formater.format(syDatum)%></i></td>
%>
let me know , is your application using any database for storing the ID ?.
                       Regards
                       Kishor Gopinathan
Message was edited by: Kishor Gopinathan

Similar Messages

  • My iMessage and Facetime won't activate, says waiting for activation. All photos and contacts are restored, using email and wifi only, no service. Only issue is date and time will not automatically set.

    My iMessage and Facetime won't activate, says waiting for activation. All photos and contacts are restored, using email and wifi only, no service. Only issue is date and time will not automatically set.

    Howdy eewebe13,
    So you have no cellular service but are on Wi-Fi yet iMessage and Facetime are waiting for activation.
    Please step through this article for that scenario.
    If you get an error when trying to activate iMessage or FaceTime - Apple Support
    Thank you for visiting Apple Support Communities.
    Nubz

  • ICal doesn't show delegation, and generates date and time error messages in /var/log/system.log

    I have a problem with my iCal, when I use my caldav account, I can only see my own calendar on my MBA, on my co-workers MBP it works fine with both my account and his. My co-worker can't see other calendars than his own when he uses iCal on my laptop.
    We can reproduce this problem on his computer by setting Location to Automatic rather than Amsterdam, then after deleting iCal's cache files, the caldav account and setting the Location back to Amsterdam solves the problem for him.
    It does not solve the problem for me (or several other co-workers). We've been looking at this for a few weeks, and we can not find any clear pattern why certain machines have this problem and others don't.
    All machines (both affected and unaffected) are running Mac OS 10.7.2 with iCal 5.0.1
    I've spoken to Apple support over the phone (in the Netherlands), unfortunately, they couldn't help with this.
    So far we've tried numerous location and language settings, but on affected machines nothing appears to solve the delegation problem (which we assume to be connected to the error messages iCal generates)
    Starting iCal yeilds the following error messages in /var/log/system.log:
    Jan  5 11:31:05 dhcp-91 [0x0-0x58f58f].com.apple.iCal[23884]: line 1,1: expecting FREQUENCE, found 'BYDAY' as token type 5
    Jan  5 11:31:05 dhcp-91 iCal[23884]: iCalendar recurrence failure BYDAY=-1SU;FREQ=YEARLY;BYMONTH=3
              line 1,6: unexpected char: '='
    Jan  5 11:31:05 dhcp-91 [0x0-0x58f58f].com.apple.iCal[23884]: line 1,1: expecting FREQUENCE, found 'BYDAY' as token type 5
    Jan  5 11:31:05 dhcp-91 iCal[23884]: iCalendar recurrence failure BYDAY=-1SU;FREQ=YEARLY;BYMONTH=10
              line 1,6: unexpected char: '='
    Jan  5 11:31:05 dhcp-91 iCal[23884]: Unexpected EOF, returning last token as fallback
    Jan  5 11:31:05 dhcp-91 iCal[23884]: VTIMEZONE does not match System Time Zone (Europe/Amsterdam) for 20100105T000000 to 20120105T000000: (
                  "interval: 2001-01-01 01:00:00 +0100, offset: 3600"
              ) != (
                  "interval: 2010-03-28 03:00:00 +0200, offset: 7200",
                  "interval: 2010-10-31 02:00:00 +0100, offset: 3600",
                  "interval: 2011-03-27 03:00:00 +0200, offset: 7200",
                  "interval: 2011-10-30 02:00:00 +0100, offset: 3600"
              BEGIN:VTIMEZONE
              X-LIC-LOCATION:Europe/Amsterdam
              TZID:Europe/Amsterdam
              BEGIN:DAYLIGHT
              TZOFFSETFROM:+0100
              TZNAME:CEST
              TZOFFSETTO:+0200
              DTSTART:19700329T020000
              END:DAYLIGHT
              BEGIN:STANDARD
              TZOFFSETFROM:+0200
              TZNAME:CET
              TZOFFSETTO:+0100
              DTSTART:19701025T030000
              END:STANDARD
              END:VTIMEZONE
    Jan  5 11:31:05 dhcp-91 [0x0-0x58f58f].com.apple.iCal[23884]: line 1,1: expecting FREQUENCE, found 'BYDAY' as token type 5
    Jan  5 11:31:05 dhcp-91 iCal[23884]: iCalendar recurrence failure BYDAY=-1SU;FREQ=YEARLY;BYMONTH=3
              line 1,6: unexpected char: '='
    Jan  5 11:31:05 dhcp-91 [0x0-0x58f58f].com.apple.iCal[23884]: line 1,1: expecting FREQUENCE, found 'BYDAY' as token type 5
    Jan  5 11:31:05 dhcp-91 iCal[23884]: iCalendar recurrence failure BYDAY=-1SU;FREQ=YEARLY;BYMONTH=10
              line 1,6: unexpected char: '='
    Jan  5 11:31:05 dhcp-91 iCal[23884]: Unexpected EOF, returning last token as fallback
    Jan  5 11:31:05 dhcp-91 iCal[23884]: VTIMEZONE does not match System Time Zone (Europe/Amsterdam) for 20100105T000000 to 20120105T000000: (
                  "interval: 2001-01-01 01:00:00 +0100, offset: 3600"
              ) != (
                  "interval: 2010-03-28 03:00:00 +0200, offset: 7200",
                  "interval: 2010-10-31 02:00:00 +0100, offset: 3600",
                  "interval: 2011-03-27 03:00:00 +0200, offset: 7200",
        "interval: 2011-10-30 02:00:00 +0100, offset: 3600"
              BEGIN:VTIMEZONE
              X-LIC-LOCATION:Europe/Amsterdam
              TZID:Europe/Amsterdam
              BEGIN:DAYLIGHT
              TZOFFSETFROM:+0100
              TZNAME:CEST
              TZOFFSETTO:+0200
              DTSTART:19700329T020000
              END:DAYLIGHT
              BEGIN:STANDARD
              TZOFFSETFROM:+0200
              TZNAME:CET
              TZOFFSETTO:+0100
              DTSTART:19701025T030000
              END:STANDARD
              END:VTIMEZONE
    And when I close iCal I get:
    Jan  5 11:33:25 dhcp-91 [0x0-0x592592].com.apple.iCal[23894]: token mismatch: 4 != 5

    I'm seeing the same thing, and I can't even find where OS X stores calendars on disk anymore...

  • User Generated Data and Cardinality Estimates

    Platform Information:
    Windows Server 2003 R2
    Oracle Enterprise Edition 10.2.0.4
    Optimizer Parameters:
    NAME                                 TYPE        VALUE
    object_cache_optimal_size            integer     102400
    optimizer_dynamic_sampling           integer     2
    optimizer_features_enable            string      10.2.0.4
    optimizer_index_caching              integer     90
    optimizer_index_cost_adj             integer     30
    optimizer_mode                       string      CHOOSE
    optimizer_secure_view_merging        boolean     TRUE
    Test Case:
    var csv VARCHAR2(250);
    exec :csv := '1,2,3,4,5,6,7,8,9,10';
    EXPLAIN PLAN FOR WITH csv_to_rows AS
            SELECT UPPER(
                            TRIM(
                                    SUBSTR
                                            txt
                                    ,       INSTR (txt, ',', 1, level  ) + 1
                                    ,       INSTR (txt, ',', 1, level+1) - INSTR (txt, ',', 1, level) -1
                    )       AS token
            FROM    (
                            SELECT ','||:csv||',' txt
                            FROM dual
                    )       t
            CONNECT BY LEVEL <= LENGTH(:csv)-LENGTH(REPLACE(:csv,',',''))+1
    SELECT * FROM csv_to_rows;
    SELECT  * FROM TABLE(DBMS_XPLAN.DISPLAY);
    Results:
    Execution Plan
    Plan hash value: 2403765415
    | Id  | Operation                     | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT              |      |     1 |    19 |     2   (0)| 00:00:01 |
    |   1 |  VIEW                         |      |     1 |    19 |     2   (0)| 00:00:01 |
    |*  2 |   CONNECT BY WITHOUT FILTERING|      |       |       |            |          |
    |   3 |    FAST DUAL                  |      |     1 |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter(LEVEL<=LENGTH(:CSV)-LENGTH(REPLACE(:CSV,',',''))+1)
    Statistics
              1  recursive calls
              0  db block gets
              0  consistent gets
              0  physical reads
              0  redo size
            502  bytes sent via SQL*Net to client
            396  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
             10  rows processed
    Question:
    Every once in a while I need to use [Tom Kyte's Varying in Lists|http://tkyte.blogspot.com/2006/06/varying-in-lists.html] method (for 9i as indicated in his blog entry) to convert a comma separated list to a "bindable" in list.
    As one can see above the cardinality estimates are not correct. The execution plans I have seen from this method usually result in a nested loop join using an index. While this makes sense for small result sets it may not be the most efficient method with larger number of entries in the comma separated list.
    Has anyone found a way to expose the correct or near correct cardinality to the optimizer at runtime? I can use the cardinality hint but the problem with that is that it must be defined as a scalar value and that may not work for all cases. The dynamic sampling won't work in this scenario because cardinality statistics already exist against DUAL.
    I haven't noticed any detrimental effects in my environment so this may be purely an academic discussion but I thought I'd throw it out there :)

    I have definitely considered using this as a possibility but I have tried to shy away from writing data (even temporarily) when all I'm looking to do is query data.I agree with you about hard-coding the cardinality values.
    A silight variation on David's suggestion is to use the dynamic sampling hint to get the statistics at run-time. There will be a slight performance cost to do this.
    Remember that all of the explain plan statistics are estimates, which may or may not be accurate. Usually they are good, but every once in a while they are incorrect.

  • Date and Time generation

    hi,
    I need to "Generate Date and Time between two date ranges" ie
    For Example if my start date is 12/Jan/2007 00:00:00 AM and end Date is 13/Jan /2007 00:00:00 PM. i need to generate
    my output as
    Date
    12/Jan/2007 00:00:00
    12/02/2007 00:01:01
    12/03/2007 00:02:00
    12/04/2007 00:03:00
    12/05/2007
    12/06/2007
    12/07/2007
    12/08/2007
    so on till
    13/Jan/2007
    I need a record for every minute in the date range ir 24hrs or 1 day.
    my output should be 1440 records(24* 60)
    Thanks a ton in advance

    sql>
    alter session
    set nls_date_format = 'dd/Mon/yyyy hh:mi:ss am'
    Session altered.
    sql>define dt1 = '12/Jan/2007 12:00:00 am'
    SP2-0863: iSQL*Plus processing completed
    sql>define dt2 = '13/Jan/2007 12:00:00 am'
    SP2-0863: iSQL*Plus processing completed
    sql>
    select to_date('&dt1')+(1/(24*60))*(n-1)
    from
      (select rownum n
       from dual
       connect by level <= (to_date('&dt2')-to_date('&dt1')) * (24*60));
    TO_DATE('12/JAN/200712: 
    12/Jan/2007 12:00:00 am 
    12/Jan/2007 12:01:00 am 
    12/Jan/2007 12:02:00 am 
    12/Jan/2007 12:03:00 am 
    12/Jan/2007 12:04:00 am 
    12/Jan/2007 12:05:00 am 
    12/Jan/2007 11:57:00 pm 
    12/Jan/2007 11:58:00 pm 
    12/Jan/2007 11:59:00 pm 
    1440 rows selected.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Hello everyone, How do I add by default a date on the actual E-mail page the date and time of when I have sent the e-mail ? Thank you very much for your suggestions. Kind regards, Christopher H. Bull, Birmingham, UK.

    Birmingham, Thursday 2. Feb. 2012
    To whom it may concern,
    I have an issue regarding the e-mail system, and I wanted to know how I can add a default that the date and time is added automatically to the E-mail page everytime I draft a new e-mail.
    Does anyone know how do create a "plug-in" to enable me to have the date and t ime posted on the e0-mail page every time i send a new e-mail ?
    If there is a plug in which is compatible with Lion iMac computers thart insert the date and time into every E-mail I send ?
    Kind  regards
    Christipoher H. Bull
    E-mail: [email protected]

    This supports macros and variables, it doesn't specifically state date and time, but if it supports variables I'd be surprised if it didn't have variables for those:
    http://email.about.com/cs/mailplugins/gr/mailtemplate.htm
    This one also supports variables and may do what you want:
    http://itunes.apple.com/gb/app/logical-mail-free/id451881152?mt=12
    You may want to look for more, I found those by googling 'mac email templates variables'.

  • Timezone effects on Date and Timestamp fields in af:query component

    Hello,
    I'm working on an ADF application where time zone is configured as follows:
    * Dynamic View Layer time zone is configured in trinidad-config.xml file and bound to a session scoped value:
    <trinidad-config>
      <skin-family>fusionFx</skin-family>
      <time-zone>#{sessionScope.tz}</time-zone>
    </trinidad-config>* ADF BC time zone is configured in adf-config.xml file and bound to View Layer time zone:
    <adf-config>
      <user-time-zone-config xmlns="http://xmlns.oracle.com/adf/usertimezone/config">
        <user-timezone expression="#{adfFacesContext.timeZone.ID}"/>
      </user-time-zone-config>
    </adf-config>The problem here is that Dates and Timestamp values work as expected all over the application except for the af:query component. When displayed as af:inputDate in af:form, Dates and Timestamp values are NOT getting converted to the time zone (TZ) configured in trinidad-config.xml file, whereas TimestampTz and TimestampLtz are. However, when displayed in af:query component, Dates and Timestamp values are automatically converted to View Layer TZ after a search has been performed.
    For example, say View Layer TZ = US/Pacific and we enter 01/jun/2011 as a search criteria of type Date and then click on the Search button. The displayed value automatically changes to 25/nov/2011, that is, it gets converted to the WLS JVM time zone, which is set to Europe/London.
    Is conversion of Date and Timestamps in af:query component the expected behaviour or could this be a bug?
    Is there any way to avoid this conversion?
    Thanks in advance
    Version:
    ADF Business Components 11.1.1.59.23
    Java(TM) Platform 1.6.0_21
    Oracle IDE 11.1.1.4.37.59.23
    PMD JDeveloper Extension 4.2.5.3.0
    Repost on 26-nov-2011 9:29
    Repost on 28-nov-2011 15:10
    Edited by: Barbara Gelabert on 26-nov-2011 9:29
    Edited by: Barbara Gelabert on 28-nov-2011 15:10

    Hi,
    Thanks for your reply. This certainly seems promising. However, I am getting a connection error now.
    The following...
    jar_loaded = require 'ojdbc14.jar'
    puts "Oracle jar loaded? #{jar_loaded}"
    puts "Starting active record"
    require 'rubygems'
    gem 'activerecord'
    gem 'activerecord-oracle_enhanced-adapter'
    require 'activerecord'
    puts "Connecting to MXGN"
    ActiveRecord::Base.establish_connection(
    :adapter => 'oracle_enhanced',
    :host => 'THEHOST',
    :port => '1550',
    :database => 'THEDB',
    :username => 'THEUSER',
    :password => 'THEPASSWORD'
    ... produces
    Oracle jar loaded? true
    Starting active record
    Connecting to MXGN
    ERROR: ActiveRecord oracle_enhanced adapter could not load Oracle JDBC driver. Please install ojdbc14.jar library.
    ERROR: ActiveRecord oracle_enhanced adapter could not load Oracle JDBC driver. Please install ojdbc14.jar library.
    C:/jruby/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:76:in `establish_connection': Please install the oracle_enhanced adapter: `gem install activerecord-oracle_enhanced-adapter` (LoadError) (RuntimeError)
    from H:\sandbox\DBPlay\lib\main_enhanced.rb:12
    I'm confused. Am I missing the driver, or have I failed to setup the enhanced Oracle adapter?
    I have tried moving the jar to $JRUBY_HOME/lib too, but the result was the same.
    All help would be greatly appreciated.
    Many Thanks
    Adrian

  • Automatically displaying date and time in a date/time field on form initialize

    Good day all;
    I am trying to have the current date and time automatically be generated in a “date/time” field when the form is opened.
    I went through the forum and found an entry from Srini “ xfa.host.messageBox("" + Date());” . Of course this brought up a system message box with the date and time.
    I then tried “DateTimeField1.rawValue = (“”+date())… This also gave me a system message box with the date and time…
    Please let me know where I am going wrong
    Chomp

    Found the answer... And yes... in was in the "help" section... What can I say I was making it a lot more crazy than I needed to.
    You can use a date/time field to automatically show the current date by using the Runtime Property option in the Value tab of the Object palette.
    When using a current date field, the date updates to reflect the system’s current date each time a user opens the form.
    1.
    In the Library palette, click the Standard category and drag a Date/Time Field object onto the form design.
    2.
    In the Object palette, click the Value tab and select Calculated - Read Only from the Type list.
    3.
    Select the Runtime Property option.
    4.
    View the form in the Preview PDF tab.

  • Automatic file generation using system date and time

    Hi guys,
    Iam trying to generate a path for file creation automatically using System date and time. I am running into errors with respect to special characters in filename. I am trying to parse the string to get date and time without the '/' and ':' but have not been successful. is there a better way to do it? Please help! I am trying to avoid a dialog box for user to enter a filename.
    Thanks!
    V
    I may not be perfect, but I'm all I got!
    Solved!
    Go to Solution.

    here is a little experiment .... building the path out of %m (month) %d (day) %(year) type stuff might help.
    Attachments:
    putting time in path.vi ‏7 KB

  • Can't remotely connect to my server if I automatically set date and time

    Hello.
    I have configured my OS X 10.6.2 server and am able to remotely manage it.
    The only ports I have opened on my router is for Mail and VPN services.
    Things work perfectly because I can connect using VPN to iChat, iCal, Address Book, Server Admin, Workgroup Manager, AFP, FTP and such.
    The problem is that on my laptop from home, or wherever, if its time is set to update automatically from an NTP server (I have tried with Apple's as well as my server for the NTP Servers) then I cannot connect to my server at all...
    The moment I turn off the auto date and time and reconnect to the office's VPN, I am able to use Server Admin, AFP, FTP, Workgroup Manager, Screen Sharing, etc, etc, etc.
    It's utterly frustrating because I have to open system preferences, disable the automatic date and time update, connect to the VPN and do stuff on the server. Then I have to disconnect from VPN and re enable the auto date and time.
    Could someone explain why this is happening and any possible solutions I might be able to try?
    Thanks in advance,
    Felipe.

    OK, after some testing things seem to be working now.
    I opened the NTP port for my server (So I don't have to be on VPN to update the time)....But regardless of that, Server admin and my corporate site work fine.
    Here is my problem, I don't understand why it's working now when 30 minutes ago I was having trouble connecting to my server regardless of what NTP Server I used.
    The only service I can't access is Workgroup Manager, but I don't know if that is supposed to be accessible only locally (though it doesn't matter since I can screen share but I would still like to know).
    Thanks in advance,
    Felipe.

  • How can I stop music and movies from being automatically deleted from my phone and saved on the cloud? I've just tried to watch a movie on my 2 hour commute, but yet AGAIN it has been removed. I do NOT want to spank all of my data allowance

    How can I stop music and movies from being automatically deleted from my phone and saved on the cloud? I've just tried to watch a movie on my 2 hour commute, but yet AGAIN it has been removed. I do NOT want to spank all of my data allowance downloading it again, especially because (believe it or not) I added it to my phone because that's precisely where I wanted it!! Any help much appreciated

    FYI I had to put this link into firefox to reply - because **** back safari just wouldn't register my clicks to any of the links on the post... Despite reloadeing and even restarting my computer. Totally annoying and a massive pain in the ***.
    But in terms of my initial query; thanks for responding. But no, this is NOT the cause of the problem. I have auto sync and sync over wifi activated, but have also selected manually manage music and videos. Plus, all of my music and videos are on my macbook, absolutely all of it, so if it my phone was syncing with my macbook everything would still be on the phone. Life would be peachy if my phone jsut copied everything that was on my macbook, but unfortuantely it keeps deleting tracks for no apparent reason.
    Any thoughts greatly welcomed, because at the moment i can only conclude that my iphone is crap.

  • Please help , I have iPhone 4S and have updated to iso6, don't know if that has anything to do with the problem but I can't set the year on date and time to the correct year, it automatically goes to 2578 ? Plz help

    Subject:
    Please help , I have iPhone 4S and have updated to iso6, don't know if that has anything to do with the problem but I can't set the year on date and time to the correct year, it automatically goes to 2578 ? Plz help

    Settings>General>International.
    Set the calendar to "Gregorian". You have it set to Buddhist.

  • The time on my iphone 5C is constantly changing, regardless of me setting the correct time manually or automatically, all iOS is up to date and phone is not damaged, any ideas?

    The time will stay correct for an hour or so, then jump backwards for no reason. I have tried setting the time manually and automatically and still get the same problem, and have tried with wifi on and off and it still does it. All my software is up to date and tried contacting EE who said to ask Apple. Phone is about 11 months old and have had no previous problems.

    Hi jennehbear,
    Thank you for using Apple Support Communities.
    Your time jumping backwards an hour sounds like an issue with the time zone. Take a look at this article to troubleshoot the issue.
    iOS: Troubleshooting issues with date and time - Apple Support
    Regards,
    Jeff D. 

  • "Your meeting was found to be out of date and has been automatically updated."

    Hello, one of our users is stating that when they make changes to meeting dates and/or times, a few minutes to a day later, the changes revert to the original date and/or time. Additionally, they will occasional also receive an email stating "Your meeting
    was found to be out of date and has been automatically updated."
    This customer is on a Win7 client and running Outlook 2007. Both the OS and Office/Outlook are completely patched as of 08/12/2014. There are also a couple of iOS devices that access the Exchange account and both are running the latest version of iOS according
    to the customer.
    The customer states that this behavior began immediately following our migration from Exchange 2007 to 2013 a couple of months back. I am not able to see any reason for this at the server level. We also do not currently have any other users complaining of
    the same issue. I am unable to replicate the issue using my account. I suspect that it is isolated to this single user at this point.
    We are running Exchange v15, build 847.32.
    Has anyone experienced the same? Thanks in advance for any input.

    Hi,
    I noticed that there are some third-party devices used to sync and manage Exchange calendar. Usually, some issues may be caused by some devices used for Exchange ActiveSync service. We can try to disable the devices and check whether the issue persists.
    Here is a KB descripted Current issues with Microsoft Exchange ActiveSync and third-party devices:
    http://support.microsoft.com/kb/2563324
    If the issue is not caused by any third-party programs, please check the time zone from Outlook client, local machine, third-party devices and Outlook Web App. Please also change a computer then send test meeting updates to check if the issue continues.
    Regards,
    Winnie Liang
    TechNet Community Support

  • Saving data in database using textbox and save button

    Hello. I just want a help about my code because when i close the application the data that i add is not been saved.
    Here is my code of save:
    function saveData(event:MouseEvent):void
      status.text = "Saving data";
      insertStmt = new SQLStatement();
      insertStmt.sqlConnection = conn;
      var sql:String = "INSERT INTO employees (firstName, lastName, salary) VALUES (:param, :param1, :param2)";
      insertStmt.text = sql;
      insertStmt.parameters[":param"] = firstName.text;
      insertStmt.parameters[":param1"] = lastName.text;
      insertStmt.parameters[":param2"] = salary.text;
      insertStmt.addEventListener(SQLEvent.RESULT, insertResult);
      insertStmt.addEventListener(SQLErrorEvent.ERROR, insertError);
      insertStmt.execute();
    Here is the full code:
    import fl.data.DataProvider;
    import flash.data.SQLResult;
    import flash.data.SQLConnection;
    import flash.filesystem.File;
    import flash.data.SQLStatement;
    import flash.data.SQLConnection;
    var conn:SQLConnection;
    var createStmt:SQLStatement;
    var insertStmt:SQLStatement;
    var insertStmt2:SQLStatement;
    var insertStmt3:SQLStatement;
    var selectStmt:SQLStatement;
    var insert1Complete:Boolean = false;
    var insert2Complete:Boolean = false;
    saveBtn.addEventListener(MouseEvent.CLICK, saveData);
    loadBtn.addEventListener(MouseEvent.CLICK, getData);
    init();
    function init():void
      conn = new SQLConnection();
      conn.addEventListener(SQLEvent.OPEN, openSuccess);
      conn.addEventListener(SQLErrorEvent.ERROR, openFailure);
      status.text = "Creating and opening database";
      // Use these two lines for an on-disk database
      // but be aware that the second time you run the app you'll get errors from
      // creating duplicate records.
    // var dbFile:File = File.applicationStorageDirectory.resolvePath("DBSample.db");
    // conn.openAsync(dbFile);
      // Use this line for an in-memory database
      conn.openAsync(null);
    function openSuccess(event:SQLEvent):void
      conn.removeEventListener(SQLEvent.OPEN, openSuccess);
      conn.removeEventListener(SQLErrorEvent.ERROR, openFailure);
      createTable();
    function openFailure(event:SQLErrorEvent):void
      conn.removeEventListener(SQLEvent.OPEN, openSuccess);
      conn.removeEventListener(SQLErrorEvent.ERROR, openFailure);
      status.text = "Error opening database";
      trace("event.error.message:", event.error.message);
      trace("event.error.details:", event.error.details);
    function createTable():void
      status.text = "Creating table";
      createStmt = new SQLStatement();
      createStmt.sqlConnection = conn;
      var sql:String = "";
      sql += "CREATE TABLE IF NOT EXISTS employees (";
      sql += " empId INTEGER PRIMARY KEY AUTOINCREMENT,";
      sql += " firstName TEXT,";
      sql += " lastName TEXT,";
      sql += " salary NUMERIC CHECK (salary >= 0) DEFAULT 0";
      sql += ")";
      createStmt.text = sql;
      createStmt.addEventListener(SQLEvent.RESULT, createResult);
      createStmt.addEventListener(SQLErrorEvent.ERROR, createError);
      createStmt.execute();
    function createResult(event:SQLEvent):void
      createStmt.removeEventListener(SQLEvent.RESULT, createResult);
      createStmt.removeEventListener(SQLErrorEvent.ERROR, createError);
      addData();
    function createError(event:SQLErrorEvent):void
      status.text = "Error creating table";
      createStmt.removeEventListener(SQLEvent.RESULT, createResult);
      createStmt.removeEventListener(SQLErrorEvent.ERROR, createError);
      trace("CREATE TABLE error:", event.error);
      trace("event.error.message:", event.error.message);
      trace("event.error.details:", event.error.details);
    function addData():void
      status.text = "Adding data to table";
      insertStmt = new SQLStatement();
      insertStmt.sqlConnection = conn;
      var sql:String = "";
      sql += "INSERT INTO employees (firstName, lastName, salary) ";
      sql += "VALUES ('Bob', 'Smith', 8000)";
      insertStmt.text = sql;
      insertStmt.addEventListener(SQLEvent.RESULT, insertResult);
      insertStmt.addEventListener(SQLErrorEvent.ERROR, insertError);
      insertStmt.execute();
      insertStmt2 = new SQLStatement();
      insertStmt2.sqlConnection = conn;
      var sql2:String = "";
      sql2 += "INSERT INTO employees (firstName, lastName, salary) ";
      sql2 += "VALUES ('John', 'Jones', 8200)";
      insertStmt2.text = sql2;
      insertStmt2.addEventListener(SQLEvent.RESULT, insertResult);
      insertStmt2.addEventListener(SQLErrorEvent.ERROR, insertError);
      insertStmt2.execute();
    function insertResult(event:SQLEvent):void
      var stmt:SQLStatement = event.target as SQLStatement;
      stmt.removeEventListener(SQLEvent.RESULT, insertResult);
      stmt.removeEventListener(SQLErrorEvent.ERROR, insertError);
      if (stmt == insertStmt)
      insert1Complete = true;
      else
      insert2Complete = true;
      if (insert1Complete && insert2Complete)
      status.text = "Ready to load data";
    function insertError(event:SQLErrorEvent):void
      status.text = "Error inserting data";
      insertStmt.removeEventListener(SQLEvent.RESULT, insertResult);
      insertStmt.removeEventListener(SQLErrorEvent.ERROR, insertError);
      trace("INSERT error:", event.error);
      trace("event.error.message:", event.error.message);
      trace("event.error.details:", event.error.details);
    function getData(event:MouseEvent):void
      status.text = "Loading data";
      selectStmt = new SQLStatement();
      selectStmt.sqlConnection = conn;
      var sql:String = "SELECT empId, firstName, lastName, salary FROM employees";
      selectStmt.text = sql;
      selectStmt.addEventListener(SQLEvent.RESULT, selectResult);
      selectStmt.addEventListener(SQLErrorEvent.ERROR, selectError);
      selectStmt.execute();
    function saveData(event:MouseEvent):void
      status.text = "Saving data";
      insertStmt = new SQLStatement();
      insertStmt.sqlConnection = conn;
      var sql:String = "INSERT INTO employees (firstName, lastName, salary) VALUES (:param, :param1, :param2)";
      insertStmt.text = sql;
      insertStmt.parameters[":param"] = firstName.text;
      insertStmt.parameters[":param1"] = lastName.text;
      insertStmt.parameters[":param2"] = salary.text;
      insertStmt.addEventListener(SQLEvent.RESULT, insertResult);
      insertStmt.addEventListener(SQLErrorEvent.ERROR, insertError);
      insertStmt.execute();
    function selectResult(event:SQLEvent):void
      status.text = "Data loaded";
      selectStmt.removeEventListener(SQLEvent.RESULT, selectResult);
      selectStmt.removeEventListener(SQLErrorEvent.ERROR, selectError);
      var result:SQLResult = selectStmt.getResult();
      resultsGrid.dataProvider = new DataProvider(result.data);
    // var numRows:int = result.data.length;
    // for (var i:int = 0; i < numRows; i++)
    // var output:String = "";
    // for (var prop:String in result.data[i])
    // output += prop + ": " + result.data[i][prop] + "; ";
    // trace("row[" + i.toString() + "]\t", output);
    function selectError(event:SQLErrorEvent):void
      status.text = "Error loading data";
      selectStmt.removeEventListener(SQLEvent.RESULT, selectResult);
      selectStmt.removeEventListener(SQLErrorEvent.ERROR, selectError);
      trace("SELECT error:", event.error);
      trace("event.error.message:", event.error.message);
      trace("event.error.details:", event.error.details);

    Your database system may well have a setting for character encoding when creating new databases. If you set that to unicode JDBC should store and retrieve UNICODE strings automatically.
    As to the HTML side, you should generally use UTF-8 encoding. You need an editor which understands UTF-8. JSPs and servlets have ways of specifying the encoding which goes into the http headers. For static HTML pages you may have to add a header like:
    <META http-equiv="Content-type" value="text/HTML; charset=UTF-8">
    When receiving form data you need to do
    request.setCharacterEncoding("UTF-8");

Maybe you are looking for

  • Using OS X Lion as a Business Server for a Windows & Mac Enviroment

    Hi there, I am debating on using OS X Lion (on a Mac Mini) as a server for a small business.  I have some lingering questions that I need help with. If I am using OS X Lion as the mail server, Does it provide any kind of online/web access (similar to

  • KE30 report is capturing Excise values

    Hi Gurus, In my pricing procedure I had used condition type VPRS & condition types for excise,education cess & higher education cess. The same VPRS has been assigned to COPA value fields. COPA actual line items shows 2 line items-  (1) For Excise (2)

  • UME Page Problem

    Hi gurus, I just installed portal 7.0 sp12. I am trying to configure system landscape after the installation. I am trying to reach ume from; "http://<hostname>:50000/useradmin", I face the user administration page in portal not the ume page. Any idea

  • How can I remove Top Sites button from Favorites?

    Hi! How can I remove Top Sites button from Favorites bar? There is no problem to remove it in previous Safari. But I cant find how to remove it in Safari 7.0.

  • JSR 168 Java Portlet, actionURL, and portletMode

    I have a very simple JSR168 Java Portlet. I created the following href: Edit When, the portlet is rendered I get the following exception. Any ideas or suggestions? javax.portlet.PortletException at com.bea.portlet.container.PortletRequestDispatcherIm