Re: [OpenMap Users] accessing mysql using dblocationhandler, adding it on the layer menu, and rendering pts.

From: Don Dietrick <dietrick_at_bbn.com>
Date: Fri, 18 Jan 2008 16:17:17 -0500

Hi Ted,

There is a com.bbn.openmap.layer.mysql package that might work better
for you that does the spatial query and displays the results from the
database.

For the DBLocationHandler, there's a little work for you to do to make
the query match your data table.

The DBLocationHandler, by default, uses the LocationData object to
read the result set from the query. It expects that this statement
was sent to the database:

select CITY (string), STATE (string), GRAPHIC (string, url or graphic
name), LATITUDE (float), LONGITUDE (float) from LOCATION_TABLE
(tablename where data is stored)

This is the string (without the (string) stuff, of course...) that
needs to go in the properties file. If you want to change the number/
order of result contents in the query, you'll need to extend the
DBLocationHandler and override the createData() method to use a object
like LocationData that knows how to take the result set from your
query and create Location objects out of it.

Hope this helps,

Don

On Jan 18, 2008, at 3:28 PM, theodore.wong_at_comcast.net wrote:

> Hi,
>
> I'm trying to connect to mysql using dblocationhandler. I place the
> in the openmap.properties
> but it gives me a "cannot create" reply at run time.
>
> # In the section for the LocationLayer:
> locationLayer.locationHandlers=dblocationhandler
>
>
> dblocationhandler
> .class=com.bbn.openmap.layer.location.db.DBLocationHandler
> dblocationhandler.locationColor=FF0000
> dblocationhandler.nameColor=008C54
> dblocationhandler.showNames=false
> dblocationhandler.showLocations=true
> dblocationhandler.jdbcDriver=oracle.jdbc.driver.OracleDriver
> dblocationhandler.jdbcString=jdbc login string
> dblocationhandler.userName=username
> dblocationhandler.userPassword=password
> dblocationhandler.locationQueryString="select * from table"
> Does anyone know if this is all that's required to access the data?
> And, how do I add this to the layers menu like the "cities" layer?
>
> Thanks,
>
> Ted

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick_at_bbn.com
BBN Technologies, Cambridge MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Jan 18 2008 - 16:17:39 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:08 EDT