equal
deleted
inserted
replaced
26 import java.util.List; |
26 import java.util.List; |
27 import java.util.logging.Level; |
27 import java.util.logging.Level; |
28 import java.util.logging.Logger; |
28 import java.util.logging.Logger; |
29 import java.util.regex.Matcher; |
29 import java.util.regex.Matcher; |
30 import java.util.regex.Pattern; |
30 import java.util.regex.Pattern; |
|
31 import java.util.regex.PatternSyntaxException; |
31 |
32 |
32 /** |
33 /** |
33 * |
34 * |
34 * @author Ing. František Kučera (frantovo.cz) |
35 * @author Ing. František Kučera (frantovo.cz) |
35 */ |
36 */ |
51 this.nameSuffix = nameSuffix; |
52 this.nameSuffix = nameSuffix; |
52 } |
53 } |
53 |
54 |
54 @Override |
55 @Override |
55 public PreparedStatement prepareStatement(Connection c) throws SQLException { |
56 public PreparedStatement prepareStatement(Connection c) throws SQLException { |
56 buildPattern(); |
57 try { |
57 placeParametersAndUpdateQuery(); |
58 buildPattern(); |
58 logPossiblyMissingParameters(); |
59 placeParametersAndUpdateQuery(); |
|
60 logPossiblyMissingParameters(); |
|
61 } catch (PatternSyntaxException e) { |
|
62 throw new SQLException("Name prefix „" + namePrefix + "“ or suffix „" + nameSuffix + "“ contain a wrong regular expression. " + e.getLocalizedMessage(), e); |
|
63 } |
59 return c.prepareStatement(updatedQuery.toString()); |
64 return c.prepareStatement(updatedQuery.toString()); |
60 } |
65 } |
61 |
66 |
62 @Override |
67 @Override |
63 public void parametrize(PreparedStatement ps) throws SQLException { |
68 public void parametrize(PreparedStatement ps) throws SQLException { |