Here you can find the source of resetTestDB()
protected static void resetTestDB()
//package com.java2s; /*// w w w .j ava 2 s. c o m * Wegas * http://wegas.albasim.ch * * Copyright (c) 2013 School of Business and Engineering Vaud, Comem * Licensed under the MIT License */ import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; public class Main { private static Connection connection = null; protected static void resetTestDB() { if (connection == null) { try { connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/wegas_test", "user", "1234"); try (Statement st = connection.createStatement()) { st.execute("DROP SCHEMA public CASCADE;"); st.execute("CREATE SCHEMA public;"); } connection.commit(); } catch (SQLException ex) { System.out.println("Error creating database"); } } } }