How to use GregorianCalendar to get today's date?

I am using the following code to get today's date? I'm curious whether there is a direct way for GregorianCalendar to get today's date?
Thanks,
java.util.Date today = new java.util.Date();
Calendar cal_today = new GregorianCalendar();
cal_today.setTime(today);
System.out.println(" month = " + cal_today.get(Calendar.MONTH));
System.out.println(" day = " + cal_today.get(Calendar.DAY_OF_MONTH));
System.out.println(" year = " + cal_today.get(Calendar.YEAR));

If you mean construct it with todays date and time, sure. Just call the contructor with no arguments. According to the API...Constructs a default GregorianCalendar using the current time in the default time zone with the default locale.

Similar Messages

  • How do I check that the today's date is = a date

    I have a form on my site that is designed to only come live after a certain date to avoid people plaguing me with false claims.
    It is accessed by a link from another page.
    I want the link to only be shown after that date.
    Working in asp, of which I have not a lot of knowledge, how would I set up asp code for the following logic, the date being the one that I need to use:
    If the system date is > 26 February 2011 then write "Here is the link to the prize draw claim form"
    else write "The link to the claim form will not be available until the 27th February"
    Would this be able to be placed in line on a Dreamweaver template page and would it just fit on the page in line with the other code?
    Seems simple enough to most people but its got me totally baffled!

    No answers from anyone yet but here is my first rough attempt:
    <html>
    <head>
    <title>How to make a claim</title>
    <script language="JScript" type="text/jscript">
       function dateComp() {
    // Get today's date
        var s = new Date();
        // Create the date of the draw
    var td = new Date('2/26/2011')
    if (s > td )
      s = "The draw will take place on the 26 February 2011" ;
    else
      s= " Go to http://www.lottery/claims.asp to make a claim.";
        return (s);
    </script>
    </body>
    </html>
    <script language="JScript" type="text/jscript">
    document.write(dateComp())
    </script>
    </html>
    </body>
    >>>>>>>>>>>>>>>>>
    This works fine in that it outputs a message on the screen. However, whilst it looks like a link on this page, all it does on a live page is print the text, rather than inject the code into the page.
    What do I use instead of document.write(dateComp) to inject the code and create a link?

  • How to use vCloud Director Catalog into vFabric Data Director

    Hi,
        How to use vCloud Director Catalog into vFabric Data Director.....

    When you install Data Director, you have the option of selecting a Global or Organizational installation.  When you select Organizational, you have an additional option to specify the vCD instance from which you can get Organizations and Users.  This must be set up at installation time.

  • Getting today's date

    I'm too lazy to look this up right now, but what's the code to get today's date? (at least I'm honest :D)

    I'm too lazy to look this up right now, but what's the
    code to get today's date? (at least I'm honest :D)It probably would have taken you less time to look it up in the API, then to post here. :)

  • How to use Replacement Path Variables to perform Date Calculations

    Hi Experts,
    Can anyone make me clear about:How to use Replacement Path Variables to perform Date Calculations???????
    Thankyou in advance..
    shankar

    In left panel select the time Dimension
    Then hit new variable in that
    give the Name and Description for the Variable
    In processing by hit Replacement Path
    In reference characterisitcs use Calendar Day...
    As ur intention is to use it for Date
    Then in adjacent tab use
    Replace variable with Query / Variable
    Then u can use Offset length and offset start for controoling the display of your variable.
    Use as single, multiple single, interval, selection option as uwish
    HIt okey
    and you are good to go

  • How to use reflection to get base classes protected field

    I have one base Base classes which have protected fields and public get method to get the field.
    class Base
    protected int proField;
    public int getProField(){return proField;}
    Class Derive extends base class Base
    class Derive extends Base implements OtherInterface
    public void funtion(){};
    Now I have an instance of Derive, how can I use reflection to get the protected field inherited from Base. It seems Java Reflection only give runtime accessibility to public field and decleared field, protected-inherited field is excluded.
    Thanks
    Lei

    as the last poster said, traverse up the class hierarchy.
    ex:
    private void doSumfinToField(String fieldName throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException {
    Class clazz = getClass();
    Field field = findFieldInClass(clazz, fieldName);
    //field.doSumfin;
    private Field findFieldInClass(Class clazz, String fieldName) throws NoSuchFieldException {
    try { // to find the field in this class    
    return clazz.getDeclaredField(fieldName);
    } catch (NoSuchFieldException e) {
    // if we don't have a superclass, continue
    if (clazz.getSuperclass().equals(Object.class)) {
    throw e;
    // check in the superclass
    return findFieldInClass(clazz.getSuperclass(), fieldName);
    }

  • How to use PDPageEnumContents to get PDText?

    Please help me to use PDPageEnumContents to get PDText, the callback and PDGraphic confused me. I donnot know how to write. I am a green hand in Plugin Development.
    Thank you.
    Jason Wang

    This is an obsolete method. It should no longer be used.
    Aandi Inston

  • Get today's date?

    I have an XML dataset that shows a schedule of events.  My page uses a yui calendar widget to get the events for specific selected days.  On load, the page shows all "events" that are listed in the XML file.  I am trying to set up a filter that will only show the events for today and days after today, on loading.  How do you set a variable to have the value of today's date, without explicitly typing in "10/30/2009?"  I don't want to call the filterData() function, because I still want to see what was scheduled in the past by selecting the dates in the calendar.  Any ideas would be greatly appreciated.
    Here is my code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script src="SpryAssets/xpath.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryDataExtensions.js" type="text/javascript"></script>
    <script src="yui/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js" type="text/javascript"></script>
    <script src="yui/2.6.0/build/calendar/calendar-min.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryDOMUtils.js" language="javascript" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    var dsEvents = new Spry.Data.XMLDataSet("schedule.xml", "events/event", {sortOnLoad: "date", sortOrderOnLoad: "ascending"}  );
    dsEvents.setColumnType("date", "date");
    dsEvents.setColumnType("@id", "number");//-->
    </script>
    <link href="yui/2.6.0/build/fonts/fonts-min.css" rel="stylesheet" type="text/css" />
    <link href="yui/2.6.0/build/calendar/assets/skins/sam/calendar.css" rel="stylesheet" type="text/css" /></head><body>
    <div id="Schedule">
      <div id="yuicalendar1"></div>
      <script type="text/javascript">
    // BeginWebWidget YUI_Calendar: yuicalendar1   (function() {
        var cn = document.body.className.toString();
        if (cn.indexOf('yui-skin-sam') == -1) {
          document.body.className += " yui-skin-sam";
      var inityuicalendar1 = function() {
        var yuicalendar1 = new YAHOO.widget.Calendar("yuicalendar1");    // The following event subscribers demonstrate how to handle
        // YUI Calendar events, specifically when a date cell is
        // selected and when it is unselected.
        // See: http://developer.yahoo.com/yui/calendar/ for more
        // information on the YUI Calendar's configurations and
        // events.
        // The YUI Calendar API cheatsheet can be found at:
        // http://yuiblog.com/assets/pdf/cheatsheets/calendar.pdf
        //--- begin event subscribers ---//
        yuicalendar1.selectEvent.subscribe(selectHandler, yuicalendar1, true);
        yuicalendar1.deselectEvent.subscribe(deselectHandler, yuicalendar1, true);
        //--- end event subscribers ---//
    yuicalendar1.render();
      }  function selectHandler(event, data) {
      // The JavaScript function subscribed to yuicalendar1.  It is called when
      // a date cell is selected.
      // alert(event) will show an event type of "Select".
      // alert(data) will show the selected date as [year, month, date]. 
      var formattedDate = data[0][0][1] + "/" + data[0][0][2] + "/" + data[0][0][0];
      var dateFilterFunc = function(dsEvents, row, rowNumber)
    if (row["date"].search(formattedDate) != -1)
       return row; // Return the row to keep it in the data set.
    return null; // Return null to remove the row from the data set.
      dsEvents.filter(dateFilterFunc); // Filter the rows in the data set.
      };  function deselectHandler(event, data) {
      // The JavaScript function subscribed to yuicalendar1.  It is called when
      // a selected date cell is unselected.
      };      // Create the YUI Calendar when the HTML document is usable.
      YAHOO.util.Event.onDOMReady(inityuicalendar1);
    // EndWebWidget YUI_Calendar: yuicalendar1
      </script>
    <div spry:region="dsEvents">
      <table cellpadding="2" id="Events">
        <tr>
          <th spry:sort="name">Name</th>
          <th spry:sort="date">Date</th>
          <th spry:sort="starttime">Start Time</th>
          <th spry:sort="endtime">End Time</th>
          <th spry:sort="location">Location</th>
          <th spry:sort="type">Type</th>
          <th spry:sort="contact">Contact</th>
          <th spry:sort="@id">Id</th>
        </tr>
        <tr spry:repeat="dsEvents">
          <td>{name}</td>
          <td>{date}</td>
          <td>{starttime}</td>
          <td>{endtime}</td>
          <td>{location}</td>
          <td>{type}</td>
          <td>{contact}</td>
          <td>{@id}</td>
        </tr>
      </table>
    </div>
    </div>
    </body>
    </html>
    And here is my XML file:
    <?xml version="1.0" encoding="utf-8"?>
    <events>
    <event id="1">
      <name>Dreamweaver CS4 Intermediate</name>
      <date>10/15/2009</date>
      <starttime>8:00 am</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 1</location>
      <type>Training</type>
      <contact>Contact 1</contact>
    </event>
    <event id="2">
      <name>InDesign CS4 Advanced</name>
      <date>10/14/2009</date>
      <starttime>8:00 am</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 2</location>
      <type>Training</type>
      <contact>Contact 1</contact>
    </event>
    <event id="3">
      <name>Flex CS4 Data Services</name>
      <date>10/15/2009</date>
      <starttime>1:00 pm</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 2</location>
      <type>Meeting</type>
      <contact>Contact 2</contact>
    </event>
    <event id="4">
      <name>Another Dreamweaver CS4 Intermediate</name>
      <date>10/30/2009</date>
      <starttime>8:00 am</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 1</location>
      <type>Training</type>
      <contact>Contact 1</contact>
    </event>
    <event id="5">
      <name>Another InDesign CS4 Advanced</name>
      <date>10/29/2009</date>
      <starttime>8:00 am</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 2</location>
      <type>Training</type>
      <contact>Contact 3</contact>
    </event>
    <event id="6">
      <name>Another Flex CS4 Data Services</name>
      <date>10/28/2009</date>
      <starttime>1:00 pm</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 2</location>
      <type>Meeting</type>
      <contact>Contact 2</contact>
    </event>
    </events>

    Hi,
    Here is my code for attaching the event highlighting to the YUI calendar.  It is triggered via an observer everytime the SpryData region markup containing the event tooltips is regenerated on my first tab.  I've also include the code I wrote for adding tooltips based on SpryData. Note I amended the Sprytooltip.js dataset to speed up the rendering based on the tip Arnout gave me
    One thing I do which is not the default for YUI calendar is I namespace my calendar so I can access it whilst doing my Spry stuff.
    YAHOO.namespace("cal");
    YAHOO.cal.yuicalendar1 = new YAHOO.widget.CalendarGroup("yuicalendar1","yuical1group", {PAGES:12,START_WEEKDAY:1});
    var myObserver = new Object;
    myObserver.onPostUpdate = function(notify, data)
    // Get Spry Data into rows variable
    rows = Events.getData();
    // Yahoo YUI stuff
    YAHOO.cal.yuicalendar1.removeRenderers();
    for (var i = 2; i < rows.length; i++)
      // Convert in date format range that yui calendar recognises
      var s = new Date(rows[i]["StartDate"]);
      s = s.getMonth() + 1 + '/' + s.getDate() + '/' + s.getFullYear();
      var e = new Date(rows[i]["EndDate"]);
      e = e.getMonth() + 1 + '/' + e.getDate() + '/' + e.getFullYear();
      var cald = s + '-' + e;
      // Add highlight to range of cells   
      YAHOO.cal.yuicalendar1.addRenderer(cald, YAHOO.cal.yuicalendar1.renderCellStyleHighlight1);
        // Now add tool tips
    // Build array of contiguous dates based on HMC events
    // Now cycle through HMC events  
      eventDates = [];
      for (var r=2;r<rows.length;r++)
        startDate = new Date(rows[r]["StartDate"]);
        endDate = new Date(rows[r]["EndDate"]);
        while (startDate <= endDate)
         startDatestr = todayFormat(startDate);
           eventDates[startDatestr] = r;
         startDate.setDate(startDate.getDate() + 1);
    // cycle through each of the 12 months.
    for (var c=0;c<=11;c++)
        addTipFast(c);
    // now render
    YAHOO.cal.yuicalendar1.render();
    function addTipFast(c)
       // reference to calendar
       var calDate = new Date();
       var cal = YAHOO.cal.yuicalendar1.pages[c];
       var calID = cal.id;
       var calDates = cal.cellDates
       var selector = 'table#' + calID + ' td[class~="calcell"]'
       // return array reference to table cells that make up calendar
          tds = Spry.$$(selector);
       // Search for match on event table
         for (var r=0;r<calDates.length;r++)
        tYear = calDates[r][0];
        tMonth = calDates[r][1];
        if (tMonth == 0)
         tMonth = 12;}
       else
        tMonth = tMonth - 1;
        tDate = calDates[r][2];
        calDate.setFullYear(tYear,tMonth,tDate);
        nDate = todayFormat(calDate);
        if (eventDates[nDate] > -1)
         toolid = 't' + eventDates[nDate];
         var myele = new Array;   
         myele[0] = tds[r];
         var t = new Spry.Widget.Tooltip(toolid,myele,{offsetY:25});
    Spry.Data.Region.addObserver("tooltips", myObserver);
    The tooltips is a div region containing all my tooltips for the calendar and generated from my SpryData Events data
    <div id="tooltips" spry:region="Events">
            <div spry:repeat="Events" id="t{ds_RowNumber}" class="tooltipContent hide"> {Title} </div>
          </div>
    I generate a unique id for each tooltip that I can use with the tooltip widget when attaching the triggers from the calendar as above. It uses the spry data row number to achieve this.
    Hope this helps you with your highlighting and tooltips if you want them. Note I ignore my first two events for highlighting as their start and end dates spans years and just represent club stuff that happens every week. Otherwise initialise your i variable with var i = 0; in the loop.
    Just noticed if I use the calendar nav controls it drops the tooltips.  I'll need to add a YUI render event notifier to pick that up.
    Cheers
    Phil

  • I can't get today's date to show on my html pages with Javascript codes.

    I use javascript 1.2 codes to show up today's date on my HTML pages but it did not execute.
    Here is my code:
    <script language="Javascript">
    <!--
    document.write(displayDate());
    // -->
    </script>
    Please help! If you know how to get it to execute.
    Thank you.

    I don not know what displayDate() means
    But I am display current date and time with the code...
    <script language="Javascript">
    <!--
         document.write((new Date).toLocaleString());
    // -->
    </script>

  • How to use CSV format in making a data connection.

    Hello All,
    I have got a form to develop. There are over 1000 entries to be imported. Can I use CSV format to embed those data in the forms. Mainly those data would be embedded as dropdowns.If I can use how to do it ? If i can not use is there any better way without using the Database like MySQL or something.
    Thanks.
    Bibhu.

    Hi Afroz,
    To be more specific, if the csv file doesn't has header, please refer to this script to add header:
    $csv = Import-Csv d:\haha.csv -Header "UserA","UserXYZ","EmailA"
    Then you can loop this csv file to run the "add-mailboxpermission" cmdlet, I recommend you can test this script before running against production environment, please also note I haven't tested this script:
    $csv = Import-Csv d:\users.csv -Header "UserA","UserXYZ","EmailA"
    foreach($each in $csv){
    write-host "assign fullaccess permission of user $($each.UserXYZ) on mailbox $($each.EmailA)"
    get-mailbox -identity $each.EmailA | add-mailboxpermission -user $each.UserXYZ -accessrights 'fullaccess'
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How to use the JE database with other data types than byte arrays?

    Hi! I searched the javadoc of Berkley DB JE, for a way to introduce entry (but I need also retrieve) data with other type than byte arrays, e.g. String, or anything else, as int may be, etc.
    Still, I didn't find any such way, because the main (only?!) method to entry data into an open database - according what I found in javadoc - is:
    "public OperationStatus put(Transaction txn, DatabaseEntry key, DatabaseEntry data) throws DatabaseException"
    and both this and the corresponding method for retrieves, are based on the same DatabaseEntry type, which allow only entry data on byte[] support.
    What if I need to use Strings or int, or even char? I must do a special conversion from these types, to byte[], to use the database?
    Thank you!

    On the doc page (this is also in the download package),
    http://download.oracle.com/docs/cd/E17277_02/html/index.html
    see:
    Getting Started Guide
    Java Collections Tutorial
    Direct Persistence Layer (DPL)
    All of these describe how to use data types other than byte arrays.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to use multiple selection parameters in the data model

    Hi, after have looked all the previous threads about how to use multiple selection parameters , I still have a problem;
    I'm using Oracle BI Publisher 10.1.3.3.2 and I'm tried to define more than one multiple selection parameters inside the data template;
    Inside a simple SQL queries they work perfectly....but inside the data template I have errors.
    My data template is the following (it's very simple...I am just testing how the parameters work):
    <dataTemplate name="Test" defaultPackage="bip_departments_2_parameters">
    <parameters>
    <parameter name="p_dep_2_param" include_in_output="false" datatype="character"/>
    <parameter name="p_loc_1_param" include_in_output="false" datatype="character"/>
    </parameters>
    <dataTrigger name="beforeReport" source="bip_departments_2_parameters.beforeReportTrigger"/>
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    select deptno, dname,loc
    from dept
    &p_where_clause
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_DEPT" source="Q2">
    <element name="deptno" value="deptno"/>
    <element name="dname" value="dname"/>
    <element name="loc" value="loc"/>
    </group>
    </dataStructure>
    </dataTemplate>
    The 2 parameters are based on these LOV:
    1) select distinct dname from dept (p_dep_2_param)
    2) select distinct loc from dept (p_loc_1_param)
    and both of them have checked the "Multiple selection" and "Can select all" boxes
    The package I created, in order to use the lexical refence is:
    CREATE OR REPLACE package SCOTT.bip_departments_2_parameters
    as
    p_dep_2_param varchar2(14);
    p_loc_1_param varchar2(20);
    p_where_clause varchar2(100);
    function beforereporttrigger
    return boolean;
    end bip_departments_2_parameters;
    CREATE OR REPLACE package body SCOTT.bip_departments_2_parameters
    as
    function beforereporttrigger
    return boolean
    is
    l_return boolean := true;
    begin
    if (p_dep_2_param is not null) --and (p_loc_1_param is not null)
    then
    p_where_clause := 'where (dname in (' || replace (p_dep_1_param, '''') || ') and loc in (' || replace (p_loc_1_param, '''') || '))';
    else
    p_where_clause := 'where 1=1';
    end if;
    return (l_return);
    end beforereporttrigger;
    end bip_departments_2_parameters;
    As you see, I tried to have only one p_where_clause (with more than one parameter inside)....but it doesn't work...
    Using only the first parameter (based on deptno (which is number), the p_where_clause is: p_where_clause := 'where (deptno in (' || replace (p_dep_2_param, '''') || '))';
    it works perfectly....
    Now I don't know if the problem is the datatype, but I noticed that with a single parameter (deptno is number), the lexical refence (inside the data template) works.....with a varchar parameter it doesn't work....
    So my questions are these:
    1) how can I define the p_where_clause (inside the package) with a single varchar parameter (for example, the department location name)
    2) how can I define the p_where_clause using more than one parameter (for example, the department location name and the department name) not number.
    Thanks in advance for any suggestion
    Alex

    Alex,
    the missing thing in your example is the fact, that if only one value is selected, the parameter has exact this value like BOSTON. If you choose more than one value, the parameter includes the *'*, so that it looks like *'BOSTON','NEW YORK'*. So you need to check in the package, if there's a *,* in the parameter or not. If yes there's more than one value, if not it's only one value or it's null.
    So change your package to (you need to expand your variables)
    create or replace package bip_departments_2_parameters
    as
    p_dep_2_param varchar2(1000);
    p_loc_1_param varchar2(1000);
    p_where_clause varchar2(1000);
    function beforereporttrigger
    return boolean;
    end bip_departments_2_parameters;
    create or replace package body bip_departments_2_parameters
    as
    function beforereporttrigger
    return boolean
    is
    l_return boolean := true;
    begin
    p_where_clause := ' ';
    if p_dep_2_param is not null then
    if instr(p_dep_2_param,',')>0 then
    p_where_clause := 'WHERE DNAME in ('||p_dep_2_param||')';
    else
    p_where_clause := 'WHERE DNAME = '''||p_dep_2_param||'''';
    end if;
    if p_loc_1_param is not null then
    if instr(p_loc_1_param,',')>0 then
    p_where_clause := p_where_clause || ' AND LOC IN ('||p_loc_1_param||')';
    else
    p_where_clause := p_where_clause || ' AND LOC = '''||p_loc_1_param||'''';
    end if;
    end if;
    else
    if p_loc_1_param is not null then
    if instr(p_loc_1_param,',')>0 then
    p_where_clause := p_where_clause || 'WHERE LOC in ('||p_loc_1_param||')';
    else
    p_where_clause := p_where_clause || 'WHERE LOC = '''||p_loc_1_param||'''';
    end if;
    end if;
    end if;
    return (l_return);
    end beforereporttrigger;
    end bip_departments_2_parameters;
    I've written a similar example at http://www.oracle.com/global/de/community/bip/tipps/Dynamische_Queries/index.html ... but it's in german.
    Regards
    Rainer

  • How to use XmlModify to sort the XML Data?

    Hello,
    I saw some examples explain how to use XmlModify in BDB XML package. I want to sort the XML data by several elements but my Java program could not work correctly.
    <CustomerData>
    <Transaction>
    <DLSFIELDS>
    <ADR_PST_CD>12345</ADR_PST_CD>
    <CLT_IRD_NBR>002</CLT_IRD_NBR>
    </DLSFIELDS>
    </Transaction>
    <Transaction>
    <DLSFIELDS>
    <ADR_PST_CD>12345</ADR_PST_CD>
    <CLT_IRD_NBR>102</CLT_IRD_NBR>
    </DLSFIELDS>
    </Transaction>
    // many nodes like transaction ...
    </CustomerData>
    My XQuery script was executed successfully in the shell. The script looks as follows:
    "for $i in collection('sample.dbxml')/CustomerData/Transaction order by xs:decimal($i//ADR_PST_CD), xs:decimal($i//CLT_IRD_NBR) return $i".
    The Java code :
    // create XmlManager
    XmlManager manager = // ...;
    // open XmlContainer
    XmlContainer container = // ...;
    XmlQueryContext context = manager.createQueryContext(XmlQueryContext.LiveValues, XmlQueryContext.Eager);
    XmlQueryExpression expression = manager.prepare("for $i in collection('sample.dbxml')/CustomerData/Transaction order by xs:decimal($i//ADR_PST_CD),xs:decimal($i//CLT_IRD_NBR) return $i", context);
    XmlModify modify = manager.createModify();
    XmlUpdateContext uc = manager.createUpdateContext();
    XmlDocument xmldoc = container.getDocument("sample.xml");
    XmlValue value = new XmlValue(xmldoc);
    long numMod = modify.execute(value, context, uc);
    System.out.println("Peformed " + numMod     + " modification operations");
    Could you point out the errors above or offer some suggestion?
    Thanks.

    I have other question of the sorting issue. Here are a large XML need to sort so I have to split it to multiple small XML files. After importing these files, I will use the XmlModify and XQuery to sort them. I'm not clear on the multiple XML files processing.
    1. Can the BDB XML ensure that all these XML files were sorted or how to update all documents with same logic.
    2. If I want export all these sorted documents, how can I ensure these files processed in sequence? Which document needs process first?
    The export method:
    public void export(String outputfile)throws Exception{
    final int BLOCK_SIZE = 5 * 1024 * 1024; // 5Mb
    try{
    File theFile = new File(outputfile);
    FileOutputStream fos = new FileOutputStream(theFile);
    byte[] buff= new byte[BLOCK_SIZE];                         
    XmlResults rs = container.getAllDocuments(new XmlDocumentConfig());               
    while(rs.hasNext()){
         XmlDocument xmlDoc = rs.next().asDocument();
         XmlInputStream inputStream = xmlDoc.getContentAsXmlInputStream();                    
         long read=0;
         while(true){
         read = inputStream.readBytes(buff, BLOCK_SIZE);
    fos.write(buff,0,(int)read);                    
         if(read < BLOCK_SIZE) break;
    inputStream.delete();
    xmlDoc.delete();
    rs.delete();
    //MUST CLOSE!
    fos.close();               
    catch(Exception e){
    System.err.println("Error exporting file from container " + container);
    System.err.println(" Message: " + e.getMessage());
    Thanks.

  • Get today's date minus 30 seconds

    How can I get the current date and time minus 30 seconds. The result shoulld be of date format.
    Thanks.

    You mean when you were answered 2 days ago on the same question you had to ask it again?
    http://forum.java.sun.com/thread.jspa?threadID=596493
    Thanks for wasting more answerers' time.

  • How to add custom line for today's date

    Hi,
    I want to add one vertical line for today's date on my line chart.
    Is it possible to draw custom line dynamically in line chart.
    Thanks in advance
    Madhuri

    I think you will probably need CRChart by ThreeD Graphics (www.threedgraphics.com).  AFAIK, it's written by the guys who supply the charting module to Crystal, so integrates 100%, even if it's a bit fiddly.
    It's a bit pricey (more than CR!), but if you need that functionality, it's about your only option. I've bought it do add a 'your average' linesymbol and 'everyone's average' linesymbol to a chart.
    Essentially, it uses macros to plot user defined lines, box fills, shapes etc onto your chart.
    You put something like this into the text fields of the chart:
    @user_line 0,0,3,100 = draw a line from the 0,0 point to the 3rd group, 50th y-value.
    You can use variable to define these points, so if you have a chart in a group, it'll display a different line position for each group.

Maybe you are looking for

  • Using a Mac Mini. Want to upgrade Safari?

    Want to update my Mac Mini2,1 from OS 10.68 to 10.7 or 10.8. Is this possible and where can I download either one? My hardware has been upgraded to 3 Gb of RAM and the HD to  a 120 GB solid state drive.

  • Importing contacts from memory card

    Have recently got new 5800 after mine got wet. The new one is slightly different and I have put my memory card from old one into new phone. I can't seem to find the right route to import my numbers off my memory card. I'm sure the card is not corrupt

  • Weblogic 8.1 with Xalan 2.6.1 and Xerces 2.6.2 ?!?

    Hi, I'm trying to use Xalan 2.6.1 and Xerces 2.6.2 with Weblogic 8.1SP2, but no result yet... I found docs on bea website: http://edocs.bea.com/wls/docs81/pdf/faq.pdf http://e-docs.bea.com/wls/docs81/xml/xml_admin.html where I found this: "Warning: I

  • Stolen pc - how do I stop it synching & updating info from phone/iPad

    I have had my lap top stolen, how can I remotely deauthorise, or stop the laptop automatically synchronising. I have iPhone and iPad to do this now? Is simply changing my password enough or is there something else I can do? I am concerned my personal

  • Cs6 download

    I am trying to download cs6 trial but keep getting an error 101. I have lots of space on my computer.