Methods Summary |
---|
public boolean | acceptsURL(java.lang.String url)
// Check on the supplied String...
if (url == null) {
return false;
}
// Everything's fine if the quoted url starts with the base url for this
// driver
if (url.startsWith(baseURL)) {
return true;
}
return false;
|
public java.sql.Connection | connect(java.lang.String url, java.util.Properties info)
// Does the URL have the right form?
if (this.acceptsURL(url)) {
// The datasource name is the remainder of the url after the ":"
String datasource = url.substring(baseURL.length() + 1);
for (String element : dataSources) {
if (datasource.equals(element)) {
/*
* Check for user and password, except for datasource =
* data1 which is set up not to require a user/password
* combination
*/
if (datasource.equals("data1")) {
// do nothing...
} else {
if (info == null) {
throw new SQLException("Properties bundle is null");
}
String user = (String) info.get(userProperty);
String password = (String) info.get(passwordProperty);
if (user == null || password == null) {
throw new SQLException("Userid and/or password not supplied");
}
if (!user.equals(validuser) || !password.equals(validpassword)) {
throw new SQLException("Userid and/or password not valid");
} // end if
} // end if
// It all checks out - so return a connection
Connection connection = new TestHelper_Connection1();
return connection;
} // end if
} // end for
} // end if
return null;
|
public int | getMajorVersion()
return majorVersion;
|
public int | getMinorVersion()
return minorVersion;
|
public java.sql.DriverPropertyInfo[] | getPropertyInfo(java.lang.String url, java.util.Properties info)
DriverPropertyInfo[] theInfos = { new DriverPropertyInfo(userProperty, "*"),
new DriverPropertyInfo(passwordProperty, "*"), };
return theInfos;
|
public boolean | jdbcCompliant()
// Basic version here returns false
return false;
|