Problem regarding java.uti..date  & Calander

Hi
I am stuck in a problem for which i need your help.i am implementing webservices for my project. There are methods in my code which i need to expose as a webservice. i am using Axis engine for devep.
i have certain methods like findxyz(java.math.BigInteger clientPk, java.util.Date startDate, java.util.Date endDate)
The parameters for this methods are of type java.util.Date. I found on the net that Axis engine provides support for date type.
When i generate my client side stubs then the parameters for methods with date as parameter change into Calander type.
i am not able to figure out what's happening here and why this change.
So can you please let me know about the problem here and how to rectify this issue.
Thanks & Regards
Vikeng

Hi'
Any takers for my problem here.
Please post your views as it is very urgent for my project.
hope to get a positive reply from your side.
Thanks & Regards
Vikeng

Similar Messages

  • Problem Writing java.sql.Date to MS Access

    I have a relatively simple application that is for my own use (not distributed on an enterprise-wide basis). As I don't have an IT staff, I'm using a rudimentary Java front-end (v1.3.1) and a Microsoft Access backend.
    I seem to have trouble using INSERT/UPDATE statements with the MS Access Date/Time data type. Below is an example of code being used (id is defined as Text, amount is a Number and timestamp is Date/Time):
    conn = DriverManager.getConnection("jdbc:odbc:markets", "", "");
    conn.setAutoCommit(true);
    String sql = "INSERT INTO temp (id, amount, timestamp) VALUES (?, ?, ?)";
    PreparedStatement stmt = conn.prepareStatement(sql);
    String id = args[0];
    int len = id.length();
    java.sql.Date dt = new java.sql.Date(new java.util.Date().getTime());
    stmt.setString(1, id);
    stmt.setDouble(2, id.length());
    // I think the problem is here - the JDBC driver doesn't properly map dates to Access???
    stmt.setDate(3, dt);
    stmt.execute();
    stmt.close();
    conn.close();And I get the following error:
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access
    Driver] Syntax error in INSERT INTO statement.
            at sun.jdbc.odbc.JdbcOdbc.createSQLException (JdbcOdbc.java:6879)
            at sun.jdbc.odbc.JdbcOdbc.standardError (JdbcOdbc.java:7036)
            at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect (JdbcOdbc.java:3065)
            at sun.jdbc.odbc.JdbcOdbcStatement.execute (JdbcOdbcStatement.java:338)
            at TestWritingDate.main(TestWritingDate.java:31) I'm virtually certain this is a translation problem with
    the java.sql.Date and the JDBC driver. But I can't seem
    to overcome this. Any help is DESPERATELY needed.
    Thanks.
    Matt

    That was it....thanks...didn't even consider that....perhaps I should start using class names that are already in use too :-). Thanks again...

  • Problem with java.tuil.Date.

    Hi all
    I am in strange problem.
    I want to convert java.util.Date object to this format :
    MM/dd/yyyy
    but the condition is i should not convert it to String type or any other type.
    My method should return Date object.
    Any body has any idea.
    Thanx in advance.

    Thanx for ur reply sir.
    The actual problem is i am using hibernate with struts.
    I have a bean called News Bean.
    In the database(SQL Server i have a datetime field called createdon.
    Now struts actionform doesnt support java.util.Date .
    So i have to convert this string value from actionform in java.util.Date(in MM/dd/yyyy formate) and then assigning it to my bean before saving the values in database.
    I have done it and its working fine.
    But now the original problem is coming while updating the things(specialy date field) .
    When i update, the struts jsp page is showing the record from the database and the date is coming in the formate yyyy-mm-dd , which is strang as i have save it with mm/dd/yyyy formate.
    To rectify this i m modifying the bean's getter method for date so that it should return the date with mm/dd/yyyy formate.
    For this i am converting date to string first of all then trying to convert it into date with mm/dd/yyyy format.
    But this is not working .
    Here i m getting problems.
    And unable to solve it
    i have enough search on the net.
    please help if u can

  • Any latest addition regarding java.sql.Date

    I have separate strings "10/21/2003" and "02:33:27".
    Just to convert String "10/21/2003" to sql date, do I really need to call up simple date format and parsing it?
    why? there is no time associated with this string. The time is on a separate string.
    I am using preparedstatement.

    Did I do unnecessary steps in getting to sql.Date ?
    String sDate = "10/16/2003";
    String sTime = "02:12:54:;
    String year = sDate.substring(6,9);
    String month = sDate.substring(0,1);
    String day = sDate.subst....
    String sDateNew = year + "-" + month + "-" + day;
    // the string becomes 2003-10-16.
    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd");
    java.util.Date uDate = sdf.parse(sDateNew);
    long time = uDate.getTime();
    java.sql.Date sqlDate = new java.sql.Date(time);
    pstmt.setDate(i, sqlDate);
    It works, but did I put in extra steps ?
    I tried using the same trick for sTime, but that did not work out.

  • Use of java.uti.Date for comparison

    Hi Friends
    I am stuck in a problem for which i need help from you.
    I have written code to convert a date object into a calander object for a functionality in my application.
    I am getting the output in the following format after conversion
    Thu May 31 00:00:00 IST 2007
    Wed Jun 13 00:00:00 IST 2007
    Now inside other method i reconvert the calendar object back to Date objects.the code is as below.
    Date start=filterStartDate.getTime();
    Date end=filterEndDate.getTime();
    Now i need to compare the 2 Date objects here and check whether the startdate is less than enddate.
    the date objects are again in the same format after conversion
    Thu May 31 00:00:00 IST 2007
    Wed Jun 13 00:00:00 IST 2007
    Can anybody let me know how to do this conversion.If possible provide me piece of code to do it.
    waiting for a positive reply from you side.
    Regards
    Vikeng

    Resolved

  • Problem regarding change of data type x to data type c

    Hi,
    Is there any way to change the data type x to data type c.
    w_end_record             TYPE x,
    SPLIT i_data_file AT c_delimiter INTO i_ekko-rtype
                                                i_ekko-ebeln
                                                i_ekko-bsart
                                                i_ekko-lifnr
                                                i_ekko-loekz
                                                w_end_record.
          macro_append_internal_table i_ekko.
    When I do syntax check in ECC6.0 it's showing the error "w_end_record"  must be Character type(C,N,D,T).The error is due to Unicode.
    I was using the class CL_ABAP_CHAR_UTILITIES but I am not able to find out appropriate attributes for it. Can anybody tell me the solution to resolve the problem.
    Is there any other to solve the problem.
    Thanks & Regards
    Prabhat

    Hi,
    Try following this peice of code.
    TYPES: BEGIN OF TAB_TYPE,
             TEXT(10)   TYPE C,
             XTEXT(160) TYPE X,
           END OF TAB_TYPE.
    DATA: TAB    TYPE STANDARD TABLE OF TAB_TYPE,
          WA_TAB TYPE TAB_TYPE.
      CONVERT TEXT TAB-TEXT INTO SORTABLE CODE TAB-XTEXT.
    Hope it works.
    Thanks,
    Sandeep.

  • Problem regarding item level data in CRMD_ORDER

    i have created a sales order in CRMD_ORDER and entered all the data for header and item . i have given required delievery date for both item and header different , but when we save the order a BADI is trigerred which will update the data to R/3 but still only header required delievery date is updated not the item level date can you provide any solution for this problem?
    another thing is can i know where does the item level data is store ie: date, quantity etc.

    Hello,
    You are posting to the SAP CRM 2007 forum so we assume you are using CRM 2007. In CRM 2007 the GUI is no longer supported and doesn't work as expected since SAP did not update the business logic in it.
    So, if you want to test your process and be 100% sure that there is a problem, use the WebUI for your tests.
    All item data is stored in CRMD_ORDERADM_I. If you want to find a date (of an item date profile) stored in an item you have to pass some tables however.
    CRMD_ORDERADM_I->CRMD_LINK->SCAPPTSEG.
    Reward points if useful!
    Regards,
    Joost

  • Regarding java.util.date / simple date format

    Hi Friends,
    I have a weired requirement where I am suppose to get time in millisecond for 3 scenarios.
    1. next 07:00 time
    2. next monday 07:00
    3. on next 1st 07:00
    Swing provides some jar where I can get next day - but not sure if I can play around to get my data.
    need your inputs.
    appreciate your quick reply friends,
    Chintan
    P.S. the reason I have to do so is
    1. I have 3 kind of reports - few reports expire daily - few weekly - few monthly.
    2. I am going to fetch the report from the external system and store (cache) in my db.
    3. Administrator can configure that when exactly the report is going to be updated in external system.
    4. So lets say for daily - every day at 7 it will be updated - so when I read the cached data, I want to compare the stored time stamp with next 7:00 time stamp and if my stored timestamp is less than next 7:00 time stamp - i can use the cached data and similarly for weekly and monthly.
    Please let me know if you have more questions.

    I'll just add an example.
    say I added a report to DB at 1188563489217 and my
    cutoff is weekly that is on next monday at 7:00 in
    the morning - at that time my milliseconds would be
    1188783033888
    now as far as my stored milliseconds are less than
    1188783033888 i can read it from my db and if my
    stored milliseconds are greater than 1188783033888
    then I need to refetch the report.
    Now for this task - every time i make a call to my DB
    - i have to get time in milli seconds for next monday
    7:00.
    Is it possible??
    I am badly struck over here - please guide.
    Chintan
    Appreciate your help buddies.
    ChintanTake the hint if the date string is 35:11:2007 07:00 in dd:MM:yyyy HH:mm format then the parsed date will be 05:12:2007 07:00.
    your problem is actually a piece of cake ;-)

  • Problem regarding JAVA project...

    this is the brief discussion about my project :it actually automatically fillup the application forms or other forms on net
    (on the sites mentioned).Actually the information that is to be fill up in application form is saved on the hard disk in the form of text file .N ow my project read this text file and fill up the application form on net.
    I am actually learning core java and i want to know which book to follow for JAVA regarding my project(Means i don't know which book to follow after core java . THERE ARE servlets and JSP books,or others books) .i have not started it(project) yet.i am learning "core java from Head First Java".
    and i even don't know what are servlets And JSP ,Why it is use????
    and also tell me the books to followed for core java and then for Advanced java ???.If there are any good tutorial regading them ,then plz send me the link.....or email me at [email protected]

    You need to be proficient in core Java (J2SE) before even thinking about starting on J2EE.
    But if you want to learn more about what J2EE is, why not read the tutorial: [http://java.sun.com/javaee/5/docs/tutorial/doc/JavaEETutorial.pdf]

  • Convert string into java.sql.Date

    Hi,
    I want to convert a date in string form into java.sql.Date to persist into the database column with Date as its datatype in Oracle. I'm trying as follows:
    import java.sql.Date;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    public class DateTest
    public static void main(String[] args)
    String strDate = "2002-07-16 14:45:01";
         System.out.println("strDate = "+strDate);
    Date aDate = null;
    try
    if(strDate != null && !strDate.trim().equals(""))
         SimpleDateFormat aSDF = new SimpleDateFormat();
         aSDF.applyPattern("yyyy-MM-dd hh:mm:ss");
         java.util.Date utilDate = aSDF.parse(strDate);
    System.out.println("utildate = "+utilDate);
         aDate = new Date(utilDate.getTime());
         aDate.setTime(utilDate.getTime());      
         System.out.println("aDate = "+aDate);
    catch (ParseException e)
    System.out.println("Unable to parse the date - "+strDate);
    catch (Exception ex)
    ex.printStackTrace();
    System.out.println("Caught Exception :"+ex.getMessage());
    It gives the output as :
    strDate = 2002-07-16 14:45:01
    utildate = Tue Jul 16 14:45:01 IST 2002
    aDate = 2002-07-16
    If I put this value into the database table, I can see only the date. Time part is missing. Is this the problem with java.sql.Date or Oracle datatype Date? Please help me asap.
    Thanks in advance.
    Regards,
    Rajapriya.R.

    If I put this value into the database table, I can
    see only the date. Time part is missing. Is this the
    problem with java.sql.Date or Oracle datatype Date?This is not a problem, this is the defined behaviour of the Date type. RTFAPI and have a look at Timestamp, while you're at it.

  • A problem regarding set up of Oracle Lite 3.6.0.2.0 on Win 95, with JDK 1.1.8 &java 2

    A problem regarding set up of Oracle Lite 3.6.0.2.0 on Win 95, with JDK 1.1.8 and Java 2 SDK ( Ver 1.3 Beta)
    After the installation of Oracle Lite 3.6.0.2.0 on a laptop (with WIN 95 OS), When I run Oracle Lite Designer from start menu, I receive following error message :
    ====================================
    Invalid class name 'FILES\ORA95_2\LITE\DESIGNER\oldes.jar;C:\PROGRAM'
    usage: java [-options] class
    where options include:
    -help print out this message
    -version print out the build version
    -v -verbose turn on verbose mode
    -debug enable remote JAVA debugging
    -noasyncgc don't allow asynchronous garbage collection
    -verbosegc print a message when garbage collection occurs
    -noclassgc disable class garbage collection
    -ss<number> set the maximum native stack size for any thread
    -oss<number> set the maximum Java stack size for any thread
    -ms<number> set the initial Java heap size
    -mx<number> set the maximum Java heap size
    -classpath <directories separated by semicolons>
    list directories in which to look for classes
    -prof[:<file>] output profiling data to .\java.prof or .\<file>
    -verify verify all classes when read in
    -verifyremote verify classes read in over the network [default]
    -noverify do not verify any class
    -nojit disable JIT compiler
    Please make sure that JDK 1.1.4 (or greater) is installed in your machine and CLASSPATH is set properly. JAVA.EXE must be in the PATH.
    ====================================
    My ORACLE_HOME is c:\program files\ora95_2 and Oracle Lite is installed under the ORACLE_HOME in LITE\DESIGNER directory.
    JDK version is 1.1.8 which is greater than 1.1.4 installed in c:\program files\jdk1.1.8, My PATH, and CLASSPATH are set in AUTOEXEC.BAT as follows:
    set CLASSPATH=c:\Progra~1\jdk1.1.8\lib\classes.zip;c:\progra~1\ora95_2\lite\classes\olite36.jar;c:\progra~1\ora95_2\lite\designer\oldes.jar;c:\progra~1\ora95_2\lite\designer\swingall.j ar
    PATH=C:\Progra~1\Ora95_2\bin;.;c:\Progra~1\jdk1.1.8\lib;c:\Progra~1\jdk1.1.8\bin;C:\Progra~1\Ora95_2\lite\Designer;C:\WIN95;C:\WIN95\COMMAND;C:\UTIL
    And, I can run JAVA.EXE from any directory on command prompt.
    With JAVA 2 SDK (ver 1.3 Beta) instead of JDK 1.1.8 I'm getting a different Error message as follows:
    =============================
    java.lang.NoClassFoundError: 'FILES\ORA95_2\LITE\DESIGNER\oldes.jar;C:\PROGRAM'
    Please make sure that JDK 1.1.4 (or greater) is installed in your machine and CLASSPATH is set properly. JAVA.EXE must be in the PATH.
    ==============================
    the PATH and CLASSPATH were set accordingly, as with JDK1.1.8, and there was no classes.zip in classpath
    also the class file or the jar file looks weird or wrapped in the error message : 'FILES\ORA95_2\LITE\DESIGNER\oldes.jar;C:\PROGRAM'
    Another interesting thing I noticed is if I run oldes.exe from Installation CD, the Oracle Lite Designer runs fine, and without error, I'm able to modify tables in the database of my laptop also.
    Could someone shade some light on what am I doing wrong here ?
    Thanks for help in advance .
    Regards
    Viral
    null

    On 07/20/2015 06:35 AM, Itzhak Hovav wrote:
    > hi
    > [snip]
    > [root@p22 eclipse]# cat eclipse.ini -startup
    > plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
    > --launcher.library
    > plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20120913-144807
    >
    > -showsplash
    > org.eclipse.platform
    > --launcher.XXMaxPermSize
    > 256m
    > --launcher.defaultAction
    > openFile
    > -vmargs
    > -Xms40m
    > -Xmx512m
    > [snip]
    Try this: http://wiki.eclipse.org/Eclipse.ini. You should have read the
    sticky posts at forum's top for getting started help.

  • MS Access Date problem (from Java program)

    I have written an app. in Java that reads & writes data from a MS Access database.
    I am trying to write an insert class which will add a row of data to one of my database tables - which contains Date fields.
    My problem is that I can update the text fields, but not Date fields - every time I try my program throws an exception:
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement
    My simplified code reads as:
    try {
    Statement insertStatement = databaseConnection.createStatement();
    String query = "INSERT INTO myTable(jobId, employeeId, date) VALUES('11', '1', " + "'13/11/2006'" + ");";
    insertStatement.execute(query);
    } //close, etc. etc.
    If I remove the date info from the query, the program executes successfully. I appreciate my problem might be related to the formatting of the date in Access, and if not a 'proper' Java question I give my apologies.
    I have attempted several formats of the date with no success or variation in the exception.
    I am, however, completely stuck and would appreciate any and all help given.
    Regards and thanks
    David

    I have amended my code to use a preparedStatement, but on execution I have the same problem.
    My code is as follows:
    PreparedStatement pstmt = null;
    try {
    String query = "INSERT INTO myTable (jobId, employeeId, date) VALUES(?, ?, ?);";
    pstmt = databaseConnection.prepareStatement(query);
    pstmt.setString(1, "11");
    pstmt.setString(2, "1");
    java.sql.Date sqlDate = getCurrentJavaSqlDate();
    pstmt.setDate(3, sqlDate);
    // execute query, and return number of rows created
    int rowCount = pstmt.executeUpdate();
    System.out.println("rowCount=" + rowCount);
    pstmt.close();
    catch, etc. etc.
    Any ideas or help most welcome
    Regards
    David

  • PreparedStatement.setDate(1,java.sql.Date x) problem

    I am using Sun JDBC-ODBC bridge to access MS SQL Server 2000. I have following statement:
    java.util.Date date = new java.util.Date();
    java.sql.Date expire_date = new java.sql.Date(date.getTime());
    PreparedStatement pstat = con.prepareStatement("update account set expire_date=? where userid=?");
    pstat.setDate(1,expire_date);
    pstat.setString(2,userid);
    When I ran the program, I got a SQLException error as
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Optional features not implemented.
    I have traced the problem happened in the statement pstat.setDate(1,expire_date). I use jdbc-odbc bridge from j2se 1.3.1.
    I appreciate any help.
    Thanks, Brian

    May I refer to a recent topic where I explained a lot about date conversion between JDBC and SQLServer?
    http://forum.java.sun.com/thread.jsp?forum=48&thread=241049
    Try how far this helps you, then ask more.

  • Needed help regarding converting  string to java.sql.Date format

    I have a a function which returns a calendar object. The date must be inserted to Oracle DB using java.sql.Date format.
    So i have converted the Calendar object to java.sql.Date format using the following code
    java.sql.Date publicationDate = new java.sql.Date(book.getPublicationDate().getTime().getTime());But while getting inserted into the DB it was in mm/dd/yyyy format whereas i wanted dd/mm/yyyy format
    Can any body please help out how to store the date in dd/mm/yyyy format ?

    Can u please explain this a bit
    This is my code
    public int addBook(List<Book> BookList) throws SQLException, ParseException{
              System.out.println("Hi there");
              Book book = new Book();
              BookDB bookDb = new BookDB();
              //listLength =      BookList.length;
              String bookId = null;
                   try{
                        DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                        con  = DriverManager.getConnection("jdbc:oracle:thin:@10.123.79.195:1521:findb01","e115314", "e115314");
                        addBook = con.prepareStatement("insert into ABC_Book values(?,?,?,?,?,?,?)");
                        Iterator<Book> iterator = BookList.iterator();
                        while(iterator.hasNext()){
                             book = (Book)iterator.next();
                             System.out.println(book.getBookId());
                             addBook.setString(1,book.getBookId());
                             addBook.setString(2,book.getTitle());
                             addBook.setString(3,book.getAuthor());
                             addBook.setString(4,book.getPublisher());
                             System.out.println(book.getPublicationDate());
                             System.out.println("Before Date");
                             System.out.println("book.getPublicationDate().getTime()"+book.getPublicationDate().getTime());
                             java.sql.Date publicationDate = new java.sql.Date(book.getPublicationDate().getTime().getTime());
                             SimpleDateFormat formatter = new SimpleDateFormat("dd/mm/yyyy");
                             dateString = formatter.format(publicationDate);
                             System.out.println("Today is"+dateString);
                             java.sql.Date date = (java.sql.Date)formatter.parse(dateString);
                             System.out.println("date"+date);
                             //java.sql.Date publicationDate = (Date)book.getPublicationDate().getTime();
                             //System.out.println("Value of date is"+publicationDate);
                             System.out.println("After Date");
                             addBook.setDate(5,publicationDate);
                             addBook.setString(6,book.getCountry());
                             addBook.setString(7,book.getLanguage());
                             rs = addBook.executeQuery();
                             //con.commit();
                             rowCount = rowCount + rs.getRow();
                        return rowCount;
                   catch(SQLException se){
                        se.printStackTrace();
                   finally{
                        con.close();
                        System.out.println("After adding ");
              return 0;
         }

  • Poblem with java.sql.Date while inserting to a table

    Hi All,
    I have a PostgreSQL database table which contains fields(columns ) of type date. I want to insert values to the table in the[b] �dd-MMM-YYYY� format using the prepared statement.
    My code is as follows
    java.text.DateFormat dateFormatter =new java.text.SimpleDateFormat("dd-MMM-yyyy");
    String formatedDate=dateFormatter.format(theDate);
    currentDate = new java.sql.Date(dateFormatter.parse(formatedDate).getTime())
    �������������������
    �������������������
    �������������������
    pst.setDate(12,currentDate);The problem is the currentDate variable gives date only in the �YYYY-MMM-dd� format but requirement is the currentDate variable should give date in the �dd-MMM-YYYY� format and this should be save to table as java.sql.Date type
    There is any solution???? please help me...
    Thanks and Regards,
    Hyson_05

    Hi,
    What are you talking about? A Date does always wrap a millisecond value, and doesn't have any formatting. It's the database, or your program which formats the date that you see.
    In short. You should format the value when you print it, and not when you store it.
    Kaj

Maybe you are looking for

  • How to see the list of Negative wagetypes in a SAP system

    Hi I want to see the list of all wagetypes where the user enters negative number, Is there any standard report or  Table where can i find these, please provide the path. please help Regards Sangitha

  • Files in catalog but are not visible.

    I have several files that have disappeared from the library but are still cataloged. If I try to re-import one the files I get a message that they are already in the catalog. If I click on show in catalog, the loupe will show "No photos in selected i

  • About 'crystal report'

    Hi All, Can someone please tell me the prcedure to instll/activate 'crystal report' in BW and generate reports from BW query by using 'crystal report'? Here is what I did. If I am wrong, please correct me.Thank you very much. 1. go to SPRO in BW to s

  • Date format Issue after HRSP Update

    Hi, We are faced with a strange issue after HRSP update was applied on our client system (upgraded from SAP-KE-30 to SAP-KE-36). There is an outgoing interface which picks up all the the starters into the local government pension scheme and updates a

  • Condition Type becoming inactive in IPC

    Hi All, Could someone please explain why a pricing condition using a custom condition formula causes the pricing condition to be inactive when viewed through the IPC. Thanks, AYeung Edited by: AYeung on Mar 16, 2011 8:31 PM