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.
Using netbeans-5_5-daily-bin-200609040000-ide-4_Sep_2006_0000: Databases -> New Driver -> Add -> sqljdbc.jar -> OK No Driver Class or Name is filled in. Click Find. Driver class is filled in correctly (com.microsoft.sqlserver.jdbc.SQLServerDriver). Still no name. Click OK. Select Driver -> Connect Using New Database Connection dialog appears. Note that no URL is filled in. Fill in URL, of form: jdbc:sqlserver://hostname:1433;DatabaseName=databasename;selectMethod=cursor; along with username, password. Click OK. Error dialog appears: "Unable to add connection, cannot establish a connection..... (Unable to find a suitable driver)" This problem occurs on the Mac, but not on Windows.
The recommended driver for MS SQL Server is jTDS, not Microsoft's driver. That's why the driver class is not detected and no driver name and database URL template are suggested. But it should be possible to connect, I will evaluate. Which version of the driver did you use? Please attach a link if possible.
The driver is for MS SQL 2005, right? I cannot reproduce the issue on Linux, will try on Mac.
Cannot reproduce on Mac either. Please start NetBeans with a clean userdir and with the -J-Dorg.netbeans.modules.db=0 parameter, reproduce the issue and attach your message log here.
Here it is. Downloaded driver from http://www.microsoft.com/downloads/details.aspx?FamilyId=6D483869-816A-44CB-9787-A866235EFC7C&displaylang=en Driver version is: Microsoft SQL Server 2005 JDBC Driver 1.1 Download filename is: sqljdbc_1.1.1501.101_enu.tar.gz (latest version, from one week ago) Wiped out userdir. Start up NB daily build netbeans-5_5-daily-bin-200609040000-ide-4_Sep_2006_0000 Added driver in the usual way. Classname is: com.microsoft.sqlserver.jdbc.SQLServerDriver Created connection in the usual way. I'm using a SQL Server 2000 server (which is supported by this driver). Specific server details available by email. Had to fill in URL by hand. Based on MS docs, it's: jdbc:sqlserver://hostname:1433;databaseName=databasename;selectMethod=cursor; Got the same error. Message log shows: [org.netbeans.modules.db.explorer.DatabaseConnection] connect() [org.netbeans.modules.db.runtime.DatabaseRuntimeManager] Runtime: org.netbeans.modules.derby.RegisterDerby for driver org.apache.derby.jdbc.ClientDriver [org.netbeans.modules.db.runtime.DatabaseRuntimeManager] Runtime: org.netbeans.modules.j2ee.sun.ide.j2ee.db.RegisterPointbase for driver com.pointbase.jdbc.jdbcUniversalDriver [org.netbeans.modules.db.explorer.DbDriverManager] Creating DbURLClassLoader[urls=[file:/Users/jdavidso/rave/misc/jdbc/microsoft/sqljdbc_1.1/enu/sqljdbc.jar]] INFORMATIONAL *********** Exception occurred ************ at 1:59 PM on Sep 7, 2006 java.sql.SQLException: Unable to find a suitable driver at org.netbeans.modules.db.explorer.DbDriverManager.createDriverNotFoundException(DbDriverManager.java:243) at org.netbeans.modules.db.explorer.DbDriverManager.getConnection(DbDriverManager.java:97) [catch] at org.netbeans.modules.db.explorer.DatabaseConnection$2.run(DatabaseConnection.java:500) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:932)
We're using Sun AS 9 for deployment, which supports the MS drivers but not jTDS. Is there a list somewhere of the recommended drivers? I looked around the site, but couldn't find one. In any case, both MS and jTDS drivers should probably work. Right now, they work at design time (except for the above Mac bug), but fail on deployment. The MS Driver on Windows fails in deployment, as reported in Bug #84405. The jTDS drivers fail in deployment, as reported in Bug #84391.
From the message log I can see the driver is loaded successfully, but its connect() method returns null. Are you sure you don't have any leading whitespace in the database URL? I added some more logging to the Database Explorer, please copy the attached module to <netbeans>/ide7/modules, reproduce the issue and attach the message log. BTW which JDK and version are you using? Please don't remove the INCOMPLETE keyword. I will as soon as I manage to reproduce the issue. Checking in src/org/netbeans/modules/db/explorer/DbDriverManager.java; /cvs/db/src/org/netbeans/modules/db/explorer/DbDriverManager.java,v <-- DbDriverManager.java new revision: 1.2.12.1.2.3; previous revision: 1.2.12.1.2.2 done
Created attachment 33718 [details] Database Explorer module
I'm not seeing the problem now. I haven't changed anything; didn't even load your revised module. I'll leave the bug open for the moment, but if the issue doesn't come back in the next day or so I'll close it.
Closing per desc9.