如何在IntelliJ中添加PostgreSQL JDBC驱动?

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

How to add a postgresql jdbc driver to intellij?

问题

我正在尝试添加一个驱动程序,这个页面告诉我要打开 View | Tool Windows | Database,链接:https://www.jetbrains.com/help/idea/managing-data-sources.html

但是并没有这样的工具窗口。请参考图片:

如何在IntelliJ中添加PostgreSQL JDBC驱动?

我尝试了按下 Alt-3,因为在菜单中找不到那个选项,但没有任何反应。

我应该如何从IntelliJ中添加postgresql驱动程序?我已经有了mysql驱动。

IntelliJ版本:IntelliJ IDEA 2020.2.1 社区版

英文:

I'm trying to add a driver, and this page tells me to open View | Tool Windows | Database https://www.jetbrains.com/help/idea/managing-data-sources.html

But there is no such tool window. See picture

如何在IntelliJ中添加PostgreSQL JDBC驱动?

I tried Alt-3 since that option is missing in the menu, but nothing happens.

How do I add the postgresql driver from Intellij? I already have the mysql driver.

IntelliJ version: IntelliJ IDA 2020.2.1 Community edition

答案1

得分: 6

正如您可以在这里看到的,Community 版本不包括数据库工具。

您需要使用 Ultimate 版本。

然后,如果您只想将该库添加到您的项目中,您可以在 IntelliJ 中选择项目根目录,按 F4 键。转到项目设置 ==> 库

点击 + 图标,然后选择 Java。

然后,浏览到您的驱动程序 jar 文件并选择它。

英文:

As you can see here, the Community edition does not include the database tool.

You'll need the Ultimate edition for that.

Then, if you want to just add the library to your project, you can select the project root in IntelliJ, hit F4. Go to Project settings ==> Libraries

Hit the + icon and choose Java.

Then, browse to your driver jar file and select it.

答案2

得分: 1

如果您使用的是Ubuntu。

如果由于某些原因无法下载驱动程序。

并且您想要手动安装驱动程序,那么您可以从这里下载postgreSQL驱动程序https://jdbc.postgresql.org/

然后将它复制到PHPStorm配置文件夹,使用以下路径。

/.config/JetBrains/PhpStorm2023.1/jdbc-drivers

在进行操作后,您应该能够成功连接到数据库。

如何在IntelliJ中添加PostgreSQL JDBC驱动?

如何在IntelliJ中添加PostgreSQL JDBC驱动?

英文:

If you use Ubuntu.

And the driver cannot be downloaded for some reasons.

And you want manually install the driver then you can download postgreSQL driver from here https://jdbc.postgresql.org/.

Then copy it into PHPStorm config folder using this this path.

/.config/JetBrains/PhpStorm2023.1/jdbc-drivers

如何在IntelliJ中添加PostgreSQL JDBC驱动?

After the operation you should get successful connection with your database.

如何在IntelliJ中添加PostgreSQL JDBC驱动?

huangapple
  • 本文由 发表于 2020年9月3日 20:37:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/63723867.html
匿名

发表评论

匿名网友

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

确定