How to write the java program to retrieve the last 7 days dates

Hi,
I am having requirement that how to write the java program to retrieve the last 7 days dates. Please help me.
Regards,
Ahamad

It needs any jar file.Of course!
I did using jscape.My program is running fine.But it
requires jar file.Which is licensed version.Maybe you should follow the link the the 'license' on the site I posted!
>
I have the doubt is apache provides jar file free
versionMaybe you should follow the link the the 'license' on the site I posted!

Similar Messages

  • How to write a JAVA program to execute the SQL queries

    I have a database in the Microsoft Access queries and I need to execute the query by some how write the Java program to make it execute the query. because I need to get the different of time so I know how fast each query run.
    Thank you

    You need jdbc-driver for MSAccess for run this example:
    JDBCClient.java
    import java.util.Properties;
    import java.lang.String;
    import java.sql.DriverManager;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.BufferedOutputStream;
    import java.lang.System;
    import java.lang.Class;
    import java.sql.SQLException;
    import java.util.Date;
    import java.util.Locale;
    import java.text.DateFormat;
    import java.sql.Time;
    public class JDBCClient{
        private String DriverName = new String();
        private String DatabaseURL = new String();
        private String UserName = new String();
        private String Password = new String();
        private String SQLFile = new String();
        private String OutputFile = new String();
        private String Separator = new String();
        private boolean NeedColumnHeaders;
        private String EncodingParamName = new String();
        private String EncodingValue = new String();
        private String OutputEncoding = new String();
        private boolean AfterLastColumnSeparator;
        JDBCClient( String propfilename){
         System.out.println( "Initializing...");
         Properties properties = new Properties();
         try{
             properties.load( new FileInputStream( propfilename));
         catch( Exception e){
                 System.out.println( "Error: " + e.toString());
             System.exit( 0);
         DriverName = properties.getProperty( "DriverName");
         DatabaseURL = properties.getProperty( "DatabaseURL");
         UserName = properties.getProperty( "UserName");
         Password = properties.getProperty( "Password");
         SQLFile = properties.getProperty( "SQLFile");
         OutputFile = properties.getProperty( "OutputFile");
         Separator = properties.getProperty( "Separator");
         if( properties.getProperty( "NeedColumnHeaders").compareToIgnoreCase( "yes") == 0 ||
             properties.getProperty( "NeedColumnHeaders").compareToIgnoreCase( "true") == 0)
             NeedColumnHeaders = true;
         else
         if( properties.getProperty( "NeedColumnHeaders").compareToIgnoreCase( "no") == 0 ||
             properties.getProperty( "NeedColumnHeaders").compareToIgnoreCase( "false") == 0)
             NeedColumnHeaders = false;
         else{
                 System.out.println( "Invalid value for \"NeedColumnHeaders\" property (logical expected)");
             System.exit( 0);
         EncodingParamName = properties.getProperty( "EncodingParamName");
         EncodingValue = properties.getProperty( "EncodingValue");
         OutputEncoding = properties.getProperty( "OutputEncoding");
         if( properties.getProperty( "AfterLastColumnSeparator").compareToIgnoreCase( "yes") == 0 ||
             properties.getProperty( "AfterLastColumnSeparator").compareToIgnoreCase( "true") == 0)
             AfterLastColumnSeparator = true;
         else
         if( properties.getProperty( "AfterLastColumnSeparator").compareToIgnoreCase( "no") == 0 ||
             properties.getProperty( "AfterLastColumnSeparator").compareToIgnoreCase( "false") == 0)
             AfterLastColumnSeparator = false;
         else{
                 System.out.println( "Invalid value for \"AfterLastColumnSeparator\" property (logical expected)");
             System.exit( 0);
         try{
             byte[] EOL = new byte[2];
             EOL[0] = 13;
             EOL[1] = 10;
             Class.forName( DriverName);
             Properties connInfo = new Properties();
             connInfo.put( "user", UserName);
             connInfo.put( "password", Password);
             if( EncodingParamName.length() != 0 && EncodingValue.length() != 0)
              connInfo.put( EncodingParamName, EncodingValue);
                 Connection connection = DriverManager.getConnection( DatabaseURL, connInfo);
             FileInputStream in = new FileInputStream( SQLFile);
             byte[] buffer = new byte[in.available()];
             in.read( buffer);
             in.close();
             String SQL = new String( buffer);
                 PreparedStatement statement = connection.prepareStatement( SQL);
             Date d1 = new Date();
                 System.out.println( "Database connected at " + d1 + " Executing statement...");
                ResultSet resultSet = null;
             if( statement.execute())
              resultSet = statement.getResultSet();
             else{
                  System.out.println( "Script updates " + statement.getUpdateCount() + " records.");
              System.exit( 0);
                 ResultSetMetaData metaData = resultSet.getMetaData();
                 BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream( OutputFile));
             if( NeedColumnHeaders && metaData.getColumnCount() > 0){
              String head = new String();
              for( int i = 1; i < metaData.getColumnCount(); i++)
                  head += metaData.getColumnName( i) + Separator;
              head += metaData.getColumnName( metaData.getColumnCount());
              out.write( head.getBytes( OutputEncoding), 0, head.length());
              out.write( EOL, 0, 2);
             String record = new String();
             while( resultSet.next()){
              record = "";
              for( int i = 1; i < metaData.getColumnCount(); i++)
                  record += resultSet.getString( i) + Separator;
              record += resultSet.getString( metaData.getColumnCount());
              if( AfterLastColumnSeparator)
                  record += Separator;
              out.write( record.getBytes( OutputEncoding), 0, record.length());
              out.write( EOL, 0, 2);
             out.close();
             Date d2 = new Date();
                 System.out.println( "Done at " + d2);
                 System.out.println( "Executing time " + new Time( d2.getTime() - d1.getTime() - 10800000));
         catch( ClassNotFoundException e){
                 System.out.println( e.toString());
         catch( SQLException e){
                 System.out.println( e.toString());
         catch( java.io.IOException e){
                 System.out.println( e.toString());
         System.exit( 0);
        public static void main( String args[]){
         if( args.length == 1)
             new JDBCClient( args[0]);
         else
             System.out.println( "Usage JDBCClient <properties_file>");
    }JDBCClient.properties ( for Oracle database)
    DriverName=oracle.jdbc.driver.OracleDriver
    DatabaseURL=jdbc:oracle:thin:@192.168.1.1:1521:test
    UserName=test
    Password=test
    SQLFile=test.sql
    OutputFile=test.csv
    Separator=*
    NeedColumnHeaders=yes
    EncodingParamName=
    EncodingValue=
    OutputEncoding=windows-1251
    AfterLastColumnSeparator=yestest.sql
    select * from users;

  • How to write the last step into the temporary XML file?

    Hi all,
    I'm running a sequence & writing the results of each step to a report file.
    When reviewing the report On-The-Fly I see azll the steps (including the last one), but in the temporary report file (ends with _00001.xml) has all the steps except the last one.
    anyone has an idea how can I "force" TestStand to write all the buffer to the file?
    thanks,
    Ido

    IdoZe,
    I was able to replicate your behavior you were seeing and spoke with our R&D team on this. On-the-fly reporting is not guaranteed to write every step, this would cause way too much writing to disk and would cause performance problems because of this. It instead writes according to when the DLL is set to write based on timers and other pieces of dll code.
    With what you are trying to do, it seems you are approaching it incorrectly. First of all, you are accessing and editing a temporary report, which is not recommended. Second, there are many better ways to do this instead of just adding a step to your main or even clean-up of your sequence. You could A) Override the PostUUT or PostUUTLoop callbacks or B) create a top level sequence that makes a sequence call to your sequence you want the report for. In the properties you would spawn a new execution for that sequence after the sequence call, you could wait for the sequence to complete and then read the XML in another step.
    You should always use the final report for this though, because editing the temporary report is a bad idea.
    Another idea is to modify the report generation to write the report correctly the first time you read it. It all depends on exactly what you are trying to do, but I would strongly suggest this last option if possible as it does not involve editing the report after it is written, which defeats the report generation's purpose.
    Brandon Vasquez | Software Engineer | Integration Services | National Instruments

  • Please let me know how to write the Query to fetch data from tables

    Hi Folks,
    Please let me know how to get the data from  different tables using the functionality SQ03,SQ02  and SQ01 .
    Helpful answers will points awarded.
    Regards,
    Ram.

    Dear Ram,
    Please find the below link which gives in detail with screen shots.
    [SAP Query|http://media.techtarget.com/searchSAP/downloads/Teach_yourself_SAP_C20.pdf#search=%22CREATE%20REPORT%20USING%20SQVI%20%2C%20SAP%22]
    Thanks
    Murtuza

  • How to get the last seven days for out put of present day

    Hi Experts,
    we developed one query for 3 years data
    1.user enter the current date (21-03-2014) but out put value should be last seven days (21-03-2014 - 7) (last one week data only)
    2.some times user will enter the (20-03-2014 ) but out put value should be last seven days (20-03-2014 - 7) (last one week data only)
    how to achieve the 2 different scenario?
    is there any standard variable ? please suggest .
    Thanks,
    Bindu.

    Hi,
    i created the Characteristic value variable not formula variable
    in char variable i can't see the off set functionality but we can see off set function in formula variable
    user requirement he wants enter the input value as date and he need last week data means one week data calday wise.
    i tired the 0PREVWK , 0CWEEK these two variables these not asking the input and direct showing the out put.
    these can achieve through the customer exit?
    Thanks,
    Bindu.

  • How to find the Last report run date

    Hello All,
    I have one ALV report.
    In that report i have to display the date on which the report was run last time.
    The user can run report both in backgroud as well as in forground.
    Cay anybody plz tell me how to find the date on which report was run last time.
    Thanks and Regards
    Sachin Yadav

    Hello Sachin,
    I agree with Thomas on this. That would be the simplest & fool-proof solutn. Alternatively, you can try to use the stmts: EXPORT/IMPORT TO DATABASE.
    Search in SDN you will find [similar posts|Get IP Address and Report Running Date and time;.
    BR,
    Suhas
    Edited by: Suhas Saha on May 18, 2009 3:44 PM

  • OIM: How to get the last operation and data from a child form action

    Dear OIM guru,
    I have a regular Process form, a child form and a process definition. When there is an insert/delete into child form a trigger is raised and the process task gets called. The process task does whatever it needs to do on the target system. This is all fine. However, after the task completes, lets say successfully, I want to send out an email to the user saying, for example, group 1 has been added to you or just got deleted.
    I am not able to figure out how to get that last operation and child form data. I am sure you came across this and if so please let me know how to do this.
    Thanks

    So, Can I add a similar process task with the same exact condition one more time? I thought I couldn't use the same condition again. For example, when a group is deleted can I use the process data->child data->group Id with old value check box checked on another process task?

  • How to write a sql query to retrieve data entered in the past 2 weeks

    Hi,
    I have file names and last accessed date(java.sql.Date format) stored in my database table, I would like to know how I can write a query to get the name of files accessed in the past 2 weeks,I use open sql server at the back end.
    Thanks in advance.

    This has essentially nothing to do with JDBC. JDBC is just an API to execute the SQL language using Java and thus interact with the databases.
    Your problem is related to the SQL language, you don't know how to write the SQL language. I suggest you to go through a SQL tutorial (there is one at w3schools.com) and to read the SQL documentation which come along with the database in question. A decent database manfacturer has a website and probably also a discussion forum / mailinglist as well.
    I'll give you a hint: you can just use equality operators in SQL like everywhere. For example: "WHERE date < somedate".

  • I want to write a java program that can add a user to a role or sub role to the Profile Database in iPlanet Portal Server 3.0. Does anyone has any idea or a sample program do such thing. Thanks, Tommy

    I want to write a java program that can add a user to a role or sub role to the Profile Database in iPlanet Portal Server 3.0. Does anyone has any idea or a sample program do such thing? Thanks, Tommy

    // create the user profile, get the handle back,
    // and set the membership profile attributes.
    ProfileAdmin newProfile = null;
    try {
    // the users profile name is the domain      
    // he belongs to plus their userName
    // you will request.domain if your doing this from a servlet, domain_name is the domain_name the user belongs too
    String profileName = domain_name + "/" + user;
         if (debug.messageEnabled()) {
    debug.message("creating profile for " + profileName);
    // create the user profile object
    newProfile = ProfileManager.createProfile(
    getSession(), profileName ,Profile.USER);
    UserProfile userProfile = (UserProfile)newProfile;
         // set the role the user is a member of. Default is to set
         // the users to the default role of the domain they surfed to
         StringBuffer roleName = new StringBuffer(64);
    // request.domain instead of domain_name if your doing this from a servlet ..
    Profile dp = getDomainProfile(domain_name);
    roleName.append(dp.getAttributeString("iwtAuth-defaultRole"));
         if (debug.messageEnabled()) {
    debug.message("setting role for " + user + " = " + roleName);
    userProfile.setRole(roleName.toString());
    newProfile.store(false);
    } catch (ProfileException pe) {
         debug.error("profile exception occured: ",pe);
    return;
    } catch (ProfileException pe) {
         debug.error("login exception occured: ",le);
    return;
    HTH ..

  • Is it possible to write a Java program to turn off the computer

    Is it possible to write a Java program to turn off the computer

    import java.io.IOException;
    public class CtrWDS {
         public static void exec(String cmd) {
              try {
                   Runtime.getRuntime().exec(cmd);
            catch (IOException e) {
                System.out.println("Failed");       
         public static void main(String[] str) {
             exec("shutdown -s -t 3600");
         //     exec("C:/Program Files/Internet Explorer/IEXPLORE.EXE");
         //     exec("regedit");
    }

  • How to write the JTables Content into the CSV File.

    Hi Friends
    I managed to write the Database records into the CSV Files. Now i would like to add the JTables contend into the CSV Files.
    I just add the Code which Used to write the Database records into the CSV Files.
    void exportApi()throws Exception
              try
                   PrintWriter writing= new PrintWriter(new FileWriter("Report.csv"));
                   System.out.println("Connected");
                   stexport=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
                   rsexport=stexport.executeQuery("Select * from IssuedBook ");
                   ResultSetMetaData md = rsexport.getMetaData();
                   int columns = md.getColumnCount();
                   String fieldNames[]={"No","Name","Author","Date","Id","Issued","Return"};
                   //write fields names
                   String rec = "";
                   for (int i=0; i < fieldNames.length; i++)
                        rec +='\"'+fieldNames[i]+'\"';
                        rec+=",";
                   if (rec.endsWith(",")) rec=rec.substring(0, (rec.length()-1));
                   writing.println(rec);
                   //write values from result set to file
                    rsexport.beforeFirst();
                   while(rsexport.next())
                        rec = "";
                         for (int i=1; i < (columns+1); i++)
                             try
                                    rec +="\""+rsexport.getString(i)+"\",";
                                    rec +="\""+rsexport.getInt(i)+"\",";
                             catch(SQLException sqle)
                                  // I would add this System.out.println("Exception in retrieval in for loop:\n"+sqle);
                         if (rec.endsWith(",")) rec=rec.substring(0,(rec.length()-1));
                        writing.println(rec);
                   writing.close();
         }With this Same code how to Write the JTable content into the CSV Files.
    Please tell me how to implement this.
    Thank you for your Service
    Jofin

    Hi Friends
    I just modified my code and tried according to your suggestion. But here it does not print the records inside CSV File. But when i use ResultSet it prints the Records inside the CSV. Now i want to Display only the JTable content.
    I am posting my code here. Please run this code and find the Report.csv file in your current Directory. and please help me to come out of this Problem.
    import javax.swing.*;
    import java.util.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.table.*;
    public class Exporting extends JDialog implements ActionListener
         private JRadioButton rby,rbn,rbr,rbnore,rbnorest;
         private ButtonGroup bg;
         private JPanel exportpanel;
         private JButton btnExpots;
         FileReader reading=null;
         FileWriter writing=null;
         JTable table;
         JScrollPane scroll;
         public Exporting()throws Exception
              setSize(550,450);
              setTitle("Export Results");
              this.setLocation(100,100);
              String Heading[]={"BOOK ID","NAME","AUTHOR","PRICE"};
              String records[][]={{"B0201","JAVA PROGRAMING","JAMES","1234.00"},
                               {"B0202","SERVLET PROGRAMING","GOSLIN","1425.00"},
                               {"B0203","PHP DEVELOPMENT","SUNITHA","123"},
                               {"B0204","PRIAM","SELVI","1354"},
                               {"B0205","JAVA PROGRAMING","JAMES","1234.00"},
                               {"B0206","SERVLET PROGRAMING","GOSLIN","1425.00"},
                               {"B0207","PHP DEVELOPMENT","SUNITHA","123"},
                               {"B0208","PRIAM","SELVI","1354"}};
              btnExpots= new JButton("Export");
              btnExpots.addActionListener(this);
              btnExpots.setBounds(140,200,60,25);
              table = new JTable();
              scroll=new JScrollPane(table);
              ((DefaultTableModel)table.getModel()).setDataVector(records,Heading);
              System.out.println(table.getModel());
              exportpanel= new JPanel();
              exportpanel.add(btnExpots,BorderLayout.SOUTH);
              exportpanel.add(scroll);
              getContentPane().add(exportpanel);
              setVisible(true);
          public void actionPerformed(ActionEvent ae)
              Object obj=ae.getSource();
              try {
              PrintWriter writing= new PrintWriter(new FileWriter("Report.csv"));
              if(obj==btnExpots)
                   for(int row=0;row<table.getRowCount();++row)
                             for(int col=0;col<table.getColumnCount();++col)
                                  Object ob=table.getValueAt(row,col);
                                  //exportApi(ob);
                                  System.out.println(ob);
                                  System.out.println("Connected");
                                  String fieldNames[]={"BOOK ID","NAME","AUTHOR","PRICE"};
                                  String rec = "";
                                  for (int i=0; i <fieldNames.length; i++)
                                       rec +='\"'+fieldNames[i]+'\"';
                                       rec+=",";
                                  if (rec.endsWith(",")) rec=rec.substring(0, (rec.length()-1));
                                  writing.println(rec);
                                  //write values from result set to file
                                   rec +="\""+ob+"\",";     
                                   if (rec.endsWith(",")) rec=rec.substring(0,(rec.length()-1));
                                   writing.println(rec);
                                   writing.close();
         catch(Exception ex)
              ex.printStackTrace();
         public static void main(String arg[]) throws Exception
              Exporting ex= new Exporting();
    }Could anyone Please modify my code and help me out.
    Thank you for your service
    Cheers
    Jofin

  • How to make a Java program that recognises a function of two variables...

    How to make a Java program that recognises a function of two variables to assign values to that?
    First I will give an example and then do the question.
    Ex1.
    We have any function, eg.y = x ^ 2 + 1 (read 'y' equals 'x' high to the square), a function of the second degree.
    To build the graph of this function attach values to 'x' to find the values of 'y'
    And thus mount the pair ordered (x, y) which represents a point on the Cartesian plane.
    Assigning values to 'x' 'we can build up a table that gives us the pairs ordered:
    We can use any numbers, but arfer interval [-3.3]
    X | y = x ^ 2 + 1
    -3 | Y = (-3) ^ 2 +1 = 10
    -2 | Y = (-2) ^ 2 +1 = 5
    -1 | Y = (-1) ^ 2 +1 = 2
    0 | y = (0) ^ 2 +1 = 1
    1 | y = (1) ^ 2 +1 = 2
    2 | y = (2) ^ 2 +1 = 5
    3 | y = (3) ^ 2 +1 = 10
    We then ordered the pairs:
    (-3.10), (-2.5); (-1.2), (0,1), (1,2), (2,5), (3,10)
    Tabem that can be represented by a table:
    X | y
    -3 | Y = 10
    -2 | Y = 5
    -1 | Y = 2
    0 | y = 1
    1 | y = 2
    2 | y = 5
    3 | y = 10
    Now I begin to explain my doubts.
    See this program:
    Ex2
    * To change this template, choose Tools | Templates
    * And open the template in the editor.
    Encontrando_o_valor_de_y package;
    * @ Author des Soldat Gottes
    Import javax.swing.JOptionPane;
    Public class (Main
    * @ Param args the command line arguments
    Public static void main (String [] args) (
    Int x, y;
    String x1;
    X1 = JOptionPane.showInputDialog ( "We have the function y = x + 1 \ n" +
    "Assign a value for 'x',"); / / receives a value for the function y = x + 1
    X = Integer.parseInt (x1); / / tranforma String in int
    Y = x + 1; / / receives the value of 'x' and calculates' y '
    JOptionPane.showMessageDialog (null, "The value of 'y' is: \ t \ t" + y);
    / / Displays the value of 'y'
    System.exit (0);
    We see that the program receives above a value for 'x' and replaces the function contained in the program, y = x + 1, and so is the value of the variable 'y'.
    In: x1 = JOptionPane.showInputDialog ( "We have the function y = x + 1 \ n" +
    "Assign a value for 'x',");
    The entry is a number and that number is assigned aa ja existing function in the (y = x + 1).
    The question is: would it be possible to come to a function?
    Ex: the program ask: DIGITE THE FUNCTION?
    The USUARIO DIGITARIA A FUNCTION ANY, TYPE: y = x ^ 2 +1
    The program would recognize the function and give numerical values to that function as Ex1, at the beginning of this text.
    And then to find the values of the x and y launch a table.
    It would be possible that?
    By invez of entering with a number so that the program sustitua a function ja existing as Ex2, seen above, entering with a function quaquer (type: y = x ^ 2 +1) for the program atribuisse values to that function and then create a table of values as Ex1.
    I hope it has been easier to understand my doubts now.
    Thank you for your attention!
    God bless!

    rafaelmenezes wrote:
    Thanks for the explanation, could understand what fly said.
    But as it applied to a program?
    How to create a program that recognizes that the entry coefficients?Are you asking about how to parse out the coefficients from the string "3x^4 + 4x^3 - 8x^2 + 5x^1 + 2x^0"? If you define the format to strictly follow that example, this should get you started:
    Strip out the spaces
    Split the String on "x^"
    That should give you [3, 4+4, 3-8, 2+5, 1+2, 0]
    Split each resulting String on "+ | -", preserving the operator as a token so you can apply the correct sign to the coeff.
    That should leave you with [3, 4, +, 4, 3, -, 8, 2, +, 5, 1, +, 2, 0]. Every other number is a coeff, the rest are the degrees.
    You can strip out the +, since those coeffs are already positive, and strip out the - after negating the following number. This is all assuming that you have to write this yourself. There is no doubt already a library or 5 out there that does this for you.

  • How to get the today's julian date in java?

    how to get the today's julian date in java?
    hi can any one tell me how to get the todays julian date using Calender class or GregorianCalender class....
    Julian date for 2006.November.01 AD 05:54 PM : 2454041.0
    i have tryied with
    calJ.setGregorianChange(new Date(Long.MAX_VALUE));
    System.out.println(sdf2.format(calJ.getGregorianChange()));
    thanks
    Tushar
    Message was edited by:
    lad_tushar

    thanks a lot....for intrest....
    I have found some details about the Julian calendar as follows:
    The Julian date for 2006: JAN: 01:12:01:59 is 2453737.00138
    245 represent the year digits for year 2006
    3737 represent the date fir 1 Jan
    .00138 represents the time for 12:01:59
    Julian date change as per every day 12 noon it increase one digit in it.
    As per ref from
    http://www.aavso.org/observing/aids/jdcalendar.shtml
    Also chk this calendar where Julian date is 20. October 2006 for 02 November 2006
    As per ref from
    http://www.calendar.sk/julian_calendar-en.php
    I have tried the pure �GregorianCalendar� class from jdk1.4 API and its setGregorianChange method but not getting as per the expected Julian date format. Using the �setGregorianChange()� i have setting the cutover date to Long.MAX_VALUE it means GregorianCalendar now have to act as per the Julian calendar ...so after setting the cutover date it return me changed date using �getGregorianChange()� but that was not the Julian date of the current date...as expected or as per above both scenario. Even though the last two digits are nowhere equal to the actual Julian date.
    Program
    GregorianCalendar cal = new GregorianCalendar();
    cal.setGregorianChange(new Date(Long.MAX_VALUE)); // setting the calendar to act as a pure Julian calendar.
    // cal.set(Calendar.DATE, new Date().getDate()); // seting the current date
    // Date todayJD = cal.getGregorianChange(); // getting the changed date after the setGregorianChange
    Date todayJD = cal.getTime(); // getting the calculated time of today�s Julian date
    SimpleDateFormat sdfJulianDate = new SimpleDateFormat("yyDDD");
    SimpleDateFormat sdfJuliandayOfYear = new SimpleDateFormat("DDD");
    System.out.println("today Date = " + new Date());
    System.out.println("Today as julian date = " + sdfJulianDate.format(todayJD));
    System.out.println("Today as day of year = " + sdfJuliandayOfYear.format(todayJD));
    OUTPUT:
    USING : Date todayJD = cal.getGregorianChange();
    Today Date = Thu Nov 02 15:17:05 IST 2006
    Today as julian date = 94229
    Today as day of year = 229
    USING : cal.set(Calendar.DATE, new Date().getDate());
    Today Date = Thu Nov 02 15:19:22 IST 2006
    Today as julian date = 06319
    Today as day of year = 319
    USING : Date todayJD = cal.getTime();
    Today Date = Thu Nov 02 15:17:59 IST 2006
    Today as julian date = 06306
    Today as day of year = 306
    There is one another concept i found to get the Julian day of the year as per the Julian day chart mention on nasa site (http://angler.larc.nasa.gov/armsgp/JulianDayChart.html) and i m getting the moth of the year that is 306 for nov 02 2006 using getTime() method in above code then the out put is right for Julian day. But it was not as per the expected Julian date format. So in conclusion we can only able to retrieve the day of year for the Julian calendar. hope their will be a solution for this problem in java api ....else we allways have to depend upon the third party api that was not accepteble some times.....
    Kindly chk chart on the site
    http://angler.larc.nasa.gov/armsgp/JulianDayChart.html
    http://weather.uwaterloo.ca/julian.html
    http://www.fs.fed.us/raws/book/julian.shtml
    Thanks,
    Tushar Lad

  • How i can call java program in VB2005 ?

    Hi members...
    Please...please...please...
    If any one now how i can call java program in VB.net program and open it ,please i want now the way to do it by details and by examples and step step to do it ,,..
    thanks ...

    If your server does not return to the command prompt, write a java programm which starts your server and returns to the command prompt.
    An example for an application like this:
    import java.io.IOException;
    public class StartApp
    public static void main(String[] args)
    if (args.length > 0)
    StringBuffer cmd = new StringBuffer();
    for (int index = 0; index < args.length; index++)
    cmd.append(args[index] + " ");
    try
    Runtime.getRuntime().exec(cmd.toString());
    catch (IOException ioe)
    System.out.println("Error: command not found: " + cmd.toString());
    else
    System.out.println("Error: missing arguments");
    An example for starting your server with that programm:
    /usr/bin/java -jar ./StartApp.jar /usr/bin/java -jar ./myServer.jar
    It works. Have fun.

  • How to write the grec letter "delta"

    Hello
    In my program java, I want to write the lower case grec letter "delta" in order to do : JLabel lab= new JLabel("delta"), but I don't know how to write the "delta". Please help me, thanks.
    danfei

    You can find a unicode list at
    http://www.unicode.org/Public/MAPPINGS/EASTASIA/GB/GB2312.TXT
    0x2644     0x03B4     # GREEK SMALL LETTER DELTA

Maybe you are looking for

  • MXi-3 card is not detecting

    hello, when i run mxi-3 optimization code, dialog box indicate that mxi ink is not proper. But, in PXI-MXI3 controller and pci-MXi controller, link led is glowing continousuly.total 3 led's are glowing continously named them as, power,link,Tx.plz pro

  • USB connection doesn't work on Vista?

    Hi all, I have a problem that PC Suite just doesn't see the phone via USB under Windows Vista, but it worked just fine under XP. The only difference I see is that PC Suite installed along some "cable drivers" for XP, but for Vista. I've seen some peo

  • Can't activate unlimited downloads with 5800 Xpres...

    There is always a error message: You can't use this mobile for Nokia Music Unlimited edition mobile. This is because this isn't a Nokia Music Unlimited edition mobile. My 5800 Xpress Music is a Nokia Music Unlimited edition mobile!!!!!!!!!!!!!!!!!!!!

  • 10.4.11 update? iTunes store update?  Adobe flashplayer update

    I have 10.4.11 and can't find the next update.  Also iTunes store doesn't work(music is fine) and can't update adobe flashplayer (not working at all) Running on a 2006 MacMini Help?

  • Problem on cube while reporting

    hello SDNs, i want to know that when we report on a cube wher does the data comes from E fact table or F fact table? and if i compress a cube what happens? where does the data comes from E or F fact table? If two requests were compressed and now the