Here you can find the source of getResultSetFromQueryAgainstDefaultConnection( String sql)
public static ResultSet getResultSetFromQueryAgainstDefaultConnection( String sql) throws SQLException
//package com.java2s; /*/*from w ww.jav a 2s . co m*/ * (C) Copyright IBM Corp. 2011 * * LICENSE: Eclipse Public License v1.0 * http://www.eclipse.org/legal/epl-v10.html */ import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static ResultSet getResultSetFromQueryAgainstDefaultConnection( String sql) throws SQLException { Connection c = getDefaultDerbyConnection(); // System.out.println(sql); ResultSet rs = c.createStatement().executeQuery(sql); return rs; } public static Connection getDefaultDerbyConnection() throws SQLException { return DriverManager.getConnection("jdbc:default:connection"); //, getGaianNodeUser(), getGaianNodePassword()); // return DriverManager.getConnection("jdbc:derby://localhost:6414/gaiandb", getGaianNodeUser(), getGaianNodePassword()); } }