001
014
015 package com.liferay.portal.dao.db;
016
017 import com.liferay.portal.kernel.dao.db.DB;
018 import com.liferay.portal.kernel.util.StringUtil;
019
020 import java.io.IOException;
021
022
027 public class JDataStoreDB extends FirebirdDB {
028
029 public static DB getInstance() {
030 return _instance;
031 }
032
033 public String buildSQL(String template) throws IOException {
034 template = convertTimestamp(template);
035 template = replaceTemplate(template, getTemplate());
036
037 template = reword(template);
038 template = StringUtil.replace(
039 template,
040 new String[] {"\\'", "\\\"", "\\\\", "\\n", "\\r"},
041 new String[] {"''", "\"", "\\", "\n", "\r"});
042
043 return template;
044 }
045
046 protected JDataStoreDB() {
047 super(TYPE_JDATASTORE);
048 }
049
050 protected String getServerName() {
051 return "jdatastore";
052 }
053
054 protected String[] getTemplate() {
055 return _JDATASTORE;
056 }
057
058 private static String[] _JDATASTORE = {
059 "--", "TRUE", "FALSE",
060 "'1970-01-01'", "current_timestamp",
061 " binary", " boolean", " date",
062 " double", " integer", " bigint",
063 " long varchar", " long varchar", " varchar",
064 "", "commit"
065 };
066
067 private static JDataStoreDB _instance = new JDataStoreDB();
068
069 }