Is there a way to include a SQL/JDBC database in a Java WAR web application so users don't have to set up MySQL?

huangapple go评论103阅读模式
英文:

Is there a way to include a SQL/JDBC database in a Java WAR web application so users don't have to set up MySQL?

问题

我有一个Java Spring MVC网络应用程序。

要运行它,用户必须安装并配置一个MySQL数据库供其连接(用于加载配置和存储用户信息等)。

是否有一种方法可以将一个SQL数据库包含在WAR文件中,以便用户无需设置MySQL数据库即可使用?

英文:

I have a Java Spring MVC web application.

To run it, users have to install and configure a MySQL database for it to connect to (to load configuration and store user info and so on).

Is there a way to include an SQL database in the WAR file that is ready to use, so users don't have to set up the MySQL database?

答案1

得分: 1

你可以尝试按照baeldung上的指南使用SQLite。

如果您希望数据被持久化,可以使用像SQLite、HSQLDB或H2这样的内存数据库。

英文:

You can try using SQLite by following this guide available on baeldung.

In-Memory Database like SQLite or HSQLDB or H2 should be used in case you want the data not to be persisted.

huangapple
  • 本文由 发表于 2020年9月25日 22:06:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/64065716.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定