Spring-iBatis-Oracle data access

Hi all,
I've just spent hours on a problem which appears unsolvable. Hope someone can clarify. I have constructed a view in my oracle database which uses data from other oracle databases.
In SQLDeveloper the queries work fine. Now, I programmed my app with all the maps, implementations, interfaces, beans and everthing else that's required and all apears fine until I
do a simple query to select all of the rows from the view. I always receive the same error despite many different attempts at defining all these components. Here´s the exact error:
--- The error occurred in xx/xxxx/xxx/xxxxxx/sqlmaps/GaeVwcmDeri.xml. 
--- The error occurred while applying a parameter map. 
--- Check the GaeVwcmDeri.selectDeriDivsList-InlineParameterMap. 
--- Check the statement (query failed). 
--- Cause: java.sql.SQLDataException: ORA-01861: el literal no coincide con la cadena de formatoNow remember, I'm using Spring and iBatis for db access to oracle so I'll start with the view definition's underlying data types:
COLUMN-NAME     DATA-TYPE     NULLABLE
DERI_CODADIFD     NUMBER          No
DERI_FECHAINI     DATE          No
DERI_FECHAFIN     DATE          Yes
DERI_PCT     NUMBER          No
DERI_CODADIFP     NUMBER          Yes
DERI_DESIG     VARCHAR2(40)     No
DERI_CODCP     VARCHAR2(5)     Yes
CCON_DESIG     CHAR(40)     Yes
DIV_CODIGO     CHAR(4)          Yes
DIV_DESIG     CHAR(30)     Yes
EMP_CODIGO     NUMBER(10,0)     No
EMP_DESIG     VARCHAR2(63)     NoSo here´s the sql-map definition (which i've tried with an explicit resultMap which you see here and I've also tried with with the implicit mapping to the bean and I´ve also tried
selecting only 1 column or 2 and just about every permutation possible as well as usuing column names instead of columnIndexes, etc.. ad infititum):
<sqlMap namespace="GaeVwcmDeri">
     <resultMap id="selectDeriDivsListResult" class="es.adif.gae.common.sql.beans.GaeVwcmDeri">
          <result property="deriCodadifd" columnIndex="1"/>
          <result property="deriFechaini" columnIndex="2" javaType="java.sql.Date" jdbcType="DATE" nullValue="0"/>
          <result property="deriFechafin" columnIndex="3" javaType="java.sql.Date" jdbcType="DATE" nullValue="0"/>
          <result property="deriPct" columnIndex="4"/>
          <result property="deriCodadifp" columnIndex="5"/>
          <result property="deriDesig" columnIndex="6" javaType="java.lang.String" jdbcType="VARCHAR" nullValue="NULL"/>
          <result property="deriCodcp" columnIndex="7" javaType="java.lang.String" jdbcType="VARCHAR" nullValue="NULL"/>
          <result property="cconDesig" columnIndex="8" javaType="java.lang.String" jdbcType="CHAR" nullValue="NULL"/>
          <result property="divCodigo" columnIndex="9" javaType="java.lang.String" jdbcType="CHAR" nullValue="NULL"/>
          <result property="divDesig" columnIndex="10" javaType="java.lang.String" jdbcType="CHAR" nullValue="NULL"/>
          <result property="empCodigo" columnIndex="11"/>
          <result property="empDesig" columnIndex="12" javaType="java.lang.String" jdbcType="VARCHAR" nullValue="NULL"/>
     </resultMap>
     <select id="selectDeriDivsList" resultMap="selectDeriDivsListResult">
          SELECT
               DERI_CODADIFD,
               DERI_FECHAINI,
               DERI_FECHAFIN,
               DERI_PCT,
               DERI_CODADIFP,
               DERI_DESIG,
               DERI_CODCP,
               CCON_DESIG,
               DIV_CODIGO,
               DIV_DESIG,
               EMP_CODIGO,
               EMP_DESIG
          FROM GAE_VWCM_DERI
     </select>
</sqlMap>So here´s the bean variable definitions (with all the setters and getters left out for brevity):
     private long deriCodadifd;
     private Date deriFechaini;
     private Date deriFechafin;
     private float deriPct;
     private long deriCodadifp;
     private String deriDesig;
     private String deriCodcp;
     private String cconDesig;
     private String divCodigo;
     private String divDesig;
     private long empCodigo;
     private String empDesig;So where is the problem? I just don't see it and I think I've tried every possible way to get the data I want. The problem has nothing to do with, GRANTs, SYNONYMs or anything else
strictly oracle related; as I've said, the query works fine in SQLDeveloper (I'll probably try it also in straight JDBC ANd ODBC to see if I can get anymore info). I think it's
clear that the problem is somewhere in the iBatis interface to oracle but I'll be damned if I can find where but I have a feeling that it may have something to do with the NULLABLE
columns which I abhor but can´t do anything about in this case as the underlying data comes from an external DB. Maybe I'll also try a stored procedure but I can't see how the
results would be any different.
If anyone could provide a reasonable suggestion, I'll be the happiest man on earth.
HELP! I'm desperate.
Thanks in advance for any reply,
Bill

Hi Bill,
My guess is that your problem is in the view. Probably because of some unintended implicit data type conversion.
Let's say you use TO_DATE on something already a DATE:
SQL> select to_date(sysdate, 'FXYYYY/MM/DD') from dual;
select to_date(sysdate, 'FXYYYY/MM/DD') from dual
Error at line 1
ORA-01861: literal does not match format stringProblem is impicit conversion of sysdate into varchar2, before applying to_date on the resulting string.
This impplicit conversion is according to your nls settings (Which are session specific, hence the difference between SQL*Plus and iBatis)
SQL> select * from nls_session_parameters
where parameter = 'NLS_DATE_FORMAT'
PARAMETER                      VALUE                                  
NLS_DATE_FORMAT                YYYYMMDD                               
1 row selected.Does this make sense?
Regards
Peter

Similar Messages

  • How to Install Oracle Data Access Components (ODAC) on Windows Server 2003?

    I recently installed "32-bit Oracle Data Access Components (ODAC) with Oracle Developer Tools for Visual Studio" on my computer (Windows 7, 64bit). Everything seems fine and I can develop and run my application in Visual Studio 2010 and IIS 7.
    Now, when I deploy my application to the Server, it raises error:
    Exception: System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleCommand' threw an exception. ---> Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client
    Obviously I need to install ODAC on the server, too. My server is:
    - Windows 2003 32 bit R2 (I know, I know!)
    - IIS 6
    So. I downloaded the same installation from Oracle website (ODAC 11.2 Release 5 and Oracle Developer Tools for Visual Studio [11.2.0.3.20]) and installed it on the server. But still getting the same error.
    PS: When I was installing, I chose Oracle Data Access Component for Oracle Client 11.2.0.3.20 in Oracle Universal Installer. hmmmm. Should I choose "Oracle Server" instead? Screenshot
    Edited by: 1000434 on Apr 17, 2013 6:35 AM
    Edited by: 1000434 on Apr 17, 2013 6:36 AM

    ODP.NET, Unmanaged Driver uses unmanaged dependencies in the Oracle Client. The error you see means you have another Oracle Client installed on the Win2003 machine and ODP.NET is attempting to load the incorrect Oracle Client version, rather than the version you installed ODP.NET with.
    What you need to do is direct ODP.NET where to find the correct version of its unamanaged Oracle Client dependencies. This will be generally the bin directory of your Oracle Client home that was installed with ODP.NET.
    You can learn more about DllPath here:
    http://docs.oracle.com/cd/E20434_01/doc/win.112/e23174/InstallODP.htm#sthref94
    If you're not familiar with how to set ODP.NET settings in the Registry or .NET config files, you can read how to do that here:
    http://docs.oracle.com/cd/E20434_01/doc/win.112/e23174/featConfig.htm#sthref106

  • How to check if Oracle Data Access Components  is installed?

    How to check if  Oracle Data Access Components is installed and version on my computer?
    Also How to check if Oracle Data Provider is installed and version?
    TIA
    Steve42

    Regedit HKLM->Software->Oracle.  See what's there...
    At the very least, that can give you paths and can check file versions from there.

  • Issue while Installing Oracle Data Access Software for Windows

    All,
    Iam getting the following error while installing Oracle Data Access Software for windows. Iam installing in WindowsXP, with Oracle 9i release 9.2.0.7.0 DB and client in the same Box.
    It shows
    The Specified Key key was not found while trying to GetValue
    * Stop installation of all Products
    * Stop installtion of this componenent only.
    Kindly let me know why this error is showing up.
    Regards
    Ramesh

    Most probably you have hit this issue:
    "If you have more than one Oracle Home installed on the same machine (e.g. Oracle8i client and Oracle9i Release 2 client), use the Oracle Home Selector to run your applications with Oracle9i Release 2 client. "
    As documented on the Oracle Data Access Software for Windows. Release 9.2.0.4.0
    ~ Madrid.

  • No Setup.exe in 64-bit Oracle Data Access Components (ODAC) Dowload

    Why is there no Setup.exe in the 64-bit Oracle Data Access Components (ODAC) Download? Are the only instructions for installing in the dowloaded readme file?

    You're probably looking at an XCOPY bundle.
    If you're looking for an x64 11.2 bundle installed via the Oracle Installer, you'd need to get either the 11201 full client on OTN, or the 11202 full client on My Oracle Support. The 11202 full client includes support for .NET 4 if you need that.
    Hope it helps,
    Greg

  • Oracle Data Access Layer - w/Enterprise Services

    I'm looking for an example Oracle Data Access layer incorporating Enterprise Services with at least a simple window form inserting and updating data tables.
    Can somepoint point me in the right direction?
    Thanks,
    Tony

    Hi Tony,
    I would recommed you hit some of the popular .Net Development sites on the Internet. For example, just googling on .Net Enterprise Services provides links where simple samples can be reviewed. These generic code samples can then be tweaked to include ODP code for data access. If your components or code will be enlisting in transactions with MTS, hence your class or aspx page is transactional, you will need to install the Oracle Services for MTS in addtion to the ODP driver.
    HTH
    Jenny

  • Issue trying to install Oracle Data Access Software for Windows

    I am trying to install the Data Access software on one of my many workstations and am having an issue with one of them. When the installer comes up it gives me an error:
    Invalid Inventory List and it exits.
    What do I have to do to get it to recognize my oracle home?

    Most probably you have hit this issue:
    "If you have more than one Oracle Home installed on the same machine (e.g. Oracle8i client and Oracle9i Release 2 client), use the Oracle Home Selector to run your applications with Oracle9i Release 2 client. "
    As documented on the Oracle Data Access Software for Windows. Release 9.2.0.4.0
    ~ Madrid.

  • Oracle Data Access with Delphi - Please help

    Hello: We would like to access Oracle Applications data using a third party tool. I understand we can use Delphi development environment to access Oracle data. Can somebody help, how do we do this? Any online tutorial or White paper. Basically we want some simple UI screens to fetch Oracle Applications data. Thanks for your help, in advance.

    Google: "Delphi" and "Oracle" and "connection"

  • Cannot connect to database using Oracle Data Access

    I have been able to connect to my database through SqlPlus, but I cannot make the connection to the database through my ASP.Net program.
    I set up my connection string following the following format:
    *"Data Source=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = X.X.X.X)(PORT = X)))(CONNECT_DATA =(SERVICE_NAME = SID)(INSTANCE_NAME = SID))(HS = OK)); User Id=Blah; Password=Blah";*
    When the program tries to open the connetion, it through
    OracleException was caught
    Oracle.DataAccess.Client.OracleException was caught
    Message=""
    StackTrace:
    at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx pOpoSqlValCtx, Object src, String procedure)*
    at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src)
    at Oracle.DataAccess.Client.OracleConnection.Open()
    at GlobalIQ.Services.DatabaseLayer.SetUpConnection() in C:\GlobalIQ\GlobalIQ\Services\DatabaseLayer.cs:line 30
    InnerException:
    I do not know if this is because I didn't set something up correctly or that I am missing something. Thanks in advance

    user13488403 wrote:
    I have been able to connect to my database through SqlPlus, but I cannot make the connection to the database through my ASP.Net program. ODP, ASP-NET providers etc. forums are here
    http://forums.oracle.com/forums/category.jspa?categoryID=44
    >
    I set up my connection string following the following format:
    *"Data Source= ... (HS = OK)) ...Is the HS part really needed?

  • Oracle Data Access Components and Windows XP Professional x64

    To start I'm running Windows XP Professional x64, using IIS 6, and Visual Studio 2005. I have a web service project that uses ODAC 11g, which runs just fine when I run it in debugging mode. However when I publish the project and try to access it through IE, I get an application error saying that Oracle.Web or one of its dependencies could not be loaded. Now I suspect that this might be happening becuase I'm running on a 64-bit machine, but I'm not convinced. The web service worked just fine on a 32 bit windows running IIS 5. If anyone could shed some light on this that would be awesome. Thanks!

    hi ,
    i have more than one question indeed.
    1.i installed personal oracle v 8.1.7 for windows nt/2000 on
    windows xp profissional platform and it works great.When i
    tryed to install developer 2000 6i a microsoft runtime error
    is produced. is thier any solutions for such problem?
    2.when i tryed to install personal oracle on another machine with the following specs:
    -p4 1.4 ghz intell proccessor
    -gigabyte motherboard built-in sound
    -128 mb ram
    -S3 savage4 32mb vga card
    the oracle universal installer never runs.

  • Issue with Oracle Data Access between Oracle 11gr2 db 64 bit and 11gr2 32 b

    Hi all,
    I have 2 machines (A,B). I have installed 11r2 64 bit on windows server 2008(64) in machine A and In B 11gr2 32 bit client on win server 2008.
    While accessing .net application i have getting following error. where I have to change Oracle.DataAccess.dll.
    The .net applicatoin has been devoloped with 10g now we are using 11gr2
    Could not load file or assembly 'Oracle.DataAccess, Version=10.2.0.100, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)thanks,
    nag

    Hi;
    Please see:
    Error: "Could not load file or assembly 'Oracle.DataAccess, Version=%s, Culture=neutral, PublicKeyToken=%s' or one of its dependencies. An attempt was made to load a program with an incorrect format" [ID 1367695.1]
    Regard
    Helios

  • Problem with Oracle.Data.Access

    Hi everybody,
    this is my problem, I've developed a web application witch .net 2005 (c#) and oracle client 10.
    Now I need to compile all my application with oracle client 9, then I have removed client 10 and installed client 9.
    But this is the problem, in References of my project I can't find Oracle.DataAccess.dll ! then I can't compile my project!
    In previous installation (with client 10) the dll was located here
    C:\oracle\product\10.2.0\client_1\bin\
    the direcotry installation of client 9 is the same but I can't find it on my pc...
    How can I switch to client 9 from client 10 without rewrite all code??
    thank so much!!!!
    Sergio

    Ok now I have the following situation...
    I've downloaded and installed this version ODAC92070.exe and I can find the file
    C:\oracle\ora92\bin\Oracle.DataAccess.dll ...
    In my reverence in visual studio2005 I delete the old file and I load the new, but qhen I try to compile this error appears
    'Oracle.DataAccess.Client.OracleDataReader' does not contain a definition for 'HasRows'
    why??
    this method is not supported in oracle client 9?

  • Microsoft OLE DB Provider for Oracle: Data type is not supported.

    I got the error:
    Microsoft OLE DB Provider for Oracle: Data type is not supported.
    Shortly after upgrading from Oracle 8 to Oracle 9. I was advised to download more up to date oracle drivers, but I was wondering if there was a way to tell what version of the 'OLE DB Provider for Oracle' is already at. Is there a command I can use via SQL Plus or something?

    I have found Microsoft ODBC for Oracle to be more stable than the Microsoft OLEDB for Oracle driver. I have also found both Microsoft ODBC and OLEDB drivers to be more stable than the drivers from Oracle.
    You could always get the latest MDAC (Microsoft Data Access Components) from Microsoft's MSDN Download site and then get the ODAC (Oracle Data Access Components) from Oracle's OTN Download site. ODAC requires MDAC. And ODAC has the latest drivers.
    I suppose it would help to have the latest patches for your Oracle client software too. Maybe Oracle MetaLink would have these?
    It may even help to have the latest service pack for Visual Studio 6 (Visual C++ 6 and Visual Basic 6) too.

  • Visual Web Developer 2010 Express and Oracle ODAC - Oracle data provider

    system - xp pro
    Microsoft Visual Web Developer 2010 Express and Oracle ODAC112021.
    I can't seem to get the ODAC to work correctly with the Web Developer Express. When putting in a gridview I only see the standard adapters. The one from Oracle does not appear. I have spent days trying to figure out why but no luck. No one else seems to have this problem. I do not see any errors when I installed the ODAC. I've followed a few tutorials.
    http://weblogs.asp.net/nannettethacker/archive/2010/09/17/installing-oracle-data-access-components-odac.aspx
    and
    http://www.smart-soft-nz.com/oracle-and-asp-dot-net.html
    I tried using the Windows adapters but they just don't seem to work. I can get results in the query builder but when I go to the next step in the wizard I get the constraints error. I've done all the research on that with no luck so I wanted to use the ODAC. This killing me! This really shouldn't be that hard. I've added the dll to the references but again it's just not an option. If anyone could give me a little direction that would be great!!!!!!!!!!!!!!!!!!!!!!
    Thank you
    John

    Dear Friends,
    Installing SP1 and updates to it solved the first issue. So the database now seems to be of type 2008 R2.
    Deleting some files solved the second issue.
    However, another issue remains.
    My most important projects were created with a version of VWDX 2010 that was downloaded from Microsoft and installed on July 3, 2012. This version of VWDX has now been lost, because my hard drive recently ceased to function and had to be replaced.
    On the new hard drive I have a version of VWDX 2010 that was downloaded yesterday (May 28, 2014). As indicated above, I also installed SP1 and related updates.
    When I load a project that was created in the version of VWDX 2010 that was installed almost two years ago and try to open the database connection, I get, in essence, the following error message:
    "The database C:\Users\...\Database.mdf cannot be opened, because it is version 661. This server supports version 655 and earlier. A downgrade path is not supported."
    So it seems that the original database version was 661, whereas the version downloaded yesterday is 655. It seems very strange that a version downloaded now should be earlier than a version downloaded two years ago. Does anyone have an explanation or a solution?
    Thank you all for your trouble, and best regards.
    Eric (orexin)
    P.S. The site from which I obtained VWDX yesterday was:
    www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-web-developer-express and the executive was called VWD2010SP1AzurePack.exe.

  • Accessing oracle data types of a different schema

    I am having trouble accessing the Oracle data types in a stored procedure. The owner of the stored procedures and the oracle data types is "ODSCUST". I am trying to access this using "CUSTOM" ID from my java program. Recently our DBAs have made a change in schema owners so the ID loging into the Oracle instance is not the owner of the data types or the stored procedures. The "CUSTOM" user has the grants to access all the types and stored procedures. There are also public synonymns created for the oracle data types and stored procedure.
    Here is a snipit of the code:
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    String user="custom";
    String password="test";
    String database="sbpair11";
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:oci:@" + database, user, password);
    OracleCallableStatement stmt = (OracleCallableStatement)conn.prepareCall( "begin ods_cust.retrieveCustPrflData(?, ?, ?, ?, ?, ?, ?); end;" );
    stmt.setString( 1, "5592556485");
    stmt.registerOutParameter( 2, OracleTypes.STRUCT, "KSCOPEACCOUNT" );
    stmt.registerOutParameter( 3, OracleTypes.ARRAY, "KSCOPERSUUSOCARRAY" );
    stmt.registerOutParameter( 4, OracleTypes.ARRAY, "KSCOPECUTADDRARRAY" );
    stmt.registerOutParameter( 5, OracleTypes.STRUCT, "KSCOPECONTACT" );
    stmt.registerOutParameter( 6, OracleTypes.STRUCT, "KSCOPEPROFILE" );
    stmt.registerOutParameter( 7, OracleTypes.ARRAY, "KSCOPEEMAILARRAY" );
    stmt.executeUpdate();
    Here is the response I get back when I run the program:
    Exception in thread "main" java.sql.SQLException: ORA-04043: object "CUSTOM"."KSCOPEACCOUNT" does not exist
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:2321)
    at oracle.jdbc.oci8.OCIDBAccess.getOracleTypeADT(OCIDBAccess.java:2516)
    at oracle.jdbc.oracore.OracleTypeADT.initMetadata(OracleTypeADT.java:460)
    at oracle.jdbc.oracore.OracleTypeADT.init(OracleTypeADT.java:407)
    at oracle.sql.StructDescriptor.initPickler(StructDescriptor.java:249)
    at oracle.sql.StructDescriptor.<init>(StructDescriptor.java:204)
    at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:138)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:164)
    at Array5.main(Array5.java:40)
    Note:
    When I do a "desc KSCOPEACCOUNT" or "desc CUSTOM.KSCOPEACCOUNT" in sqlplus as the "CUSTOM" id it works but not from Java. Initially I was using the JDBC thin driver but was recomended to switch to OCI which still didn't resolve this issue.

    Way too little info here for a definite conclusion.
    Some thoughts:
    1.) Did you take down the database when you were moving the datafiles? If so, is this the first time the batch job is running since the move? If so, perhaps the cache is cold?
    2.) How much physical I/O is the batch job doing? Has the volume of physical I/O changed significantly after the move? What are the characteristics of the lun on which the newly mounted filesystem is built? Is it a smaller number of spindles than before?
    Ultimately, you need to profile the batch process, and determine where the most time is being consumed.
    -Mark

Maybe you are looking for