# HG changeset patch # User Calvin Yeh # Date 1506694528 -7200 # Node ID 090035f793731b5286b0711fc9d63a3c3dde7500 # Parent 6a508b605b5fa96b2e66fd1bf5fbfc3131aeb797 extract db url into config file diff -r 6a508b605b5f -r 090035f79373 src/main/java/de/mpiwg/gazetteer/utils/DBService.java --- 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")); diff -r 6a508b605b5f -r 090035f79373 src/main/resources/config.properties --- a/src/main/resources/config.properties Fri Sep 29 16:03:06 2017 +0200 +++ b/src/main/resources/config.properties Fri Sep 29 16:15:28 2017 +0200 @@ -6,6 +6,7 @@ #db_gazetter_name=Gazetteer # SBB server: +db_gazetter_url=jdbc:mysql://194.94.134.66/ db_gazetter_name=gazetteer db_gazetter_username=gazetteer db_gazetter_password=R-9C7Bmx%2