- 浏览: 666377 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (608)
- Java (125)
- Struts (16)
- Spring (19)
- iBatis (11)
- Hibernate (14)
- Oracle (33)
- Mysql (22)
- JBoss (4)
- JavaScript (46)
- Ajax (9)
- jQuery (5)
- web (25)
- Html (14)
- Exception (26)
- Linux (106)
- Vim (11)
- Python (12)
- ComputerTech (25)
- 文章 (50)
- Maven (20)
- FreeMarker (5)
- Json (0)
- Tomcat (6)
- ActiveMQ (2)
- Test (1)
- Git (5)
- Shell (1)
- 《Java并发编程实践》 (2)
- 产品设计 (1)
- xxx (0)
- diamond (1)
- dubbo (1)
- Raspbian (1)
- IDE (3)
- 并发编程 (1)
最新评论
-
mikzhang:
抱歉,写这篇文章时,博主开发的程序只面对IE浏览器,故没考虑其 ...
JS 中改变confirm默认按钮提示“确定""取消" -
poterliu:
测试过了,发现execScript方法只支持IE浏览器。目前已 ...
JS 中改变confirm默认按钮提示“确定""取消"
Exception in thread "main" java.lang.IllegalArgumentException: No SqlMapClient specified at org.springframework.util.Assert.notNull(Assert.java:112) at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:163) at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:219) at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:266) at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:260) at com.suntendy.framework.sjjh.dao.impl.BsjdcbyltjjuDaoImpl.getBsjdcbyltjjuByVo(BsjdcbyltjjuDaoImpl.java:22) at com.suntendy.framework.sjjh.test.DbTest.main(DbTest.java:15)
public static void main(String[] args) { BsjdcbyltjjuDao dao = new BsjdcbyltjjuDaoImpl(); List l = dao.getBsjdcbyltjjuByVo(); System.out.println(l.size()); }...
解决:ibatis的dao层一定要用spring加载。userdao直接在main中new了,应该要从context.getbean就可以了
发表评论
-
Oracle_ojdbc6 使用 报错
2015-06-10 14:29 1031via: http://sd8089730.iteye.c ... -
It is indirectly referenced from required .class file
2014-08-19 15:30 434via: http://www.blogjava.net/z ... -
Hibernate_a different object with the same identifier value was already associat
2014-07-05 17:03 516via: http://www.blogjava.net/h ... -
Connection reset by peer: socket write error
2013-03-14 10:24 853Connection reset by peer: soc ... -
java.sql.SQLException: 索引中丢失 IN 或 OUT 参数
2012-05-07 17:00 2570java.sql.SQLException: 索引中丢失 ... -
org.apache.coyote.tomcat5.CoyoteResponseFacade.sendRedirec
2012-03-19 15:25 1616【from http://www.cxy.me/bbs/vie ... -
request.getHeader("referer") is null
2012-03-19 15:23 952referer 用来判断上一页是不是自己的网站 如果我 ... -
ORA-14551: cannot perform a DML operation inside a query
2012-04-26 14:49 1098ORA-14551: cannot perform a ... -
Struts FileUpload - Processing of multipart/form-data request failed
2011-09-16 15:52 7307Struts FileUpload 异常处 ... -
HTTP Status 500 - No action instance for path could be created
2011-09-16 15:03 1710HTTP Status 500 - No action ... -
java.sql.SQLException: ORA-01830: date format picture ends before converting ent
2011-08-17 17:48 3407java.sql.SQLException: ORA-0 ... -
Bean property 'xxDao' is not writable or has an invalid setter method
2011-08-08 16:25 8744Bean property 'xxDao' is not ... -
SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null];
2011-08-04 15:38 2241网上解决方案 1.起初没有创建序列s_log,因此需要在Or ... -
org.xml.sax.SAXParseException: Document root element "struts-config", must match
2011-08-01 22:19 1677org.xml.sax.SAXParseException: ... -
Error creating form bean of class...
2011-08-01 10:44 1026Error creating form bean of cla ... -
java.text.ParseException: Unparseable date: "11/10/10" at java.text.DateFormat.
2011-08-01 10:39 5613使用DateFormat的使用,然后自己试了下,结果出来个错误 ... -
[interceptor.FileUploadInterceptor:intercept] [Removing file filesXXX .tmp]
2011-07-25 11:18 4504上传完文件时控制台显示[interceptor.FileUpl ... -
The Network Adapter could not establish the connection
2011-07-15 17:05 12561、oracle配置 oracle9i2中把C:\ora ... -
java.sql.SQLException: ORA-00933: SQL 命令未正确结束
2011-06-30 12:16 2112java.sql.SQLException: ORA-0093 ... -
ORA-00942 Table or View Does Not Exist Oracle Error
2011-06-22 23:55 4457Cause: java.sql.SQLException: ...
相关推荐
通过调用`SqlMapClient.startTransaction()`开启事务,`SqlMapClient.commitTransaction()`提交事务,或者`SqlMapClient.rollbackTransaction()`回滚事务。 6. **异常处理**: 在初始化SqlMapClient或执行数据库...
`SqlMapClient`对象是iBatis的核心接口,它提供了对数据库进行CRUD(Create、Read、Update、Delete)操作的能力,并且支持事务管理。由于`SqlMapClient`是线程安全的,因此在实际应用中,通常会将其作为单例模式来...
SqlMapClient sqlMapClient = sqlMapClientTemplate.getSqlMapClient(); try { // 开始事务 sqlMapClient.startTransaction(); // 开始批处理 sqlMapClient.startBatch(); for (Reply reply : replyList) {...
private static SqlMapClient sqlMapClient = null; static { try { Reader reader = com.ibatis.common.resources.Resources.getResourceAsReader("com/itcast/SqlMapConfig.xml"); sqlMapClient = ...
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <value>classpath:SqlMapConfig.xml <property name="dataSource" ref="dataSource"></property> ...
SqlMapClient可以通过SqlMapClientBuilder类来构建,这个类提供了加载XML配置文件并初始化SqlMapClient的方法。 Ibatis的配置文件中,你可以定义SQL语句的映射,这些映射位于独立的XML文件中,通常命名为xxxSqlMap....
SqlMapClient sqlMapClient = (SqlMapClient) applicationContext.getBean("sqlMapClient"); ``` 2. **开启事务**:使用SqlMapClient提供的方法开启一个新的事务。 ```java Transaction tx = new Transaction...
- SqlMapClient是iBATIS的核心接口,提供执行SQL语句的方法,如`queryForObject()`, `queryForList()`, `insert()`, `update()` 和 `delete()`。 - 示例代码展示了如何使用SqlMapClient进行CRUD操作。 7. **OR...
下面是创建`SqlMapClient`实例的一个示例类`SqlMapUtil`,该类通过静态方法`getSqlMapClient()`返回`SqlMapClient`实例。 ```java import java.io.IOException; import com.ibatis.common.resources.Resources...
- **SqlMapClient 实例化**:通过 `SqlMapClientBuilder` 创建 `SqlMapClient` 实例,这是Ibatis的核心组件之一。 - **QueryForList 方法**:用于查询所有记录,其中 `"queryAll"` 是映射文件中 `<select>` 元素的 `...
public StudentDAO(SqlMapClient sqlMapClient) { this.sqlMapClient = sqlMapClient; } public List<Student> getStudentsByTeacherId(String teacherId) { return sqlMapClient.queryForList(...
SqlMapClient sqlMapClient = new SqlMapClientBuilder().buildWithoutXMLReader(new FileInputStream("SqlMapConfig.xml")); // 执行查询 List<YourEntity> list = sqlMapClient.queryForList("selectYourEntity")...
3.3 SQLMAPCLIENT基本操作示例 6 3.3.1 数据写入操作(insert, update, delete) 6 3.3.2 数据查询 (select) 7 3.3.3 在指定对象中存放查询结果(select) 7 3.3.4 执行批量查询 (select) 7 3.3.5 关于AutoCommit 7 ...
在批处理操作中,需要使用SqlMapClient的startTransaction()方法来启动事务,startBatch()方法来启动批处理,然后执行批处理操作,最后使用executeBatch()方法来执行批处理,commitTransaction()方法来提交事务。...
部分配置代码,所有代码都有,很全 class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <value>classpath:jdbc... <property name="sqlMapClient" ref="sqlMapClient"> </bean>
例如,使用 `sqlMapClient.queryForObject(id, parameter)` 执行查询,`sqlMapClient.insert(id, parameter)` 插入数据等。 **Ibatis API** Ibatis 提供了一些基本的API,如查询、添加、删除和修改方法。通常,会...
SqlMapClient sqlMapClient = SqlMapClientBuilder.buildSqlMapClient(Resources.getResourceAsStream("SqlMapConfig.xml")); // 执行查询 List<Account> accounts = (List) sqlMapClient.queryForList("getAccount...