looking in the org.geotools.data.sqlserver.jdts package [1] there's to
nothing like SQLServerJNDIDataStoreFactory eg.
JTDSSqlServerJNDIDataStoreFactory which I would expect at first glance
SQLServerJNDIDataStoreFactory wraps a SQLServerDataStoreFactory (DBTYPE
== sqlserver) so that would never give me a
JTDSSqlServerDataStoreFactory (DBTYPE == jtds-sqlserver)
even though JTDSSqlServerDataStoreFactory extends
SQLServerDataStoreFactory, AFAICT the
SQLServerDataStoreFactory#setupParameters() always sets the type to
sqlserver [2], so somewhere an explicit cast would be required to get a
jdts version from a jndi lookup.
gonna have another look tomorrow, time for a beer
[1]
https://github.com/geotools/geotools/tree/master/modules/plugin/jdbc/jdbc-sqlserver/src/main/java/org/geotools/data/sqlserver/jtds
[2]
https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-sqlserver/src/main/java/org/geotools/data/sqlserver/SQLServerDataStoreFactory.java#L99
Mark
<https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-sqlserver/src/main/java/org/geotools/data/sqlserver/SQLServerJNDIDataStoreFactory.java>
Op 15-05-16 om 19:24 schreef Ian Turton:
I'm pretty sure that there is code there, but I suspect it has never
been tested.
Ian
On 15 May 2016 19:06, "Mark Prins" <[email protected]
<mailto:[email protected]>> wrote:
just a quick question; it seems that there is no JNDI version of
the dataStorefactory for jDTS,
should I be using SQLServerJNDIDataStoreFactory
<http://docs.geotools.org/latest/javadocs/org/geotools/data/sqlserver/SQLServerJNDIDataStoreFactory.html>?
currently I'm doing
params.put("jndiReferenceName",
"java:comp/env/jdbc/brmo/rsgbbgt");
params.put("dbtype", "jdts-sqlserver");
params.put("schema",rsgbbgt);
JDBCDataStore dataStore = (JDBCDataStore)
DataStoreFinder.getDataStore(params);
but the dataStore turns out to be null (same code works fine for
oracle and postgis), I could work around by setting up the
connection from the jndi ref myself.
Thanx, mark
--
Disclaimer;
This message is just a reflection of what I thought at the time of
sending. The message may contain information that is not intended
for you or that you don't understand.
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users