-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a new DatabaseChoiceListProvider with ja/fr/en translations #8
base: master
Are you sure you want to change the base?
Conversation
tduchateau
commented
Jan 12, 2015
- The new choice list provider is fully configurable: JDBC URL and driver, db name, db table, db column, db username, db password. It allows per-job database configuration only.
- Moreover, a fallback mechanism has been added and allows to read a local file containing choices (one per line) if the connection to the database can't be established (for any reason)
- All Messages*.properties have been updated accordingly
- WARNING: the driver class must be manually added to the classpath (either by putting the right JAR in the WEB-INF\lib folder of Jenkins, or by installing one of the Database plugins, such as https://wiki.jenkins-ci.org/display/JENKINS/MySQL+Database+Plugin)
* The new choice list provider is fully configurable: JDBC URL and driver, db name, db table, db column, db username, db password * Moreover, a fallback mechanism has been added and allows to read a local file containing choices (one per line) if the connection to the database can't be established (for any reason) * All Messages*.properties have been updated accordingly * WARNING: the driver class must be manually added to the classpath (either by putting the JAR in the WEB-INF\ib folder of Jenkins, or by installing one the Database Plugin such as https://wiki.jenkins-ci.org/display/JENKINS/MySQL+Database+Plugin
Additional notes:
|
Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests |
} | ||
} | ||
catch (SQLException se) { | ||
LOGGER.log(Level.SEVERE,"Unable to access the database: " + dbName + "." + se); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use Logger.log(Level, String, Throwable)
.
It displays also stacktraces.
|
private String jdbcDriver; | ||
private String fallbackFilePath; | ||
|
||
public String getDbUsername() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation.
Please don't use tab letters for indentations. Use only blank letters for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please send me you code style formatter. Much more simpler for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's a problem with a formatter.
It's generally a bad idea to use both blank characters and tab characters for indentations.
You'd better to configure your Eclipse to display whitespace characters.
If you need a formatter, I recommend you to create a one with following pages.
https://wiki.jenkins-ci.org/display/JENKINS/Governance+Document#GovernanceDocument-CoreCodingConvention
http://www.oracle.com/technetwork/java/codeconvtoc-136057.html
This can be resolved by integrated with Database plugin.
|
#9 demonstrates implementation with database plugin. |
} | ||
|
||
@DataBoundConstructor | ||
public DatabaseChoiceListProvider(String userdb, String passworddb, String urldb, String colomndb, String namedb, String tabledb, String driverdb, String fallbackfile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't work as Jenkins binds parameters in jelly and parameters in the constructer with their definition name.
(they should be `String dbUsername, String dbPassword, ...)