Java 如何在 SQL Developer 4.0 中安装最新的 Postgresql JDBC jar
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21035508/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install latest Postgresql JDBC jar in SQL Developer 4.0
提问by Charlesliam
I am using CentOS and Postgresql as my database.
我使用 CentOS 和 Postgresql 作为我的数据库。
According to thisthread SQL Developer can now support Postgresql. So I manage to download the requirement such as SQL Developer 4.0and Postgresql jdbc connector.
根据这个线程 SQL Developer 现在可以支持 Postgresql。所以我设法下载了SQL Developer 4.0和Postgresql jdbc connector 等需求。
Is there a step by step procedure how to install the jdbc connector to sql developer? I tried to follow the PostgreSQL documentationbut with no luck.
是否有分步过程如何将 jdbc 连接器安装到 sql developer?我试图遵循PostgreSQL 文档,但没有运气。
I tried to extract/install the jar file using java -jar postgresql-9.3_1100.jdbc41.jar
the return is no main manifest attribute in postgresql-9.3_1100.jdbc41.jar
我尝试使用java -jar postgresql-9.3_1100.jdbc41.jar
返回来提取/安装 jar 文件no main manifest attribute in postgresql-9.3_1100.jdbc41.jar
my java version is: 1.7.0_45
我的Java版本是: 1.7.0_45
采纳答案by Craig Ringer
You can't just runa JDBC driver as if it was an executable JAR.
您不能像运行可执行 JAR一样运行JDBC 驱动程序。
java -jar postgresql-9.3_1100.jdbc41.jar
will produce the error:
会产生错误:
no main manifest attribute in postgresql-9.3_1100.jdbc41.jar
because it has no main
manifest attribute in the jar. That's because you're not supposed to run it.
因为它main
在 jar 中没有manifest 属性。那是因为你不应该运行它。
Install the JDBC driver, like any other JDBC driver, according to the instructions for your application. See "Oracle SQL Developer" install JDBC driver.
根据应用程序的说明安装 JDBC 驱动程序,就像安装任何其他 JDBC 驱动程序一样。请参阅“Oracle SQL Developer”安装 JDBC 驱动程序。
The above search finds instructions on installing 3rd party (non-Oracle) JDBC driversand "Configure JDBC in Oracle JDBC driver". I strongly suggest following those instructions.
上述搜索找到有关安装 3rd 方(非 Oracle)JDBC 驱动程序和“在 Oracle JDBC 驱动程序中配置 JDBC”的说明。我强烈建议遵循这些说明。
In future, please explain step by step what you've done when you're having a problem, where you get stuck, and what you expect to happen instead.
以后,请逐步解释您在遇到问题时做了什么,遇到了什么问题,以及您希望发生什么。
P.s. I've submitted a patch to PgJDBC so that when you try this in future, it'll give you an informative error. See https://github.com/pgjdbc/pgjdbc/pull/112
Ps 我已经向 PgJDBC 提交了一个补丁,所以当你以后尝试这个时,它会给你一个信息性错误。见https://github.com/pgjdbc/pgjdbc/pull/112