Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-06-07 12:00:41 -0400
committerEike Stepper2012-06-07 12:00:41 -0400
commitfea9a8c7ef1711000c05627fdc2c199aea0aadc8 (patch)
treeb18fd74ad97bc968d774cf23c493f8765c207efb /plugins/org.eclipse.net4j.db.hsqldb
parentfce1378c776953be9eea47338ecda5e2419948f0 (diff)
downloadcdo-fea9a8c7ef1711000c05627fdc2c199aea0aadc8.tar.gz
cdo-fea9a8c7ef1711000c05627fdc2c199aea0aadc8.tar.xz
cdo-fea9a8c7ef1711000c05627fdc2c199aea0aadc8.zip
Update Javadocs
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.java199
-rw-r--r--plugins/org.eclipse.net4j.db.hsqldb/src/org/eclipse/net4j/db/hsqldb/HSQLDBDataSource.java2
2 files changed, 103 insertions, 98 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 202f9c2f0c..24ecbcd499 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
@@ -1,98 +1,101 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * 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
- */
-package org.eclipse.net4j.db.hsqldb;
-
-import org.eclipse.net4j.db.DBType;
-import org.eclipse.net4j.db.ddl.IDBField;
-import org.eclipse.net4j.spi.db.DBAdapter;
-
-import org.hsqldb.jdbcDriver;
-
-import javax.sql.DataSource;
-
-import java.sql.Driver;
-
-/**
- * @author Eike Stepper
- * @since 2.0
- */
-public class HSQLDBAdapter extends DBAdapter
-{
- private static final String NAME = "hsqldb"; //$NON-NLS-1$
-
- public static final String VERSION = "1.8.0.8"; //$NON-NLS-1$
-
- public HSQLDBAdapter()
- {
- super(NAME, VERSION);
- }
-
- public Driver getJDBCDriver()
- {
- return new jdbcDriver();
- }
-
- public DataSource createJDBCDataSource()
- {
- return new HSQLDBDataSource();
- }
-
- @Override
- protected String getTypeName(IDBField field)
- {
- DBType type = field.getType();
- switch (type)
- {
- case BOOLEAN:
- case BIT:
- case TINYINT:
- case SMALLINT:
- case INTEGER:
- case BIGINT:
- case FLOAT:
- case REAL:
- case DOUBLE:
- case DATE:
- case TIME:
- case TIMESTAMP:
- return type.toString();
-
- case LONGVARCHAR:
- return "LONGVARCHAR"; //$NON-NLS-1$
-
- case LONGVARBINARY:
- return "LONGVARBINARY"; //$NON-NLS-1$
-
- case BLOB:
- return "LONGVARBINARY"; //$NON-NLS-1$
-
- case CLOB:
- return "LONGVARCHAR"; //$NON-NLS-1$
-
- case CHAR:
- case VARCHAR:
- case BINARY:
- case VARBINARY:
- return type.toString() + field.formatPrecision();
-
- case NUMERIC:
- case DECIMAL:
- return type.toString() + field.formatPrecisionAndScale();
- }
-
- return super.getTypeName(field);
- }
-
- public String[] getReservedWords()
- {
- return getSQL92ReservedWords();
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * 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
+ */
+package org.eclipse.net4j.db.hsqldb;
+
+import org.eclipse.net4j.db.DBType;
+import org.eclipse.net4j.db.IDBAdapter;
+import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.spi.db.DBAdapter;
+
+import org.hsqldb.jdbcDriver;
+
+import javax.sql.DataSource;
+
+import java.sql.Driver;
+
+/**
+ * A {@link IDBAdapter DB adapter} for <a href="http://hsqldb.org/">HyperSQL</a> databases.
+ *
+ * @author Eike Stepper
+ * @since 2.0
+ */
+public class HSQLDBAdapter extends DBAdapter
+{
+ private static final String NAME = "hsqldb"; //$NON-NLS-1$
+
+ public static final String VERSION = "1.8.0.8"; //$NON-NLS-1$
+
+ public HSQLDBAdapter()
+ {
+ super(NAME, VERSION);
+ }
+
+ public Driver getJDBCDriver()
+ {
+ return new jdbcDriver();
+ }
+
+ public DataSource createJDBCDataSource()
+ {
+ return new HSQLDBDataSource();
+ }
+
+ @Override
+ protected String getTypeName(IDBField field)
+ {
+ DBType type = field.getType();
+ switch (type)
+ {
+ case BOOLEAN:
+ case BIT:
+ case TINYINT:
+ case SMALLINT:
+ case INTEGER:
+ case BIGINT:
+ case FLOAT:
+ case REAL:
+ case DOUBLE:
+ case DATE:
+ case TIME:
+ case TIMESTAMP:
+ return type.toString();
+
+ case LONGVARCHAR:
+ return "LONGVARCHAR"; //$NON-NLS-1$
+
+ case LONGVARBINARY:
+ return "LONGVARBINARY"; //$NON-NLS-1$
+
+ case BLOB:
+ return "LONGVARBINARY"; //$NON-NLS-1$
+
+ case CLOB:
+ return "LONGVARCHAR"; //$NON-NLS-1$
+
+ case CHAR:
+ case VARCHAR:
+ case BINARY:
+ case VARBINARY:
+ return type.toString() + field.formatPrecision();
+
+ case NUMERIC:
+ case DECIMAL:
+ return type.toString() + field.formatPrecisionAndScale();
+ }
+
+ return super.getTypeName(field);
+ }
+
+ public String[] getReservedWords()
+ {
+ return getSQL92ReservedWords();
+ }
+}
diff --git a/plugins/org.eclipse.net4j.db.hsqldb/src/org/eclipse/net4j/db/hsqldb/HSQLDBDataSource.java b/plugins/org.eclipse.net4j.db.hsqldb/src/org/eclipse/net4j/db/hsqldb/HSQLDBDataSource.java
index 4fbaa18f12..f5f8844a72 100644
--- a/plugins/org.eclipse.net4j.db.hsqldb/src/org/eclipse/net4j/db/hsqldb/HSQLDBDataSource.java
+++ b/plugins/org.eclipse.net4j.db.hsqldb/src/org/eclipse/net4j/db/hsqldb/HSQLDBDataSource.java
@@ -15,6 +15,8 @@ import org.hsqldb.jdbc.JDBCDataSource;
import java.text.MessageFormat;
/**
+ * An {@link JDBCDataSource HSQLDB data source} with a nicer {@link #toString()} method.
+ *
* @author Eike Stepper
*/
public class HSQLDBDataSource extends JDBCDataSource

Back to the top