Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] PostGIS Database Connections

Hi Jody,

Jody Garnett wrote:
Thanks emily
1) The typeParam is not getting set correctly in the params.

In the DataConnectionPage.java the getParams() method calls this:
params.put(dialect().typeParam.key, (Serializable) dialect().typeParam.sample);

"dialect().typeParam.sample" returns null so the PostGIS connection is never created.

If I do this:
params.put(dialect().typeParam.key, "postgisng");
it solve one problem. Obviously this is not the correct way to deal with this problem.

I had also figured out about "postgisng" being required. The DBTYPE should be done for each subclass of JDBCNGFactory - but that seems to not be done. I will arrange a patch I guess But for now we can replace this with a hard coded "postgisng"; indeed I think I committed a change to that effect last night.

I think hard-coding for now will work for postgisng; however I believe this same code is used by the MySQL Server so my guess (without testing) is that the MySQL database connection won't work. Maybe I'll try to find a mysql database to test against.

I'm wondering if we need to add a getDatabaseType() function to the DatabaseServiceDialect in order to get the correct database type.

I think there is a protected method like that already...

Hmm I don't see it.  If there is we should use it.

2) The second problem exists in PostgisServiceExtensions2.java
The doOtherChecks method called this:
if( !DBTYPE.sample.equals(params.get(DBTYPE.key)) ){

which caused a null pointer exception as DBTYPE.sample is null. I'm not sure this check is necessary anymore.

Thanks I had not found this one - replacing with with "postgisng" and will try testing.

So if we can figure out the correct way to deal with problem (1) above I think we can have PostGIS database connections working. As an aside the postgis instance hosted at www.refractions.net is working again.

Great that is what I will test against; I did a change yesterday so that an error in connecting would actually appear in the wizard. Before it was being set; and then the warning about schemas not being available due to permissions replaced it.

That said I did manage to connect & view PostGIS data with the udig trunk.

Thanks!


Back to the top