Skip to content
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

Let DB properties be loaded from resource path #287

Open
alcarraz opened this issue Oct 26, 2023 · 0 comments
Open

Let DB properties be loaded from resource path #287

alcarraz opened this issue Oct 26, 2023 · 0 comments

Comments

@alcarraz
Copy link
Contributor

alcarraz commented Oct 26, 2023

It would be nice that, in addition to be able to load DB properties from a file, it would be possible to load it from a resource in the class path.

I'm proposing that, similarly to the packages, use the jar: prefix for that, I'm writing the code for the PR, but if anyone else sees a reason not to do this or to do it differently I can adapt. Personally, I would prefer classpath: (or cp) or something else like that as a prefix, but for consistency I will go with jar:. Or I could implement all of them if agreed.

I'm talking about the DB_PROPERTIES system property in:

private void configureProperties(Configuration cfg) throws IOException
{
String propFile = System.getProperty("DB_PROPERTIES", "cfg/db.properties");
Properties dbProps = loadProperties(propFile);
if (dbProps != null)
{
cfg.addProperties(dbProps);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant