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