Bug #3554 Driver doesn't accept empty database parameter
Submitted: 24 Apr 2004 10:12 Modified: 24 Apr 2004 10:51
Reporter: Teemu Kuulasmaa
Status: Closed
Category:Connector/J Severity:S2 (Serious)
Version:3.1-nightly-2004042 OS:Microsoft Windows (windows)
Assigned to: Target Version:

[24 Apr 2004 10:12] Teemu Kuulasmaa
Description:
Hi

I am developing GUI database manager and I need to connect mysql database by using empty
database parameter. Today I downloaded nightly snapshot and unfortunately it did't work
like earlier versions. The snapshot produces SQLException if I do not specify database in
connection string. This is new bug in Connector/J 3.1-nightly-2004042. I have succesfully
used earlier versions of Connector/J 3.0.10 and 3.1.1-alpha.

Teemu

Stacktrace:
------------

java.sql.SQLException: Malformed URL
'jdbc:mysql://localhost:3306/?user=root&password=root&maxRows=0&profileSQL=false&connectTi
meout=60000&allowLoadLocalInfile=true&continueBatchOnError=true&strictUpdates=true&useComp
ression=false&paranoid=true&allowMultiQueries=true&requireSSL=false&useSSL=false&socketTim
eout=0&useUnicode=false&characterEncoding&useTimezone=false'.
	at com.mysql.jdbc.Connection.<init>(Connection.java:373)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:218)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at org.myconnector.db.MyDataSource.connect(MyDataSource.java:260)
	at
org.myconnector.gui.swing.db.DataSourceTree.connectDataSource(DataSourceTree.java:610)
	at
org.myconnector.gui.swing.db.DataSourcesTree$ConnectDBAction.actionPerformed(DataSourcesTr
ee.java:496)
	at
org.myconnector.gui.swing.db.DataSourcesTree$TreeMouseHandler.mouseClicked(DataSourcesTree
.java:431)
	

How to repeat:
Just try to connect without specifying database parameter in connection string:
            
Connection conn =
DriverManager.getConnection("jdbc:mysql://localhost/?user=monty&password=greatsqldb");
[24 Apr 2004 10:51] Mark Matthews
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html