This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
1. Add MS SQL Server connection. I used: jdbc:sqlserver://rave-db:1433;DatabaseName=master;SelectMethod=cursor 2. Create project. Add 'Table' component to the page. 3. Click table from DB and then click on 'Table' component on the page. Result: Exception arises. And 'Table' component is not bound to DB. If I click on the page, then RowSet and DataProvider are created, but when I tried bound table to DataProvider it was RED.
Created attachment 42060 [details] IDE's log
is there a datasource created under Data Source References node. and if so, what is the name generated ?
Datasource's name is 'dbo_MicrosoftSQLServer'. DB's schema is called 'dbo'.
I reproduced the problem, using a database here. URL: jdbc:sqlserver://rave-cheetah.sfbay.sun.com:1433;DatabaseName=travel;SelectMethod=cursor The failure occurs because the method DesignTimeDatasource.getConnection() cannot find a connection. That happens because of a mismatch: The URL property of the DesignTimeDatasource is set to: jdbc:sqlserver://jdbc:sqlserver://rave-cheetah.sfbay.sun.com:1433 But, the URL for the appropriate connection is: jdbc:sqlserver://rave-cheetah.sfbay.sun.com:1433;DatabaseName=travel;SelectMethod=cursor So, no match is found. I think the URL of the DesignTimeDataSource is wrong. John, does this look like something in your area?
it appears the serverplugin is failing to add any datasources to the project. More evaluation is needed.
it appears the serverplugin is failing to add any datasources to the project. More evaluation is needed. Will investigate for M10 and release note for M9 A workaroud is to use the jTDS driver http://sourceforge.net/project/showfiles.php?group_id=33291
Per discussion with John and Jayashri, this is not a show-stopper for M9. One workaround is to use jTDS. The problem may lie in the MS driver, or in the serverplugin module, or both. If possible, we should be able to add a driver-specific workaround. Expect to have something for M10.
Release note added
workaround found, P1->P2
I confirmed that - this is still an issue in M10; - jTDS is still a valid workaround The problem is that we end up with mismatched URL's, as the earlier message indicates. We create a datasource with URL: jdbc:sqlserver://rave-cheetah.sfbay.sun.com:1433;DatabaseName=travel;SelectMethod=cursor But later on we find one with URL: jdbc:sqlserver://rave-cheetah.sfbay.sun.com:1433 I.e., truncated. Assigning the John B to investigate, since it's a datasource issue.
Issues with target release should be resolved for the milestone. This was marked as target release M10 then reassigned to me after M10 had been released
previous evaluation was incorrect. metadata is null. The url property of dataSource and connection are actually set correctly in DatabaseMetaData (jdbc:sqlserver://rave-cheetah.sfbay.sun.com:1433;DatabaseName=travel;SelectMethod=cursor) connection is set on line 439 of DatabaseMetaData via: connection = dataSource.getConnection(); but the statement below on line 444, to retrieve the metadata fails: metaData = getConnection().getMetaData(); In DatabaseMetaData.getTablesInternal(...) , the metadata property of the resultset is null This appears to be a driver issue and we may not be able to do anything about this. Handing back to Jim
Not a driver problem; the driver returns an instance of SQLServerDatabaseMetadata, as it should. Looks like a server plugin problem. My previous analysis stands. We create a datasource (via ProjectDataSourceManager.addDataSource()) with the url: "jdbc:sqlserver://rave-cheetah.sfbay.sun.com:1433;DatabaseName=travel;SelectMethod=cursor" When we retrieve the datasources (via ProjectDataSourceManager.getDataSourceWithName()), we get back one with the url: "jdbc:sqlserver://rave-cheetah.sfbay.sun.com:1433" -- i.e., missing DatabaseName and SelectMethod. They are also missing from the sunresources.xml file. Because of this, the DesignTimeDataSource (which tests the URLs for equality) cannot find a connection that matches the datasource, so the call to getMetaData() returns null. Solution is to figure out why the URL is being munged. This didn't happen in 5.5 (with the same drivers), and it doesn't happen with jTDS. Assigning back to John, to get this fixed. May require a fix from the server plugin people.
This prevents using MSSQL Server driver with visualweb applications. The data source may not be getting created successfully since the url appears as munged when retrieved using // Attempt to create a data source that has a JDBC URL "jdbc:sqlserver://rave-cheetah.sfbay.sun.com:1433;DatabaseName=travel;SelectMethod=cursor" J2eeModuleProvider jmp = (J2eeModuleProvider)project.getLookup().lookup(J2eeModuleProvider.class); jmp.getConfigSupport().createDatasource(req.getResourceName(), req.getUrl(), req.getUsername(), req.getPassword(), req.getDriverClassName()); // here in the createDatasource, the url is passed in as "jdbc:sqlserver://rave-cheetah.sfbay.sun.com:1433;DatabaseName=travel;SelectMethod=cursor" // later on when retrieving the data source... J2eeModuleProvider jmp = (J2eeModuleProvider)p.getLookup().lookup(J2eeModuleProvider.class); Set<Datasource> dss = null; try { dss = jmp.getServerDatasources(); } catch (ConfigurationException e) { dss = new HashSet<Datasource>(); // TODO: give some feedback to the user } Set<RequestedJdbcResource> reqDss = new HashSet<RequestedJdbcResource>(); Iterator<Datasource> it = dss.iterator(); while (it.hasNext()) { Datasource ds = it.next(); RequestedJdbcResource r = new RequestedJdbcResource(ds.getJndiName(),ds.getDriverClassName(), ds.getUrl(), null, ds.getUsername(), ds.getPassword(), null); reqDss.add(r); } ds.getUrl() returns the url munged as "jdbc:sqlserver://rave-cheetah.sfbay.sun.com:1433" Set<Datasource> dss = null; try { dss = jmp.getModuleDatasources(); } catch (ConfigurationException e) { dss = new HashSet<Datasource>(); // TODO: give some feedback to the user } Set<RequestedJdbcResource> reqDss = new HashSet<RequestedJdbcResource>(); Iterator<Datasource> it = dss.iterator(); while (it.hasNext()) { Datasource ds = it.next(); RequestedJdbcResource r = new RequestedJdbcResource(ds.getJndiName(),ds.getDriverClassName(), ds.getUrl(), null, ds.getUsername(), ds.getPassword(), null); reqDss.add(r); }
Note MSSQL server worked fine with visualweb in previous releases. 5.5 and 5.5.1
Extended logic to create server resources and construct DataSource elements for IDE. Plugin now adds url and driverClass property elements for all connection poolelements created by zero-config and uses these when constructing DataSource elements for IDE http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/DomainEditor.java?r1=1.5&r2=1.6 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/beans/ResourceConfigurator.java?r1=1.18&r2=1.19 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/beans/ResourceUtils.java?r1=1.24&r2=1.25 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/sunresources/beans/WizardConstants.java?r1=1.9&r2=1.10
Verified with build 070803.
*** Issue 76686 has been marked as a duplicate of this issue. ***