Sharing databases between projects within Intellij

六眼飞鱼酱① 提交于 2020-01-12 04:04:17

问题


I use Intellij to inspect databases, run sql, view data in tables etc. This all works fine but the only thing I am missing is the ability to define these datasources once and view them in all my projects i.e. that I can share them between other projects and not have to redefine them for new projects. Is this possible in Intellij?


回答1:


Go to the Database tool window and click on the Data Source Properties button. Select the data source you want to make global. Click on the Make Global button in the tool bar above.

The Make Global button looks like this:

Now you can use the data source from all your projects. However a global data source is not stored in the project files, so any other developers working on the same project will need to define their own data source.




回答2:


The Make Global button is no longer green (Intellij Ultimate 2018.02).

It's located above the datasource list, as in the (crappy) screenshot.




回答3:


In IntelliJ 2019.1, 2019.2 to share connection to DB with multiple projects:

  1. Open Database panel
  2. Datasource Properties
  3. Make Global



回答4:


So how I did it on 2018.3 was to go to the Database tool window then right click on your datasource you want to copy then Database Tools -> Copy Datasource to Clipboard. In the Database window for the project you want to copy to click the + at the top left and it has an option to Import from Clipboard.



来源:https://stackoverflow.com/questions/41934918/sharing-databases-between-projects-within-intellij

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!