Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2026-04-30 9f2ef60949ced4fab4d077a7e1c6d913f3620c9b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package com.example.proj;
 
import java.sql.SQLException;
import org.postgresql.pljava.annotation.Function;
 
import java.util.logging.Logger;
 
public class TestIntegers {
    @Function
    public static short maxSmallIntJava() throws SQLException {
        return (short)32767;
    }
 
    @Function
    public static short sum2SmallIntJava(short a, short b) throws SQLException {
        return (short)(a + b);
    }
 
    @Function
    public static int maxIntegerJava() throws SQLException {
        return 2147483647;
    }
 
    @Function
    public static int returnIntJava() throws SQLException {
        return 10;
    }
 
    @Function
    public static int inc2ToIntJava(int val) throws SQLException {
        return val + 2;
    }
 
    @Function
    public static int sum3IntegerJava(int aaa, int bbb, int ccc) throws SQLException {
        return aaa + bbb + ccc;
    }
 
    @Function
    public static int sum4IntegerJava(int a, int b, int c, int d) throws SQLException {
        return a + b + c + d;
    }
 
    @Function
    public static int sum2IntegerJava(int a, int b) throws SQLException {
        return a + b;
    }
 
    @Function
    public static long maxBigIntJava() throws SQLException {
        return Long.MAX_VALUE;
    }
 
    @Function
    public static long sum2BigIntJava(long a, long b) throws SQLException {
        return a + b;
    }
 
    @Function
    public static long mixedBigIntJava(int a, int b, long c) throws SQLException {
        return (long)a + (long)b + c;
    }
 
    @Function
    public static long mixedIntJava(short a, short b, int c) throws SQLException {
        return (int)a + (int)b + c;
    }
 
}