Here you can find the source of executeResource(Connection con, String resource)
private static void executeResource(Connection con, String resource) throws IOException, SQLException
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.io.InputStream; import java.sql.Connection; import java.sql.SQLException; public class Main { private static void executeResource(Connection con, String resource) throws IOException, SQLException { InputStream ins = Thread.currentThread().getContextClassLoader() .getResourceAsStream(resource); byte[] b = new byte[ins.available()]; ins.read(b);//from ww w . j a v a2 s . co m con.createStatement().execute(new String(b)); } }