修改注释

master
星期八 5 years ago
parent 85f98a6734
commit 2c206f7859
  1. 4
      panda-code/src/main/java/org/panda/code/uitl/RSAUtils.java
  2. 3
      panda-jdbc/src/main/java/org/panda/jdbc/BeanHander.java
  3. 3
      panda-jdbc/src/main/java/org/panda/jdbc/JdbcLoad.java
  4. 8
      panda-jdbc/src/main/java/org/panda/jdbc/JdbcUtils.java
  5. 15
      pom.xml

@ -31,7 +31,7 @@ public class RSAUtils {
/** /**
* 默认字符集编码 utf-8 * 默认字符集编码 utf-8
*/ */
public static final String DEFALUT_CHART="utf-8"; public static final String DEFAULT_CHART="utf-8";
/** /**
@ -82,7 +82,7 @@ public class RSAUtils {
RSAPublicKey pubKey = (RSAPublicKey) KeyFactory.getInstance(ALGORITHM_RSA).generatePublic(new X509EncodedKeySpec(decoded)); RSAPublicKey pubKey = (RSAPublicKey) KeyFactory.getInstance(ALGORITHM_RSA).generatePublic(new X509EncodedKeySpec(decoded));
Cipher cipher = Cipher.getInstance(ALGORITHM_RSA); Cipher cipher = Cipher.getInstance(ALGORITHM_RSA);
cipher.init(Cipher.ENCRYPT_MODE,pubKey); cipher.init(Cipher.ENCRYPT_MODE,pubKey);
String outStr = Base64.getEncoder().encodeToString(cipher.doFinal(str.getBytes(DEFALUT_CHART))); String outStr = Base64.getEncoder().encodeToString(cipher.doFinal(str.getBytes(DEFAULT_CHART)));
return outStr; return outStr;
} }

@ -25,11 +25,8 @@ public class BeanHander implements ResultSetHandler {
@Override @Override
public Object handler(ResultSet rs) { public Object handler(ResultSet rs) {
try { try {
Object bean = BeanUtil.instantiateClass(clazz); Object bean = BeanUtil.instantiateClass(clazz);
List<Field> fieldList = BeanUtil.getAllField(clazz); List<Field> fieldList = BeanUtil.getAllField(clazz);
for (Field f:fieldList){ for (Field f:fieldList){
String fieldName = f.getName(); String fieldName = f.getName();
String columnName = BeanSqlUtil.caseToHump(fieldName); String columnName = BeanSqlUtil.caseToHump(fieldName);

@ -31,6 +31,9 @@ public class JdbcLoad {
loadDriver(); loadDriver();
} }
/**
* 加载驱动类
*/
private void loadDriver(){ private void loadDriver(){
try { try {
Class.forName(this.driver); Class.forName(this.driver);

@ -1,5 +1,6 @@
package org.panda.jdbc; package org.panda.jdbc;
import com.sun.xml.internal.bind.v2.TODO;
import org.panda.code.uitl.PropsUtil; import org.panda.code.uitl.PropsUtil;
import org.panda.code.uitl.StringUtil; import org.panda.code.uitl.StringUtil;
import org.panda.jdbc.helper.DbConfigInterface; import org.panda.jdbc.helper.DbConfigInterface;
@ -21,7 +22,9 @@ public class JdbcUtils {
* 线程安全 * 线程安全
*/ */
private static final ThreadLocal<Connection> CONNECTION_HOLDER = new ThreadLocal<>(); private static final ThreadLocal<Connection> CONNECTION_HOLDER = new ThreadLocal<>();
/**
* 数据源
*/
private DataSource dataSource; private DataSource dataSource;
public JdbcUtils(DataSource dataSource){ public JdbcUtils(DataSource dataSource){
@ -143,7 +146,6 @@ public class JdbcUtils {
/** /**
* 创建表 * 创建表
*
* @param sql * @param sql
*/ */
public void createTable(String sql) { public void createTable(String sql) {
@ -169,7 +171,6 @@ public class JdbcUtils {
/** /**
* 查询 * 查询
*
* @param sql * @param sql
* @param params * @param params
* @param rsh * @param rsh
@ -201,7 +202,6 @@ public class JdbcUtils {
* @param st * @param st
* @param rs * @param rs
*/ */
public void release(Connection conn, Statement st, ResultSet rs) { public void release(Connection conn, Statement st, ResultSet rs) {
if (rs != null) { if (rs != null) {
try { try {

@ -70,20 +70,7 @@
</dependencies> </dependencies>
<build> <build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build> </build>
<distributionManagement> <distributionManagement>

Loading…
Cancel
Save