Topic: A Tutorial on Spring & iBATIS

  Print this page

1.A Tutorial on Spring & iBATIS Copy to clipboard
Posted by: floater
Posted on: 2004-11-18 06:21

Here is a tutorial on iBATIS and Spring. I can't believe it took me so long until now, too many things got into the way.

There are still things left, as mentioned in the doc, such as JTA testing(span across 2 different types of databases).

This is pretty much I do for Spring in this year. Hopefully, next year we could come up something for Spring core and remoting.

Spring and iBATIS notes 0.3.pdf (178.93k)

2.Re:Spring and iBATIS doc [Re: floater] Copy to clipboard
Posted by: sanshaoye
Posted on: 2004-11-18 15:37

A very useful document, thank you!

I don't like inner class, iBatis is good. Simple and clearly code.......

But I think the example is too simple, I often have a query at least join 3 table, what's the best approach?

3.Re:Spring and iBATIS doc [Re: floater] Copy to clipboard
Posted by: sanshaoye
Posted on: 2004-11-18 19:13

The chapter 6 ,Database Testing is wonderful!!! I like that! Smile

4.Re:Spring and iBATIS doc [Re: floater] Copy to clipboard
Posted by: floater
Posted on: 2004-11-18 23:14

I did on purpose to break large pieces of code into simple ones, shoot one target at a time.

I don't like inner classes and callbacks either, that's why I highly recommend iBATIS, but I've been cornered to use jdbc(Spring version) recently, thanks to IBM idiots(IBM copyrighted the word e-business, among other words, e-commerce, etc. I kindly sent them a similar word, e-diots, Tounge)

It is the general rule to map one table to one DAO, the reason behind this is to isolate dependencies. But if you have to have some dependencies, well, you might just put it in any place meaningful from the business side, e.g., one of the DAOs, or a new DAO.

Remember DAO doesn't care how many tables you have to use.

5.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: jigsaw
Posted on: 2004-11-22 12:32

thx floater

btw, do u know if iBATIS's sqlmap 2.0.7 support FUNCTION?

6.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: jigsaw
Posted on: 2004-11-22 12:43

just tested it...it does support function as well as sp

7.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: floater
Posted on: 2004-11-22 13:06

I tried with hsqldb, seems working. which db did you test against?

8.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: jigsaw
Posted on: 2004-11-22 18:07

oracle9i. it works. =)

9.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: asksun
Posted on: 2004-11-28 09:39

I hava a question. where are you all physically located? eastern or western coast?
maybe we can meet out for a lunch someday.

10.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: jigsaw
Posted on: 2004-11-28 16:49

偶在东海岸。。。欧亚板块的东海岸。。。

11.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: floater
Posted on: 2004-11-29 10:18

I am near the east coast, ny/nj. Yeas, there are a few of us in this area, ftang and I went out for lunch several times.

12.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: why
Posted on: 2005-04-19 03:54

I didn't notice this good tutorial until today... yuck...

One very minor non-technical comment: please use a lighter color for shading the code section -- this will consume considerably more amount of printer toner.
You know, this is a nice handy doc to be printed. Smile

13.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: floater
Posted on: 2005-04-19 09:29

yes, now I am using a 5% grey, but still no good, too dark for printers, too light for screens.

I am writing another doc for beans only. But this time it's in simplied chinese, not sure you can read it, Smile. I can read traditional chinese, in fact, I love it since I practiced calligraphy for a long time.

14.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: why
Posted on: 2005-04-19 20:00

floater wrote:
I am writing another doc for beans only. But this time it's in simplied chinese, not sure you can read it, Smile. I can read traditional chinese, in fact, I love it since I practiced calligraphy for a long time.

敝人自少繁簡兩用,看寫皆無問題
唯對個別簡化漢字,心有戚戚焉

習書法好
敬候大作

15.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: skyin
Posted on: 2005-05-04 20:03

Thank you for the tutorial, floater.

I've tested the code within and found some twol bugs.
1. All of "CertUser" should be "User"
2. In TestUser class,
user.setage("21");
should be
user.setage(21);

16.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: floater
Posted on: 2005-05-04 21:53

Thanks, I fixed the java code, but still keep the xml references for "CertUser"(They can be anything anyway, I am afraid of breaking them. But the java code has to be fixed.)

17.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: wood
Posted on: 2005-05-09 16:06

spring live中的例子,移植到oracle9i,点击UserList.html时,出现exception,有大家没有介绍ibatis用在oracle9i的资源,谢谢!
.................
--- Check the getUsers-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: java.sql.SQLException: ORA-00911: 无效字符

com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in org/appfuse/dao/ibatis/UserSQL.xml.
--- The error occurred while applying a parameter map.
--- Check the getUsers-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: java.sql.SQLException: ORA-00911: 无效字符

Caused by: java.sql.SQLException: ORA-00911: 无效字符
.....................................

18.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: floater
Posted on: 2005-05-09 21:56

You need to hunt down this line:

Caused by: java.sql.SQLException: ORA-00911: 无效字符

19.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: felexs
Posted on: 2005-05-10 08:39

你是用iBatis吧,去掉xml配置文件中SQL语句最后的分号“;”

20.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: wood
Posted on: 2005-05-10 10:38

非常感谢,就是分号的问题,哈哈哈

有没有什么办法在日志文件里把iBatis拼的sql语句记录下来,否则调这种sql错,简直就是在撞大运。

21.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: felexs
Posted on: 2005-05-10 11:30

也没找到相关配置,看来要分析源码(或要改源码)

22.Re:A Tutorial on Spring & iBATIS [Re: floater] Copy to clipboard
Posted by: realpal
Posted on: 2005-05-30 13:11

配置log啊,把针对ibatis包的log配到debug级,那么所有的sql语句你都能看到。


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923