Here you can find the source of executeQuery(DataSource dataSource, String... queries)
private static void executeQuery(DataSource dataSource, String... queries) throws Exception
//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(); } }