Two Data Objects is one too much

I got a field in a database named 'Date'. Now i want to get the date and formate it. For both operations i need the packages java.sql (for database) and java.text.SimpledateFormatter (to formate the date). Now i get the errror message that java don't now which Date Object i mean in my code, cause Class data is part of the package java.sql and java.text.SimpleDateFormatter. Has anyone an idea?

I take it you are getting the 'amibiguous' error message returned? To eradicate this, simply import the exact classes of the specific packages you require, as opposed to simply importing the whole package. ie do not just import java.sql.*, on different lines import specific classes. Since this produces no performance degredation it does not matter, and some poeple would say it is a better programming style (unless you are using several classes from a package) since readers of your code can see exactly what you are using and where.

Similar Messages

  • How to compare two date Objects

    Hi,
    I have two Calendar Objects, one is coming from client and one is my server time, I need to evaluate that incoming time with server time so that if it is sent before an hour back then i should not do anything on that request Object. I have converted the incoming String into Calendar Object and how can i evaluate these two Calendar Objects including their hours and minutes.
    Thanks in advance
    bajju

    bajjurireddy, ignore Mobiquity's post. It contains no useful information and will only serve to confuse and frustrate you.
    Mobiquity wrote:
    Also make sure that the two date objects are in the same date format..
    public static String DateToDateString(java.util.Date d, String dateFormat)
         throws ParseException {
              SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
              sdf.setLenient(false); // this is required else it will convert
              String dateString = sdf.format(d);
              return dateString;

  • Accessing two data sources in one method

    I wanted to access two connection pools in one EJB project. I manage to create two connection pools in weblogic server and I successfully wrote the lookup code. I wanted to call these two data sources in one method. But it only gives result from one data source connection. other is null. Im getting following message also
    Connection has already been created in this tx context for pool named jdbc_informix_pool. Illegal attempt to create connection from another pool: JDBC_informix_webdata
    "jdbc_informix_pool" and "JDBC_informix_webdata" is the names of my connection pools. the two data sources works perfectly when they are accessed separately. but whenever im tryng to call two data sources in one method it retrive data from only one data source and gives me above message.
    anyone know how to fix it.?
    thnx
    sameera

    hi...
    thnx man.. it worked. But there is another problem. I cant close my data source connection. whenever im tryng to close it, it says
    Result set already closed
    i manage to run my program without closing the data source connection. but after a while it says
    No resources currently available in pool JDBC_informix_webdata to allocate to applications, please increase the size of the pool and retry
    i can increase the size of the pool and run my program. but i guess if I close the data source connection this will be resolved. But how can I close my data source connection. I tried finally clause. but it gives me the result set already closed message
    how can i do it.?
    thnx
    sameera
    Edited by: Sameera on Jun 18, 2009 8:35 PM
    Edited by: Sameera on Jun 18, 2009 8:40 PM

  • Can I have two Data Files in One control file of sql*loader tool

    hi,
    Can someone help me out. is it possible to have two Data Files in one control file of Sql*loader.
    And isit possible to run 10,000 records before lunch and 10,000 records before tea and 10,000 records before evening session by giving breaks after every 10,000 records.
    Thanks
    Ram

    Yes. You can specify two datafiles in one control file and can load using sql loader.
    I give you the sample control file.
    Load DATA
    INFILE 'TEST1.CSV'
    INFILE 'TEST2.CSV'
    TRUNCATE
    INTO TABLE TEST_P
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    (COL_1,
    COL_2,
    COL_n)
    Hope It will help you.
    -Karthik

  • Obiee 11.1.1.6.6 - analysis displays two dates instead of one prompted

    Hi all,
    my analysis somehow displays two dates instead of one prompted.
    How can it be?
    Tell me please what additional information should I include for you to help me.
    obiee 11.1.1.6.6
    Upd: prompt screenshots
    http://marchello.ccx-grads.org/img/BI_prompt_001.png
    http://marchello.ccx-grads.org/img/BI_prompt_002.png

    This is from "Administration" -> "Manage Sessions" section of obiee
    1) everything seems fine, WHERE clause shows correct date
    SET VARIABLE QUERY_SRC_CD='Report',SAW_SRC_PATH='/shared/VB/8.RB-213.BI.1';SELECT
       0 s_0,
       "VB"."VBIREP8"."AASYSDATE" s_1,
       "VB"."VBIREP8"."ADAY" s_2,
       "VB"."VBIREP8"."AMONTH" s_3,
       "VB"."VBIREP8"."ARCDATE" s_4,
       "VB"."VBIREP8"."AYEAR" s_5,
       "VB"."VBIREP8"."CONTRAGENTID" s_6,
       "VB"."VBIREP8"."CONTRAGENTNAME" s_7,
       "VB"."VBIREP8"."CREDITS" s_8,
       "VB"."VBIREP8"."DEPOSITARY" s_9,
       "VB"."VBIREP8"."DEPOSITS" s_10,
       "VB"."VBIREP8"."IDENTIFYCODE" s_11,
       "VB"."VBIREP8"."OVERDAY30" s_12,
       "VB"."VBIREP8"."RESTRUCTURED" s_13,
       "VB"."VBIREP8"."SEGMENT" s_14,
       "VB"."VBIREP8"."STATUS" s_15,
       "VB"."VBIREP8"."TOBO" s_16
    FROM "VB"
    WHERE
    (CAST("VBIREP8"."ARCDATE" AS DATE) = date '2013-08-15')
    ORDER BY 1, 3 ASC NULLS LAST, 4 ASC NULLS LAST, 6 ASC NULLS LAST, 5 ASC NULLS LAST, 7 ASC NULLS LAST, 8 ASC NULLS LAST, 12 ASC NULLS LAST, 15 ASC NULLS LAST, 16 ASC NULLS LAST, 9 ASC NULLS LAST, 14 ASC NULLS LAST, 13 ASC NULLS LAST, 11 ASC NULLS LAST, 10 ASC NULLS LAST, 17 ASC NULLS LAST, 2 ASC NULLS LAST
    FETCH FIRST 100000001 ROWS ONLY
    2) and now attention, I press "next rows" arrow, my WHERE clause is simply ABSENT! 
    SET VARIABLE QUERY_SRC_CD='Report',SAW_SRC_PATH='/shared/VB/8.RB-213.BI.1';SELECT
       0 s_0,
       "VB"."VBIREP8"."AASYSDATE" s_1,
       "VB"."VBIREP8"."ADAY" s_2,
       "VB"."VBIREP8"."AMONTH" s_3,
       "VB"."VBIREP8"."ARCDATE" s_4,
       "VB"."VBIREP8"."AYEAR" s_5,
       "VB"."VBIREP8"."CONTRAGENTID" s_6,
       "VB"."VBIREP8"."CONTRAGENTNAME" s_7,
       "VB"."VBIREP8"."CREDITS" s_8,
       "VB"."VBIREP8"."DEPOSITARY" s_9,
       "VB"."VBIREP8"."DEPOSITS" s_10,
       "VB"."VBIREP8"."IDENTIFYCODE" s_11,
       "VB"."VBIREP8"."OVERDAY30" s_12,
       "VB"."VBIREP8"."RESTRUCTURED" s_13,
       "VB"."VBIREP8"."SEGMENT" s_14,
       "VB"."VBIREP8"."STATUS" s_15,
       "VB"."VBIREP8"."TOBO" s_16
    FROM "VB"
    ORDER BY 1, 3 ASC NULLS LAST, 4 ASC NULLS LAST, 6 ASC NULLS LAST, 5 ASC NULLS LAST, 7 ASC NULLS LAST, 8 ASC NULLS LAST, 12 ASC NULLS LAST, 15 ASC NULLS LAST, 16 ASC NULLS LAST, 9 ASC NULLS LAST, 14 ASC NULLS LAST, 13 ASC NULLS LAST, 11 ASC NULLS LAST, 10 ASC NULLS LAST, 17 ASC NULLS LAST, 2 ASC NULLS LAST
    FETCH FIRST 100000001 ROWS ONLY
    Sure, I receive another date (01.02.2013). Just one thing is strange here - why do I receive only one extra date (I should receive ALL dates in Oracle table when I perform query without any WHERE clause).

  • Two data sources to One Infosource?

    HI GURUS
    Can we connect Two data sources to One Infosource?
    Regards
    Durai

    Hi Expert !
    Thanks
    If we assigned two data sources to an Infosource, all those fields will be availabe in the transfer rule maintanence screen that we can choose and assign to Infosource infoobjects.
    Am I correct?
    Regards
    Durai

  • The datediff function resulted in an overflow. The number of dateparts separating two date/time instances is too large. Try to use datediff with a less precise datepart.

    The below function is giving me the hours difference what I wanted, but today it is giving us the below error: 
    Msg 535, Level 16, State 0, Line 1
    The datediff function resulted in an overflow. The number of dateparts separating two date/time instances is too large. Try to use datediff with a less precise datepart.
    Please Help..
    ALTER FUNCTION [dbo].[GetHoursExcludingWeekdays](@StartDate datetime2,@EndDate datetime2)
    returns decimal(12,3)
    as
    begin
        if datepart(weekday,@StartDate) = 1
            set @StartDate = dateadd(day,datediff(day,0,@StartDate),1)
        if datepart(weekday,@StartDate) = 7
            set @StartDate = dateadd(day,datediff(day,0,@StartDate),2)
        -- if @EndDate happens on the weekend, set to previous Saturday 12AM
        -- to count all of Friday's hours
        if datepart(weekday,@EndDate) = 1
            set @EndDate = dateadd(day,datediff(day,0,@EndDate),-2)
        if datepart(weekday,@EndDate) = 7
            set @EndDate = dateadd(day,datediff(day,0,@EndDate),-1)
        declare @return decimal(12,3)
        set @return = ((datediff(second,@StartDate,@EndDate)/60.0/60.0) - (datediff(week,@StartDate,@EndDate)*48))
        return @return
    end
    ReportingServices

    You'll get this error if the difference between the start and end date is greater that about 68 years due to the "second" DATEDIFF specification.  Perhaps the dates are greater than the expected range due to a data quality issue. 
    Taking the advice from the error message, you could use minutes instead of seconds like the example below the version below.  This could still result in the error of the difference is greater than a couple of hundred years, though.  You might consider
    validating the dates and returning NULL if outside expected limits.
    ALTER FUNCTION [dbo].[GetHoursExcludingWeekdays](@StartDate datetime2,@EndDate datetime2)
    returns decimal(12,3)
    as
    begin
    if datepart(weekday,@StartDate) = 1
    set @StartDate = dateadd(day,datediff(day,0,@StartDate),1)
    if datepart(weekday,@StartDate) = 7
    set @StartDate = dateadd(day,datediff(day,0,@StartDate),2)
    -- if @EndDate happens on the weekend, set to previous Saturday 12AM
    -- to count all of Friday's hours
    if datepart(weekday,@EndDate) = 1
    set @EndDate = dateadd(day,datediff(day,0,@EndDate),-2)
    if datepart(weekday,@EndDate) = 7
    set @EndDate = dateadd(day,datediff(day,0,@EndDate),-1)
    declare @return decimal(12,3)
    set @return = ((datediff(minute,@StartDate,@EndDate)/60.0) - (datediff(week,@StartDate,@EndDate)*48))
    return @return
    end
    GO
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • Combine two date field into one timestamp field

    Hello all,
    I need help combining two date fields into one timestamp field.
    I have separate Date and Milliseconds fields and want to
    combine to one Timestamp field can some suggest sql???

    This is my data
    01 JAN 1989 12:01:00.001 AM
    this is my insert drag_time is a timestamp field in another schema
    INSERT
    INTO DRAG (drag_time)
    SELECT to_char(drag_time, 'DD MON YYYY HH12:MI:SS')||(drag_second)||to_char(drag_time, ' AM')
    FROM sa.drag;
    This is the error
    ERROR at line 3:
    ORA-01855: AM/A.M. or PM/P.M. required

  • Data Load into two data targest from one DataSource

    Hi,
    I want to load data into two data targest from one DataSource. I did full load, then Initialization & delta settings for that DataSource. But I want to load data into one data target using delta InfoPackage & into 2nd data target using Full Load InfoPackage. Can I schedule execution of these 2 infopackges one delta & 2nd Full load InfoPackage for the same DataSource simaltaneously?
    Regards,
    Pradip

    Hi,
    In BI, You can achieve this. As thorugh info package, you laod data till PSA only. Then it is being loaded to other data targets.
    Create two DTPs, one with FULL load and another one with Detla Load. It will work.
    In R/3 Side, As sandeep has mentioned , there might be possibility that if you run full load after delta , your delta may get corrupt. i am not sure about that , but there is a possibility.
    - Jaimin

  • Two response objects within one servlet...

    Heya guys, quite new to java and got stuck for the whole day on this.
    I need to combine two responses inside one servlet. One response retrieves picture from the database and it works fine. Another one retrieves text from database also works fine on its own. Second i try to use both end up with hundreds of exceptions.
    Any idea what to do, not how...but what???
    Thanks

    Compiling 1 source file to F:\gopal\weba\WebApplication6\build\web\WEB-INF\classes
    F:\gopal\weba\WebApplication6\src\java\NewServlet.java:48:
    processRequest(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,javax.servlet.http.HttpServletResponse) in NewServlet cannot be applied to (javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
    processRequest(request, response);
    F:\gopal\weba\WebApplication6\src\java\NewServlet.java:57: processRequest(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,javax.servlet.http.HttpServletResponse) in NewServlet cannot be applied to (javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
    processRequest(request, response);
    2 errors
    F:\gopal\weba\WebApplication6\nbproject\build-impl.xml:295: The following error occurred while executing this line:
    F:\gopal\weba\WebApplication6\nbproject\build-impl.xml:149: Compile failed; see the compiler error output for details.
    BUILD FAILED (total time: 2 seconds)
    You cannot use two response object.

  • Uix two view-objects on one entity-object synchronize

    Hi All
    I want to add some uix pages to an old project using ADF UIX and Business Components.
    I have an entity object to a table witch about 50 fields.
    Now I create two view objects due to a better performance. One witch seven attributes for the overwiew and one with all attributes for the detail page.
    They are related via a view link.
    I create the overview as a read-only-table and the detail-page as an input-form.
    The proplem is that the synchronization don't work. The detail page shows the first dataset ever.
    Has anyone a solution or a tip where I can found that?
    Is where a performance problem if I use one view-object for both pages?
    Thanks in advance
    Roger

    Use custom DataAction for the first page:
    package controller;
    import oracle.adf.controller.struts.actions.DataAction;
    import oracle.adf.controller.struts.actions.DataActionContext;
    public class Class1 extends DataAction
      protected void validateModelUpdates(DataActionContext actionContext)
         //super.validateModelUpdates(actionContext);
          // put you custom validation here
    }http://www.oracle.com/technology/products/jdev/collateral/papers/10g/ADFBindingPrimer/index.html#usingdataaction
    Message was edited by:
    Sasha
    Message was edited by:
    Sasha

  • ABAP routine to join two ODS objects into one

    Hi there,
    i have two ODS objects related to each other. and i want to load them into another ODS object and join them so to say.
    as far as i got now, it seems that the only way to do this is an ABAP routine in the update rules. ca nanyone give me a hint on how to do this? no clue how ABAP works yet.
    i suppose there must be some template or something because i think others must have had the same issue before. anyone who already solved this?
    i'd appreciate your help,
    regards,
    stefan

    HI Stefan,
    First add VTS_KUN (customer code)
    VTS_BEDA (order date)
    in ODS2 VTSNWBP2 and don't map to any field intransfer rule.
    write this code in start routine of udpate rule between VTSNWBP2 and VTSNWBDN.
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    <u>TABLES: /BIC/AVTS_NWBE00.</u>
    DATA:   ...
    $$ end of global - insert your declaration only before this line   -
    The follow definition is new in the BW3.x
    TYPES:
      BEGIN OF DATA_PACKAGE_STRUCTURE.
         INCLUDE STRUCTURE <i>/BIC/CS8ZODS2</i>.
    TYPES:
         RECNO   LIKE sy-tabix,
      END OF DATA_PACKAGE_STRUCTURE.
    DATA:
      DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
           WITH HEADER LINE
           WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
    FORM startup
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
               MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n
               DATA_PACKAGE STRUCTURE DATA_PACKAGE
      USING    RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
    fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
    to make monitor entries
    <b>DATA:  S_DATA TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
           WITH HEADER LINE
           WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
    DATA:  ITEM_TABLE TYPE STANDARD TABLE OF /BIC/AVTS_NWBE00
           WITH HEADER LINE
           WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
    *start of modification
    *Populating the order number data from ODS1 table
    SELECT * FROM  /BIC/AVTS_NWBE00 INTO TABLE ITEM_TABLE.
    SORT DATA_PACKAGE BY VTS_BES  ASCENDING.
    SORT <u><i>ITEM_TABLE</i></u> BY VTS_BES  ASCENDING.
    LOOP AT DATA_PACKAGE INTO S_DATA.
       LOOP AT ITEM_TABLE WHERE VTS_BES = S_DATA-VTS_BES.
         MOVE-CORRESPONDING item_table to s_data.
         APPEND S_DATA.
       ENDLOOP.
    ENDLOOP.
    DATA_PACKAGE[] = S_DATA[].</b>
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    ENDFORM.
    *TABLES: /BIC/AVTS_NWBE00.--ODS1 table
    Lemme know this is working.
    Regards,
    San!
    Message was edited by: San!

  • Azure Data Sync Log Take Too Much Time to Load

    Hi,
    I've found that the Azure Sync Log inside the Portal take too much time to load if my sync group was created long time ago. i.e. for those new sync group with only a few logs, it will take around 5 seconds for loading. However, I've many sync group created
    more than 1 year, and it will take me up to 10 minutes for viewing the first page of the logs.
    It seems the Portal will download ALL the logs to my browser even I just want to view the most recent logs (maybe I just want to view the last 10 records, but it will download the whole 5000 pages?)
    It will be great if the Portal only fetch the data of the page I am currently viewing, instead of fetching all the logs.
    Is there any ways to speed up the log loading time?
    Michael Yung

    Hello,
    I suggest you post a feedback on
    Azure SQL Data Sync feedback forum.
    All of the feedback you share in the forum will be monitored and reviewed by the Microsoft engineering teams responsible for building Azure.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Two data Models in one report

    Hi There,
    I have created two data model for my report. The queries have no relation to each other. Is that possible to put both these in one report with same user parameters. or do u have any better suggestion to do this.
    For Example:
    select count(*) from (select name "Worker" from person
    where start_date between (:P_1) and (:P_2)
    select count(*) from (select name "ADMIN PERSON" from admin
    where start_date between (:P_1) and (:P_2)
    Thanks

    Hi Jagjit,
    I created one report with 2 SQL queries:
    select count(*) from employees where department_id < :P_1
    and
    select count(*) from departments where department_id < :P_1
    And it worked fine. So your report should be OK. By the way, a report has just one "Data Model". It is possible to have 2 or more "Queries" in the data model.
    Navneet.

  • Syncronise two data sets were one set is not constantly logging

    Hello,
    I’m trying to collect data from two counters
    and three analogue signals. The problems I have are that the shaft encoders connected
    to the counters sometimes do not rotate. So no signal is sent and subsequently
    stops the analogue data from being collected until the counters get a signal
    again. I was told to use two independent while loops one or the counters and
    the second one for the analogue signals. To further improve the system and make
    use of the dual core technology I separated the loops completely this means I
    save the data into to files also. But when I want to synchronise the data I
    have no synchronising point in the two sets to align the data to.
    I attached the vi file that might make it easier.
    Thanks for your help in advance.
    Regards,
    Fred
    Attachments:
    parallel_task_11.vi ‏393 KB

    If what you want is synchronize analog input and counter measurement, I suggest you go for buffered AI and buffered count edge measurement. For synchronization, use the AI sample clock as the clock for counter edge measurement. Configure all the tasks (two counter and one AI) and start the counter tasks first and then the AI task. In this way measurement will be synchronized with respect to a common clock.
    Configure counter 1 (CI. Cnt Edges)--> Cnfigure Counter 2 (CI. Cnt Edges)---> Configure AI (continuous)---> Set counter 1's clock as AI Sample clock ---> Set counter 2's clock as AI Sample clock --->Start Counter 1task --->Start counter 2 task --->Start AI task----> read counter 1, counter 2 and AI in parallel loops...
    Have a nice day!!!
    LabVIEW | LabWindows/CVI | TestStand
    Certified LabVIEW Architect

Maybe you are looking for

  • Uploads pictures not music

    I used to be able to upload music and photos, but all of the sudden I can no longer get the music to upload, only the picutres will upload. I have tried the 5r, and nothing. I get a message when i try to sync my music the error message states "The ip

  • Simple line chart formatting problems

    I am using the Visual Studio 2008 version of Crystal reports. I am trying to chart the maximum, minimum, and today's prices for natural gas. I have a sql view to that returns 48 rows of data. I want the legend to be MIN. MAX, NOW and the colors to be

  • Passing Script variable to Package variable, ultimately used as fileName

    Following an excellent post by Geplaatst door Joost, I put together a script which SHOULD populate a package variable, then use that variable as a file name. The Script code is as follows: public class ScriptMain : UserComponent string iScriptVar; pu

  • Default language in iTunes

    Hi, I live in the French speaking part of Switzerland but recently the iTunes store has become German (it used to be exclusively English). I'm assuming that Apple intends to use all of the main languages (German, French and Italian) and possibly also

  • Error while publish application

    Hi, I have problems with the translation of an application. I've exported the file and translated. After import I applied the file to the application and then tried to publish. But I get this message: ORA-20001: Sync error: WWV_FLOW_PAGE_PLUGS.PLUG_N