}
private Connection clientConnection(String hostName, int portNo, String dbPath)
throws SQLException, ClassNotFoundException, IllegalAccessException,
InstantiationException
{
ClientDataSourceInterface ds;
if (JDBC.vmSupportsJNDI()) {
ds = (ClientDataSourceInterface)Class.forName(
"org.apache.derby.jdbc.ClientDataSource").newInstance();
} else {
ds = new BasicClientDataSource40();
}
ds.setDatabaseName(dbPath);
ds.setServerName(hostName);
ds.setPortNumber(portNo);
// ds.setConnectionAttributes(useEncryption(false));
return ds.getConnection();
}