* <p>
* Should also test bug [1051595] jtdsDataSource connects only to
* localhost.
*/
public void testNormal() {
JtdsDataSource ds = new JtdsDataSource();
ds.setServerName(TestBase.props.getProperty(Messages.get(Driver.SERVERNAME)));
ds.setUser(TestBase.props.getProperty(Messages.get(Driver.USER)));
ds.setPassword(TestBase.props.getProperty(Messages.get(Driver.PASSWORD)));
ds.setDatabaseName(TestBase.props.getProperty(Messages.get(Driver.DATABASENAME)));
ds.setTds(TestBase.props.getProperty(Messages.get(Driver.TDS)));
ds.setServerType("2".equals(TestBase.props.getProperty(Messages.get(Driver.SERVERTYPE))) ? 2 : 1);
try {
ds.setPortNumber(Integer.parseInt(
TestBase.props.getProperty(Messages.get(Driver.PORTNUMBER))));
} catch (Exception ex) {
// Ignore
}
try {
Connection c = ds.getConnection();
assertNotNull(c);
c.close();
} catch (SQLException ex) {
ex.printStackTrace();
fail("SQLException caught: " + ex.getMessage() + " SQLState=" + ex.getSQLState());