com.mars.mj.helper.DBHelper Maven / Gradle / Ivy
package com.mars.mj.helper;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.mars.core.constant.MarsConstant;
import com.mars.jdbc.util.JdbcConfigUtil;
import java.lang.reflect.Method;
import java.sql.*;
import java.util.*;
/**
* JDBC连接帮助类
*/
public class DBHelper {
/**
* 数据源对象集合
*/
private static Map druidDataSources;
/**
* sql语句预编译处理接口
*/
private static PreparedStatement preparedStatement;
/**
* sql语句处理接口
*/
private static Statement statement;
/**
* 默认数据源名称
*/
private static String defaultDataSourceName;
public static String getDefaultDataSourceName(){
return defaultDataSourceName;
}
/**
* 无条件查询
*
* @param sql sql语句
* @param connection 数据库连接
* @return 结果集
* @throws Exception
*/
public static List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy