/*
* 软件名称:HashMap关系数据映射技术中间件[简称:JadePool]V3.0
* 版权所有: (C) 2006-2016 上海皆普信息科技有限公司胡开明
* 应用范围:JDBC数据库编程
* 交流邮箱:1669925058@qq.com
* 技术参考:http://www.jp863.com
*
* 这是一款免费开源分享软件;
* 授权许可给任何中外自然人和法人使用,您可以将它自由传播、分享、运用在商业和非商业软件项目中,
* 但请务必保留本软件的版权信息。
*/
package cn.jadepool.sql;
import cn.jadepool.util.DateTool;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Savepoint;
import java.sql.Statement;
import java.sql.Time;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
*
* @author 上海皆普 胡开明
*/
public abstract class AbstractVO implements Jdml {
protected Connection con;
protected Statement stmt;
protected ResultSet rs;
protected ResultSetMetaData rsmd;
protected Savepoint savepoint; //事务设置回滚点
protected JadeTool tool = new JadeTool();
protected DateTool dt = new DateTool();
protected DbCenter db = null; //实例化时,Db使用的数据库连接类型与ProcessVO一致
protected boolean failCommit;
protected int indexStepLength = 1000;
public AbstractVO() {
}
/**
* 设置事务隔离级别,默认的事务隔离级别是Connection.TRANSACTION_READ_COMMITTED,具体请参阅Connection的文档
* <pre>
* Connection.TRANSACTION_NONE= 0; 不能使用
* Connection.TRANSACTION_READ_UNCOMMITTED = 1; dirty reads, non-repeatable reads and phantom reads can occur
* Connection.TRANSACTION_READ_COMMITTED = 2; dirty reads are prevented; non-repeatable reads and phantom reads can occur
* Connection.TRANSACTION_REPEATABLE_READ = 4; dirty reads and non-repeatable reads are prevented; phantom reads can occur.
* Connection.TRANSACTION_SERIALIZABLE = 8; dirty reads, non-repeatable reads and phantom reads are prevented
* </pre>
*
* @param transactionIsolation 的取值应当是Connection给定的常量之一 :
* @throws java.sql.SQLException 抛出SQL异常
*/
public abstract void setTransactionIsolation(int transactionIsolation) throws SQLException;
/**
*
* @return 返回设置事务保存点
* @throws SQLException 抛出SQL异常
*/
public abstract Savepoint setSavepoint() throws SQLException;
/**
* 设置事务保存点。
*
* @param point 事务点名称
* @return 返回设置事务保存点
* @throws SQLException 抛出SQL异常
*/
public abstract Savepoint setSavepoint(String point) throws SQLException;
/**
* 释放事务保存点。
*
* @throws SQLException 抛出SQL异常
*/
public abstract void releaseSavepoint() throws SQLException;
/**
* 提交事务。
*
* @throws SQLException 抛出SQL异常
*/
public abstract void commit() throws SQLException;
/**
* 事务回滚。
*
* @throws SQLException 抛出SQL异常
*/
public abstract void rollback() throws SQLException;
/**
* 用于判断数据库连接是否使用了事务
*
* @return 是否提交事务
* @throws SQLException 抛出SQL异常
*/
public abstract boolean isAutoCommit() throws SQLException;
/**
* 设定事务处理
*
* @param autoCommit false开启事务,true关闭事务
* @throws SQLException 抛出SQL异常
*/
public abstract void setAutoCommit(boolean autoCommit) throws SQLException;
/**
* 是否关闭了数据库连接
*
* @return 用于判断数据库连接是否关闭,返回true表示已关闭,返回false表示未关闭.
* @throws SQLException 抛出SQL异常
*
*/
@Override
public abstract boolean isClosed() throws SQLException;
/**
* 关闭数据库联接
*
* @throws SQLException 抛出SQL异常
*/
@Override
public abstract void closeCon() throws SQLException;
/**
* 返回数据库连接
*
* @return 返回Connection con对象
*/
@Override
public Connection getCon() {
return this.con;
}
/**
* 返回Db实例,以便于用户查询数据库及其表、字段的结构信息
*
* @return 当前使用的Db实例
*/
@Override
public DbCenter getDb() {
return db;
}
//CRUD开始
/**
* 插入记录
*
* @param insertSql 插入语句
* @return 返回JDBC标准插入语句的返回值
* @throws SQLException 抛出SQL异常
*/
@Override
public int insert(String insertSql) throws SQLException {
int num = this.update(insertSql);
return num;
}
/**
* 插入一组记录
*
* @param insertSql 插入语句数组
* @return 返回JDBC标准插入语句的返回值
* @throws SQLException 抛出SQL异常
*/
@Override
public int insert(String[] insertSql) throws SQLException {
int num = this.update(insertSql);
return num;
}
/**
* 插入一条记录
*
* @param tableName 是表名
* @param mapRecord
* 是准备插入到表中的一条记录的数据,其键名与字段名相同,顺序无关;但键名不能是字段名以外的其它名称,自动过滤无效字段数据
* @return 返回JDBC标准插入语句的返回值
* @throws SQLException 抛出SQL异常
*/
@Override
public int insert(String tableName, Map<String, Object> mapRecord) throws SQLException {
List<Map> a = new ArrayList();
a.add(mapRecord);
int num = this.insert(tableName, a);
return num;
}
/**
* 插入一条记录
*
* @param tableName 是表名
* @param mapRecord 是准备插入到表中的一条记录的数据,其键名与字段名相同,顺序无关 ,自动过滤无效字段数据
* @param autoInsertKey 值为true时,自动插入主键
* @return 返回JDBC标准插入语句的返回值
* @throws SQLException 抛出SQL异常
*/
@Override
public int insert(String tableName, Map<String, Object> mapRecord, boolean autoInsertKey) throws SQLException {
int num = 0;
List a = new ArrayList();
a.add(mapRecord);
num = this._preparedStatementInsert(tableName, a, autoInsertKey);
return num;
}
/**
* 插入多条记录
*
* @param tableName 是表名
* @param listRecord 是准备插入到表中的多条记录的数据,其键名与字段名相同,顺序无关 ,自动过滤无效字段数据
* @return 返回JDBC标准插入语句的返回值
* @throws SQLException 抛出SQL异常
*/
@Override
public int insert(String tableName, List<Map> listRecord) throws SQLException {
int num = this._preparedStatementInsert(tableName, listRecord, false);
return num;
}
/**
* 插入多条记录
没有合适的资源?快使用搜索试试~ 我知道了~
HashMap关系数据映射技术软件jadepool-community-3.0
共357个文件
html:230个
class:49个
java:45个
需积分: 10 22 下载量 9 浏览量
2017-01-23
09:28:14
上传
评论 1
收藏 1.52MB RAR 举报
温馨提示
JadePool3.0的主要变化是: 1、支持JTA分布式事务; 2、调整了DbCenter实例; 3、优化了键值生成器方法,并做了高并发性能测试; 4、添加了一组字段值累加累减方法; 5、简化了db.xml配置文件,并兼容1.x版; 升级后的JadePool3.0高并发性做了充分的测试,得到了充分的验证。 JadePool3.0除了具备了简洁、高效、智能化的特性之外,还具备高并发性、高稳定性。
资源推荐
资源详情
资源评论
收起资源包目录
HashMap关系数据映射技术软件jadepool-community-3.0 (357个子文件)
AbstractVO.class 50KB
Access.class 40KB
ProcessForm.class 24KB
Jade.class 24KB
Base.class 18KB
Pool.class 17KB
JadeTool.class 13KB
DbCenter.class 12KB
DbAccess.class 11KB
DateTool.class 10KB
DbConnection.class 9KB
Record.class 8KB
Lunar.class 6KB
Table.class 6KB
DbTransactionManager.class 5KB
LunarYear.class 5KB
CastRMB.class 5KB
MailTool.class 5KB
ProcessVO.class 5KB
MapTree.class 4KB
ProcessImage.class 4KB
ConvertJSObject.class 4KB
ByteProcess.class 4KB
Field.class 4KB
Check.class 4KB
JadeJS.class 4KB
Jdml.class 3KB
Picture.class 3KB
AvailableNumber.class 3KB
ProcessVO$1.class 2KB
LunarDay.class 2KB
LunarMonth.class 2KB
MapNode.class 2KB
Db.class 2KB
Scale.class 1KB
DbConnectionQueue.class 1KB
JsonUtil.class 1KB
Access$1.class 1KB
Label.class 927B
MailTool$1.class 899B
MailTool$2.class 838B
IndexNode.class 761B
RegexType.class 710B
StateNumber.class 621B
VERSION.class 586B
Test.class 265B
State.class 146B
Jddl.class 133B
Safe.class 105B
stylesheet.css 13KB
stylesheet.css 13KB
db.dtd 846B
db.dtd 846B
index-all.html 275KB
index-all.html 275KB
AbstractVO.html 168KB
AbstractVO.html 168KB
Access.html 138KB
Access.html 138KB
Jade.html 100KB
Jade.html 100KB
Jdml.html 97KB
Jdml.html 97KB
Pool.html 95KB
Pool.html 95KB
Base.html 56KB
Base.html 56KB
JadeTool.html 56KB
JadeTool.html 56KB
DbCenter.html 55KB
DbCenter.html 55KB
DbAccess.html 54KB
DbAccess.html 54KB
DateTool.html 53KB
DateTool.html 53KB
Db.html 41KB
Db.html 41KB
ProcessForm.html 41KB
ProcessForm.html 41KB
ProcessVO.html 41KB
ProcessVO.html 41KB
Record.html 40KB
Record.html 40KB
Field.html 32KB
Field.html 32KB
Table.html 26KB
Table.html 26KB
ByteProcess.html 22KB
ByteProcess.html 22KB
serialized-form.html 21KB
serialized-form.html 21KB
ConvertJSObject.html 21KB
ConvertJSObject.html 21KB
LunarDay.html 21KB
LunarDay.html 21KB
MapTree.html 20KB
MapTree.html 20KB
DbConnection.html 18KB
DbConnection.html 18KB
JadeJS.html 18KB
共 357 条
- 1
- 2
- 3
- 4
资源评论
皆普
- 粉丝: 30
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功