If I have a remotly hosted database and I'm using either the ODBC or JConnectors to access it, how secure are those connections? Can I setup a SSL link? How would I do that?
i'm using:
i'm using:
Code:
public void makeConnection (String url, String userName, String passWord) throws DbException{
if (url.equalsIgnoreCase("")){
throw new DbException(4, "DbConnector", "getConnection", "No URL specified. Unable to connect.", null);
}
try {
// Load Sun's jdbc-odbc driver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
} catch (ClassNotFoundException cnfea){ // driver not found
DbException my = new DbException(0, "DbConnector", "getConnection",
"ClassNotFoundException. Cause/message: " +
cnfea.getCause() + "/" + cnfea.getMessage(), null);
throw new DbException(1, "DbConnector", "getConnection", "ODBC: Unable to load database driver.", my);
} catch (InstantiationException ie2){
DbException my = new DbException(0, "DbConnector", "getConnection",
"InstantiationException. Cause/message: " +
ie2.getCause() + "/" + ie2.getMessage(), null);
throw new DbException(2, "DbConnector", "getConnection", "Instatiation exception on ODBC driver.", my);
} catch (IllegalAccessException iae2){
DbException my = new DbException(0, "DbConnector", "getConnection",
"IllegalAccessException. Cause/message: " +
iae2.getCause() + "/" + iae2.getMessage(), null);
throw new DbException(3, "DbConnector", "getConnection", "Failed to load driver.", my);
}
// driver has been loaded - attempting to gain connection to DB
try {
connector = DriverManager.getConnection("jdbc:odbc:" + url,
userName, passWord);
} catch (SQLException sqle){
DbException my = new DbException(0, "DbConnector", "getConnection",
"SQLException. State/error/message: " +
sqle.getSQLState() + "/" + sqle.getErrorCode()+ "/" + sqle.getMessage(), null);
throw new DbException(4, "DbConnector", "getConnection", "Failed to get connection.", my);
}
}