简体   繁体   中英

Properties file for database connection GWT

Hi is it possible to use a properties file in GWT that contains database details and then just change it anytime if for example, your database details change? This file would be read by java.sql.Connection so that the system could connect to the database. Thanks

It is possible to use files to configure GWT. Every GWT "module" has a definition xml file, and you can always define constants in your Java code too.

On the server side, you can use all of the Java tools you're used to, as long as your server supports them! GWT does not place any additional constraints on your server code.

I suggest you to try with an ORM (object-relational mapping) in order to handle your database communication. In this case you will naturally use a configuration-property file.

There is a good article that provides some info about using GWT with Hibernate .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM