package cz.hsrs.db.util;

import java.sql.ResultSet;
import java.sql.SQLException;

import cz.hsrs.db.pool.SQLExecutor;

public class TestUtil {
   /**
     * Test utilization method to select given query
     * @param query
     * @return
     * @throws SQLException
     */
    public static String testQuery(String query) throws SQLException{
        ResultSet res = SQLExecutor.getInstance().executeQuery(query); 
        if(res.next()){
            String resp = res.getString(1);
            return resp;
        }
        else{
            throw new SQLException("There is not any query!");
        }
        
    }
}