How to create a config file
-
මට දැනගන්න ඔනේ කොහොමද db connection detials store කරලා තියාගන්න config file එකක් හදාගන්නේ මගේ java application එකට,
උදා : wordpress manual install කරන්වන්ම් අපිට config file කිය්න එක edit කරලා db name user password දෙනවනේ අන්න ඒ වගේ එකක් java application එකට හදාගන්න විදිහ
-
@Malith FYA
-
@ChrisSachintha oya mokak hari framework ekak use karanwda , spring wage use karanwnm eyalage default config file ekak enwa . pure java use karanwanm oyta java class ekak hadagena tiyagan wenawa . ex db_connection.java wage meke oyta methods hadagan puluwn
-
@Malith tutorial ekak hari mokak hari refference ekak hari nadha
-
@ChrisSachintha balala ewanam
-
-
if java spring boot, u can use the application.properties file with code
#DATA SOURCE
spring.datasource.url=jdbc:mysql://db4free.net:3306/xxxdb?useSSL=false
spring.datasource.username=xxxdb
spring.datasource.password=xxxx#HIBERNATE PROPERTIES
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
spring.jpa.hibernate.ddl-auto=updatesecurity.ignored=/**
#server.contextPath=/api
server.port=8080 -
@tnlthanzeel pure java walata ahanne mchan
-
oh then i dont know bro, but i found this
https://stackoverflow.com/questions/212539/java-equivalent-to-app-config -
@tnlthanzeel @ChrisSachintha FYI