Asp.Net中对操作Sql Server 简单处理的SqlDB类
好久不接触这些闲暇时间回顾一下以前的基础。因为平常使用的时候都是直接调用SqlDB.dll这个类。先看这个类的结构
纸上得来终觉浅,绝知此事要躬行。个人觉得里面的标准操作就是对数据库增删查改 。特别适合初学者操作数据库,当初我也是那么来的。下面直接贴代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web; using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.Configuration;
using System.Text; namespace FileUpDownThroou
{
/// <summary>
/// SqlServer访问类
/// </summary>
public class SqlDB
{
#region <——————————定义参数——————————>
/// <summary>
/// 数据库链接字符串
/// </summary>
protected readonly string SqlConning = ConfigurationManager.ConnectionStrings["ConnSqlString"].ConnectionString;
/// <summary>
/// 数据库链接对象
/// </summary>
private SqlConnection sqlConnection;
/// <summary>
/// 数据库事务对象
/// </summary>
private SqlTransaction sqlTransaction;
/// <summary>
/// 构造函数创建数据库链接
/// </summary>
#endregion #region<——————————构造函数——————————>
public SqlDB()
{
if(sqlConnection==null)
{
sqlConnection = new SqlConnection(SqlConning);
sqlConnection.Open();
}
}
#endregion #region <——————————事务处理——————————>
public SqlTransaction SqlTran
{
get { return sqlTransaction; }
set { sqlTransaction = value; }
}
/// <summary>
/// 打开数据链接
/// </summary>
public void OpenConnection()
{
if(sqlConnection != null && sqlConnection.State != ConnectionState.Open)
{
sqlConnection.Open();
}
}
/// <summary>
/// 关闭数据库链接
/// </summary>
public void CloseConnection()
{
if(sqlConnection != null && sqlConnection.State==ConnectionState.Open)
{
sqlConnection.Close();
}
}
/// <summary>
/// 开始一个数据库事务
/// </summary>
/// <param name="isolationlevel">链接的事务锁定行为</param>
public void BeginTransaction(IsolationLevel isolationlevel)
{
if(sqlConnection.State==ConnectionState.Closed)
{
sqlConnection.Open();
}
try
{
SqlTran = sqlConnection.BeginTransaction(isolationlevel);
}
catch(SqlException ex)
{
throw new Exception(ex.StackTrace);
}
catch(Exception e)
{
throw new Exception(e.StackTrace);
}
}
/// <summary>
/// 开始一个数据库事务
/// </summary>
public void BeginTransaction()
{
if (sqlConnection.State == ConnectionState.Closed)
{
sqlConnection.Open();
} try
{
SqlTran = sqlConnection.BeginTransaction();
}
catch (SqlException ex)
{
throw new Exception(ex.StackTrace);
}
catch (Exception e)
{
throw new Exception(e.StackTrace);
}
}
/// <summary>
/// 提交一个数据库事务
/// </summary>
public void CommitTransaction()
{
try
{
sqlTransaction.Commit();
CloseConnection();
}
catch(SqlException ex)
{
throw new Exception(ex.StackTrace);
}
catch(Exception e)
{
throw new Exception(e.StackTrace);
}
}
/// <summary>
/// 回退一个数据库事务
/// </summary>
public void RollBackTransaction()
{
try
{
SqlTran.Rollback();
CloseConnection(); }
catch (SqlException ex)
{
throw new Exception(ex.StackTrace);
}
catch (Exception e)
{
throw new Exception(e.StackTrace);
}
}
#endregion #region <——————————标准操作——————————> /// <summary>
/// 执行Sql语句返回SqlDataReader
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <param name="commandBehavior">查询影响说明</param>
/// <returns>满足条件的SqlDataReader</returns>
public SqlDataReader ExecuteDataReader(string Sql, List<SqlParameter> parameters, CommandType commandType, CommandBehavior commandBehavior)
{
return CreateSqlCommand(Sql, parameters, commandType).ExecuteReader(commandBehavior);
} /// <summary>
/// 执行Sql语句返回SqlDataReader
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <returns>满足条件的SqlDataReader</returns>
public SqlDataReader ExecuteDataReader(string Sql, List<SqlParameter> parameters, CommandType commandType)
{
return ExecuteDataReader(Sql, parameters, commandType, CommandBehavior.Default);
} /// <summary>
/// 执行Sql语句返回SqlDataReader
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <returns>满足条件的SqlDataReader</returns>
public SqlDataReader ExecuteDataReader(string Sql, List<SqlParameter> parameters)
{
return ExecuteDataReader(Sql, parameters, CommandType.Text, CommandBehavior.Default);
} /// <summary>
/// 执行Sql语句返回SqlDataReader
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <returns>满足条件的SqlDataReader</returns>
public SqlDataReader ExecuteDataReader(string Sql)
{
return ExecuteDataReader(Sql, null, CommandType.Text, CommandBehavior.Default);
} /// <summary>
/// 执行Sql语句返回单个对象
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <returns>满足条件的单个对象</returns>
public object ExecuteScalar(string Sql, List<SqlParameter> parameters, CommandType commandType)
{
return CreateSqlCommand(Sql, parameters, commandType).ExecuteScalar();
} /// <summary>
/// 执行Sql语句返回单个对象
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <returns>满足条件的单个对象</returns>
public object ExecuteScalar(string Sql, List<SqlParameter> parameters)
{
return ExecuteScalar(Sql, parameters, CommandType.Text);
} /// <summary>
/// 执行Sql语句返回单个对象
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <returns>满足条件的单个对象</returns>
public object ExecuteScalar(string Sql)
{
return ExecuteScalar(Sql, null, CommandType.Text);
} /// <summary>
/// 执行非查询类的Sql语句
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <returns>成功执行所影响的记录数</returns>
public int ExecuteNonQuery(string Sql, List<SqlParameter> parameters, CommandType commandType)
{
return CreateSqlCommand(Sql, parameters, commandType).ExecuteNonQuery();
} /// <summary>
/// 执行非查询类的Sql语句z
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <returns>成功执行所影响的记录数</returns>
public int ExecuteNonQuery(string Sql, List<SqlParameter> parameters)
{
return ExecuteNonQuery(Sql, parameters, CommandType.Text);
} /// <summary>
/// 执行非查询类的Sql语句
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <returns>成功执行所影响的记录数</returns>
public int ExecuteNonQuery(string Sql)
{
return ExecuteNonQuery(Sql, null, CommandType.Text);
} /// <summary>
/// 执行Sql语句返回DataTable
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <returns>DataTable</returns>
public DataTable ExecuteDataTable(string Sql, List<SqlParameter> sqlParameters, CommandType commandType)
{
SqlDataAdapter dataAdapter = new SqlDataAdapter(CreateSqlCommand(Sql, sqlParameters, commandType));
DataTable dataTable = new DataTable();
dataAdapter.Fill(dataTable);
return dataTable;
} /// <summary>
/// 执行Sql语句返回DataTable
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <returns>DataTable</returns>
public DataTable ExecuteDataTable(string Sql, List<SqlParameter> sqlParameters)
{
return ExecuteDataTable(Sql, sqlParameters, CommandType.Text);
} /// <summary>
/// 执行Sql语句返回DataTable
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <returns>DataTable</returns>
public DataTable ExecuteDataTable(string Sql)
{
return ExecuteDataTable(Sql, null, CommandType.Text);
} /// <summary>
/// 执行Sql语句返回DataSet
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <returns>DataSet</returns>
public DataSet ExecuteDataSet(string Sql, List<SqlParameter> sqlParameters, CommandType commandType)
{
SqlDataAdapter dataAdapter = new SqlDataAdapter(CreateSqlCommand(Sql, sqlParameters, commandType));
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet);
return dataSet;
} /// <summary>
/// 执行Sql语句返回DataSet
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <returns>DataSet</returns>
public DataSet ExecuteDataSet(string Sql, List<SqlParameter> sqlParameters)
{
return ExecuteDataSet(Sql, sqlParameters, CommandType.Text);
} /// <summary>
/// 执行Sql语句返回DataSet
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <returns>DataSet</returns>
public DataSet ExecuteDataSet(string Sql)
{
return ExecuteDataSet(Sql, null, CommandType.Text);
} /// <summary>
/// 执行查询,返回查询的分页结果数据集
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <param name="PageIndex">页索引</param>
/// <param name="PageSize">每页的记录数</param>
/// <returns>分页结果数据集</returns>
public DataSet ExecuteDataSet(string Sql, List<SqlParameter> sqlParameters, CommandType commandType, int PageIndex, int PageSize)
{
//设置导入的起始地址
int firstPage = PageIndex * PageSize; SqlDataAdapter dataAdapter = new SqlDataAdapter(CreateSqlCommand(Sql, sqlParameters, commandType));
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet, firstPage, PageSize, "PranaTable"); return dataSet;
} /// <summary>
/// 执行查询,返回查询的分页结果数据集
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="PageIndex">页索引</param>
/// <param name="PageSize">每页的记录数</param>
/// <returns>分页结果数据集</returns>
public DataSet ExecuteDataSet(string Sql, List<SqlParameter> sqlParameters, int PageIndex, int PageSize)
{
return ExecuteDataSet(Sql, sqlParameters, CommandType.Text, PageIndex, PageSize);
} /// <summary>
/// 执行查询,返回查询的分页结果数据集
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="PageIndex">页索引</param>
/// <param name="PageSize">每页的记录数</param>
/// <returns>分页结果数据集</returns>
public DataSet ExecuteDataSet(string Sql, int PageIndex, int PageSize)
{
return ExecuteDataSet(Sql, null, CommandType.Text, PageIndex, PageSize);
} /// <summary>
/// 创建Sql命令对象
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <returns>成功创建的SqlCommand对象</returns>
private SqlCommand CreateSqlCommand(string Sql, List<SqlParameter> parameters, CommandType commandType)
{
SqlCommand sqlCommand = new SqlCommand(Sql, sqlConnection, SqlTran);
sqlCommand.CommandType = commandType;
if (parameters != null)
{
foreach (SqlParameter parameter in parameters)
{
sqlCommand.Parameters.Add(parameter);
}
}
return sqlCommand;
} #endregion #region <——————————缓存操作——————————> /// <summary>
/// Hashtable中缓存的参数
/// </summary>
private static Hashtable parmCache = Hashtable.Synchronized(new Hashtable()); /// <summary>
/// 缓存查询的OleDb参数对象.
/// </summary>
/// <param name="cacheKey"></param>
/// <param name="cmdParms"></param>
public void CacheParameters(string cacheKey, params SqlParameter[] cmdParms)
{
parmCache[cacheKey] = cmdParms;
} /// <summary>
/// 从缓存获取指定的参数对象数组.
/// </summary>
/// <param name="cacheKey"></param>
/// <returns></returns>
public SqlParameter[] GetCachedParameters(string cacheKey)
{
SqlParameter[] cachedParms = (SqlParameter[])parmCache[cacheKey]; if (cachedParms == null)
{
return null;
} SqlParameter[] clonedParms = new SqlParameter[cachedParms.Length];
for (int i = , j = cachedParms.Length; i < j; i++)
{
clonedParms[i] = (SqlParameter)((ICloneable)cachedParms[i]).Clone();
} return clonedParms;
} #endregion #region <——————————增删改查——————————> private static bool haveTransaction = false; public static bool HaveTransaction
{
get
{
return haveTransaction;
}
set
{
haveTransaction = value;
}
} /// <summary>
/// 查询字符串的默认长度
/// </summary>
private const int defaultCommandTextLength = ; /// <summary>
/// 根据表名等参数创建数据库查询语句
/// </summary>
/// <param name="tableName">表名称</param>
/// <param name="topNum">返回的记录数</param>
/// <param name="field">字段名称</param>
/// <param name="condition">条件</param>
/// <param name="order">排序字段</param>
/// <returns>数据库查询语句</returns>
private StringBuilder CreateSqlCommandText(string tableName, int topNum, string field, string condition, string order)
{
StringBuilder Sql = new StringBuilder(defaultCommandTextLength);
Sql.Append("SELECT ");
if (topNum > )
{
Sql.AppendFormat("TOP {0} ", topNum);
}
Sql.AppendFormat("{0} FROM {1} ", field, tableName);
if (condition != null && condition.Trim().Length != )
{
Sql.AppendFormat("WHERE {0} ", condition);
}
if (order != null && order.Trim().Length != )
{
Sql.AppendFormat(" ORDER BY {0}", order);
}
return Sql;
} /// <summary>
/// 向表中插入数据
/// </summary>
/// <param name="tableName">表名称</param>
/// <param name="field">字段名称字符串</param>
/// <param name="fieldValue">字段值参数字符串</param>
/// <param name="parameters">字段参数集合</param>
/// <returns>成功插入的记录数</returns>
public int Insert(string tableName, string field, string fieldValue, List<SqlParameter> parameters)
{
try
{
if (HaveTransaction == false)
{
OpenConnection();
}
StringBuilder Sql = new StringBuilder(defaultCommandTextLength);
Sql.AppendFormat("INSERT INTO {0}({1}) VALUES({2});", tableName, field,
fieldValue);
return ExecuteNonQuery(Sql.ToString(), parameters);
}
finally
{
if (HaveTransaction == false)
{
CloseConnection();
}
} } /// <summary>
/// 从表中删除数据
/// </summary>
/// <param name="tableName">表名称</param>
/// <param name="condition">删除条件</param>
/// <param name="parameters">删除条件参数集合</param>
/// <returns>成功删除的记录数</returns>
public int Delete(string tableName, string condition, List<SqlParameter> parameters)
{
try
{
if (HaveTransaction == false)
{
OpenConnection();
}
StringBuilder Sql = new StringBuilder(defaultCommandTextLength);
Sql.AppendFormat("DELETE FROM {0} ", tableName);
if (condition != null && condition.Trim().Length != )
{
Sql.AppendFormat("WHERE {0}", condition);
}
return ExecuteNonQuery(Sql.ToString(), parameters);
}
finally
{
if (HaveTransaction == false)
{
CloseConnection();
}
}
} /// <summary>
/// 根据条件修改表中的数据
/// </summary>
/// <param name="tableName">表名称</param>
/// <param name="fieldValue">字段名城</param>
/// <param name="condition">修改条件</param>
/// <param name="parameters">修改参数集合</param>
/// <returns>成功修改的记录数</returns>
public int Update(string tableName, string fieldValue, string condition, List<SqlParameter> parameters)
{
try
{
if (HaveTransaction == false)
{
OpenConnection();
}
StringBuilder Sql = new StringBuilder(defaultCommandTextLength);
Sql.AppendFormat("UPDATE {0} SET {1} ", tableName, fieldValue);
if (condition != null && condition.Trim().Length != )
{
Sql.AppendFormat("WHERE {0}", condition);
}
return ExecuteNonQuery(Sql.ToString(), parameters);
}
finally
{
if (HaveTransaction == false)
{
CloseConnection();
}
}
} #endregion }
}
里面的每个方法都有注解,应该都看的清楚。增删查改都有不同的重载
就像这个DetSet就有5个重载 用的时候根据需要就可以。
/// <summary>
/// 执行Sql语句返回DataSet
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <returns>DataSet</returns>
public DataSet ExecuteDataSet(string Sql, List<SqlParameter> sqlParameters, CommandType commandType)
{
SqlDataAdapter dataAdapter = new SqlDataAdapter(CreateSqlCommand(Sql, sqlParameters, commandType));
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet);
return dataSet;
}
/// <summary>
/// 执行Sql语句返回DataSet
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <returns>DataSet</returns>
public DataSet ExecuteDataSet(string Sql, List<SqlParameter> sqlParameters)
{
return ExecuteDataSet(Sql, sqlParameters, CommandType.Text);
}
/// <summary>
/// 执行Sql语句返回DataSet
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <returns>DataSet</returns>
public DataSet ExecuteDataSet(string Sql)
{
return ExecuteDataSet(Sql, null, CommandType.Text);
}
/// <summary>
/// 执行查询,返回查询的分页结果数据集
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <param name="PageIndex">页索引</param>
/// <param name="PageSize">每页的记录数</param>
/// <returns>分页结果数据集</returns>
public DataSet ExecuteDataSet(string Sql, List<SqlParameter> sqlParameters, CommandType commandType, int PageIndex, int PageSize)
{
//设置导入的起始地址
int firstPage = PageIndex * PageSize;
SqlDataAdapter dataAdapter = new SqlDataAdapter(CreateSqlCommand(Sql, sqlParameters, commandType));
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet, firstPage, PageSize, "PranaTable");
return dataSet;
}
/// <summary>
/// 执行查询,返回查询的分页结果数据集
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="PageIndex">页索引</param>
/// <param name="PageSize">每页的记录数</param>
/// <returns>分页结果数据集</returns>
public DataSet ExecuteDataSet(string Sql, List<SqlParameter> sqlParameters, int PageIndex, int PageSize)
{
return ExecuteDataSet(Sql, sqlParameters, CommandType.Text, PageIndex, PageSize);
}
/// <summary>
/// 执行查询,返回查询的分页结果数据集
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="PageIndex">页索引</param>
/// <param name="PageSize">每页的记录数</param>
/// <returns>分页结果数据集</returns>
public DataSet ExecuteDataSet(string Sql, int PageIndex, int PageSize)
{
return ExecuteDataSet(Sql, null, CommandType.Text, PageIndex, PageSize);
}
Asp.Net中对操作Sql Server 简单处理的SqlDB类的更多相关文章
- 在易语言中调用MS SQL SERVER数据库存储过程方法总结
Microsoft SQL SERVER 数据库存储过程,根据其输入输出数据,笼统的可以分为以下几种情况或其组合:无输入,有一个或多个输入参数,无输出,直接返回(return)一个值,通过output ...
- SQL Server学习之路(七):Python3操作SQL Server数据库
0.目录 1.前言 2.准备工作 3.简单测试语句 4.提交与回滚 5.封装成类的写法 1.前言 前面学完了SQL Server的基本语法,接下来学习如何在程序中使用sql,毕竟不能在程序中使用的话, ...
- [转]C#操作SQL Server数据库
转自:C#操作SQL Server数据库 1.概述 ado.net提供了丰富的数据库操作,这些操作可以分为三个步骤: 第一,使用SqlConnection对象连接数据库: 第二,建立SqlComman ...
- Python 学习笔记:Python 操作 SQL Server 数据库
最近要将数据写到数据库里,学习了一下如何用 Python 来操作 SQL Server 数据库. 一.连接数据库: 首先,我们要连接 SQL Server 数据库,需要安装 pymssql 这个第三方 ...
- PHP操作SQL Server 2008/2012
PHP操作SQL Server驱动,微软官方提供2个版本,Version 2.0 和 Version 3.0 Version 2.0 版本支持的操作系统有: Windows Server 2003 S ...
- 在打包程序中自动安装SQL Server数据库 .
原文:在打包程序中自动安装SQL Server数据库 . 1.创建安装项目“Setup1”安装项目 在“文件”菜单上指向“添加项目”,然后选择“新建项目”. 在“添加新项目”对话框中,选择“项目类型” ...
- 数据库SQL Server2012笔记(七)——java 程序操作sql server
1.crud(增删改查)介绍:create/retrieve/update/delete 2.JDBC介绍 1)JDBC(java database connectivity,java数据库连接) 2 ...
- 使用php来访问操作sql server
使用php来访问操作sql server 在此分成三步走: 第一部:查看配置,下载文件 首先查看自己的php和sql server版本 Php文件输入echo PHP_VERSION 运行脚本就可以 ...
- Nodejs 操作 Sql Server
Nodejs 操作 Sql Server Intro 最近项目需要爬取一些数据,数据有加密,前端的js又被混淆了,ajax请求被 hook 了,有些复杂,最后打算使用 puppeteer 来爬取数据. ...
随机推荐
- 数据结构图解(递归,二分,AVL,红黑树,伸展树,哈希表,字典树,B树,B+树)
递归反转 二分查找 AVL树 AVL简单的理解,如图所示,底部节点为1,不断往上到根节点,数字不断累加. 观察每个节点数字,随意选个节点A,会发现A节点的左子树节点或右子树节点末尾,数到A节点距离之差 ...
- centos6安装cas5
cas是Central Authentication Service的缩写,中文为中央认证服务,在这里我就不说理论了,在公司里项目研发需要cas平台,所以经过两天研究,搞了一个简化版的cas服务,有不 ...
- 【MySQL】存储emoji表情报错(Incorrect string value: '\xF0\x9F\x98\x82\xF0\x9F...')的解决方案
Emoji表情字符现在在APP已经广泛支持了.但是MySQL的UTF8编码对Emoji字符的支持却不是那么好.所以我们经常会遇到这样的异常: Java.sql.SQLException: Inco ...
- Python-OpenCV 图像叠加加权实现
函数说明 cv2.addWeighted(src1, alpha, src2, beta, gamma[, dst[, dtype]]) → dst 1 参数说明 src1 – first input ...
- Python字符串的格式化,看这一篇就够了
相信很多人在格式化字符串的时候都用"%s" % v的语法,PEP 3101 提出一种更先进的格式化方法 str.format() 并成为 Python 3 的标准用来替换旧的 %s ...
- javaScript笔记详解(1)
javaScript基础详解 版权声明 本文原创作者:雨点的名字 作者博客地址:https://home.cnblogs.com/u/qdhxhz/ 首先讲javaScript的摆放位置:<sc ...
- Oracle客户端连接数据库配置
配置文件和路径 配置文件:tnsnames.ora 默认路径:%ORACLE_HOME%\network\admin\tnsnames.ora,%ORACLE_HOME%通常在环境变量中使用. 我的路 ...
- mysql 开发基础系列22 SQL Model
一.概述 与其它数据库不同,mysql 可以运行不同的sql model 下, sql model 定义了mysql应用支持的sql语法,数据校验等,这样更容易在不同的环境中使用mysql. sql ...
- Spring Boot 1.5升级2.1 主要问题汇总
我们目前工作的系统是基于Spring Boot 1.5.19.RELEASE.Spring Cloud Edgware.SR3开发的,因为一个新项目开发过程的体验,所以在考虑升级到Spring Boo ...
- iOS逆向开发(4):注入目标函数 | fishhook | MobileSubstrate | MSHookFunction | iOSOpenDev
从获得APP的所有类声明,到锁定目标类与函数,现在是时候注入函数了. 所谓"注入函数",小程的意思是让APP执行到小程写的代码中,跟"钩子"的概念一致.小程把个 ...