Search in sources :

Example 1 with WMIService

use of org.jkiss.wmi.service.WMIService in project dbeaver by serge-rider.

the class WMIDataSource method initialize.

@Override
public void initialize(@NotNull DBRProgressMonitor monitor) throws DBException {
    final DBPConnectionConfiguration connectionInfo = container.getActualConnectionConfiguration();
    try {
        WMIService service = WMIService.connect(connectionInfo.getServerName(), connectionInfo.getHostName(), connectionInfo.getUserName(), connectionInfo.getUserPassword(), null, connectionInfo.getDatabaseName());
        this.rootNamespace = new WMINamespace(null, this, connectionInfo.getDatabaseName(), service);
    } catch (UnsatisfiedLinkError e) {
        throw new DBException("Can't link with WMI native library", e);
    } catch (Throwable e) {
        throw new DBException("Can't connect to WMI service", e);
    }
}
Also used : DBPConnectionConfiguration(org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration) DBException(org.jkiss.dbeaver.DBException) WMIService(org.jkiss.wmi.service.WMIService)

Aggregations

DBException (org.jkiss.dbeaver.DBException)1 DBPConnectionConfiguration (org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration)1 WMIService (org.jkiss.wmi.service.WMIService)1