db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shreyas Kaushik <Shreyas.Kaus...@Sun.COM>
Subject Re: [jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource
Date Wed, 05 Jan 2005 13:14:01 GMT
Can someone please add comments here for this issue. If people are ok
with the way it is currently behaving we can go ahead with the proposed
solution that I have suggested in one of my previous comments.


Shreyas Kaushik (JIRA) wrote:
>      [ http://nagoya.apache.org/jira/browse/DERBY-95?page=comments#action_57065 ]
> Shreyas Kaushik commented on DERBY-95:
> --------------------------------------
> The getConnection() method returns null because the url is of the format as shown below:
> "jdbc:derby:jdbc:derby:databaseName=testdb".
> As said in my previous comment it treats the entire string passed to the setDatabaseName
as a valid database and tries to establish a connection to that. The url is built in the update()
method in the EmbeddedXADataSource.java where it just appends the databaseName that is set
previously to the Protocol string, hence the error.
>    So we need to figure out what needs to be done here, specify/document that a valid
databaseName should be passed to the setDatabaseName() if it is not passed a SQLException
is thrown saying no DB exists. Alternatively, try and verify/ validate whatever is passed
as argument( i feel the first approach is the way to go ) and take action accordingly.
>   In the second case the extra effort of validation is required.
>>NPE when passing in url instead of database name to EmbeddedXADataSource
>>         Key: DERBY-95
>>         URL: http://nagoya.apache.org/jira/browse/DERBY-95
>>     Project: Derby
>>        Type: Bug
>>  Components: JDBC
>>    Reporter: Myrna van Lunteren
>>    Priority: Minor
>>     Fix For:
>>When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g.
mydb) the XADataSource gives a NullPointerException.
>>It should either handle this a little more gracefully & give an error, or accept
the url (like EmbeddedDataSource does).

View raw message