- 浏览: 418639 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (244)
- struts2 (15)
- ognl (1)
- hibernate (17)
- gwt (17)
- GROOVY (2)
- GRAILS学习 (7)
- SPRING (4)
- AJAX (2)
- JQUERY (6)
- XML (1)
- DWR (3)
- 线程 (0)
- SVN (0)
- json (1)
- anotation (0)
- 反射 (2)
- rapidframework (0)
- OA工作流 (2)
- 事务 (0)
- mysql (0)
- oracle (26)
- EXTJ (0)
- 求职 (2)
- 随笔 (22)
- 注释 (1)
- java综合 (30)
- 设计模式 (1)
- JSP SERVLET (2)
- 插件 (7)
- 应用 (3)
- HTML (5)
- flex (13)
- android (8)
- javascript (14)
- Exception (0)
- Linux (2)
- 计算机常识 (3)
- EXCEL (2)
- 正则表达式 (1)
- 开源工具 (2)
- 测试 (1)
- 生活 (7)
- 房子 (0)
- 购房大学 (4)
- UML (1)
- 服务器 (1)
- 发展 (1)
- 英语 (1)
- 项目管理 (1)
- 摘 (1)
- 网站 (1)
最新评论
-
a347911:
架构师教程:https://note.youdao.com/s ...
架构师之路--- 一个四年 JAVA 程序员的工作经历 转 -
hzxlb910:
对我帮助很大。
架构师之路--- 一个四年 JAVA 程序员的工作经历 转 -
xly_971223:
引用因此,while (!isInterrupted())也可 ...
Java 终止线程方法 -
zdglt88:
其实这个datagrid挺简单的,没有难度
Jquery easy ui 之datagrid简介 -
完善自我:
抓住重点,支持一下!
Jquery easy ui 之datagrid简介
Spring中关于SqlRowSet的Invalid scale size. Cannot be less than zero异常处理
在使用Spring中使用JdbcTemplate.queryForRowSet()方法时,抛出了SQLException:Invalid scale size. Cannot be less than zero 异常。报这个异常情况如下:
2数据库环境为oracle而且使用了RowSet时。具体原因是由于“oracle驱动面对一个数值型的返回字段时,在得到指定的字段小数点右边的数值数量时(Gets the designated column's number of digits to right of the decimal point.这个是原文),居然会返回-127,而oracle本身的cacheRowSet实现不允许这种情况出现,于是就会报标题所说的异常。
oracle9i和oracle10之间会存在这种差别。具体的解决办法如下:
①编写一个类实现org.springframework.jdbc.core.ResultSetExtractor接口
package com.*.base.dao;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.sql.rowset.CachedRowSet;
import oracle.jdbc.rowset.OracleCachedRowSet;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet;
import org.springframework.jdbc.support.rowset.SqlRowSet;
public class SqlRowSetOracleResultSetExtractor implements ResultSetExtractor {
public Object extractData(ResultSet rs) throws SQLException,DataAccessException {
// TODO Auto-generated method stub
return createSqlRowSet(rs);
}
protected SqlRowSet createSqlRowSet(ResultSet rs) throws SQLException {
CachedRowSet rowSet = newCachedRowSet();
rowSet.populate(rs);
return new ResultSetWrappingSqlRowSet(rowSet);
}
/**
* Create a new CachedRowSet instance, to be populated by
* the createSqlRowSet implementation.
* This implementation creates a new instance of
* Oracle's oracle.jdbc.rowset.OracleCachedRowSet class,
* which is their implementation of the Java 1.5 CachedRowSet interface.
* @return a new CachedRowSet instance
* @throws SQLException if thrown by JDBC methods
* @see #createSqlRowSet
* @see oracle.jdbc.rowset.OracleCachedRowSet
*/
protected CachedRowSet newCachedRowSet() throws SQLException {
return new OracleCachedRowSet();
}
}
②使用这个类代替JdbcTemplate.queryForRowSet():
rs = (SqlRowSet) jdbcTemplate.query(sql, new SqlRowSetOracleResultSetExtractor());
SqlRowSet rs = (SqlRowSet)jdbcTemplate.query(sql,params,new SqlRowSetResultSetExtractor() {
protected CachedRowSet newCachedRowSet() throws SQLException {
return new OracleWebRowSet();
}
});
这个异常源自于oracle驱动面对一个数值型的返回字段时,在得到指定的字段小数点右边的数值数量时(Gets the designated column's number of digits to right of the decimal point.这个是原文),居然会返回-127,而oracle本身的cacheRowSet实现不允许这种情况出现,于是就会报标题所说的异常。
对于一般的做法,需要修改很多地方,包括ResultSet的decorate类,还有Spring的SqlRowSetResultSetExtractor
所谓头痛医头,脚痛医脚,这里提供一种方法直接从oracle jdbc驱动入手,彻底从源头上修改掉该问题:
反编译ojdbc14.jar(Oracle 9i驱动为例)
package oracle.jdbc.driver;
public class OracleResultSetMetaData
目标方法:
public int getScale(int paramInt)
throws SQLException
{
int i = getValidColumnIndex(paramInt);
return this.statement.getDBDescription()[i].scale;
}
使用javassist编写一段代码:
public void crackOracleDriver() {
ClassPool pool = ClassPool.getDefault();
try {
pool.insertClassPath("E:\\allproject\\bpmtrans\\lib\\ojdbc14.jar");
CtClass cc = pool.get("oracle.jdbc.driver.OracleResultSetMetaData");
System.out.println(cc);
CtClass[] param = new CtClass[1] ;
param[0]=pool.get("int");
CtMethod a = cc.getDeclaredMethod("getScale",param);
System.out.println(a);
a.setBody("{int i = getValidColumnIndex($1);\n" +
" int res=statement.getDBDescription()[i].scale;\n" +
"return res<0?0:res; }");
cc.writeFile("c:\\");
} catch (Exception e) {
e.printStackTrace();
}
}
将生成的class置换原来的class,大功告成!
这个所谓的精度,一般来说,修改了应该没有多大问题的
I have been dealing with the same problem (SQLException - "Invalid scale size. Cannot be less than zero") and believe I have arrived at a better solution for those who wish to use the Spring API as much as possible.
The basic problem, as I understand it, is that there is an incompatibility between Oracle and the standard CachedRowSet implementation (CachedRowSetImpl) of Java 1.5. Spring uses this implementation by default when you call queryForRowSet(...). However, this does not mean that you cannot use SqlRowSet. The SqlRowSet class doesn't know anything about the implementation of the CachedRowSet interface that you're using. The class that is actually utilizing the CachedRowSetImpl class is the ResultSetExtractor... more specifically, the SqlRowSetResultSetExtractor (this is used by Spring when you call queryForRowSet).
In order to achieve the same result (returning a Spring SqlRowSet), you can pass in your own ResultSetExtractor to the query(...) methods (*not* queryForRowSet) that take a ResultSetExtractor as a parameter. What I did was just clone the SqlRowSetResultSetExtractor and instead of using the standard CachedRowSetImpl class, I replaced it with Oracle's CachedRowSet implementation. This way, when the ResultSet is mapped to a CachedRowSet, it uses Oracle's implementation to do so and thus the incompatibility is eliminated. Here is my ResultSetExtractor class that does just that...
-------------------------
Java代码
package com.xunjienet.cms.logic;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.sql.rowset.CachedRowSet;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet;
import org.springframework.jdbc.support.rowset.SqlRowSet;
import oracle.jdbc.rowset.OracleCachedRowSet;
public class SqlRowSetOracleResultSetExtractor implements ResultSetExtractor {
public Object extractData(ResultSet rs) throws SQLException {
return createSqlRowSet(rs);
}
/**
* Create a SqlRowSet that wraps the given ResultSet,
* representing its data in a disconnected fashion.
* <p>This implementation creates a Spring ResultSetWrappingSqlRowSet
* instance that wraps a standard JDBC CachedRowSet instance.
* Can be overridden to use a different implementation.
* @param rs the original ResultSet (connected)
* @return the disconnected SqlRowSet
* @throws SQLException if thrown by JDBC methods
* @see #newCachedRowSet
* @see org.springframework.jdbc.support.rowset.ResultSetW rappingSqlRowSet
*/
protected SqlRowSet createSqlRowSet(ResultSet rs) throws SQLException {
CachedRowSet rowSet = newCachedRowSet();
rowSet.populate(rs);
return new ResultSetWrappingSqlRowSet(rowSet);
}
/**
* Create a new CachedRowSet instance, to be populated by
* the <code>createSqlRowSet</code> implementation.
* <p>This implementation creates a new instance of
* Oracle's <code>oracle.jdbc.rowset.OracleCachedRowSet</code> class,
* which is their implementation of the Java 1.5 CachedRowSet interface.
* @return a new CachedRowSet instance
* @throws SQLException if thrown by JDBC methods
* @see #createSqlRowSet
* @see oracle.jdbc.rowset.OracleCachedRowSet
*/
protected CachedRowSet newCachedRowSet() throws SQLException {
return new OracleCachedRowSet();
}
}
-------------------------
You can pass this to the various query methods like so:
Java代码 SqlRowSet sqlRowSet = (SqlRowSet)jdbcTemplate.query(sql, new SqlRowSetOracleResultSetExtractor()); >>>>>>>>>>>>>>从9i到10g就出现了这个问题
查阅相关资料:数据库中有number型字段没有指定精度我也出了这个问题.我用NVL把空数字转为了0就解决了. http://forum.springsource.org/showthread.php?t=19848 java.sql.SQLException: Invalid scale size. Cannot be less than zero
数据库Oracle 10203
package com;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.sql.rowset.*;
import com.sun.rowset.CachedRowSetImpl;;
public class Test {
public static void main(String arg[]) {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
String url="jdbc:oracle:thin:@***.***.***.***:1521:billdb2";
Connection c = DriverManager.getConnection(url,"test","test");
Statement s = c.createStatement();
ResultSet r = s.executeQuery("select * from b");
CachedRowSet crs = new CachedRowSetImpl();
crs.populate(r);
while(crs.next()){
System.out.println(crs.getInt(1));
System.out.println(crs.getFloat(2));
}
}catch(Exception e) {
System.out.println(e.toString());
}
}
}
SQL> desc a
Name Type Nullable Default Comments
---- ------ -------- ------- --------
ID NUMBER Y
ID2 NUMBER Y
SQL> desc b
Name Type Nullable Default Comments
---- ----------- -------- ------- --------
ID NUMBER(1) Y
ID2 NUMBER(5,2) Y
使用CachedRowSetImpl 接口,如果数据库表字段为number且未指定精度(如a表),就会出现该错误。
如果指定精度程序运行正常(如b表)
使用CachedRowSetImpl 接口,如果数据库表字段为number且未指定精度,就会出现该错误。
也可以看参见 aggie2000 http://forum.springsource.org/showthread.php?t=19848
如果本机没有问题,则看看服务上tomcat本身有没有问题!
2数据库环境为oracle而且使用了RowSet时。具体原因是由于“oracle驱动面对一个数值型的返回字段时,在得到指定的字段小数点右边的数值数量时(Gets the designated column's number of digits to right of the decimal point.这个是原文),居然会返回-127,而oracle本身的cacheRowSet实现不允许这种情况出现,于是就会报标题所说的异常。
oracle9i和oracle10之间会存在这种差别。具体的解决办法如下:
①编写一个类实现org.springframework.jdbc.core.ResultSetExtractor接口
package com.*.base.dao;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.sql.rowset.CachedRowSet;
import oracle.jdbc.rowset.OracleCachedRowSet;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet;
import org.springframework.jdbc.support.rowset.SqlRowSet;
public class SqlRowSetOracleResultSetExtractor implements ResultSetExtractor {
public Object extractData(ResultSet rs) throws SQLException,DataAccessException {
// TODO Auto-generated method stub
return createSqlRowSet(rs);
}
protected SqlRowSet createSqlRowSet(ResultSet rs) throws SQLException {
CachedRowSet rowSet = newCachedRowSet();
rowSet.populate(rs);
return new ResultSetWrappingSqlRowSet(rowSet);
}
/**
* Create a new CachedRowSet instance, to be populated by
* the createSqlRowSet implementation.
* This implementation creates a new instance of
* Oracle's oracle.jdbc.rowset.OracleCachedRowSet class,
* which is their implementation of the Java 1.5 CachedRowSet interface.
* @return a new CachedRowSet instance
* @throws SQLException if thrown by JDBC methods
* @see #createSqlRowSet
* @see oracle.jdbc.rowset.OracleCachedRowSet
*/
protected CachedRowSet newCachedRowSet() throws SQLException {
return new OracleCachedRowSet();
}
}
②使用这个类代替JdbcTemplate.queryForRowSet():
rs = (SqlRowSet) jdbcTemplate.query(sql, new SqlRowSetOracleResultSetExtractor());
SqlRowSet rs = (SqlRowSet)jdbcTemplate.query(sql,params,new SqlRowSetResultSetExtractor() {
protected CachedRowSet newCachedRowSet() throws SQLException {
return new OracleWebRowSet();
}
});
这个异常源自于oracle驱动面对一个数值型的返回字段时,在得到指定的字段小数点右边的数值数量时(Gets the designated column's number of digits to right of the decimal point.这个是原文),居然会返回-127,而oracle本身的cacheRowSet实现不允许这种情况出现,于是就会报标题所说的异常。
对于一般的做法,需要修改很多地方,包括ResultSet的decorate类,还有Spring的SqlRowSetResultSetExtractor
所谓头痛医头,脚痛医脚,这里提供一种方法直接从oracle jdbc驱动入手,彻底从源头上修改掉该问题:
反编译ojdbc14.jar(Oracle 9i驱动为例)
package oracle.jdbc.driver;
public class OracleResultSetMetaData
目标方法:
public int getScale(int paramInt)
throws SQLException
{
int i = getValidColumnIndex(paramInt);
return this.statement.getDBDescription()[i].scale;
}
使用javassist编写一段代码:
public void crackOracleDriver() {
ClassPool pool = ClassPool.getDefault();
try {
pool.insertClassPath("E:\\allproject\\bpmtrans\\lib\\ojdbc14.jar");
CtClass cc = pool.get("oracle.jdbc.driver.OracleResultSetMetaData");
System.out.println(cc);
CtClass[] param = new CtClass[1] ;
param[0]=pool.get("int");
CtMethod a = cc.getDeclaredMethod("getScale",param);
System.out.println(a);
a.setBody("{int i = getValidColumnIndex($1);\n" +
" int res=statement.getDBDescription()[i].scale;\n" +
"return res<0?0:res; }");
cc.writeFile("c:\\");
} catch (Exception e) {
e.printStackTrace();
}
}
将生成的class置换原来的class,大功告成!
这个所谓的精度,一般来说,修改了应该没有多大问题的
I have been dealing with the same problem (SQLException - "Invalid scale size. Cannot be less than zero") and believe I have arrived at a better solution for those who wish to use the Spring API as much as possible.
The basic problem, as I understand it, is that there is an incompatibility between Oracle and the standard CachedRowSet implementation (CachedRowSetImpl) of Java 1.5. Spring uses this implementation by default when you call queryForRowSet(...). However, this does not mean that you cannot use SqlRowSet. The SqlRowSet class doesn't know anything about the implementation of the CachedRowSet interface that you're using. The class that is actually utilizing the CachedRowSetImpl class is the ResultSetExtractor... more specifically, the SqlRowSetResultSetExtractor (this is used by Spring when you call queryForRowSet).
In order to achieve the same result (returning a Spring SqlRowSet), you can pass in your own ResultSetExtractor to the query(...) methods (*not* queryForRowSet) that take a ResultSetExtractor as a parameter. What I did was just clone the SqlRowSetResultSetExtractor and instead of using the standard CachedRowSetImpl class, I replaced it with Oracle's CachedRowSet implementation. This way, when the ResultSet is mapped to a CachedRowSet, it uses Oracle's implementation to do so and thus the incompatibility is eliminated. Here is my ResultSetExtractor class that does just that...
-------------------------
Java代码
package com.xunjienet.cms.logic;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.sql.rowset.CachedRowSet;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet;
import org.springframework.jdbc.support.rowset.SqlRowSet;
import oracle.jdbc.rowset.OracleCachedRowSet;
public class SqlRowSetOracleResultSetExtractor implements ResultSetExtractor {
public Object extractData(ResultSet rs) throws SQLException {
return createSqlRowSet(rs);
}
/**
* Create a SqlRowSet that wraps the given ResultSet,
* representing its data in a disconnected fashion.
* <p>This implementation creates a Spring ResultSetWrappingSqlRowSet
* instance that wraps a standard JDBC CachedRowSet instance.
* Can be overridden to use a different implementation.
* @param rs the original ResultSet (connected)
* @return the disconnected SqlRowSet
* @throws SQLException if thrown by JDBC methods
* @see #newCachedRowSet
* @see org.springframework.jdbc.support.rowset.ResultSetW rappingSqlRowSet
*/
protected SqlRowSet createSqlRowSet(ResultSet rs) throws SQLException {
CachedRowSet rowSet = newCachedRowSet();
rowSet.populate(rs);
return new ResultSetWrappingSqlRowSet(rowSet);
}
/**
* Create a new CachedRowSet instance, to be populated by
* the <code>createSqlRowSet</code> implementation.
* <p>This implementation creates a new instance of
* Oracle's <code>oracle.jdbc.rowset.OracleCachedRowSet</code> class,
* which is their implementation of the Java 1.5 CachedRowSet interface.
* @return a new CachedRowSet instance
* @throws SQLException if thrown by JDBC methods
* @see #createSqlRowSet
* @see oracle.jdbc.rowset.OracleCachedRowSet
*/
protected CachedRowSet newCachedRowSet() throws SQLException {
return new OracleCachedRowSet();
}
}
-------------------------
You can pass this to the various query methods like so:
Java代码 SqlRowSet sqlRowSet = (SqlRowSet)jdbcTemplate.query(sql, new SqlRowSetOracleResultSetExtractor()); >>>>>>>>>>>>>>从9i到10g就出现了这个问题
查阅相关资料:数据库中有number型字段没有指定精度我也出了这个问题.我用NVL把空数字转为了0就解决了. http://forum.springsource.org/showthread.php?t=19848 java.sql.SQLException: Invalid scale size. Cannot be less than zero
数据库Oracle 10203
package com;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.sql.rowset.*;
import com.sun.rowset.CachedRowSetImpl;;
public class Test {
public static void main(String arg[]) {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
String url="jdbc:oracle:thin:@***.***.***.***:1521:billdb2";
Connection c = DriverManager.getConnection(url,"test","test");
Statement s = c.createStatement();
ResultSet r = s.executeQuery("select * from b");
CachedRowSet crs = new CachedRowSetImpl();
crs.populate(r);
while(crs.next()){
System.out.println(crs.getInt(1));
System.out.println(crs.getFloat(2));
}
}catch(Exception e) {
System.out.println(e.toString());
}
}
}
SQL> desc a
Name Type Nullable Default Comments
---- ------ -------- ------- --------
ID NUMBER Y
ID2 NUMBER Y
SQL> desc b
Name Type Nullable Default Comments
---- ----------- -------- ------- --------
ID NUMBER(1) Y
ID2 NUMBER(5,2) Y
使用CachedRowSetImpl 接口,如果数据库表字段为number且未指定精度(如a表),就会出现该错误。
如果指定精度程序运行正常(如b表)
使用CachedRowSetImpl 接口,如果数据库表字段为number且未指定精度,就会出现该错误。
也可以看参见 aggie2000 http://forum.springsource.org/showthread.php?t=19848
如果本机没有问题,则看看服务上tomcat本身有没有问题!
发表评论
-
hibernate抓取策略
2012-04-20 09:58 1292Hibernate3 定义了如下几种抓取策略: 连接抓取( ... -
BLOB和CLOB的区别以及在ORALCE中的插入和查询操作
2012-04-09 12:59 1569ORACLE中的大对象: LONG: 可变长的字符串数据,最 ... -
hibernate open session in view 抛出异常解决方法
2012-03-23 20:52 1185http://www.blogjava.net/dreamst ... -
jdbcTemplate使用总结1
2011-09-20 15:16 1366SqlRowSet rs = jdbcTemplate.que ... -
java.lang.String 与string
2011-06-24 15:58 1031个人认为string应该是java.lang.String与数 ... -
hibernate一对多sort和order by
2011-04-15 09:23 15701. 從資料庫的觀點 ... -
Hibernate对集合排序
2011-04-15 09:19 1711Hibernate对集合中的元素支持两种排序方式: Ø 在数 ... -
spring security deault login & jquery layout 的问题--http://yaofeng911.javaeye.com/
2011-03-28 15:19 1944使用spring security时需要配置默认的登陆页面,就 ... -
Hibernate之deleted object would be re-saved by cascade 异常的解决
2011-02-24 11:31 935以下是我在网上找到的, 我用了第二种方法,奇怪的是: 我在ac ... -
Hibernate学习笔记
2011-02-12 16:25 1245HQL 注意事项: 1.请把以前sql中的表名换成类名,把字 ... -
hql 多表查询
2011-01-20 18:19 1142String sql = "select test1 ... -
拼接字符串的学习
2010-12-22 21:58 945package com.ccid.str; import j ... -
[原创]多条件模糊查询的通用代码
2010-12-22 18:31 1505str_query1 = "se ... -
Hibernate中使用Hql查询出一定时间段的记录【 Date 比较】
2010-12-22 18:30 20007// 初步过滤出符合条件的区域ID String sql = ... -
spring bean property name
2010-12-02 14:00 1256spring: 配置bean的开始,注意在property里n ... -
Hibernate 中 UUID.HEX的实现机制??
2010-11-26 10:13 3588Hibernate主键生成方式 Key ... -
为什么我们要研究Hibernate ?-----转载自J道
2010-10-08 15:56 1065最近论坛上关于Hibernate ... -
HQL中修改对象属性的句子
2010-05-20 15:54 2086def newInstance = Organization. ... -
struts和hibernate和 spring的优缺点
2010-04-26 17:49 10411.struts struts框架具有组件的模块化,灵活性和 ...
相关推荐
import org.springframework.jdbc.support.rowset.SqlRowSet; import org.springframework.jdbc.support.rowset.SqlRowSetMetaData; import org.springframework.stereotype.Service; import ...
All Classes AbstractAdvisorAutoProxyCreator AbstractApplicationContext AbstractApplicationEventMulticaster AbstractAspectJAdvice AbstractAspectJAdvisorFactory AbstractAspectJAdvisorFactory....
`JDBCTemplate`是Spring框架中用于简化JDBC编程的一个工具类,它可以帮助开发者避免编写大量的重复性代码,并且处理诸如关闭资源、异常转换等繁琐任务。相比传统的JDBC编程,使用`JDBCTemplate`可以让开发者更专注于...
4. 使用SimpleJdbcCall获取SqlRowSet:这部分内容展示了如何在Spring环境中通过SimpleJdbcCall来执行存储过程并获取结果集。同时,还涉及了如何处理Oracle数据库,因为Spring对不同数据库的支持方式可能会有所不同。...
相较于传统的JDBC编程方式,使用`JdbcTemplate`可以极大地减少样板代码的编写,并能更好地处理异常、事务以及资源管理等问题。 #### 二、JdbcTemplate简介 `JdbcTemplate`作为Spring JDBC的核心类,主要负责执行...
在示例中,需要的jar文件包括`common-logging.jar`(日志处理),`spring.jar`(Spring核心库),以及数据库驱动对应的jar(如`ojdbc.jar`,这里是Oracle驱动)。 总结起来,JdbcTemplate是Spring框架中一个强大的...
在本文中,我们将详细介绍jdbcTemplate的使用方法实例解析,以及其在实际开发中的应用价值。 一、JdbcTemplate概述 JdbcTemplate是Spring JDBC抽象框架的核心类,提供了大量实用的方法来简化数据库操作。它通过...
在Java编程中,ROWSET允许程序员在离线环境中处理数据库数据,这意味着它可以在没有实际数据库连接的情况下操作数据。这使得ROWSET在处理大量数据时更为高效,因为减少了与数据库的来回通信。 ROWSET基于JavaBeans...