java - "Solutions"用于创建数据库、表、列和填充表?

标签 java mysql jdbc

我想编写执行此类任务的代码:

check if a given database exists.
1a-->if no, then create a DB, make some tables in it and some columns too.

   1.1-->Check if certain columns in a "list" exist. 
         Create those columns which don't exist yet.
   1.2--> once 1.1 is done, populate these tables with some test data. 

1b-->else check if certain tables exist and create them if they 
     don't exist. After that, do the stuff mentioned in 1.1 and 1.2 

我是自己编写代码还是已经存在针对此类任务的“解决方案”?

最佳答案

我可以提出其他建议 flyway , 希望你会觉得它更容易掌握

关于java - "Solutions"用于创建数据库、表、列和填充表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11750037/

相关文章:

java - 如何防止段落和下表之间出现分页符

java - 将 <property-placeholder> 属性暴露给 Spring 环境

java - 我应该怎么做才能停止线程执行?

MySQL 无法启动?

mysql - 从同一个表连接 MySQL 结果

java - 准备好的SQL语句可以被数据库改写吗?

java - 将 Shiro Guice 与 jdbcRealm 结合使用

java - 使用 Hibernate 和 Postgres 读取/更新并发实体

mysql - SELECT 语句子查询

java - 如何重置 JDBC 连接池