Hi Andrea,
Thanks. After that I got the error that the Oracle driver did not exist. After
copying the ojdbc jar's to the WEB-INF/lib directory and restart of Tomcat it
worked fine.
Another question:
Is it possible to connect with the 'fat' method using a tnsname instead of a
host, port and database?
Thanks.
Ron
________________________________
From: Andrea Aime <[email protected]>
To: Ron Lindhoudt <[email protected]>
Cc: "[email protected]"
<[email protected]>
Sent: Thursday, June 21, 2012 8:44 AM
Subject: Re: [Geotools-gt2-users] Oracle DataStore getFeatureSource gives
NullPointerException
On Wed, Jun 20, 2012 at 9:44 AM, Ron Lindhoudt <[email protected]> wrote:
Hello,
>
>
>I am new to GeoTools. Trying to connect to an Oracle DataStore in a jsp:
>
>
>
>---------------
>
>java.util.Map params = new java.util.HashMap();
>params.put( "dbtype", "oracle");
>params.put( "host", "nbg-proj-srv");
>params.put( "port", 1521);
>params.put( "schema", "gie");
>params.put( "database", "nbg");
>params.put( "user", "gie");
>params.put( "passwd", "gie");
>
>DataStore dataStore = DataStoreFinder.getDataStore(params);
>
If this returns null it means the connection to the database did not work.
To get a better error message as to why that did not work try this instead:
DataStore oracle = new OracleNGDataStoreFactory().createDataStore(params);
Cheers
Andrea
--
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users