Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-03-13 12:10:02 -0500
committerEike Stepper2010-03-13 12:10:02 -0500
commit72090604b2546dc8f2369b3924116b29d98b33b8 (patch)
tree311d91dcea415cf41db28e08fd67012c86249ec2 /plugins/org.eclipse.net4j.db.hsqldb
parente2fba9bb3a2edaf28abac46bb3eae3149708e1c1 (diff)
downloadcdo-72090604b2546dc8f2369b3924116b29d98b33b8.tar.gz
cdo-72090604b2546dc8f2369b3924116b29d98b33b8.tar.xz
cdo-72090604b2546dc8f2369b3924116b29d98b33b8.zip
[256936] Support for Offline Mode
https://bugs.eclipse.org/bugs/show_bug.cgi?id=256936
Diffstat (limited to 'plugins/org.eclipse.net4j.db.hsqldb')
-rw-r--r--plugins/org.eclipse.net4j.db.hsqldb/src/org/eclipse/net4j/db/hsqldb/HSQLDBAdapter.java53
1 files changed, 1 insertions, 52 deletions
diff --git a/plugins/org.eclipse.net4j.db.hsqldb/src/org/eclipse/net4j/db/hsqldb/HSQLDBAdapter.java b/plugins/org.eclipse.net4j.db.hsqldb/src/org/eclipse/net4j/db/hsqldb/HSQLDBAdapter.java
index cfeaf8699d..11d4e8a285 100644
--- a/plugins/org.eclipse.net4j.db.hsqldb/src/org/eclipse/net4j/db/hsqldb/HSQLDBAdapter.java
+++ b/plugins/org.eclipse.net4j.db.hsqldb/src/org/eclipse/net4j/db/hsqldb/HSQLDBAdapter.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
*/
@@ -19,7 +19,6 @@ import org.hsqldb.jdbcDriver;
import javax.sql.DataSource;
import java.sql.Driver;
-import java.util.StringTokenizer;
/**
* @author Eike Stepper
@@ -96,54 +95,4 @@ public class HSQLDBAdapter extends DBAdapter
{
return getSQL92ReservedWords();
}
-
- @Override
- public void appendValue(StringBuilder builder, IDBField field, Object value)
- {
- Object newValue = value;
-
- if (value instanceof String)
- {
- // HSQLDB just adds one additional single quote for a single quote
- String str = (String)value;
- StringTokenizer tokenizer = new StringTokenizer(str, "\'", true); // split on single quote //$NON-NLS-1$
- StringBuilder newValueBuilder = new StringBuilder();
-
- while (tokenizer.hasMoreTokens())
- {
- String current = tokenizer.nextToken();
- if (current.length() == 0)
- {
- continue;
- }
-
- if (current.length() > 1) // >1 -> can not be token -> normal string
- {
- newValueBuilder.append(current);
- }
- else
- { // length == 1
- newValueBuilder.append(processEscape(current.charAt(0)));
- }
- }
-
- newValue = newValueBuilder.toString();
- }
- else if (value instanceof Character)
- {
- newValue = processEscape((Character)value);
- }
-
- super.appendValue(builder, field, newValue);
- }
-
- private Object processEscape(char c)
- {
- if (c == '\'') // one single quote -->
- {
- return "\'\'"; // results two single quotes //$NON-NLS-1$
- }
-
- return c; // no escape character --> return as is
- }
}

Back to the top