aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-10-22 12:52:33 -0400
committerJames Moger <james.moger@gitblit.com>2014-10-22 22:29:00 -0400
commitcd036aa20930859fef51ed2fc4abc3d8cada5e3d (patch)
tree4c0cd3085ac371e9fc1a570d913ed063b1752055
parent40ad76e1db008923cd089b0dde80590156fa0596 (diff)
downloadiciql-cd036aa20930859fef51ed2fc4abc3d8cada5e3d.tar.gz
iciql-cd036aa20930859fef51ed2fc4abc3d8cada5e3d.zip
Update dependencies
-rw-r--r--.classpath10
-rw-r--r--README.markdown12
-rw-r--r--build.moxie15
-rw-r--r--src/main/java/com/iciql/Constants.java2
-rw-r--r--src/main/java/com/iciql/SQLDialectDefault.java20
-rw-r--r--src/main/java/com/iciql/SQLDialectDerby.java2
-rw-r--r--src/test/java/com/iciql/test/IciqlSuite.java5
7 files changed, 35 insertions, 31 deletions
diff --git a/.classpath b/.classpath
index 1157ddf..7e0f9a7 100644
--- a/.classpath
+++ b/.classpath
@@ -3,11 +3,11 @@
<classpathentry kind="src" path="src/main/java" />
<classpathentry kind="src" path="src/test/java" output="bin/test-classes" />
<classpathentry kind="lib" path="ext/jcommander-1.17.jar" sourcepath="ext/src/jcommander-1.17.jar" />
- <classpathentry kind="lib" path="ext/h2-1.3.168.jar" sourcepath="ext/src/h2-1.3.168.jar" />
- <classpathentry kind="lib" path="ext/hsqldb-2.2.8.jar" />
- <classpathentry kind="lib" path="ext/derby-10.9.1.0.jar" />
- <classpathentry kind="lib" path="ext/mysql-connector-java-5.1.15.jar" />
- <classpathentry kind="lib" path="ext/postgresql-9.0-801.jdbc4.jar" sourcepath="ext/src/postgresql-9.0-801.jdbc4.jar" />
+ <classpathentry kind="lib" path="ext/h2-1.4.181.jar" sourcepath="ext/src/h2-1.4.181.jar" />
+ <classpathentry kind="lib" path="ext/hsqldb-2.3.2.jar" sourcepath="ext/src/hsqldb-2.3.2.jar" />
+ <classpathentry kind="lib" path="ext/derby-10.11.1.1.jar" />
+ <classpathentry kind="lib" path="ext/mysql-connector-java-5.1.33.jar" />
+ <classpathentry kind="lib" path="ext/postgresql-9.3-1102-jdbc4.jar" sourcepath="ext/src/postgresql-9.3-1102-jdbc4.jar" />
<classpathentry kind="lib" path="ext/slf4j-api-1.6.1.jar" sourcepath="ext/src/slf4j-api-1.6.1.jar" />
<classpathentry kind="lib" path="ext/commons-pool-1.5.6.jar" sourcepath="ext/src/commons-pool-1.5.6.jar" />
<classpathentry kind="lib" path="ext/commons-dbcp-1.4.jar" sourcepath="ext/src/commons-dbcp-1.4.jar" />
diff --git a/README.markdown b/README.markdown
index 110ca0c..4c2b2c7 100644
--- a/README.markdown
+++ b/README.markdown
@@ -5,7 +5,7 @@ iciql **is**...
- a model-based, database access wrapper for JDBC
- for modest database schemas and basic statement generation
- for those who want to write code, instead of SQL, using IDE completion and compile-time type-safety
-- small (175KB with debug symbols) with no runtime dependencies
+- small (200KB with debug symbols) with no runtime dependencies
- pronounced *icicle* (although it could be French: *ici ql* - here query language)
- a friendly fork of the H2 [JaQu](http://h2database.com/html/jaqu.html) project
@@ -17,11 +17,11 @@ iciql **is not**...
Supported Databases (Unit-Tested)
-------
-- [H2](http://h2database.com) 1.3.168
-- [HSQLDB](http://hsqldb.org) 2.2.8
-- [Derby](http://db.apache.org/derby) 10.9.1.0
-- [MySQL](http://mysql.com) 5.0.51b
-- [PostgreSQL](http://postgresql.org) 9.0
+- [H2](http://h2database.com) 1.4
+- [HSQLDB](http://hsqldb.org) 2.3
+- [Derby](http://db.apache.org/derby) 10.11
+- [MySQL](http://mysql.com) 5.6
+- [PostgreSQL](http://postgresql.org) 9.3
Support for others is possible and may only require creating a simple "dialect" class.
diff --git a/build.moxie b/build.moxie
index fdb8d2f..058407a 100644
--- a/build.moxie
+++ b/build.moxie
@@ -82,12 +82,11 @@ dependencyDirectory: ext
repositories: central
properties: {
- h2.version : 1.3.168
- hsqldb.version : 2.2.8
- derby.version : 10.9.1.0
- mysql.version : 5.0.51b
- postgresql.version : 9.0
- postgresqldriver.version : 9.0-801.jdbc4
+ h2.version : 1.4.181
+ hsqldb.version : 2.3.2
+ derby.version : 10.11.1.1
+ mysql.version : 5.6
+ postgresql.version : 9.3
}
dependencies:
@@ -95,8 +94,8 @@ dependencies:
- provided 'com.h2database:h2:${h2.version}'
- provided 'org.hsqldb:hsqldb:${hsqldb.version}'
- provided 'org.apache.derby:derby:${derby.version}'
-- provided 'mysql:mysql-connector-java:5.1.15'
-- provided 'postgresql:postgresql:${postgresqldriver.version}'
+- provided 'mysql:mysql-connector-java:5.1.33'
+- provided 'org.postgresql:postgresql:9.3-1102-jdbc4'
- provided 'org.slf4j:slf4j-api:1.6.1'
- provided 'commons-pool:commons-pool:1.5.6'
- provided 'commons-dbcp:commons-dbcp:1.4'
diff --git a/src/main/java/com/iciql/Constants.java b/src/main/java/com/iciql/Constants.java
index 8b54493..a680dc5 100644
--- a/src/main/java/com/iciql/Constants.java
+++ b/src/main/java/com/iciql/Constants.java
@@ -25,7 +25,7 @@ public class Constants {
// The build script extracts this exact line so be careful editing it
// and only use A-Z a-z 0-9 .-_ in the string.
- public static final String VERSION = "1.2.0-SNAPSHOT";
+ public static final String VERSION = "1.3.0-SNAPSHOT";
// The build script extracts this exact line so be careful editing it
// and only use A-Z a-z 0-9 .-_ in the string.
diff --git a/src/main/java/com/iciql/SQLDialectDefault.java b/src/main/java/com/iciql/SQLDialectDefault.java
index 364db7b..e29d7b8 100644
--- a/src/main/java/com/iciql/SQLDialectDefault.java
+++ b/src/main/java/com/iciql/SQLDialectDefault.java
@@ -37,10 +37,12 @@ import com.iciql.util.StringUtils;
* Default implementation of an SQL dialect.
*/
public class SQLDialectDefault implements SQLDialect {
-
+
final String LITERAL = "'";
float databaseVersion;
+ int databaseMajorVersion;
+ int databaseMinorVersion;
String databaseName;
String productVersion;
@@ -53,8 +55,10 @@ public class SQLDialectDefault implements SQLDialect {
public void configureDialect(String databaseName, DatabaseMetaData data) {
this.databaseName = databaseName;
try {
- databaseVersion = Float.parseFloat(data.getDatabaseMajorVersion() + "."
- + data.getDatabaseMinorVersion());
+ databaseMajorVersion = data.getDatabaseMajorVersion();
+ databaseMinorVersion = data.getDatabaseMinorVersion();
+ databaseVersion = Float.parseFloat(databaseMajorVersion + "."
+ + databaseMinorVersion);
productVersion = data.getDatabaseProductVersion();
} catch (SQLException e) {
throw new IciqlException(e);
@@ -63,7 +67,7 @@ public class SQLDialectDefault implements SQLDialect {
/**
* Allows subclasses to change the type of a column for a CREATE statement.
- *
+ *
* @param sqlType
* @return the SQL type or a preferred alternative
*/
@@ -202,10 +206,10 @@ public class SQLDialectDefault implements SQLDialect {
buff.append(" WHERE ");
buff.append(where.toString());
}
-
+
prepareCreateView(stat, def, buff.toString());
}
-
+
@Override
public <T> void prepareCreateView(SQLStatement stat, TableDefinition<T> def, String fromWhere) {
StatementBuilder buff = new StatementBuilder();
@@ -221,7 +225,7 @@ public class SQLDialectDefault implements SQLDialect {
buff.append(fromWhere);
stat.setSQL(buff.toString());
}
-
+
protected boolean isIntegerType(String dataType) {
if ("INT".equals(dataType)) {
return true;
@@ -328,7 +332,7 @@ public class SQLDialectDefault implements SQLDialect {
stat.appendSQL(" OFFSET " + offset);
}
}
-
+
@Override
public String prepareParameter(Object o) {
if (o instanceof String) {
diff --git a/src/main/java/com/iciql/SQLDialectDerby.java b/src/main/java/com/iciql/SQLDialectDerby.java
index f954a7c..99405b7 100644
--- a/src/main/java/com/iciql/SQLDialectDerby.java
+++ b/src/main/java/com/iciql/SQLDialectDerby.java
@@ -40,7 +40,7 @@ public class SQLDialectDerby extends SQLDialectDefault {
@Override
public void appendLimitOffset(SQLStatement stat, long limit, long offset) {
// FETCH/OFFSET added in 10.5
- if (databaseVersion >= 10.5f) {
+ if (databaseMajorVersion >= 10 && databaseMinorVersion >= 5) {
if (offset > 0) {
stat.appendSQL(" OFFSET " + offset + (offset == 1 ? " ROW" : " ROWS"));
}
diff --git a/src/test/java/com/iciql/test/IciqlSuite.java b/src/test/java/com/iciql/test/IciqlSuite.java
index a26bf08..0273399 100644
--- a/src/test/java/com/iciql/test/IciqlSuite.java
+++ b/src/test/java/com/iciql/test/IciqlSuite.java
@@ -98,7 +98,8 @@ public class IciqlSuite {
private static final TestDb[] TEST_DBS = {
new TestDb("H2", true, true, "jdbc:h2:mem:iciql"),
- new TestDb("H2", true, false, "jdbc:h2:file:testdbs/h2/iciql"),
+ new TestDb("H2", true, false, "jdbc:h2:file:"
+ + new File(System.getProperty("user.dir")).getAbsolutePath() + "testdbs/h2/iciql"),
new TestDb("H2", false, false, "jdbc:h2:tcp://localhost/"
+ new File(System.getProperty("user.dir")).getAbsolutePath() + "/testdbs/h2tcp/iciql"),
new TestDb("HSQL", true, true, "jdbc:hsqldb:mem:iciql"),
@@ -106,7 +107,7 @@ public class IciqlSuite {
new TestDb("HSQL", false, false, "jdbc:hsqldb:hsql://localhost/iciql"),
new TestDb("Derby", true, true, "jdbc:derby:memory:iciql;create=true"),
new TestDb("Derby", true, false, "jdbc:derby:directory:testdbs/derby/iciql;create=true"),
- new TestDb("MySQL", false, false, "jdbc:mysql://localhost:7000/iciql", "sa", "sa"),
+ new TestDb("MySQL", false, false, "jdbc:mysql://localhost:3306/iciql", "sa", "sa"),
new TestDb("PostgreSQL", false, false, "jdbc:postgresql://localhost:5432/iciql", "sa", "sa") };
private static final TestDb DEFAULT_TEST_DB = TEST_DBS[0];