db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stavros Kounis" <skou...@gmail.com>
Subject DerbyClient has problem with whitespaces in connection urls
Date Fri, 04 Aug 2006 09:39:44 GMT
hi all

Trying to create a dataset using BIRT report's designer i have faced a
problem related with white spaces in connection urls.

After digging a while
(see this bugzilla entry that describe the problem
https://bugs.eclipse.org/bugs/show_bug.cgi?id=152709)
we have find that is a driver related problem

for example the connection url
jdbc:derby://localhost:1527/C:\\Program
Files\\IBM\\Cloudscape_10.0\\demo\\databases\\toursDB

gives the "org.apache.derby.client.am.DisconnectException: The
application server
rejected establishment of the connection.  An attempt was made to access a
database, C:\Program, which was not found." error message

this not happened using embedded driver.

Demo code tha generate the problem:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class TestDeby
{
        public static void main( String[] args )
        {
                // TODO Auto-generated method stub
                String _driver = "org.apache.derby.jdbc.ClientDriver";
                String _server = "jdbc:derby://localhost:1527/C:\\Program
Files\\IBM\\Cloudscape_10.0\\demo\\databases\\toursDB";
                String _login = "root";
                String _pswd = "root";
                Connection conn = null;

                try
                {//1 setting to get the connection.
                        Class.forName( _driver );
                        conn = DriverManager.getConnection( _server, _login,
_pswd );
                }
                catch ( ClassNotFoundException e )
                {
                        e.printStackTrace( );
                }
                catch ( SQLException e )
                {
                        e.printStackTrace( );
                }
                finally
                {
                }

        }
}

When running the application the same exception
"org.apache.derby.client.am.DisconnectException: The application server
rejected establishment of the connection.  An attempt was made to access a
database, C:\Program, which was not found." is thrown.
So this bug is Driver's problem. I think you can try other driver or move the
data file to a path without white spaces like you have done.

Is there any roundtrip available ?

regards
stavros

-- 
Stavros S. Kounis
Osmosis networks & consulting   http://www.osmosis.gr
Read my weblog at               http://tools.osmosis.gr/blog

Mime
View raw message