[Geoserver-devel] Oracle question

Hello all,

I’m emailing about an issue I posted on the users list a while ago, and I was wondering if this was something that I could fix (supposing I’m not running into designed behavior I’m just not understanding).

When using Oracle, if you have a Date field, this field also contains a time. This time is not being output when you call GetFeature/GetFeatureInfo. Miles suggested that the datastore could be updated to alter the session and correct the problem, using ALTER SESSION SET NLS_DATE_FORMAT = ‘DD-MON-YYYY HH24:MI:SS’; This would at least get the time out there, although it doesn’t give you much control of the formatting.

Does anyone have any feedback on whether or not something like this would be useful? Am I missing an obvious/easy fix? If it is something to change, I have some time to poke around and try to make it work. If someone could point me in the right direction in the source code, I’ll make the change and try to test it out.

Also, in a related question, how does one debug geotools? I think this question has been asked before, but I couldn’t find any documentation on the geotools site.

Thanks!

Aaron

Hi Aaron,

First of all, if you are going to go down the ALTER SESSION route, then I suggest creating an after logon trigger which would handle this. I don't think we should handle this in the Java as it is implementation specific, and whilst would suit us UK based users, others across the pond would be less than impressed. I do not think this is worth while.

What we really should do however, is make use of the TO_CHAR function, which converts dates from the date column into a char representation. The reverse of this from char to date is TO_DATE.

So if i understand your use case correctly, we would use TO_CHAR.

I think the best thing to do in this case, would be to add an extra column to your table of type VARCHAR2 called chardate for example, and run the simple query:

update <tablename> set chardate = TO_CHAR(datetimecolumn, 'DD/MM/YYYY HH24:MI:SS');

The second part of the function is the formatting you would like - if you look up the function you could specify which formatting option you like.

The reason I don't think this should be in the code as it would be different for every single user, so unless we have a datastore dropdown to select the format, then the easiest change for this is in the db itself.

Cheers,
Steve

________________________________________
From: Gundel, Aaron [Aaron_Gundel@anonymised.com]
Sent: 16 March 2011 17:42
To: geoserver-devel@lists.sourceforge.net
Subject: [Geoserver-devel] Oracle question

Hello all,

I’m emailing about an issue I posted on the users list a while ago, and I was wondering if this was something that I could fix (supposing I’m not running into designed behavior I’m just not understanding).

When using Oracle, if you have a Date field, this field also contains a time. This time is not being output when you call GetFeature/GetFeatureInfo. Miles suggested that the datastore could be updated to alter the session and correct the problem, using ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS'; This would at least get the time out there, although it doesn’t give you much control of the formatting.

Does anyone have any feedback on whether or not something like this would be useful? Am I missing an obvious/easy fix? If it is something to change, I have some time to poke around and try to make it work. If someone could point me in the right direction in the source code, I’ll make the change and try to test it out.

Also, in a related question, how does one debug geotools? I think this question has been asked before, but I couldn’t find any documentation on the geotools site.

Thanks!

Aaron

DISCLAIMER:

This email may contain confidential information and is intended only for the use of the specific individual(s) to which it is addressed. If you are not the intended recipient of this email, you are hereby notified that any unauthorized use, dissemination or copying of this email or the information contained in it or attached to it is strictly prohibited. If you received this message in error, please immediately notify the sender at Infotech or Mail.Admin@anonymised.com and delete the original message.

Hey Steve,

I'm currently following this (extra column) approach. I had considered that the alter session approach doesn't give much control over the formatting. (Although it is worth noting that the date column type is already preformatted (and unchangeable) in getfeature and getfeatureinfo calls) I was just wondering if it would be worth it to make the time something that is natively displayed (similar to the postgres timestamp column...the oracle timestamp doesn't show up at all). Perhaps setting up control in the datastore setup page is a good idea?

Aaron

-----Original Message-----
From: Steve Way [mailto:Steve.Way@anonymised.com]
Sent: Wednesday, March 16, 2011 2:05 PM
To: Gundel, Aaron; geoserver-devel@lists.sourceforge.net
Subject: RE: Oracle question

Hi Aaron,

First of all, if you are going to go down the ALTER SESSION route, then I suggest creating an after logon trigger which would handle this. I don't think we should handle this in the Java as it is implementation specific, and whilst would suit us UK based users, others across the pond would be less than impressed. I do not think this is worth while.

What we really should do however, is make use of the TO_CHAR function, which converts dates from the date column into a char representation. The reverse of this from char to date is TO_DATE.

So if i understand your use case correctly, we would use TO_CHAR.

I think the best thing to do in this case, would be to add an extra column to your table of type VARCHAR2 called chardate for example, and run the simple query:

update <tablename> set chardate = TO_CHAR(datetimecolumn, 'DD/MM/YYYY HH24:MI:SS');

The second part of the function is the formatting you would like - if you look up the function you could specify which formatting option you like.

The reason I don't think this should be in the code as it would be different for every single user, so unless we have a datastore dropdown to select the format, then the easiest change for this is in the db itself.

Cheers,
Steve

________________________________________
From: Gundel, Aaron [Aaron_Gundel@anonymised.com]
Sent: 16 March 2011 17:42
To: geoserver-devel@lists.sourceforge.net
Subject: [Geoserver-devel] Oracle question

Hello all,

I'm emailing about an issue I posted on the users list a while ago, and I was wondering if this was something that I could fix (supposing I'm not running into designed behavior I'm just not understanding).

When using Oracle, if you have a Date field, this field also contains a time. This time is not being output when you call GetFeature/GetFeatureInfo. Miles suggested that the datastore could be updated to alter the session and correct the problem, using ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS'; This would at least get the time out there, although it doesn't give you much control of the formatting.

Does anyone have any feedback on whether or not something like this would be useful? Am I missing an obvious/easy fix? If it is something to change, I have some time to poke around and try to make it work. If someone could point me in the right direction in the source code, I'll make the change and try to test it out.

Also, in a related question, how does one debug geotools? I think this question has been asked before, but I couldn't find any documentation on the geotools site.

Thanks!

Aaron

DISCLAIMER:

This email may contain confidential information and is intended only for the use of the specific individual(s) to which it is addressed. If you are not the intended recipient of this email, you are hereby notified that any unauthorized use, dissemination or copying of this email or the information contained in it or attached to it is strictly prohibited. If you received this message in error, please immediately notify the sender at Infotech or Mail.Admin@anonymised.com and delete the original message.

On Wed, Mar 16, 2011 at 6:42 PM, Gundel, Aaron <Aaron_Gundel@anonymised.com> wrote:

Hello all,

I’m emailing about an issue I posted on the users list a while ago, and I
was wondering if this was something that I could fix (supposing I’m not
running into designed behavior I’m just not understanding).

When using Oracle, if you have a Date field, this field also contains a
time. This time is not being output when you call
GetFeature/GetFeatureInfo. Miles suggested that the datastore could be
updated to alter the session and correct the problem, using ALTER SESSION
SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS'; This would at least get the
time out there, although it doesn’t give you much control of the
formatting.

Does anyone have any feedback on whether or not something like this would be
useful? Am I missing an obvious/easy fix? If it is something to change, I
have some time to poke around and try to make it work. If someone could
point me in the right direction in the source code, I’ll make the change and
try to test it out.

Also, in a related question, how does one debug geotools? I think this
question has been asked before, but I couldn’t find any documentation on the
geotools site.

The GeoTools code uses prepared statements to get back dates and has
a custom converter to go from the Oracle custom date objects to java
dates.
There is a very light test that is checking how things are working vs dates
and timestampts that should really be improved.

All you need is in GeoTools, in particular in the following two modules:
http://svn.osgeo.org/geotools/trunk/modules/library/jdbc/
http://svn.osgeo.org/geotools/trunk/modules/plugin/jdbc/jdbc-oracle/

In order to run the oracle tests you'll have to hand modify the classpath
of the project to remove the dummy classes we use for compiling the module
without using the non redistributable jdbc driver and put the actual
jdbc driver instead, and then create a oracle.properties
file in $home/.geotools with the connection params to a writable
Oracle store:
#This is an example fixture. Update the values and remove the .example
suffix to enable the test
#Sun Jun 20 16:55:13 CEST 2010
dbtype=Oracle
port=1521
password=postgis
url=jdbc\:oracle\:thin\:@localhost\:1521\:xe
host=localhost
database=xe
driver=oracle.jdbc.driver.OracleDriver
username=myuser
user=mypassword

Then you should be able to run all the tests.

Hope this helps

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 333 8128928

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

-------------------------------------------------------

Hi Andrea,

I've done the modifications you mention, but I'm still running into issues when I go to run the tests. It looks like the jdbc driver won't connect, it's giving me... Io exception: The Network Adapter could not establish the connection. (So it skips the connected tests) This isn't extraordinarily detailed, I'm guessing it has to do with my oracle.properties file, but I'm not sure. I'll post the stack trace and the file (though I'll have to remove all the actual connection details). Anyone have any ideas? Thanks!

Aaron

java.lang.RuntimeException: org.apache.commons.dbcp.SQLNestedException: Cannot
reate PoolableConnectionFactory (Io exception: The Network Adapter could not es
ablish the connection)
        at org.geotools.jdbc.JDBCTestSupport.isOnline(JDBCTestSupport.java:98)
        at org.geotools.test.OnlineTestCase.checkAvailable(OnlineTestCase.java:
42)
        at org.geotools.test.OnlineTestCase.run(OnlineTestCase.java:120)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner
java:81)
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet
java:62)
Skipping oracle tests, resources not available: org.apache.commons.dbcp.SQLNest
dException: Cannot create PoolableConnectionFactory (Io exception: The Network
dapter could not establish the connection)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTe
tSet(AbstractDirectoryTestSuite.java:140)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(A
stractDirectoryTestSuite.java:127)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(S
refireBooter.java:345)
        at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.
ava:1009)
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableCo
nectionFactory (Io exception: The Network Adapter could not establish the conne
tion)
        at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFact
ry(BasicDataSource.java:1549)
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSo
rce.java:1388)
        at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSourc
.java:1044)
        at org.geotools.data.jdbc.datasource.AbstractManageableDataSource.getCo
nection(AbstractManageableDataSource.java:44)
        at org.geotools.jdbc.JDBCTestSupport.isOnline(JDBCTestSupport.java:93)
        ... 15 more
Caused by: java.sql.SQLException: Io exception: The Network Adapter could not e
tablish the connection
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.jav
:112)
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.jav
:146)
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.jav
:255)
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java
420)
        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtensi
n.java:35)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
        at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(Dri
erConnectionFactory.java:38)
        at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(Poolabl
ConnectionFactory.java:582)
        at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Ba
icDataSource.java:1556)
        at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFact
ry(BasicDataSource.java:1545)
        ... 19 more

port=1521
password=[my password]
url=jdbc\:oracle\:thin\:@[tried host name and IP here]\:1521\:[SID]
host=[tried host and IP here]
database=[database name]
driver=oracle.jdbc.driver.OracleDriver
username=[username here]
user=[tried username and password here]

-----Original Message-----
From: andrea.aime@anonymised.com [mailto:andrea.aime@anonymised.com] On Behalf Of Andrea Aime
Sent: Thursday, March 17, 2011 10:07 AM
To: Gundel, Aaron
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] Oracle question

On Wed, Mar 16, 2011 at 6:42 PM, Gundel, Aaron <Aaron_Gundel@anonymised.com> wrote:

Hello all,

I'm emailing about an issue I posted on the users list a while ago,
and I was wondering if this was something that I could fix (supposing
I'm not running into designed behavior I'm just not understanding).

When using Oracle, if you have a Date field, this field also contains
a time. This time is not being output when you call
GetFeature/GetFeatureInfo. Miles suggested that the datastore could
be updated to alter the session and correct the problem, using ALTER
SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS'; This would at
least get the time out there, although it doesn't give you much
control of the formatting.

Does anyone have any feedback on whether or not something like this
would be useful? Am I missing an obvious/easy fix? If it is
something to change, I have some time to poke around and try to make
it work. If someone could point me in the right direction in the
source code, I'll make the change and try to test it out.

Also, in a related question, how does one debug geotools? I think
this question has been asked before, but I couldn't find any
documentation on the geotools site.

The GeoTools code uses prepared statements to get back dates and has a custom converter to go from the Oracle custom date objects to java dates.
There is a very light test that is checking how things are working vs dates and timestampts that should really be improved.

All you need is in GeoTools, in particular in the following two modules:
http://svn.osgeo.org/geotools/trunk/modules/library/jdbc/
http://svn.osgeo.org/geotools/trunk/modules/plugin/jdbc/jdbc-oracle/

In order to run the oracle tests you'll have to hand modify the classpath of the project to remove the dummy classes we use for compiling the module without using the non redistributable jdbc driver and put the actual jdbc driver instead, and then create a oracle.properties file in $home/.geotools with the connection params to a writable Oracle store:
#This is an example fixture. Update the values and remove the .example suffix to enable the test #Sun Jun 20 16:55:13 CEST 2010 dbtype=Oracle
port=1521
password=postgis
url=jdbc\:oracle\:thin\:@localhost\:1521\:xe
host=localhost
database=xe
driver=oracle.jdbc.driver.OracleDriver
username=myuser
user=mypassword

Then you should be able to run all the tests.

Hope this helps

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 333 8128928

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

-------------------------------------------------------

On Mon, Mar 21, 2011 at 6:28 PM, Gundel, Aaron <Aaron_Gundel@anonymised.com> wrote:

Hi Andrea,

I've done the modifications you mention, but I'm still running into issues when I go to run the tests. It looks like the jdbc driver won't connect, it's giving me... Io exception: The Network Adapter could not establish the connection. (So it skips the connected tests) This isn't extraordinarily detailed, I'm guessing it has to do with my oracle.properties file, but I'm not sure. I'll post the stack trace and the file (though I'll have to remove all the actual connection details). Anyone have any ideas? Thanks!

Yeah, those property files need some cleanup so that we don't have to
type the same info multiple times.
Nobody had the time to do that so far, but we can always hope :slight_smile:

port=1521
password=postgis
url=jdbc\:oracle\:thin\:@localhost\:1521\:xe
host=localhost
database=xe
driver=oracle.jdbc.driver.OracleDriver
username=myuser
user=mypassword

So mine looks like this:

port=1521
password=<thepassword>
url=jdbc\:oracle\:thin\:@localhost\:1521\:xe
host=localhost
database=xe
driver=oracle.jdbc.driver.OracleDriver
username=<theuser>
user=<theuser>

see how the username has to be provided twice, but it has to be consistent,
and it's two times the same.
The password is your database password... do you also like to tease Oracle
spatial like me, stating the password is "postgis"? :wink:

All the other params have to be customized to your enviroment as well...
are you using Oracle XE too? How is your database called?
If it's not XE and the db is called "monnalisa" instead of "xe" you'll have to
fix both the url and database accordingly.

Sorry it's a bit convoluted, we need to keep these files, that are different
for each developer, out of svn, and Oracle adds insult to the injury by not
allowing us to redistribute the driver in maven repositories.

Ah, just remembered another thing. Oracle XE out of the box is pretty unusable
even for the task of doing tests because of its very limited number of processes
and sessions, you should follow this tutorial and increase both:

http://www.markcallen.com/oracle/oracle-xe-tuning

And then be patient... running the test suite against Oracle takes
ages, it's easily
3 times slower than PostgreSQL/PostGIS: Oracle it's fast in
production, but setting
up and dropping tables and spatial indexes is glacially slow...

Hope this helps

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 333 8128928

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

-------------------------------------------------------

Hey Andrea,

I was able to get it to connect after a few more tweaks. Looks like the instance I was trying to connect to wasn't even up. That makes a difference!

Anyway, I'm using a full Oracle Spatial instance (not XE). The tests flew through, but a lot of them failed. I'm guessing that the GeoServer user I've created needs certain permissions that I haven't given it yet (I believe it only has create table and create view right now). I'm trying to figure out what extra permissions it needs so it'll pass these tests...looks like it's failing the OracleVirtualTableTest, OracleGeometrylessTest, OracleFeatureStoreExposePkTest, and OracleFeatureSourceExposePkTest.

Aaron

-----Original Message-----
From: andrea.aime@anonymised.com [mailto:andrea.aime@anonymised.com] On Behalf Of Andrea Aime
Sent: Monday, March 21, 2011 1:37 PM
To: Gundel, Aaron
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] Oracle question

On Mon, Mar 21, 2011 at 6:28 PM, Gundel, Aaron <Aaron_Gundel@anonymised.com> wrote:

Hi Andrea,

I've done the modifications you mention, but I'm still running into issues when I go to run the tests. It looks like the jdbc driver won't connect, it's giving me... Io exception: The Network Adapter could not establish the connection. (So it skips the connected tests) This isn't extraordinarily detailed, I'm guessing it has to do with my oracle.properties file, but I'm not sure. I'll post the stack trace and the file (though I'll have to remove all the actual connection details). Anyone have any ideas? Thanks!

Yeah, those property files need some cleanup so that we don't have to type the same info multiple times.
Nobody had the time to do that so far, but we can always hope :slight_smile:

port=1521
password=postgis
url=jdbc\:oracle\:thin\:@localhost\:1521\:xe
host=localhost
database=xe
driver=oracle.jdbc.driver.OracleDriver
username=myuser
user=mypassword

So mine looks like this:

port=1521
password=<thepassword>
url=jdbc\:oracle\:thin\:@localhost\:1521\:xe
host=localhost
database=xe
driver=oracle.jdbc.driver.OracleDriver
username=<theuser>
user=<theuser>

see how the username has to be provided twice, but it has to be consistent, and it's two times the same.
The password is your database password... do you also like to tease Oracle spatial like me, stating the password is "postgis"? :wink:

All the other params have to be customized to your enviroment as well...
are you using Oracle XE too? How is your database called?
If it's not XE and the db is called "monnalisa" instead of "xe" you'll have to fix both the url and database accordingly.

Sorry it's a bit convoluted, we need to keep these files, that are different for each developer, out of svn, and Oracle adds insult to the injury by not allowing us to redistribute the driver in maven repositories.

Ah, just remembered another thing. Oracle XE out of the box is pretty unusable even for the task of doing tests because of its very limited number of processes and sessions, you should follow this tutorial and increase both:

http://www.markcallen.com/oracle/oracle-xe-tuning

And then be patient... running the test suite against Oracle takes ages, it's easily
3 times slower than PostgreSQL/PostGIS: Oracle it's fast in production, but setting up and dropping tables and spatial indexes is glacially slow...

Hope this helps

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 333 8128928

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

-------------------------------------------------------

Hey Andrea,

I had some time and was finally able to get this up and running. (Looks like I just needed to give it create resource permission. Doing this allowed all the tests to finish (in 8 minutes) successfully.) Thanks for helping me this far.

In looking through the OracleDateTest, I can see how it would be problematic now. Since the DATE and TIMESTAMP types are functionally equivalent as far as geotools is concerned, wouldn't it be necessary to test both the date and the timestamp in regard to filtering by time, date, and datetime?

Aaron

-----Original Message-----
From: andrea.aime@anonymised.com [mailto:andrea.aime@anonymised.com] On Behalf Of Andrea Aime
Sent: Monday, March 21, 2011 1:37 PM
To: Gundel, Aaron
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] Oracle question

On Mon, Mar 21, 2011 at 6:28 PM, Gundel, Aaron <Aaron_Gundel@anonymised.com> wrote:

Hi Andrea,

I've done the modifications you mention, but I'm still running into issues when I go to run the tests. It looks like the jdbc driver won't connect, it's giving me... Io exception: The Network Adapter could not establish the connection. (So it skips the connected tests) This isn't extraordinarily detailed, I'm guessing it has to do with my oracle.properties file, but I'm not sure. I'll post the stack trace and the file (though I'll have to remove all the actual connection details). Anyone have any ideas? Thanks!

Yeah, those property files need some cleanup so that we don't have to type the same info multiple times.
Nobody had the time to do that so far, but we can always hope :slight_smile:

port=1521
password=postgis
url=jdbc\:oracle\:thin\:@localhost\:1521\:xe
host=localhost
database=xe
driver=oracle.jdbc.driver.OracleDriver
username=myuser
user=mypassword

So mine looks like this:

port=1521
password=<thepassword>
url=jdbc\:oracle\:thin\:@localhost\:1521\:xe
host=localhost
database=xe
driver=oracle.jdbc.driver.OracleDriver
username=<theuser>
user=<theuser>

see how the username has to be provided twice, but it has to be consistent, and it's two times the same.
The password is your database password... do you also like to tease Oracle spatial like me, stating the password is "postgis"? :wink:

All the other params have to be customized to your enviroment as well...
are you using Oracle XE too? How is your database called?
If it's not XE and the db is called "monnalisa" instead of "xe" you'll have to fix both the url and database accordingly.

Sorry it's a bit convoluted, we need to keep these files, that are different for each developer, out of svn, and Oracle adds insult to the injury by not allowing us to redistribute the driver in maven repositories.

Ah, just remembered another thing. Oracle XE out of the box is pretty unusable even for the task of doing tests because of its very limited number of processes and sessions, you should follow this tutorial and increase both:

http://www.markcallen.com/oracle/oracle-xe-tuning

And then be patient... running the test suite against Oracle takes ages, it's easily
3 times slower than PostgreSQL/PostGIS: Oracle it's fast in production, but setting up and dropping tables and spatial indexes is glacially slow...

Hope this helps

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 333 8128928

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

-------------------------------------------------------

On Thu, Mar 24, 2011 at 6:01 PM, Gundel, Aaron <Aaron_Gundel@anonymised.com> wrote:

Hey Andrea,

I had some time and was finally able to get this up and running. (Looks like I just needed to give it create resource permission. Doing this allowed all the tests to finish (in 8 minutes) successfully.) Thanks for helping me this far.

8 minutes! Wow, it's even slower than on my machine with poor silly XE. :slight_smile:

In looking through the OracleDateTest, I can see how it would be problematic now. Since the DATE and TIMESTAMP types are functionally equivalent as far as geotools is concerned, wouldn't it be necessary to test both the date and the timestamp in regard to filtering by time, date, and datetime?

Yeah, it would be a good idea.
And also test insertion/update, which is actually the biggest pain point

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 333 8128928

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

-------------------------------------------------------