Jdbc.properties

jdbc.properties

1 예시 1[ | ]

jdbc.url = jdbc:mysql://localhost:3306/jmnotedb
jdbc.driver = com.mysql.jdbc.Driver
jdbc.username = dbuser
jdbc.password = P@ssw0rd

2 예시 2[ | ]

jdbc.url = jdbc:sqlserver://135.79.246.80:1521;databaseName=jmnotedb
jdbc.driver = com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.username = dbuser
jdbc.password = P@ssw0rd

3 읽어오기[ | ]

Properties properties = new Properties();
properties.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("config.properties"));
String url = properties.getProperty("jdbc.url");
String driver = properties.getProperty("jdbc.driver");
String username = properties.getProperty("jdbc.username");
String password = properties.getProperty("jdbc.password");
... (생략)

4 같이 보기[ | ]

5 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}