ibatis

Accessing Datasource from Outside A Web Container (through JNDI)

Hi everyone, I'm trying to access a data source that is defined within a web container (JBoss) from a fat client outside the container. I've decided to look up the data source through JNDI. Actually, my persistence framework (Ibatis) does this. When performing queries I always end up getting this error: java.lang.IllegalAccessExcepti...

iBATIS for Python?

At my current gig, we use iBATIS through Java to CRUD our databases. I like the abstract qualities of the tool, especially when working with legacy databases, as it doesn't impose its own syntax on you. I'm looking for a Python analogue to this library, since the website only has Java/.NET/Ruby versions available. I don't want to have...

How to unit test a DAO that is extending SqlMapClientDaoSupport

Spring DA helps in writing DAOs. When using iBATIS as the persistence framework, and extending SqlMapClientDaoSupport, a SqlMapClient mock should be set for the DAO, but I can't do it. SqlMapClientTemplate is not an interface and EasyMock cannot creates a mock for it. ...

Mapping to Dictionary with iBATIS

Given a simple statement, such as: <statement id="SelectProducts" resultMap="???"> SELECT * FROM Products </statement> Is it possible to get a list of dictionary objects where the keys are the column names? ie. var list = Mapper.QueryForList<IDictionary<string,string>>("SelectProducts", null); IDictionary<string, string> dict = li...

Pass and return custom array object in ibatis and oracle in java

I've looked around for a good example of this, but I haven't run into one yet. I want to pass a custom string array from java to oracle and back, using the IBATIS framework. Does anyone have a good link to an example? I'm calling stored procs from IBATIS. Thanks ...

JAVA Swing client, Data Access to Remote Database; Ibatis

I've got a Java client that needs to access a remote database. It is the goal to hide database credentials from the user and not hardcode any credentials within the code. Therefore, the database access will probably have to be on the server side. I'm restricted to use Ibatis as a data abstraction framework. Apart from that I have JBoss ...

Reusing a resultMap for different column names

Is there a way of reusing the same resultMap multiple times in a single query. For example, suppose I have a "foo" resultMap: <resultMap id="foo" class="Foo"> <result property="Bar" column="bar" /> </resultMap> Is there a way to define another resultMap that reuses the above for different columns? Something like... <resultMap id="...

How to map multiple records using SqlMap in Ibatis

I am just getting into ibatis with SqlMap for the first time and I have run into a problem. I have figured out how to insert, delete, update, and select single records. Now however I am trying to write a select statement that will bring back more than a single record and I am getting mapping errors. How do I specify that the result sh...

Fastest way for doing INSERTS using IBATIS

I need to insert 20,000 rows in a single table (SQL Server 2005) using iBatis. What's the fastest way to do it ? I'm already using batch mode, but it didn't help much: try { sqlMap.startTransaction(); sqlMap.startBatch(); // ... execute statements in between sqlMap.commitTransaction(); } finally { sqlMap.endTransaction(); } ...

Oracle SQL DATE conversion problem using iBATIS via Java JDBC

I'm currently wrestling with an Oracle sql DATE conversion problem using iBATIS from Java. Am using the Oracle JDBC thin driver ojdbc14 version 10.2.0.4.0. iBATIS version 2.3.2. Java 1.6.0_10-rc2-b32. The problem revolves around a column of DATE type that is being returned by this snippet of SQL: SELECT * FROM TABLE(pk_invoice_qry...

Would you use NHibernate for a project with a legacy database, which is partly out of your control?

For me the answer is currently: No, I would use iBatis, because NHibernate is a pain, when the database model and the object model are not in synch. If I don't have full control over the database I end up with a lot of work. Why do I ask? Well, first of all: I never used NHibernate. I just know it from the surface. I have read about th...

Java - Ibatis - mySQL with Dynamic Query based on Role

I'm using Java - Ibatis and mySQL with Flex/Flash on the front-end. I have one requirement that is to be able to dynamically add creterias and table to a query depending on the user role. here is an example Same object calling same SQL but different result based on role Role 1 : Fully Access to employees SELECT * FROM Employee A ...

java CLASS/JSP file on-the-run deployment

Oracle 10g Application Server, Java 1.5 + JSF (presentation layer) + iBatis (database communication layer) In the place where I work at the moment, there sometimes rises the necessity to do small tweaks to the deployment directory. I don't deny that it's not the best practice (if I stay long enough on this site maybe I'll end up the exa...

How perform Junit tests with Struts - Ibatis

Hello everyone, im using Struts 1.2.x and Ibatis 2.x version for development, so i finish yesterday and now i want to perform test this is my first time trying to work with JUnit, I already make test but in JavaApp not running on server, so how can I simulate or generate mocks with server behavior, and wich mocks are recommended for Stru...

How to implement one-to-many relationships in Ibatis?

Let's say I have this Class: Class A { int id; int[] b; // Other properties } Class B { int id; // Other properties } The Class A has one-to-many relation with class B. I already have a service which caches B objects and return them on id. Table schema looks something like thi...

SmartGWT Live Grid (with iBATIS)

I didn't find any docs about how to convert a SmartGWT ListGrid in a Live Grid. How can I do it? Is the ListGrid a Live Grid by default? If so, how can I disable this feature? Finally: I have to provide a DataSource for the Grid. My app uses iBATIS in the server-side, using GWT-RPC. How can I provide the data to the Live Grid and let it...

iBATIS cache does not get flushed on given statements.

Hi, I am using iBatis for my database interaction. Lately I am trying to improve performance of some static data fetches by configuring caching. The chache got configured and worked properly however the problem is in flushing of cache data whenever any insert/update/delete happens to that data. I did following configuration for category...

ibatis return values

I'm currently using ibatis to returns some pojos and everything works great. My question is: I have to return 1 row from a table, just like 3 fields, and I don't want to create a pojo for it. I just want to run the query and get the 3 values. Is there any easy way to do this without create a special java object just for this? ...

How do I implement inheritance using iBatis for Java?

Please point me to an example! iBatis documentation doesn't cover this. I have been struggling all morning getting my discriminator and subMap to work! ...

Hibernate, iBatis, JEE or other Java ORM tool

We're in the process of planning a large, enterprise application. We're focusing our efforts on evaluating hibernate after experiencing the pains of J2EE. It looks like the new JEE API is simpler. I've also read some good things about Hibernate and iBatis. Our team has little experience with any of the frameworks. There are 5 main co...