BatchEncoder: fix (encode query with numbered parameters) v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Wed, 08 Jan 2014 14:50:26 +0100
branchv_0
changeset 1455f90decd3b59
parent 144 d273d7c6dc0c
child 146 4f4f515df807
BatchEncoder: fix (encode query with numbered parameters)
java/sql-dk/src/info/globalcode/sql/dk/batch/BatchEncoder.java
     1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/batch/BatchEncoder.java	Wed Jan 08 14:33:51 2014 +0100
     1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/batch/BatchEncoder.java	Wed Jan 08 14:50:26 2014 +0100
     1.3 @@ -41,14 +41,14 @@
     1.4  
     1.5  			buffer.write(BATCH_START);
     1.6  
     1.7 +			if (sqlCommand instanceof SQLCommandNamed) {
     1.8 +				sqlCommand = ((SQLCommandNamed) sqlCommand).getSQLCommandNumbered();
     1.9 +			}
    1.10 +
    1.11  			byte[] sqlBytes = toBytes(sqlCommand.getQuery());
    1.12  			buffer.writeInt(sqlBytes.length);
    1.13  			buffer.write(sqlBytes);
    1.14  
    1.15 -			if (sqlCommand instanceof SQLCommandNamed) {
    1.16 -				sqlCommand = ((SQLCommandNamed) sqlCommand).getSQLCommandNumbered();
    1.17 -			}
    1.18 -
    1.19  			List<? extends Parameter> parameters = sqlCommand.getParameters();
    1.20  
    1.21  			buffer.writeInt(parameters.size());