java/sql-vyuka/src/java/cz/frantovo/sql/vyuka/dao/PruvodceDAO.sql.xml
author František Kučera <franta-hg@frantovo.cz>
Sat Feb 12 15:00:38 2011 +0100 (2011-02-12)
changeset 76 48d0c0d0da21
parent 37 e32867db5487
permissions -rw-r--r--
Datový zdroj pro jettyho. První nástřel.
Stačí doplnit heslo, nahrát JDBC ovladač do $JETTY_HOME/lib/ext a v start.ini do OPTIONS přidat „plus“.
Soubor sql-vyuka.xml přijde do složky contexts v jettym.
Otestováno s jettym jetty-distribution-7.3.0.v20110203.tar.gz a vypadá funkčně.

TODO: pooling datových zdrojů
org.postgresql.ds.PGConnectionPoolDataSource
org.postgresql.jdbc2.optional.PoolingDataSource
franta-hg@37
     1
<?xml version="1.0" encoding="UTF-8"?>
franta-hg@37
     2
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
franta-hg@37
     3
<properties>
franta-hg@37
     4
    <entry key="PODLE_KODU">
franta-hg@37
     5
        <![CDATA[
franta-hg@37
     6
        SELECT  *
franta-hg@37
     7
        FROM pruvodce
franta-hg@37
     8
        WHERE kod = ?;
franta-hg@37
     9
        ]]>
franta-hg@37
    10
    </entry>
franta-hg@37
    11
    <entry key="PODLE_ID">
franta-hg@37
    12
        <![CDATA[
franta-hg@37
    13
        SELECT  *
franta-hg@37
    14
        FROM pruvodce
franta-hg@37
    15
        WHERE id = ?;
franta-hg@37
    16
        ]]>
franta-hg@37
    17
    </entry>
franta-hg@37
    18
    <entry key="PODLE_ID_PREDCHOZI">
franta-hg@37
    19
        <![CDATA[
franta-hg@37
    20
        SELECT  *
franta-hg@37
    21
        FROM pruvodce
franta-hg@37
    22
        WHERE id < ?
franta-hg@56
    23
        ORDER BY id DESC
franta-hg@37
    24
        LIMIT 1;
franta-hg@37
    25
        ]]>
franta-hg@37
    26
    </entry>
franta-hg@37
    27
    <entry key="PODLE_ID_NASLEDUJICI">
franta-hg@37
    28
        <![CDATA[
franta-hg@37
    29
        SELECT  *
franta-hg@37
    30
        FROM pruvodce
franta-hg@37
    31
        WHERE id > ?
franta-hg@37
    32
        ORDER BY id
franta-hg@37
    33
        LIMIT 1;
franta-hg@37
    34
        ]]>
franta-hg@37
    35
    </entry>
franta-hg@37
    36
</properties>