使用psstmt时不能打印出完整的sql语句,挺不方便的,找到一个实现方法,记录下来。

  1. package com.zhh.function.util;
  2. import java.io.InputStream;
  3. import java.io.Reader;
  4. import java.math.BigDecimal;
  5. import java.net.URL;
  6. import java.sql.Array;
  7. import java.sql.Blob;
  8. import java.sql.Clob;
  9. import java.sql.Connection;
  10. import java.sql.Date;
  11. import java.sql.NClob;
  12. import java.sql.ParameterMetaData;
  13. import java.sql.PreparedStatement;
  14. import java.sql.Ref;
  15. import java.sql.ResultSet;
  16. import java.sql.ResultSetMetaData;
  17. import java.sql.RowId;
  18. import java.sql.SQLException;
  19. import java.sql.SQLWarning;
  20. import java.sql.SQLXML;
  21. import java.sql.Time;
  22. import java.sql.Timestamp;
  23. import java.util.ArrayList;
  24. import java.util.Calendar;
  25. /**
  26. *
  27. * 项目名称:CFR
  28. * 类名称:LoggableStatement
  29. * 类描述:扩展PreparedStatement,以便输出执行的sql语句,即sql日志
  30. * 创建时间:2010-6-22 下午10:47:39
  31. * @version   1.0
  32. * @author zhh
  33. *来自网络 *
  34. */
  35. public class LoggableStatement implements PreparedStatement {
  36. /** used for storing parameter values needed for producing log */
  37. private ArrayList parameterValues;
  38. /** the query string with question marks as parameter placeholders */
  39. private String sqlTemplate;
  40. /** a statement created from a real database connection */
  41. private PreparedStatement wrappedStatement;
  42. public LoggableStatement(Connection connection, String sql)
  43. throws SQLException {
  44. // use connection to make a prepared statement
  45. wrappedStatement = connection.prepareStatement(sql);
  46. sqlTemplate = sql;
  47. parameterValues = new ArrayList();
  48. }
  49. private void saveQueryParamValue(int position, Object obj) {
  50. String strValue;
  51. if (obj instanceof String || obj instanceof Date) {
  52. // if we have a String, include '' in the saved value
  53. strValue = "'" + obj + "'";
  54. } else {
  55. if (obj == null) {
  56. // convert null to the string null
  57. strValue = "null";
  58. } else {
  59. // unknown object (includes all Numbers), just call toString
  60. strValue = obj.toString();
  61. }
  62. }
  63. // if we are setting a position larger than current size of
  64. // parameterValues, first make it larger
  65. while (position >= parameterValues.size()) {
  66. parameterValues.add(null);
  67. }
  68. // save the parameter
  69. parameterValues.set(position, strValue);
  70. }
  71. // 这一步是对ArrayList与sql进行处理,输出完整的sql语句
  72. public String getQueryString() {
  73. int len = sqlTemplate.length();
  74. StringBuffer t = new StringBuffer(len * 2);
  75. if (parameterValues != null) {
  76. int i = 1, limit = 0, base = 0;
  77. while ((limit = sqlTemplate.indexOf('?', limit)) != -1) {
  78. t.append(sqlTemplate.substring(base, limit));
  79. t.append(parameterValues.get(i));
  80. i++;
  81. limit++;
  82. base = limit;
  83. }
  84. if (base < len) {
  85. t.append(sqlTemplate.substring(base));
  86. }
  87. }
  88. return t.toString();
  89. }
  90. public void addBatch() throws SQLException {
  91. wrappedStatement.addBatch();
  92. }
  93. public void clearParameters() throws SQLException {
  94. wrappedStatement.clearParameters();
  95. }
  96. public boolean execute() throws SQLException {
  97. return wrappedStatement.execute();
  98. }
  99. public ResultSet executeQuery() throws SQLException {
  100. return wrappedStatement.executeQuery();
  101. }
  102. public int executeUpdate() throws SQLException {
  103. return wrappedStatement.executeUpdate();
  104. }
  105. public ResultSetMetaData getMetaData() throws SQLException {
  106. return wrappedStatement.getMetaData();
  107. }
  108. public ParameterMetaData getParameterMetaData() throws SQLException {
  109. return wrappedStatement.getParameterMetaData();
  110. }
  111. public void setArray(int i, Array x) throws SQLException {
  112. wrappedStatement.setArray(i, x);
  113. saveQueryParamValue(i, x);
  114. }
  115. public void setAsciiStream(int parameterIndex, InputStream x, int length)
  116. throws SQLException {
  117. wrappedStatement.setAsciiStream(parameterIndex, x, length);
  118. saveQueryParamValue(parameterIndex, x);
  119. }
  120. public void setBigDecimal(int parameterIndex, BigDecimal x)
  121. throws SQLException {
  122. wrappedStatement.setBigDecimal(parameterIndex, x);
  123. saveQueryParamValue(parameterIndex, x);
  124. }
  125. public void setBinaryStream(int parameterIndex, InputStream x, int length)
  126. throws SQLException {
  127. wrappedStatement.setBinaryStream(parameterIndex, x, length);
  128. saveQueryParamValue(parameterIndex, x);
  129. }
  130. public void setBlob(int i, Blob x) throws SQLException {
  131. wrappedStatement.setBlob(i, x);
  132. saveQueryParamValue(i, x);
  133. }
  134. public void setBoolean(int parameterIndex, boolean x) throws SQLException {
  135. wrappedStatement.setBoolean(parameterIndex, x);
  136. saveQueryParamValue(parameterIndex, new Boolean(x));
  137. }
  138. public void setByte(int parameterIndex, byte x) throws SQLException {
  139. wrappedStatement.setByte(parameterIndex, x);
  140. saveQueryParamValue(parameterIndex, new Byte(x));
  141. }
  142. public void setBytes(int parameterIndex, byte[] x) throws SQLException {
  143. wrappedStatement.setBytes(parameterIndex, x);
  144. saveQueryParamValue(parameterIndex, x);
  145. }
  146. public void setCharacterStream(int parameterIndex, Reader reader, int length)
  147. throws SQLException {
  148. wrappedStatement.setCharacterStream(parameterIndex, reader, length);
  149. saveQueryParamValue(parameterIndex, reader);
  150. }
  151. public void setClob(int i, Clob x) throws SQLException {
  152. wrappedStatement.setClob(i, x);
  153. saveQueryParamValue(i, x);
  154. }
  155. public void setDate(int parameterIndex, Date x) throws SQLException {
  156. wrappedStatement.setDate(parameterIndex, x);
  157. saveQueryParamValue(parameterIndex, x);
  158. }
  159. public void setDate(int parameterIndex, Date x, Calendar cal)
  160. throws SQLException {
  161. wrappedStatement.setDate(parameterIndex, x, cal);
  162. saveQueryParamValue(parameterIndex, x);
  163. }
  164. public void setDouble(int parameterIndex, double x) throws SQLException {
  165. wrappedStatement.setDouble(parameterIndex, x);
  166. saveQueryParamValue(parameterIndex, new Double(x));
  167. }
  168. public void setFloat(int parameterIndex, float x) throws SQLException {
  169. wrappedStatement.setFloat(parameterIndex, x);
  170. saveQueryParamValue(parameterIndex, new Float(x));
  171. }
  172. public void setInt(int parameterIndex, int x) throws SQLException {
  173. wrappedStatement.setInt(parameterIndex, x);
  174. saveQueryParamValue(parameterIndex, new Integer(x));
  175. }
  176. public void setLong(int parameterIndex, long x) throws SQLException {
  177. wrappedStatement.setLong(parameterIndex, x);
  178. saveQueryParamValue(parameterIndex, new Long(x));
  179. }
  180. public void setNull(int parameterIndex, int sqlType) throws SQLException {
  181. wrappedStatement.setNull(parameterIndex, sqlType);
  182. saveQueryParamValue(parameterIndex, new Integer(sqlType));
  183. }
  184. public void setNull(int paramIndex, int sqlType, String typeName)
  185. throws SQLException {
  186. wrappedStatement.setNull(paramIndex, sqlType, typeName);
  187. saveQueryParamValue(paramIndex, new Integer(sqlType));
  188. }
  189. public void setObject(int parameterIndex, Object x) throws SQLException {
  190. wrappedStatement.setObject(parameterIndex, x);
  191. saveQueryParamValue(parameterIndex, x);
  192. }
  193. public void setObject(int parameterIndex, Object x, int targetSqlType)
  194. throws SQLException {
  195. wrappedStatement.setObject(parameterIndex, x, targetSqlType);
  196. saveQueryParamValue(parameterIndex, x);
  197. }
  198. public void setObject(int parameterIndex, Object x, int targetSqlType,
  199. int scale) throws SQLException {
  200. wrappedStatement.setObject(parameterIndex, x, targetSqlType, scale);
  201. saveQueryParamValue(parameterIndex, x);
  202. }
  203. public void setRef(int i, Ref x) throws SQLException {
  204. wrappedStatement.setRef(i, x);
  205. saveQueryParamValue(i, x);
  206. }
  207. public void setShort(int parameterIndex, short x) throws SQLException {
  208. wrappedStatement.setShort(parameterIndex, x);
  209. saveQueryParamValue(parameterIndex, new Short(x));
  210. }
  211. public void setString(int parameterIndex, String x) throws SQLException {
  212. wrappedStatement.setString(parameterIndex, x);
  213. saveQueryParamValue(parameterIndex, x);
  214. }
  215. public void setTime(int parameterIndex, Time x) throws SQLException {
  216. wrappedStatement.setTime(parameterIndex, x);
  217. saveQueryParamValue(parameterIndex, x);
  218. }
  219. public void setTime(int parameterIndex, Time x, Calendar cal)
  220. throws SQLException {
  221. wrappedStatement.setTime(parameterIndex, x, cal);
  222. saveQueryParamValue(parameterIndex, x);
  223. }
  224. public void setTimestamp(int parameterIndex, Timestamp x)
  225. throws SQLException {
  226. wrappedStatement.setTimestamp(parameterIndex, x);
  227. saveQueryParamValue(parameterIndex, x);
  228. }
  229. public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
  230. throws SQLException {
  231. wrappedStatement.setTimestamp(parameterIndex, x, cal);
  232. saveQueryParamValue(parameterIndex, x);
  233. }
  234. public void setURL(int parameterIndex, URL x) throws SQLException {
  235. wrappedStatement.setURL(parameterIndex, x);
  236. saveQueryParamValue(parameterIndex, x);
  237. }
  238. public void setUnicodeStream(int parameterIndex, InputStream x, int length)
  239. throws SQLException {
  240. wrappedStatement.setUnicodeStream(parameterIndex, x, length);
  241. saveQueryParamValue(parameterIndex, x);
  242. }
  243. public void addBatch(String sql) throws SQLException {
  244. wrappedStatement.addBatch(sql);
  245. }
  246. public void cancel() throws SQLException {
  247. wrappedStatement.cancel();
  248. }
  249. public void clearBatch() throws SQLException {
  250. wrappedStatement.clearBatch();
  251. }
  252. public void clearWarnings() throws SQLException {
  253. wrappedStatement.clearWarnings();
  254. }
  255. public void close() throws SQLException {
  256. wrappedStatement.close();
  257. }
  258. public boolean execute(String sql) throws SQLException {
  259. return wrappedStatement.execute(sql);
  260. }
  261. public boolean execute(String sql, int autoGeneratedKeys)
  262. throws SQLException {
  263. return wrappedStatement.execute(sql, autoGeneratedKeys);
  264. }
  265. public boolean execute(String sql, int[] columnIndexes) throws SQLException {
  266. return wrappedStatement.execute(sql, columnIndexes);
  267. }
  268. public boolean execute(String sql, String[] columnNames)
  269. throws SQLException {
  270. return wrappedStatement.execute(sql, columnNames);
  271. }
  272. public int[] executeBatch() throws SQLException {
  273. return wrappedStatement.executeBatch();
  274. }
  275. public ResultSet executeQuery(String sql) throws SQLException {
  276. return wrappedStatement.executeQuery(sql);
  277. }
  278. public int executeUpdate(String sql) throws SQLException {
  279. return wrappedStatement.executeUpdate(sql);
  280. }
  281. public int executeUpdate(String sql, int autoGeneratedKeys)
  282. throws SQLException {
  283. return wrappedStatement.executeUpdate(sql, autoGeneratedKeys);
  284. }
  285. public int executeUpdate(String sql, int[] columnIndexes)
  286. throws SQLException {
  287. return wrappedStatement.executeUpdate(sql, columnIndexes);
  288. }
  289. public int executeUpdate(String sql, String[] columnNames)
  290. throws SQLException {
  291. return wrappedStatement.executeUpdate(sql, columnNames);
  292. }
  293. public Connection getConnection() throws SQLException {
  294. return wrappedStatement.getConnection();
  295. }
  296. public int getFetchDirection() throws SQLException {
  297. return wrappedStatement.getFetchDirection();
  298. }
  299. public int getFetchSize() throws SQLException {
  300. return wrappedStatement.getFetchSize();
  301. }
  302. public ResultSet getGeneratedKeys() throws SQLException {
  303. return wrappedStatement.getGeneratedKeys();
  304. }
  305. public int getMaxFieldSize() throws SQLException {
  306. return wrappedStatement.getMaxFieldSize();
  307. }
  308. public int getMaxRows() throws SQLException {
  309. return wrappedStatement.getMaxRows();
  310. }
  311. public boolean getMoreResults() throws SQLException {
  312. return wrappedStatement.getMoreResults();
  313. }
  314. public boolean getMoreResults(int current) throws SQLException {
  315. return wrappedStatement.getMoreResults(current);
  316. }
  317. public int getQueryTimeout() throws SQLException {
  318. return wrappedStatement.getQueryTimeout();
  319. }
  320. public ResultSet getResultSet() throws SQLException {
  321. return wrappedStatement.getResultSet();
  322. }
  323. public int getResultSetConcurrency() throws SQLException {
  324. return wrappedStatement.getResultSetConcurrency();
  325. }
  326. public int getResultSetHoldability() throws SQLException {
  327. return wrappedStatement.getResultSetHoldability();
  328. }
  329. public int getResultSetType() throws SQLException {
  330. return wrappedStatement.getResultSetType();
  331. }
  332. public int getUpdateCount() throws SQLException {
  333. return wrappedStatement.getUpdateCount();
  334. }
  335. public SQLWarning getWarnings() throws SQLException {
  336. return wrappedStatement.getWarnings();
  337. }
  338. public void setCursorName(String name) throws SQLException {
  339. wrappedStatement.setCursorName(name);
  340. }
  341. public void setEscapeProcessing(boolean enable) throws SQLException {
  342. wrappedStatement.setEscapeProcessing(enable);
  343. }
  344. public void setFetchDirection(int direction) throws SQLException {
  345. wrappedStatement.setFetchDirection(direction);
  346. }
  347. public void setFetchSize(int rows) throws SQLException {
  348. wrappedStatement.setFetchSize(rows);
  349. }
  350. public void setMaxFieldSize(int max) throws SQLException {
  351. wrappedStatement.setMaxFieldSize(max);
  352. }
  353. public void setMaxRows(int max) throws SQLException {
  354. wrappedStatement.setMaxFieldSize(max);
  355. }
  356. public void setQueryTimeout(int seconds) throws SQLException {
  357. wrappedStatement.setQueryTimeout(seconds);
  358. }
  359. public void setAsciiStream(int parameterIndex, InputStream x)
  360. throws SQLException {
  361. // TODO Auto-generated method stub
  362. }
  363. public void setAsciiStream(int parameterIndex, InputStream x, long length)
  364. throws SQLException {
  365. // TODO Auto-generated method stub
  366. }
  367. public void setBinaryStream(int parameterIndex, InputStream x)
  368. throws SQLException {
  369. // TODO Auto-generated method stub
  370. }
  371. public void setBinaryStream(int parameterIndex, InputStream x, long length)
  372. throws SQLException {
  373. // TODO Auto-generated method stub
  374. }
  375. public void setBlob(int parameterIndex, InputStream inputStream)
  376. throws SQLException {
  377. // TODO Auto-generated method stub
  378. }
  379. public void setBlob(int parameterIndex, InputStream inputStream, long length)
  380. throws SQLException {
  381. // TODO Auto-generated method stub
  382. }
  383. public void setCharacterStream(int parameterIndex, Reader reader)
  384. throws SQLException {
  385. // TODO Auto-generated method stub
  386. }
  387. public void setCharacterStream(int parameterIndex, Reader reader,
  388. long length) throws SQLException {
  389. // TODO Auto-generated method stub
  390. }
  391. public void setClob(int parameterIndex, Reader reader) throws SQLException {
  392. // TODO Auto-generated method stub
  393. }
  394. public void setClob(int parameterIndex, Reader reader, long length)
  395. throws SQLException {
  396. // TODO Auto-generated method stub
  397. }
  398. public void setNCharacterStream(int parameterIndex, Reader value)
  399. throws SQLException {
  400. // TODO Auto-generated method stub
  401. }
  402. public void setNCharacterStream(int parameterIndex, Reader value,
  403. long length) throws SQLException {
  404. // TODO Auto-generated method stub
  405. }
  406. public void setNClob(int parameterIndex, NClob value) throws SQLException {
  407. // TODO Auto-generated method stub
  408. }
  409. public void setNClob(int parameterIndex, Reader reader) throws SQLException {
  410. // TODO Auto-generated method stub
  411. }
  412. public void setNClob(int parameterIndex, Reader reader, long length)
  413. throws SQLException {
  414. // TODO Auto-generated method stub
  415. }
  416. public void setNString(int parameterIndex, String value)
  417. throws SQLException {
  418. // TODO Auto-generated method stub
  419. }
  420. public void setRowId(int parameterIndex, RowId x) throws SQLException {
  421. // TODO Auto-generated method stub
  422. }
  423. public void setSQLXML(int parameterIndex, SQLXML xmlObject)
  424. throws SQLException {
  425. // TODO Auto-generated method stub
  426. }
  427. public boolean isClosed() throws SQLException {
  428. // TODO Auto-generated method stub
  429. return false;
  430. }
  431. public boolean isPoolable() throws SQLException {
  432. // TODO Auto-generated method stub
  433. return false;
  434. }
  435. public void setPoolable(boolean poolable) throws SQLException {
  436. // TODO Auto-generated method stub
  437. }
  438. public boolean isWrapperFor(Class<?> iface) throws SQLException {
  439. // TODO Auto-generated method stub
  440. return false;
  441. }
  442. public <T> T unwrap(Class<T> iface) throws SQLException {
  443. // TODO Auto-generated method stub
  444. return null;
  445. }
  446. }

输出:

  1. Connection conn = null;
  2. PreparedStatement ps = null;
  3. ResultSet rs = null;
  4. JdbcProp jp = new JdbcProp();
  5. try{
  6. String sql = " insert into someInfection_list (INFECTION_ID, INFECTION_CARDID, INFECTION_HOSADDRCODE, INFECTION_CARDSN, "
  7. +" INFECTION_NAME, INFECTION_PARENTNAME, INFECTION_SEX, INFECTION_PHONE, INFECTION_IDSN, INFECTION_ORG,"
  8. +" INFECTION_ADDR, INFECTION_ADDRCODE, INFECTION_ADDRTYPE, INFECTION_PERSONTYPE, INFECTION_TAKENDATE,"
  9. +" INFECTION_DIAGNOSEDATE, INFECTION_DEADDATE, INFECTION_TYPE, INFECTION_DOCTOR, INFECTION_INFECTIONTYPE,"
  10. +" infection_infectionsn, infection_zhongshendate, INFECTION_USERID, INFECTION_MEMO, INFECTION_BIRTHDAY,"
  11. +" INFECTION_DOCTORFILLDATE , infection_oldcardid, INFECTION_CARDCREATEDDATE, infection_xianshen,"
  12. +" infection_shishen, infection_shengshen, INFECTION_DELETEDATE, INFECTION_REPORTORG, INFECTION_ORGTYPE,"
  13. +" INFECTION_REPAIRDATE, infection_flag, infection_datasource, infection_firstinfection) " +
  14. " values " +
  15. "(sys_guid(),?,?,?,?,?,?,?,?,?, " + //  10
  16. "?,?,?,?,to_date(?,'yyyy-mm-dd hh24:mi:ss'),to_date(?,'yyyy-mm-dd hh24:mi:ss'),to_date(?,'yyyy-mm-dd hh24:mi:ss'),?,?,?, " +
  17. "?, to_date(?,'yyyy-mm-dd hh24:mi:ss'),?,?,to_date(?,'yyyy-mm-dd hh24:mi:ss')," +  //25
  18. "to_date(?,'yyyy-mm-dd hh24:mi:ss'),?,to_date(?,'yyyy-mm-dd hh24:mi:ss'),to_date(?,'yyyy-mm-dd hh24:mi:ss'),to_date(?,'yyyy-mm-dd hh24:mi:ss'), " +
  19. "?,to_date(?,'yyyy-mm-dd hh24:mi:ss'),?,?,to_date(?,'yyyy-mm-dd hh24:mi:ss'),?,?,?)";
  20. conn = jp.getConn();
  21. //          ps = conn.prepareStatement(sql);
  22. ps = new LoggableStatement(conn,sql);
  23. ps.setString(1, paras[0]);
  24. ...
  25. ...
  26. System.out.println("Executing SQL: "+((LoggableStatement)ps).getQueryString());
  27. ps.executeUpdate();
 
0
0

使用PreparedStatement时,输出完整的SQL语句的更多相关文章

  1. 通过Linux命令过滤出binlog中完整的SQL语句

    DB:5.6.16CentOS:CentOS release 6.3 (Final) 当insert语句通过空格跨行输入的时候,如何提取完整的insert语句! 创建一个空表:mysql> cr ...

  2. sql中有一些保留字,当你的字段名是它的保留字时,这个时候sql语句的字段不加``就会报错

    sql中有一些保留字,当你的字段名是它的保留字时,这个时候sql语句的字段不加``就会报错

  3. Ibatis 后台打印完整的sql语句

    http://blog.csdn.net/deng11342/article/details/9122015 http://www.blogjava.net/libin2722/archive/200 ...

  4. EFCore, 输出执行的Sql语句到控制台或者调试窗口

    .net core 已经集成的各种日志功能,使用efcore时,只需要按情况引入相应的包即可,如果你用的是.net core调试,那么可以引入 Microsoft.Extensions.Logging ...

  5. YII2 输出 执行的 SQL 语句,直接用程序输出

    $query = User::find() ->,,,]) ->select(['username']) // 输出SQL语句 $commandQuery = clone $query; ...

  6. 输出MYSQL所有SQL语句

    在my.cnf中的mysqld段增加如下参数,然后重启MYSQL: log-output = FILE general_log = 1 general_log_file = "D:/Visu ...

  7. yii 输出当前的sql语句

    <?php namespace app\controllers; use yii\web\Controller; use yii\data\Pagination; use app\models\ ...

  8. 快速过滤出完整的SQL语句

    [root@bass ca]# mysqlbinlog -- |egrep -v "^(/|SET|BEGIN|COMMITER|#|COMMIT)" >a.log [roo ...

  9. java/jsp执行sql语句的方式

    首先给出sql驱动包 引入sql包 import java.sql.*;//java <%@ page import="java.sql.*"%>//jsp 连接mys ...

随机推荐

  1. python技巧 显示对象的所有属性

    python技巧 显示对象的所有属性for attr in dir(ad):... print attr+":"+str(getattr(ad,attr))

  2. shiro 会话管理

  3. 配置IIS支持Json格式

    配置iis支持.json格式的文件 原文地址:http://blog.eroad.info/iis-suport-json/ 在做easyUI的官方示例的时候 有的例子是直接读取的json文件,但是默 ...

  4. Python基础学习Day7 基础数据类型的扩展 集合 深浅copy

    一.基础数据类型的扩展 1.1GBK ---> UTF - 8 # str --->bytes s1 = '太白' # 字符串是unicode编码 b1 = s1.encode('gbk' ...

  5. maintenance

    Maintenance Primitives Operator经常需要在包含Mesos集群的机器上执行维护任务. 大多数Mesos升级可以在不影响运行的任务的情况下完成,但是有些情况下维护可能会影响正 ...

  6. 2018面向对象程序设计(Java)第10周学习指导及要求

    2018面向对象程序设计(Java)第10周学习指导及要求(2018.11.1-2018.11.4)  学习目标 理解泛型概念: 掌握泛型类的定义与使用: 掌握泛型方法的声明与使用: 掌握泛型接口的定 ...

  7. xm数据写入

    reshape有两个参数: 其中,参数:cn为新的通道数,如果cn = 0,表示通道数不会改变. 参数rows为新的行数,如果rows = 0,表示行数不会改变. 注意:新的行*列必须与原来的行*列相 ...

  8. 消息队列RabbitMQ与Spring

    1.RabbitMQ简介 RabbitMQ是流行的开源消息队列系统,用erlang语言开发.RabbitMQ是AMQP(高级消息队列协议)的标准实现. 官网:http://www.rabbitmq.c ...

  9. msf客户端渗透(一):payload利用简单示范

    针对Windows 开启侦听 查看payload选项 将1.exe传到网页上 win7访问网页并下载1.exe 下载好之后双击运行,在服务器端就获得了一个shell   针对linux 先获取到一个软 ...

  10. centos7.2 增加3T的XFS模式分区

    parted -l 查看分区情况与要分区的设备 # parted /dev/sda                   #选定要操作的硬盘     此时命令提示符会变成(parted)    (par ...