svn-gvsig-desktop / tags / v1_0_2_Build_914 / libraries / libGDBMS / src / main / java / com / hardcode / gdbms / engine / values / ValueWriter.java @ 12200
History | View | Annotate | Download (2.8 KB)
1 | 3199 | fjp | package com.hardcode.gdbms.engine.values; |
---|---|---|---|
2 | |||
3 | import java.sql.Date; |
||
4 | import java.sql.Time; |
||
5 | import java.sql.Timestamp; |
||
6 | |||
7 | |||
8 | /**
|
||
9 | * DOCUMENT ME!
|
||
10 | *
|
||
11 | * @author Fernando Gonz?lez Cort?s
|
||
12 | */
|
||
13 | public interface ValueWriter { |
||
14 | public final static ValueWriter internalValueWriter = new ValueWriterImpl(); |
||
15 | |||
16 | /**
|
||
17 | * Gets the string of the i param as it would appear in a SQL statement
|
||
18 | *
|
||
19 | * @param i long to format
|
||
20 | *
|
||
21 | * @return String
|
||
22 | */
|
||
23 | public String getStatementString(long i); |
||
24 | |||
25 | /**
|
||
26 | * Gets the string of the i param as it would appear in a SQL statement
|
||
27 | *
|
||
28 | * @param i integer to format
|
||
29 | * @param sqlType SQL type of the parameter. Any of the following
|
||
30 | * java.sql.Types constants: INTEGER, SMALLINT, TINYINT
|
||
31 | *
|
||
32 | * @return String
|
||
33 | */
|
||
34 | public String getStatementString(int i, int sqlType); |
||
35 | |||
36 | /**
|
||
37 | * Gets the string of the d param as it would appear in a SQL statement
|
||
38 | *
|
||
39 | * @param d double to format
|
||
40 | * @param sqlType SQL type of the parameter. Any of the following
|
||
41 | * java.sql.Types constants: DOUBLE, FLOAT, REAL, NUMERIC, DECIMAL
|
||
42 | *
|
||
43 | * @return String
|
||
44 | */
|
||
45 | public String getStatementString(double d, int sqlType); |
||
46 | |||
47 | /**
|
||
48 | * Gets the string of the str param as it would appear in a SQL statement
|
||
49 | *
|
||
50 | * @param str string to format
|
||
51 | * @param sqlType SQL type of the parameter. Any of the following
|
||
52 | * java.sql.Types constants: CHAR, VARCHAR, LONGVARCHAR
|
||
53 | *
|
||
54 | * @return String
|
||
55 | */
|
||
56 | public String getStatementString(String str, int sqlType); |
||
57 | |||
58 | /**
|
||
59 | * Gets the string of the param as it would appear in a SQL statement
|
||
60 | *
|
||
61 | * @param d Date to format
|
||
62 | *
|
||
63 | * @return String
|
||
64 | */
|
||
65 | public String getStatementString(Date d); |
||
66 | |||
67 | /**
|
||
68 | * Gets the string of the param as it would appear in a SQL statement
|
||
69 | *
|
||
70 | * @param t Time to format
|
||
71 | *
|
||
72 | * @return String
|
||
73 | */
|
||
74 | public String getStatementString(Time t); |
||
75 | |||
76 | /**
|
||
77 | * Gets the string of the param as it would appear in a SQL statement
|
||
78 | *
|
||
79 | * @param ts timestamp to format
|
||
80 | *
|
||
81 | * @return String
|
||
82 | */
|
||
83 | public String getStatementString(Timestamp ts); |
||
84 | |||
85 | /**
|
||
86 | * Gets the string of the binary param as it would appear in a SQL
|
||
87 | * statement
|
||
88 | *
|
||
89 | * @param binary byte array to format
|
||
90 | *
|
||
91 | * @return String
|
||
92 | */
|
||
93 | public String getStatementString(byte[] binary); |
||
94 | |||
95 | /**
|
||
96 | * Gets the string of the binary param as it would appear in a SQL
|
||
97 | * statement
|
||
98 | *
|
||
99 | * @param b byte array to format
|
||
100 | *
|
||
101 | * @return String
|
||
102 | */
|
||
103 | public String getStatementString(boolean b); |
||
104 | |||
105 | /**
|
||
106 | * Gets the string of the binary param as it would appear in a SQL
|
||
107 | * statement
|
||
108 | *
|
||
109 | * @return String
|
||
110 | */
|
||
111 | public String getNullStatementString(); |
||
112 | } |