Skip to content
Permalink
Browse files

0002152: DDL errors on DB2 i5 AS/400

  • Loading branch information...
chenson42 committed Jan 29, 2015
1 parent 9837fe6 commit 742955c145838ad2413f70d1d6d324110232ab9f
@@ -20,17 +20,9 @@
*/
package org.jumpmind.symmetric.service.impl;

import java.io.File;
import java.sql.Types;
import java.util.Date;
import java.util.Map;

import org.apache.commons.dbcp.BasicDataSource;
import org.jumpmind.db.platform.IDatabasePlatform;
import org.jumpmind.db.platform.JdbcDatabasePlatformFactory;
import org.jumpmind.db.sql.SqlTemplateSettings;
import org.jumpmind.db.util.BasicDataSourceFactory;
import org.jumpmind.properties.TypedProperties;

public class RegistrationServiceSqlMap extends AbstractSqlMap {

@@ -94,22 +86,4 @@ public RegistrationServiceSqlMap(IDatabasePlatform platform,

}

public static void main(String[] args) throws Exception {
String sql = "update sym_registration_request "
+ " set "
+ " last_update_by=?, last_update_time=?, attempt_count=1, registered_node_id=?, status=?, error_message=? "
+ " where "
+ " node_group_id=? and external_id=? and ip_address=? and host_name=? and status in ('RQ', 'ER') ";
BasicDataSource ds = BasicDataSourceFactory.create(new TypedProperties(new File("../symmetric-pro/target/engines/server.properties")));
IDatabasePlatform platform = JdbcDatabasePlatformFactory.createNewPlatformInstance(ds, new SqlTemplateSettings(), false);
int count = platform.getSqlTemplate().update(
sql,
new Object[] { "me", new Date(),
"1", "ER", "",
"client", "1", "127.0.0.1", "localhost" },
new int[] { Types.VARCHAR, Types.DATE, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,
Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR });
System.out.println("updated " + count);
}

}

0 comments on commit 742955c

Please sign in to comment.
You can’t perform that action at this time.