英文:
How to add a postgresql jdbc driver to intellij?
问题
我正在尝试添加一个驱动程序,这个页面告诉我要打开 View | Tool Windows | Database
,链接:https://www.jetbrains.com/help/idea/managing-data-sources.html
但是并没有这样的工具窗口。请参考图片:
我尝试了按下 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
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
在进行操作后,您应该能够成功连接到数据库。
英文:
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
After the operation you should get successful connection with your database.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论