1 / 4

Property

Property. ㅇ < context:property-placeholder > - < context:property-placeholder location =" classpath:config.properties " />. Java. config.properties. @Value(“${prop}”) private String prop; @Value(“${ prop.id}”) private String propId ; @Value(“${ prop.pw}”)

Download Presentation

Property

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Property ㅇ<context:property-placeholder> - <context:property-placeholder location="classpath:config.properties" /> Java config.properties @Value(“${prop}”) private String prop; @Value(“${prop.id}”) private String propId; @Value(“${prop.pw}”) private String propPw; prop=Test prop.id=seorab prop.pw=pass db.driver=oracle.jdbc.driver.OracleDriver db.url=jdbc:oracle:thin:@localhost:1521:xe db.id=scott db.pw=tiger

  2. Property ㅇ<context:property-placeholder> - <context:property-placeholder location="classpath:config.properties" /> xml <context:property-placeholder location="classpath:edu/seowon/jdbc/config.properties" /> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="${db.driver}" /> <property name="url" value="${db.url}" /> <property name="username" value="${db.id}" /> <property name="password" value="${db.pw}" /> </bean>

  3. Property ㅇ<util:properties> - <util:properties id="config" location="classpath:edu/seowon/jdbc/config.properties" /> Java config.properties @Value(“#{config[‘prop’]}”) private String prop; @Value(“#{config[‘prop.id’]}”) private String propId; @Value(“#{config[‘prop.pw’]}”) private String propPw; prop=Test prop.id=seorab prop.pw=pass db.driver=oracle.jdbc.driver.OracleDriver db.url=jdbc:oracle:thin:@localhost:1521:xe db.id=scott db.pw=tiger

  4. Property ㅇ<util:properties> - <util:properties id="config" location="classpath:edu/seowon/jdbc/config.properties" /> xml <util:properties location="classpath:edu/seowon/jdbc/config.properties" /> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value=“#{config[‘db.driver’]}" /> <property name="url" value=“#{config[‘db.url’]}" /> <property name="username" value=“#{config[‘db.id’]}" /> <property name="password" value=“#{config[‘db.pw’]}" /> </bean>

More Related