Exemplo n.º 1
0
 public static void execute(DataSource dataSource, String sql, List<Object> parameters)
     throws SQLException {
   Connection conn = null;
   try {
     conn = dataSource.getConnection();
     execute(conn, sql, parameters);
   } finally {
     close(conn);
   }
 }
Exemplo n.º 2
0
 public static void insertToTable(Connection conn, String tableName, Map<String, Object> data)
     throws SQLException {
   String sql = makeInsertToTableSql(tableName, data.keySet());
   List<Object> parameters = new ArrayList<Object>(data.values());
   execute(conn, sql, parameters);
 }
Exemplo n.º 3
0
 public static void execute(DataSource dataSource, String sql, Object... parameters)
     throws SQLException {
   execute(dataSource, sql, Arrays.asList(parameters));
 }