1

I'm very new to Jenkins and just hacking my way through it, please forgive me if this is a simple question. I'm using Extended Choice Parameter Plug-In to create a multi select box for a build, pretty much just a list of locations to copy files to. I have the list hardcoded in the build. This has been working great...

however I would like to have this list generated from a database table I have in MSSQL. I've poked around and I've found references to 'groovy scripts' and a variety of other plug-ins, and many of these posts are very dated. So I don't want to hunt down the wrong path and build something out of date.

What is the suggested plugin to use to created a multi select in a Jenkins build that can be populated from a MSSQL database? Do I need a 'groovy' plug-in as well?

If it's helpful, I'm skilled with python and perl, if 'groovy' isn't optimal. Thank you for your patience and time!

sniperd
  • 5,124
  • 6
  • 28
  • 44

1 Answers1

0

I find a solution to fix the problem. But it's a little bit dirty.

directly import your Driver in your class :

import net.sourceforge.jtds.jdbc.Driver;

DriverManager doesn't manage to find the good driver when you use it in Jenkins so you can simply instantiate your driver :

this.p = new Properties();
p.put("user", "user");
p.put("password", "password");      
Driver d = new Driver();
con = d.connect("jdbc:jtds:sqlserver://"+p.getProperty("db.host")+":1433;databaseName="+p.getProperty("db.name")+";instance="+p.getProperty("db.instance"),p);

then, you will probably have a new error with SSO. So you can follow this guide : I/O Error: SSO Failed: Native SSPI library not loaded

You simply have to add a dll in your jdk/bin folder to make your driver work.

That's the only way I found and I think it's more a hack than a real solution ! Happy coding ;)

Camille Gerin-Roze
  • 4,271
  • 1
  • 11
  • 16
  • My hacked up solution was to have SQL pump out a text file on a schedule that jenkins could read. Clearly not ideal! I'm on vacation this week so I cannot give this solution a try yet, once I'm back at work I will :) – sniperd Dec 22 '17 at 22:56