throws java.sql.SQLException {
java.sql.Connection rc = null;
// resource is expected to be com.sun.appserv.jdbc.DataSource
if (resource instanceof DataSource) {
DataSource ds = (DataSource)resource;
if (username == null) {
rc = ds.getNonTxConnection();
} else {
rc = ds.getNonTxConnection(username, password);
}
} else {
throw new JDOFatalInternalException(I18NHelper.getMessage(
messages, "ejb.SunTransactionHelper.wrongdatasourcetype", //NOI18N
resource.getClass().getName()));