named parameters: better exceptions v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Tue, 24 Dec 2013 01:42:24 +0100
branchv_0
changeset 50074b81e5fa7c
parent 49 b4c74461d0f9
child 51 6730214fab41
named parameters: better exceptions
java/sql-dk/src/info/globalcode/sql/dk/SQLCommandNamed.java
     1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/SQLCommandNamed.java	Tue Dec 24 01:38:55 2013 +0100
     1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/SQLCommandNamed.java	Tue Dec 24 01:42:24 2013 +0100
     1.3 @@ -99,7 +99,7 @@
     1.4  			if (name.isEmpty()) {
     1.5  				updatedQuery.append(PROBLEM_MARK);
     1.6  				updatedQuery.append(originalQuery.substring(m.end(), originalQuery.length()));
     1.7 -				throw new SQLException("Named parameter (near " + PROBLEM_MARK + ") is not defined: " + updatedQuery);
     1.8 +				throw new SQLException("Named parameter (near " + PROBLEM_MARK + ") is not defined: „" + updatedQuery + "“");
     1.9  			}
    1.10  
    1.11  			updatedQuery.append("?");
    1.12 @@ -112,7 +112,7 @@
    1.13  
    1.14  		for (NamedParameter definedParameter : parameters) {
    1.15  			if (findByName(parametersUsed, definedParameter.getName()) == null) {
    1.16 -				throw new SQLException("Parameter " + definedParameter.getName() + " is defined but not used in the query.");
    1.17 +				throw new SQLException("Parameter „" + definedParameter.getName() + "“ is defined but not used in the query: „" + originalQuery + "“");
    1.18  			}
    1.19  		}
    1.20  	}