public synchronized XADataSource getDataSource (String dbName, boolean create) throws SQLException
{
try
{
XaDataSource xads = (COM.cloudscape.core.XaDataSource) DataSourceFactory.getXADataSource();
int index1 = dbName.indexOf(cloudscape_3_6.driverName);
if (index1 == -1)
throw new SQLException("cloudscape_3_6.getDataSource - "+jdbcLogger.logMesg.getString("com.arjuna.ats.internal.jdbc.drivers.invaliddb")+" Cloudscape");
else
{
/*
* Strip off any spurious parameters.
*/
int index2 = dbName.indexOf(cloudscape_3_6.semicolon);
String theDbName = null;
if (index2 == -1)
{
theDbName = dbName.substring(index1+cloudscape_3_6.driverName.length());
}
else
{
theDbName = dbName.substring(index1+cloudscape_3_6.driverName.length(),index2);
}
/*
* At present cloudscape does not allow remote
* XA connections. So, we know the thing after the :
* in the 'url' must be the database name. If this
* restriction changes, we'll need to determine the
* server name, port, and database name some other
* way.
*/
xads.setDatabaseName(theDbName);
if (create)
xads.setCreateDatabase("create");
return (XADataSource) xads;
}
}
catch (SQLException e1)