SQL Server connection bug [SEC=UNCLASSIFIED]

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SQL Server connection bug [SEC=UNCLASSIFIED]

Steve Cameron

Hello,

 

I think the SQLServerDataStoreFactory class in Geotools has a problem. This might explain why I cannot connect to the DB from uDig.

 

(1) The test class org.geotools.data.sqlserver.SQLServerTestSetup has the line:

 

fixture.put("password", "geotools");

 

It should be :

 

fixture.put("passwd", "geotools");

 

I’m trying to find where this param is set inside udig to see if it’s wrong there as well.

 

 

 

Stephen Cameron

Antarctic Fisheries Computing and Database Support Provider

Australian Antarctic Division

Kingston, Tasmania

 

EmailSig (2)

Phone: 03 62323571

 

___________________________________________________________________________

    Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not the
intended recipient, you are notified that use or dissemination of this communication is
strictly prohibited by Commonwealth law. If you have received this transmission in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and
DELETE the message.
        Visit our web site at http://www.antarctica.gov.au/
___________________________________________________________________________


_______________________________________________
udig-users mailing list
[hidden email]
http://lists.refractions.net/mailman/listinfo/udig-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Server connection bug [SEC=UNCLASSIFIED]

Andrea Antonello
Hi Steve,
directing this in the developer's list, since there you might find more help. Let's discuss this there.


 

I think the SQLServerDataStoreFactory class in Geotools has a problem. This might explain why I cannot connect to the DB from uDig.

 

(1) The test class org.geotools.data.sqlserver.SQLServerTestSetup has the line:

 

fixture.put("password", "geotools");

 

It should be :

 

fixture.put("passwd", "geotools");

 

I’m trying to find where this param is set inside udig to see if it’s wrong there as well.



That is a good question. In fact I assume you are using the SQL Server connection as of Import->Datastore->Microsoft SQL Server
Right?

That means that the proper connection classes are extracted from geotools and you will not find any SQLServerDataStoreFactory 
written anywhere.

But you might be able to catch some exception that maybe isn't being trapped.
The plugin you are looking for is (Jody please jump in) net.refractions.udig.catalog.geotools
which handles all the geotools supported datasets, supplying an autogenerated gui.

So if you debug after the connection is done, you might be able to catch something.

I am in a real rush,so tale the following with caution :)

I guess the gui is built in: net.refractions.udig.catalog.geotools.data.DataStoreParameterPage

There is an internal class that tests for the connection: net.refractions.udig.catalog.geotools.data.DataStoreParameterPage.TestConnection
That might be a good place to lurk with a breakpoint.

Hope that get's you a bit further.


Good luck,
Andrea












 

 

 

 

Stephen Cameron

Antarctic Fisheries Computing and Database Support Provider

Australian Antarctic Division

Kingston, Tasmania

 

EmailSig (2)

Phone: 03 62323571

 

___________________________________________________________________________

    Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not the
intended recipient, you are notified that use or dissemination of this communication is
strictly prohibited by Commonwealth law. If you have received this transmission in error,
please notify the sender immediately by e-mail or by telephoning <a href="tel:%2B61%203%206232%203209" value="+61362323209" target="_blank">+61 3 6232 3209 and
DELETE the message.
        Visit our web site at http://www.antarctica.gov.au/
___________________________________________________________________________


_______________________________________________
udig-users mailing list
[hidden email]
http://lists.refractions.net/mailman/listinfo/udig-users



_______________________________________________
udig-users mailing list
[hidden email]
http://lists.refractions.net/mailman/listinfo/udig-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Server connection bug [SEC=UNCLASSIFIED]

Jody Garnett-2
Good evening:

I am afraid I do not have an SQL Server to test against.

The geotools docs are here:
- http://docs.geotools.org/latest/userguide/library/jdbc/sqlserver.html

Could you write a quick test case or java program to confirm you are able to connect using GeoTools?

The SQL Server plugin is supported plugin in GeoTools so we can ask for help once we confirm we are able to connect.
That is a good question. In fact I assume you are using the SQL Server connection as of Import->Datastore->Microsoft SQL Server
Right?

That means that the proper connection classes are extracted from geotools and you will not find any SQLServerDataStoreFactory 
written anywhere.
That is correct  - the class is DataStoreService; and the toDataAccess method is responsible for connecting.


    public synchronized DataAccess< ? , ? > toDataAccess() throws IOException {
        if (dataStore == null) {
            // connect!
            try {
                dataStore = factory.createDataStore(connectionParams);
            } catch (IOException e) {
                message = e;
                throw e;
            }
        }
        return dataStore;
    }

I guess the gui is built in: net.refractions.udig.catalog.geotools.data.DataStoreParameterPage

There is an internal class that tests for the connection: net.refractions.udig.catalog.geotools.data.DataStoreParameterPage.TestConnection
That might be a good place to lurk with a breakpoint.
 Reviewing.

    private final class TestConnection implements IRunnableWithProgress {
        private boolean isConnected;
        public void run( IProgressMonitor monitor ) throws InvocationTargetException,
                InterruptedException {
            isConnected = false;
            DataAccessFactory factory = getPreviousPage().getFactory();
            connectionParameters = getParams();

            if (factory.canProcess(connectionParameters)) {
                try {
                    factory.createDataStore(connectionParameters);
                    isConnected = true;
                } catch (IOException e) {
                    setErrorMessage(e.toString());
                }
            }
        }
        public boolean isConnected() {
            return isConnected;
        }
    }

Looks like that will set the error message if there is any problem connecting. So if you are able to make it past this screen we should be good to go.

Jody



_______________________________________________
udig-users mailing list
[hidden email]
http://lists.refractions.net/mailman/listinfo/udig-users