JdbcCommandType type = (JdbcCommandType) cmd.getCommandType(); switch (type) { case QUERY: query = cmd.getParams().get(0); break; case QUERYPARAMS: queryParameters = cmd.getParams(); break; case FETCHSIZE: fetchSize = Integer.parseInt(cmd.getParams().get(0)); break; default:
String url = cmds.get(0).getParams().get(0);
String url = cmds.get(0).getParams().get(0);
JdbcCommandType type = (JdbcCommandType) cmd.getCommandType(); switch (type) { case QUERY: query = cmd.getParams().get(0); break; case FETCHSIZE: fetchSize = Integer.parseInt(cmd.getParams().get(0)); break; default:
/** * Test for the metadata query to see if the check for unsigned int is present */ @Test public void testUnsignedInt() throws SchemaException { State state = new WorkUnitState(); state.setId("id"); MysqlExtractor mysqlExtractor = new MysqlExtractor((WorkUnitState) state); List<Command> commands = mysqlExtractor.getSchemaMetadata("db", "table"); assertTrue(commands.get(0).getCommandType() == JdbcCommand.JdbcCommandType.QUERY); assertTrue(commands.get(0).getParams().get(0).contains("bigint")); assertTrue(commands.get(1).getCommandType() == JdbcCommand.JdbcCommandType.QUERYPARAMS); assertTrue(!commands.get(1).getParams().get(0).contains("unsigned")); // set option to promote unsigned int to bigint state.setProp(ConfigurationKeys.SOURCE_QUERYBASED_PROMOTE_UNSIGNED_INT_TO_BIGINT, "true"); commands = mysqlExtractor.getSchemaMetadata("db", "table"); assertTrue(commands.get(0).getCommandType() == JdbcCommand.JdbcCommandType.QUERY); assertTrue(commands.get(0).getParams().get(0).contains("bigint")); assertTrue(commands.get(1).getCommandType() == JdbcCommand.JdbcCommandType.QUERYPARAMS); assertTrue(commands.get(1).getParams().get(0).contains("unsigned")); }
JdbcCommandType type = (JdbcCommandType) cmd.getCommandType(); switch (type) { case QUERY: query = cmd.getParams().get(0); break; case QUERYPARAMS: queryParameters = cmd.getParams(); break; case FETCHSIZE: fetchSize = Integer.parseInt(cmd.getParams().get(0)); break; default:
JdbcCommandType type = (JdbcCommandType) cmd.getCommandType(); switch (type) { case QUERY: query = cmd.getParams().get(0); break; case FETCHSIZE: fetchSize = Integer.parseInt(cmd.getParams().get(0)); break; default: