Statistics
| Revision:

root / trunk / libraries / geotools-2.1.1-epsg-hsql / src / org / geotools / referencing / factory / epsg / doc-files / HSQL.html @ 28854

History | View | Annotate | Download (2.69 KB)

1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2

    
3
<HTML>
4
  <HEAD>
5
    <TITLE>Creating EPSG database for HSQL</TITLE>
6
  </HEAD>
7
  <BODY>
8
    <H1>Creating EPSG database for HSQL</H1>
9
    <P ALIGN="justify">The following gives some hints for creating a HSQL database
10
    and populate it with EPSG data from the SQL scripts.</P>
11
    <UL>
12
      <LI><P>Copy the <CODE><A HREF="sqltool.rc">sqltool.rc</A></CODE> file in the developper's
13
      home directory and edit it URL path provided in this file.</P></LI>
14

    
15
      <LI><P>Prepare a copy of EPSG's SQL scripts and modify them for HSQL syntax. The
16
      following <A HREF="PrepareForHSQL.xml">Ant file</A> can be used for this purpose.</P></LI>
17

    
18
      <LI><P>Creates the database using the following commands:</P>
19
<BLOCKQUOTE><PRE>java org.hsqldb.util.SqlTool --autoCommit EPSG-admin EPSG_v67.hsql_Tables.sql
20
java org.hsqldb.util.SqlTool --autoCommit EPSG-admin EPSG_v67.hsql_Data.sql
21
java org.hsqldb.util.SqlTool --autoCommit EPSG-admin EPSG_v67.hsql_FKeys.sql</PRE></BLOCKQUOTE></LI>
22

    
23
      <LI><P>Launch the following application:</P></LI>
24
<BLOCKQUOTE><PRE>java org.hsqldb.util.DatabaseManagerSwing</PRE></BLOCKQUOTE></LI>
25

    
26
      <P>Make sure the database is okay, and invoke the following commands:</P>
27
<BLOCKQUOTE><PRE>SCRIPT 'EPSG.sql';
28
SHUTDOWN COMPACT;</PRE></BLOCKQUOTE></LI>
29

    
30
      <LI><P>Quit the application. Edit the <CODE>EPSG.sql</CODE> script as below:</P>
31
      <UL>
32
        <LI>Remove the <CODE>SET DELAY 60</CODE> statement; 60 is already the default.</LI>
33

    
34
        <LI>Remove the <CODE>CREATE USER "SA"</CODE> statement; this user will exists
35
            before the script is run.</LI>
36

    
37
        <LI>In the table <CODE>EPSG_DATUM</CODE>, change the type of column <CODE>REALIZATION_EPOCH</CODE>
38
            to <CODE>INTEGER</CODE>.</LI>
39

    
40
        <LI>Copy all <CODE>ALTER TABLE ... FOREIGN KEY</CODE> statements to the end of the script.</LI>
41

    
42
        <LI>Remove all <CODE>CONSTRAINT ... FOREIGN KEY</CODE> from the <CODE>CREATE TABLE</CODE>
43
            statements at the begining of the script, and move them as <CODE>ALTER TABLE ... FOREIGN KEY</CODE>
44
            statements at the end of the script.</LI>
45

    
46
        <LI>Add <CODE>SHUTDOWN COMPACT</CODE> statement at the end of file.</LI>
47

    
48
      </UL></LI>
49

    
50
      <LI><P>Run the following commands:</P>
51
<BLOCKQUOTE><PRE>java org.geotools.referencing.factory.epsg.Compactor</PRE></BLOCKQUOTE></LI>
52

    
53
      <LI><P>Copy the file created in the above step into the
54
          <CODE>org.geotools.referencing.factory.epsg</CODE> package directory
55
          using "<CODE>EPSG.sql</CODE>" filename. Finally, create the JAR file
56
          as usual, which should includes the <CODE>EPSG.sql</CODE> script.<P></LI>
57
    </UL>
58
  </BODY>
59
</HTML>