Substitute principal multiple times.
authorcantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sun, 14 Sep 2003 17:47:42 +0000 (17:47 +0000)
committercantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sun, 14 Sep 2003 17:47:42 +0000 (17:47 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@756 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/aa/attrresolv/provider/JDBCDataConnector.java

index ea3f1a2..875abf7 100644 (file)
@@ -577,6 +577,15 @@ class DefaultStatementCreator implements JDBCStatementCreator {
                try {
                        log.debug("Creating prepared statement.  Substituting principal: (" + principal.getName() + ")");
                        preparedStatement.setString(1, principal.getName());
+            //Tried using ParameterMetaData to determine param count, but it fails, so...
+            try {
+                int i=2;
+                while (true) {
+                    preparedStatement.setString(i++, principal.getName());
+                }
+            } catch (SQLException e) {
+                //Ignore any additional exceptions, assume parameters simply don't exist.
+            }
                } catch (SQLException e) {
                        log.error("Encountered an error while creating prepared statement: " + e);
                        throw new JDBCStatementCreatorException(