· 9 years ago · Jul 11, 2017, 04:44 AM
1<Resource
2 name="jdbc/geonetwork"
3 type="javax.sql.DataSource"
4 auth="Container"
5 driverClassName="org.postgresql.Driver"
6 url="jdbc:postgresql://localhost:5432/geonetwork"
7 username="geonetwork_user"
8 password=""
9 maxActive="20"
10 maxIdle="20"
11 maxWait="200"
12 initialSize="20"
13 removeAbandoned="true"
14 removeAbandonedTimeout="120"
15 logAbandoned="true"
16 testOnBorrow="true"
17 defaultReadOnly="false"
18 defaultAutoCommit="false"
19 validationQuery="SELECT 1"
20 timeBetweenEvictionRunsMillis="10000"
21 minEvictableIdleTimeMillis="1800000"
22 testWhileIdle="true"
23 numTestsPerEvictionRun="3"
24 poolPreparedStatements="true"
25 maxOpenPreparedStatements="1200"
26 provideDataStore="true" --> tried this to build spatialindex table
27/>
28
29<bean id="jdbcDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
30 <property name="jndiName" value="java:/comp/env/jdbc/geonetwork"/>
31 <property name="cache" value="true"/>
32 <property name="exposeAccessContext" value="false"/>
33 </bean>
34 <bean id="jpaVendorAdapterDatabaseParam" class="java.lang.String">
35 <constructor-arg value="POSTGRESQL"/>
36 </bean>
37
38CREATE TABLE spatialindex(
39 fid serial PRIMARY KEY NOT NULL,
40 id varchar (250)
41);
42CREATE EXTENSION IF NOT EXISTS postgis;
43ALTER TABLE spatialindex ADD COLUMN geom geometry(Multipolygon,4326);
44ALTER TABLE spatialindex OWNER TO geonetwork_user;
45
46CREATE TABLE spatialindex
47 (
48 fid int not null,
49 id varchar(250),
50 primary key(fid)
51 );
52CREATE INDEX spatialindexNDX1 ON spatialindex(id);
53SELECT AddGeometryColumn('spatialindex', 'the_geom', 4326, 'MULTIPOLYGON', 2 );
54CREATE INDEX spatialindexNDX2 on spatialindex USING GIST(the_geom);