Spring ibatis example

Spring ibatis example

Here I am describing a spring ibatis example. It is a very simple Spring project with iBatis and Display tag. let me describe the working environment. my another post shows how to set up your environment.

note – this project is available at google code.
project name – springibatis
# Non-members may check out a read-only working copy anonymously over HTTP.

url(springibatis-read-only): svn checkout http://springibatis.googlecode.com/svn/trunk/

Eclipse 3.4: Ganymede;

Plugs in: svn, Maven, spring-ide, tomcat lunher, ant.

Tomcat: 5.5

FireFox: 3

Create a new project in Eclipse;

spring ibatis example - Eclipse create new project

Eclipse create new project

spring ibatis example - newproject1

create one package name:  click the right button on the src folder and select new -> Package and put  com.rajib.spring.ibatis value.

create a class Person under the ibatis folder. similar way create some other files – Person.xml, PersonDao.java, PersonDaoImpl.java

create applicationContext-ibatis.xml under src folder. we will describe at web.xml that where the applicationContext file is located. it looks

——————  applicationContext-ibatis.xm

 

here we create one bean ‘dataSource’ that store database connnection. we create another bean sqlMapClient that will be use all ibatis query. we push datasource bean to sqlMapClient bean. these 2 bean will use personDao later.

I used a new display tag that does column display, sorting, paging, cropping, grouping, exporting, smart linking and decoration of a table.

In index.jsp,

this is used to collecting data from database. the persons list is put into request so that the display tag can used it easily.

the output looks-

Spring ibatis example - output1

2 thoughts on “Spring ibatis example

  1. Just dropping by.Btw, you website have great content!

    ______________________________
    Why this one-minute therapy is being suppressed in the U.S. while more than 15,000 European doctors have been using it to heal millions of patients

  2. Pingback: Complete example/error-solution of jdbc connection wOracle,MSSql,MySql

Leave a Reply

Your email address will not be published. Required fields are marked *