1
14
15 package com.liferay.portal.dao.db;
16
17 import com.liferay.portal.kernel.dao.db.DB;
18 import com.liferay.portal.kernel.util.StringUtil;
19
20 import java.io.IOException;
21
22
29 public class JDataStoreDB extends FirebirdDB {
30
31 public static DB getInstance() {
32 return _instance;
33 }
34
35 public String buildSQL(String template) throws IOException {
36 template = convertTimestamp(template);
37 template = replaceTemplate(template, getTemplate());
38
39 template = reword(template);
40 template = StringUtil.replace(
41 template,
42 new String[] {"\\'", "\\\"", "\\\\", "\\n", "\\r"},
43 new String[] {"''", "\"", "\\", "\n", "\r"});
44
45 return template;
46 }
47
48 protected JDataStoreDB() {
49 super(TYPE_JDATASTORE);
50 }
51
52 protected String getServerName() {
53 return "jdatastore";
54 }
55
56 protected String[] getTemplate() {
57 return _JDATASTORE;
58 }
59
60 private static String[] _JDATASTORE = {
61 "--", "TRUE", "FALSE",
62 "'1970-01-01'", "current_timestamp",
63 " binary", " boolean", " date",
64 " double", " integer", " bigint",
65 " long varchar", " long varchar", " varchar",
66 "", "commit"
67 };
68
69 private static JDataStoreDB _instance = new JDataStoreDB();
70
71 }