Java DataSource executeQuery(DataSource dataSource, String... queries)

Here you can find the source of executeQuery(DataSource dataSource, String... queries)

Description

execute Query

License

Open Source License

Declaration

private static void executeQuery(DataSource dataSource, String... queries) throws Exception 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import javax.sql.DataSource;
import java.sql.Connection;

import java.sql.Statement;

public class Main {
    private static void executeQuery(DataSource dataSource, String... queries) throws Exception {
        Connection conn = dataSource.getConnection();
        Statement stmt = conn.createStatement();
        for (String query : queries) {
            stmt.execute(query);/*from  w  w  w. j av a  2  s .  co m*/
        }
        conn.close();
    }
}

Related

  1. createTables(final DataSource ds)
  2. doInsert(DataSource ds, String tableName, int id, String value)
  3. doSelect(DataSource ds, String tableName, int id)
  4. execute(DataSource ds, String sql, Object... args)
  5. execute(String execute, DataSource datasource)
  6. getConnection(CommonDataSource dataSource)
  7. getConnection(DataSource dataSource)
  8. getConnection(final DataSource ds, final boolean autoCommit)
  9. getConnectionFromDataSource(DataSource ds)