1
22
23 package com.liferay.portal.kernel.dao.db;
24
25 import com.liferay.portal.SystemException;
26
27 import java.io.IOException;
28
29 import java.sql.Connection;
30 import java.sql.SQLException;
31
32 import java.util.List;
33
34 import javax.naming.NamingException;
35
36
41 public interface DB {
42
43 public static final int MINIMAL = 1;
44
45 public static final int POPULATED = 0;
46
47 public static final int SHARDED = 2;
48
49 public static final String TYPE_DB2 = "db2";
50
51 public static final String TYPE_DERBY = "derby";
52
53 public static final String TYPE_FIREBIRD = "firebird";
54
55 public static final String TYPE_HYPERSONIC = "hypersonic";
56
57 public static final String TYPE_INFORMIX = "informix";
58
59 public static final String TYPE_INGRES = "ingres";
60
61 public static final String TYPE_INTERBASE = "interbase";
62
63 public static final String TYPE_JDATASTORE = "jdatastore";
64
65 public static final String TYPE_MYSQL = "mysql";
66
67 public static final String TYPE_ORACLE = "oracle";
68
69 public static final String TYPE_POSTGRESQL = "postgresql";
70
71 public static final String TYPE_SAP = "sap";
72
73 public static final String TYPE_SQLSERVER = "sqlserver";
74
75 public static final String TYPE_SYBASE = "sybase";
76
77 public static final String[] TYPE_ALL = {
78 TYPE_DB2, TYPE_DERBY, TYPE_FIREBIRD, TYPE_HYPERSONIC, TYPE_INFORMIX,
79 TYPE_INGRES, TYPE_INTERBASE, TYPE_JDATASTORE, TYPE_MYSQL, TYPE_ORACLE,
80 TYPE_POSTGRESQL, TYPE_SAP, TYPE_SQLSERVER, TYPE_SYBASE
81 };
82
83 public void buildCreateFile(String databaseName) throws IOException;
84
85 public void buildCreateFile(String databaseName, int population)
86 throws IOException;
87
88 public String buildSQL(String template) throws IOException;
89
90 public void buildSQLFile(String fileName) throws IOException;
91
92 public List<Index> getIndexes() throws SQLException;
93
94 public String getTemplateFalse();
95
96 public String getTemplateTrue();
97
98 public String getType();
99
100 public long increment() throws SystemException;
101
102 public boolean isSupportsAlterColumnName();
103
104 public boolean isSupportsAlterColumnType();
105
106 public boolean isSupportsDateMilliseconds();
107
108 public boolean isSupportsScrollableResults();
109
110 public boolean isSupportsStringCaseSensitiveQuery();
111
112 public boolean isSupportsUpdateWithInnerJoin();
113
114 public void runSQL(String sql) throws IOException, SQLException;
115
116 public void runSQL(Connection con, String sql)
117 throws IOException, SQLException;
118
119 public void runSQL(String[] sqls) throws IOException, SQLException;
120
121 public void runSQL(Connection con, String[] sqls)
122 throws IOException, SQLException;
123
124 public void runSQLTemplate(String path)
125 throws IOException, NamingException, SQLException;
126
127 public void runSQLTemplate(String path, boolean failOnError)
128 throws IOException, NamingException, SQLException;
129
130 public void runSQLTemplateString(
131 String template, boolean evaluate, boolean failOnError)
132 throws IOException, NamingException, SQLException;
133
134 public void setSupportsStringCaseSensitiveQuery(
135 boolean supportsStringCaseSensitiveQuery);
136
137 public void updateIndexes(
138 String tablesSQL, String indexesSQL, String indexesProperties,
139 boolean dropStaleIndexes)
140 throws IOException, SQLException;
141
142 }