diff src/main/java/de/mpiwg/gazetteer/utils/DBService.java @ 103:090035f79373

extract db url into config file
author Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
date Fri, 29 Sep 2017 16:15:28 +0200
parents f4242db6206b
children
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/gazetteer/utils/DBService.java	Fri Sep 29 16:03:06 2017 +0200
+++ b/src/main/java/de/mpiwg/gazetteer/utils/DBService.java	Fri Sep 29 16:15:28 2017 +0200
@@ -38,11 +38,6 @@
 	// JDBC driver name and database URL
 	static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
 
-
-	//static final String DB_URL = "jdbc:mysql://localhost/";
-	static final String DB_URL = "jdbc:mysql://194.94.134.66/";	// TODO: when move Gazetteer database to SBB, need to re-config this
-																// replace the IP with SBB's host IP: 194.94.134.66
-
 	private static String SECTIONS_TABLE = "sections_index";
 
 
@@ -1111,7 +1106,8 @@
 	public static Connection getNewConnection() throws SQLException, IOException{
 
 		return DriverManager.getConnection(
-				DB_URL + PropertiesUtils.getPropValue("db_gazetter_name") + "?useUnicode=yes&characterEncoding=UTF-8",
+				PropertiesUtils.getPropValue("db_gazetter_url") + 
+                PropertiesUtils.getPropValue("db_gazetter_name") + "?useUnicode=yes&characterEncoding=UTF-8",
 				PropertiesUtils.getPropValue("db_gazetter_username"),
 				PropertiesUtils.getPropValue("db_gazetter_password"));