1
22
23 package com.liferay.portal.dao.db;
24
25 import com.liferay.portal.kernel.dao.db.DB;
26 import com.liferay.portal.kernel.util.StringUtil;
27
28 import java.io.IOException;
29
30
37 public class JDataStoreDB extends FirebirdDB {
38
39 public static DB getInstance() {
40 return _instance;
41 }
42
43 public String buildSQL(String template) throws IOException {
44 template = convertTimestamp(template);
45 template = replaceTemplate(template, getTemplate());
46
47 template = reword(template);
48 template = StringUtil.replace(
49 template,
50 new String[] {"\\'", "\\\"", "\\\\", "\\n", "\\r"},
51 new String[] {"''", "\"", "\\", "\n", "\r"});
52
53 return template;
54 }
55
56 protected JDataStoreDB() {
57 super(TYPE_JDATASTORE);
58 }
59
60 protected String getServerName() {
61 return "jdatastore";
62 }
63
64 protected String[] getTemplate() {
65 return _JDATASTORE;
66 }
67
68 private static String[] _JDATASTORE = {
69 "--", "TRUE", "FALSE",
70 "'1970-01-01'", "current_timestamp",
71 " binary", " boolean", " date",
72 " double", " integer", " bigint",
73 " long varchar", " long varchar", " varchar",
74 "", "commit"
75 };
76
77 private static JDataStoreDB _instance = new JDataStoreDB();
78
79 }