Java Code Examples for com.microsoft.sqlserver.jdbc.SQLServerDataSource

The following examples show how to use com.microsoft.sqlserver.jdbc.SQLServerDataSource. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: dashbuilder   Source File: SQLServerTestSettings.java    License: Apache License 2.0 7 votes vote down vote up
@Override
public SQLDataSourceLocator getDataSourceLocator() {
    return new SQLDataSourceLocator() {
        public DataSource lookup(SQLDataSetDef def) throws Exception {
            String url = connectionSettings.getProperty("url");
            String user = connectionSettings.getProperty("user");
            String password = connectionSettings.getProperty("password");

            SQLServerDataSource ds = new SQLServerDataSource();
            ds.setURL(url);
            if (!StringUtils.isBlank(user)) {
                ds.setUser(user);
            }
            if (!StringUtils.isBlank(password)) {
                ds.setPassword(password);
            }
            return ds;
        }
    };
}
 
Example 2
@Override
public Class<? extends DataSource> dataSourceClassName() {
	return SQLServerDataSource.class;
}
 
Example 3
@Override
public Class<? extends DataSource> dataSourceClassName() {
	return SQLServerDataSource.class;
}
 
Example 4
Source Project: hibernate-master-class   Source File: AbstractTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Class<? extends DataSource> dataSourceClassName() {
    return SQLServerDataSource.class;
}