Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop

    How to create a config file

    Programming
    java
    4
    10
    1382
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • KrissSachintha
      KrissSachintha last edited by

      මට දැනගන්න ඔනේ කොහොමද db connection detials store කරලා තියාගන්න config file එකක් හදාගන්නේ මගේ java application එකට,

      උදා : wordpress manual install කරන්වන්ම් අපිට config file කිය්න එක edit කරලා db name user password දෙනවනේ අන්න ඒ වගේ එකක් java application එකට හදාගන්න විදිහ

      Nubelle 1 Reply Last reply Reply Quote 0
      • dev_lak
        dev_lak last edited by

        @Malith FYA

        1 Reply Last reply Reply Quote 1
        • Nubelle
          Nubelle Web Development @KrissSachintha last edited by

          @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

          KrissSachintha 1 Reply Last reply Reply Quote 0
          • KrissSachintha
            KrissSachintha @Nubelle last edited by

            @Malith tutorial ekak hari mokak hari refference ekak hari nadha

            Nubelle 1 Reply Last reply Reply Quote 0
            • Nubelle
              Nubelle Web Development @KrissSachintha last edited by

              @ChrisSachintha balala ewanam

              Nubelle 1 Reply Last reply Reply Quote 0
              • Nubelle
                Nubelle Web Development @Nubelle last edited by

                meka refere karana https://medium.com/@sonaldwivedi/how-to-read-config-properties-file-in-java-6a501dc96b25

                1 Reply Last reply Reply Quote 0
                • tnlthanzeel
                  tnlthanzeel Web Development last edited by tnlthanzeel

                  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=update

                  security.ignored=/**

                  #server.contextPath=/api
                  server.port=8080

                  Nubelle 1 Reply Last reply Reply Quote 2
                  • Nubelle
                    Nubelle Web Development @tnlthanzeel last edited by

                    @tnlthanzeel pure java walata ahanne mchan

                    1 Reply Last reply Reply Quote 0
                    • tnlthanzeel
                      tnlthanzeel Web Development last edited by tnlthanzeel

                      oh then i dont know bro, but i found this
                      https://stackoverflow.com/questions/212539/java-equivalent-to-app-config

                      Nubelle 1 Reply Last reply Reply Quote 2
                      • Nubelle
                        Nubelle Web Development @tnlthanzeel last edited by

                        @tnlthanzeel @ChrisSachintha FYI

                        1 Reply Last reply Reply Quote 1
                        • 1 / 1
                        • First post
                          Last post

                        0
                        Online

                        3.6k
                        Users

                        1.3k
                        Topics

                        5.3k
                        Posts

                        • Privacy
                        • Terms & Conditions
                        • Donate

                        © Copyrights and All right reserved Lanka Developers Community

                        Powered by Axis Technologies (PVT) Ltd

                        Made with in Sri Lanka

                        | |