ibatis

is this possible to do with iBatis + spring

usual idiom of using ibatis with spring support is following. Or this is how I'm doing it. please let me know if it can be done a better way? beans xml: <bean id="DataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="jdbc/some/som1/my/mydb"/> </bean> <bean id="SqlMapClient" class="org...

how to set SqlMapClient outside of spring xmls

I have the following in my xml configurations. I would like to convert these to my code because I am doing some unit/integration testing outside of the container. xmls: <bean id="MyMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <property name="configLocation" value="classpath:sql-map-config-oracle.xml"/> ...

how to check the path in web service

I m using cxf webservices.I have a service path @Path'/summary/abc/{xyz}/name/{login}'. I want to generate some custom error message when someone give wrong url like '/summary/ab/{xyz}/na/{login}/' ...

instantiating spring bean outside the container (for testing)

I have following in my applicaionContext.xml <bean id="IbatisDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="oracle.jdbc.OracleDriver"/> <property name="url" value="jdbc:oracle:thin:@123.210.85.56:1522:ORCL"/> <property name="username" value="mydb"/> ...

com iplanet ias JAR

I've been struggling with this for past couple of days. I am trying to test a DAO outside the container but while running the test case I am getting the error: Error creating bean with name 'SqlMapClient' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.l...

Ibatis2 and test context

Hi everyone, I'm having a stupid configuration issue with Ibatis in my Spring project. Please don't jump on me about how all this was setup, I'm just following the "in house project structure policy". So here is the structure, we have the "src/main/resources/META-INF/" folder that contains all of our config files used by the applicati...

Supporting both Oracle and MySQL: how similar is their SQL syntax?

We use Oracle on a project and would like to also support MySQL. How close are their SQL dialects? Is it perhaps even possible to use the same SQL source for both without too many gymnastics? Details: We're using iBatis, a persistence manager that cleanly segregates the SQL statements into resource files. But we work at the SQL le...

Hibernate vs Ibatis caching

Hi, We can speed up a hibernate app easyly with 2nd level cache using infinispan or ehcache/terracotta,... but ibatis only have a simple interface to implement for caching. And hibernate knows more information about the data, so it helps for better caching, too. In the other side, the simplicity of ibatis is also the power of it and it'...

Hibernate or iBatis or something else?

In my project i need to switch between databases during runtime. I tried to use Hibernate, but stuck in a place, where i need to map object with table in database. The problem is, that i have several tables with prefix: documents2001, documents2002 ... As i understood, i can't map class with table during runtime. I tried using iBatis, bu...

asp.net mvc + library + Ibatis

Hi! Sorry my poor english ... I have 2 projects: mvc application and another with the persistence database (library). I need to have the ibatis configuration files (sqlmap, providers, xmls) also in the application to MVC all work? Because I can run locally ibatis when put into this project mvc, but not when put in the library. ...

Concurrency issues when retriveing Ids of newly inserted rows with ibatis

I'm using iBatis/Java and Postgres 8.3. When I do an insert in ibatis i need the id returned. I use the following table for describing my question: CREATE TABLE sometable ( id serial NOT NULL, somefield VARCHAR(10) ); The Sequence sometable_id_seq gets autogenerated by running the create statement. At the moment i use the following sq...

Howto return ids on Inserts with Ibatis ( with RETURNING keyword )

I'm using iBatis/Java and Postgres 8.3. When I do an insert in ibatis i need the id returned. I use the following table for describing my question: CREATE TABLE sometable ( id serial NOT NULL, somefield VARCHAR(10) ); The Sequence sometable_id_seq gets autogenerated by running the create statement. At the moment i use the following sq...

Maintaining / Auto-generating IBatis SQL Maps?

Hello, I just started a new job and inherited the project from hell. Hell = {2 years over schedule, overly complex, uses both oracle and sql server} There are 100+ stored procedures in the Oracle server and each one has a IBatis SQL Map. Some share the same result map. The DBA likes to change stores procs on a daily basis and not tell m...

How to map a stored package function in iBatis?

I am presently using <parameterMap class="map" id="param1"> <parameter property="result" jdbcType="BOOLEAN" javaType="boolean" mode="OUT"/> <parameter property="arg1" jdbcType="VARCHAR" mode="IN"/> <parameter property="resultCode" jdbcType="INTEGER" javaType="int" mode="OUT"/> </parameterMap> <procedure id="contAvail" para...

Ibatis : Is there a way of adding a rowhandler in an Ibatis resultmap subselect within the sqlmap xml?

I have a two ibatis sql maps that are linked together via a sub select like the simplified example below: <resultMap id="order" class="Order"> <collection property="orderLines" ofType="OrderLine" resultMap=”orderLine”/> </resultMap> I have an order object that contains a collection of line objects that are returned by a join and an ...

MySQL like query runs extremly slow for 5000 records table.

I have this issue on our production server. The application stack is, Java Web App on Tomcat 6.0.18 iBatis data access layer MySQL 5.0 database CentOS The system is deployed on virtual server having around 256 MB memory. Real problem: The query like, select * from customer executes in around 10 seconds however if the following q...

ibatis java.util.Map parameters with dot(.) character

I have a parameters Map with property name "xx.xx", but Ibatis cannot know property named "xx.xx" ("xxxx" is ok). how can I use Map property with name contains dot(.) character? or I have to remove the dot(.). Thanks very much Thang Hoang ...

Unsupported SQL Type 1111 when passing String to a VARCHAR field

I have been smashing my head against this for a while now. I am using iBatis with my JAVA code to run Stored Proc residing in Sybase DB. Stored procedure is expecting some parameters. few of them are declared as VARCHAR (6) So in my iBatis mapping i did the following for those parameters. <parameter property="searchUserId" jdbcTyp...

Hibernate Vs iBATIS

For our new product re-engineering, we are in the process of selecting the best framework from Java. As the consideration is to go for database agnostic approach for model, we are working on options between Struts + Spring with iBATIS or Hibernate. Please advice which is best as both offer persistence. ...

How to implement the greater than or equal SQL statement in iBatis?

Let's say in my sql statement I want to do: WHERE numberOfCookies >= 10 How do I do this in iBatis? ...