test
Форк от lirfrnk/test
1package com.bittercode.util;
2
3import java.io.IOException;
4import java.io.InputStream;
5import java.util.Properties;
6
7class DatabaseConfig {
8
9static Properties prop = new Properties();
10static {
11
12ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
13InputStream input = classLoader.getResourceAsStream("application.properties");
14
15try {
16prop.load(input);
17} catch (IOException e) {
18e.printStackTrace();
19}
20}
21
22public final static String DRIVER_NAME = prop.getProperty("db.driver");
23public final static String DB_HOST = prop.getProperty("db.host");
24public final static String DB_PORT = prop.getProperty("db.port");
25public final static String DB_NAME = prop.getProperty("db.name");
26public final static String DB_USER_NAME = prop.getProperty("db.username");
27public final static String DB_PASSWORD = prop.getProperty("db.password");
28public final static String CONNECTION_STRING = DB_HOST + ":" + DB_PORT + "/" + DB_NAME;
29
30}
31