title: Jenkins - Active choices from MySQL query
body: <p>Having a first play with Jenkins and trying to get an active choices parameter working using a groovy script but not having much luck. The parameter drop down is always empty when I run the build. My groovy script is as below:</p>
  
  <pre><code>import groovy.sql.Sql
  
  def output = []
  
  def sql = Sql.newInstance('jdbc:mysql://localhost:3308/information_schema', 'jenkins', 'password', 'com.mysql.jdbc.Driver')
  String sqlString = "select schema_name from information_schema.schemata;"
  sql.eachRow(sqlString){ row -&gt;  
      output.push(row[0])
  }
  
  
  return output
  </code></pre>
  
  <p>Where am I going wrong? Is there a way to see the output from the groovy script so I can see whether it is even making a connection to the database?</p>
  
  <p>Thanks in advance for any help / suggestions</p>