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.

Bug 84404 - Mac: Unable to use MS SQLServer driver at design time
Summary: Mac: Unable to use MS SQLServer driver at design time
Status: RESOLVED INVALID
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: Macintosh All
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-07 04:48 UTC by _ jimdavidson
Modified: 2007-10-25 13:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Database Explorer module (1013.59 KB, application/octet-stream)
2006-09-08 12:41 UTC, Andrei Badea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ jimdavidson 2006-09-07 04:48:02 UTC
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.
Comment 1 Andrei Badea 2006-09-07 13:15:40 UTC
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.
Comment 2 Andrei Badea 2006-09-07 16:36:53 UTC
The driver is for MS SQL 2005, right? I cannot reproduce the issue on Linux,
will try on Mac.
Comment 3 Andrei Badea 2006-09-07 16:47:29 UTC
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.
Comment 4 _ jimdavidson 2006-09-07 22:01:47 UTC
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)
Comment 5 _ jimdavidson 2006-09-07 22:36:21 UTC
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.
Comment 6 Andrei Badea 2006-09-08 12:40:41 UTC
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
Comment 7 Andrei Badea 2006-09-08 12:41:24 UTC
Created attachment 33718 [details]
Database Explorer module
Comment 8 _ jimdavidson 2006-09-12 21:57:24 UTC
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.
Comment 9 Andrei Badea 2007-10-25 13:58:40 UTC
Closing per desc9.