Groups
Groups
Sign in
Groups
Groups
myj2eebook
Conversations
About
Send feedback
Help
数据存储框架第二遍
3 views
Skip to first unread message
spring
unread,
Sep 23, 2008, 9:53:16 AM
9/23/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to myj2eebook
数据存储框架看了一遍觉得没嚼细,遂又浏览了一遍
有个问题问一下作者
为什么每次数据库操作,都要调用setDataSourceName方法设置数据源?在做过的几个项目中,每个项目的的数据源都只有一个,比如用
hibernate是写在hibernate.cfg.xml里的,用jdbc是写在BaseDAO的static{}里的,在使用中不用再关心数据源
的问题。先看起来如果用QueryOperator类的access方法的话必须先调用setDataSourceName方法,这样每次数据库操作都
要设置数据源
Henry Yu
unread,
Sep 24, 2008, 11:51:36 AM
9/24/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to myj2e...@googlegroups.com
你说的有道理,对于只有一个数据源的系统,老是set是显得很啰嗦。
其实,在现在框架中,如果你不设置数据源,会自动找默认数据源的。
另外,在一个项目里面,多个数据源也很常见的。
2008/9/23 spring
<
liuspr...@gmail.com
>
Reply all
Reply to author
Forward
0 new messages