Oracle SQL Developer 和 PostgreSQL
我正在尝试使用 Oracle SQL Developer 3.0.04 连接到 PostgreSQL 9.1 数据库,但到目前为止还没有取得任何成功。
首先,如果我在首选项中添加第三方驱动程序,则在添加新连接时,没有 PostgreSQL 选项卡(不过它对于 MySQL 来说工作得很好)。我使用的是 JDBC4 版本 9.1 驱动程序,但我尝试了相同版本的 JDBC3,但仍然得到相同的结果。
其次,添加新连接时没有什么比手动配置选项卡更好的了。最接近的是 Oracle 选项卡上的“高级”选项,我可以在其中提供自定义 URL,但它失败了,因为抱怨所选的驱动程序(当然)。
最后,我通过从 XML 文件导入连接(如下内容)进行连接,但它仅显示我的架构,而不显示其中的表。
所以,我的问题是:Orable SQL Developer 支持 PostgreSQL 连接吗?有没有其他方法可以让我的表格显示在 ObjectViewer 中?
<?xml version = '1.0' encoding = 'UTF-8'?>
<References xmlns="http://xmlns.oracle.com/adf/jndi">
<Reference name="Lumea" className="oracle.jdeveloper.db.adapter.DatabaseProvider" credentialStoreKey="Lumea" xmlns="">
<Factory className="oracle.jdeveloper.db.adapter.DatabaseProviderFactory"/>
<RefAddresses>
<StringRefAddr addrType="user">
<Contents>lumea</Contents>
</StringRefAddr>
<StringRefAddr addrType="subtype">
<Contents>thirdParty</Contents>
</StringRefAddr>
<StringRefAddr addrType="customUrl">
<Contents>jdbc:postgresql://localhost:5432/versates</Contents>
</StringRefAddr>
<StringRefAddr addrType="SavePassword">
<Contents>true</Contents>
</StringRefAddr>
<StringRefAddr addrType="password">
<Contents>myencryptedpass</Contents>
</StringRefAddr>
<StringRefAddr addrType="driver">
<Contents>org.postgresql.Driver</Contents>
</StringRefAddr>
<StringRefAddr addrType="DeployPassword">
<Contents>true</Contents>
</StringRefAddr>
</RefAddresses>
</Reference>
</References>
I'm trying to connect to a PostgreSQL 9.1 database using Oracle SQL Developer 3.0.04, but I'm not having any success so far.
First, if I add a third party driver on preferences, when adding a new connection there's no tab for PostgreSQL (it works fine for MySQL though). I'm using a JDBC4 version 9.1 driver, but I tried a JDBC3 of the same version and still get the same thing.
Second, there's nothing like manual configuration tab when adding a new connection. The closest is the Advanced option on Oracle tab, where I can provide a custom URL, but it fails because complains about the selected Driver (of course).
Finally, I got connected importing a connection from an XML file (contents below), but it displays only my schemas and doesn't show my tables inside them.
So, my question is: does Orable SQL Developer support PostgreSQL connections? Is there any other way to have my tables being displayed in the ObjectViewer?
<?xml version = '1.0' encoding = 'UTF-8'?>
<References xmlns="http://xmlns.oracle.com/adf/jndi">
<Reference name="Lumea" className="oracle.jdeveloper.db.adapter.DatabaseProvider" credentialStoreKey="Lumea" xmlns="">
<Factory className="oracle.jdeveloper.db.adapter.DatabaseProviderFactory"/>
<RefAddresses>
<StringRefAddr addrType="user">
<Contents>lumea</Contents>
</StringRefAddr>
<StringRefAddr addrType="subtype">
<Contents>thirdParty</Contents>
</StringRefAddr>
<StringRefAddr addrType="customUrl">
<Contents>jdbc:postgresql://localhost:5432/versates</Contents>
</StringRefAddr>
<StringRefAddr addrType="SavePassword">
<Contents>true</Contents>
</StringRefAddr>
<StringRefAddr addrType="password">
<Contents>myencryptedpass</Contents>
</StringRefAddr>
<StringRefAddr addrType="driver">
<Contents>org.postgresql.Driver</Contents>
</StringRefAddr>
<StringRefAddr addrType="DeployPassword">
<Contents>true</Contents>
</StringRefAddr>
</RefAddresses>
</Reference>
</References>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
Oracle SQL Developer 4.0.1.14 确实支持与 PostgreSQL 的连接。
工具→首选项
,数据库→第三方 JDBC 驱动程序
并添加 jar 文件(请参阅http://www.oracle.com/technetwork/products/migration/ jdbc-migration-1923524.html 逐步示例)数据库连接
,而不是Oracle
,选择PostgreSQL
选项卡编辑:
如果您有不同的用户名和数据库名称,应在主机名中指定:
主机名/数据库?
(不要忘记?
)或主机名:端口/数据库?
。(感谢@kinkajou和@Kloe2378231;更多详细信息请参见https://stackoverflow.com/a/28671213/565525) 。
Oracle SQL Developer 4.0.1.14 surely does support connections to PostgreSQL.
Tools → Preferences
,Database → Third Party JDBC Drivers
and add the jar file (see http://www.oracle.com/technetwork/products/migration/jdbc-migration-1923524.html for step by step example)Database Connection
and instead ofOracle
, selectPostgreSQL
tabEdit:
If you have different user name and database name, one should specify in hostname:
hostname/database?
(do not forget?
) orhostname:port/database?
.(thanks to @kinkajou and @Kloe2378231; more details on https://stackoverflow.com/a/28671213/565525).
我刚刚下载了适用于 OS X (10.9) 的 SQL Developer 4.0,它刚刚结束测试版。我还下载了最新的 Postgres JDBC jar。我一高兴就决定安装它(与 SQL Dev 中其他第三方数据库驱动程序的方法相同),并且它接受了它。每当我单击“新连接”时,现在都会有一个 Postgres 选项卡...单击它会显示一个询问数据库连接详细信息的面板。
这个问题的答案变了,不管支持与否,似乎都可以。有一个“选择数据库”按钮,如果单击该按钮,则会显示一个下拉列表,其中包含可用的 postgres 数据库。您创建连接并打开它,它会列出该数据库中的架构。大多数 postgres 命令似乎都可以工作,但没有 psql 命令(\list 等)。
那些需要一个工具来连接多个数据库引擎的人现在可以使用 SQL Developer。
I've just downloaded SQL Developer 4.0 for OS X (10.9), it just got out of beta. I also downloaded the latest Postgres JDBC jar. On a lark I decided to install it (same method as other third party db drivers in SQL Dev), and it accepted it. Whenever I click "new connection", there is a tab now for Postgres... and clicking it shows a panel that asks for the database connection details.
The answer to this question has changed, whether or not it is supported, it seems to work. There is a "choose database" button, that if clicked, gives you a dropdown list filled with available postgres databases. You create the connection, open it, and it lists the schemas in that database. Most postgres commands seem to work, though no psql commands (\list, etc).
Those who need a single tool to connect to multiple database engines can now use SQL Developer.
Oracle SQL Developer 不支持与 PostgreSQL 的连接。使用 pgAdmin 来连接 PostgreSQL,您可以从以下 URL 获取它
http://www.pgadmin.org/download/windows.php
Oracle SQL Developer doesn't support connections to PostgreSQL. Use pgAdmin to connect to PostgreSQL instead, you can get it from the following URL
http://www.pgadmin.org/download/windows.php
如果没有与用户名同名的数据库,则单击“选择数据库”将失败,并出现类似“状态:失败 -FATAL:数据库“your_username”不存在”的错误解决
方法将
5432/database_name?
放入 Port 字段中,其中5432
是 Postgres 实例的端口,database_name
是your_username
有权访问的现有数据库的名称。然后再次单击“选择数据库”,它应该可以工作。现在您可以选择所需的数据库并从端口字段中删除额外的/database_name?
。If there is no database with the same name as the username, then clicking "Choose Database" will fail with an error like "Status : Failure -FATAL: database "your_username" does not exist"
To work around this, put
5432/database_name?
in the Port field, where5432
is the port of your Postgres instance anddatabase_name
is the name of at an existing database thatyour_username
has access to. Then click "Choose Database" again and it should work. Now you can choose the database you want and remove the extra/database_name?
from the Port field.我设法使用 SQL Developer 连接到 postgres。
我下载了 postgres jdbc 驱动程序并将其保存在一个文件夹中。
我运行 SQL Developer ->工具->首选项->搜索->数据库连接
我为数据库和数据建模器定义了 postgres jdbc 驱动程序(可选)。
这就是窍门。
创建新连接时定义主机名,例如 localhost/crm?其中 crm 是数据库名称。测试连接,工作正常。
I managed to connect to postgres with SQL Developer.
I downloaded postgres jdbc driver and saved it in a folder.
I run SQL Developer -> Tools -> Preferences -> Search -> JDBC
I defined postgres jdbc driver for the Database and Data Modeler (optional).
This is the trick.
When creating new connection define Hostname like localhost/crm? where crm is the database name. Test the connection, works fine.
我认为这个问题需要更新答案,因为自从最初提出这个问题以来,PostgreSQL 和 SQLDeveloper 都已经更新了好几次。
我有一个在 Azure 中运行的 PostgreSQL 实例,且 SSLMODE=Require。
虽然我一直在使用 DBeaverCE 访问该实例并生成 ER 图,但我已经非常熟悉 SQLDeveloper,它现在是 v19.4。
有关下载最新 PostgreSQL JDBC 驱动程序及其放置位置的说明是正确的。不过,改变的是配置数据库访问的位置。
您将找到一个文件
$HOME/.sqldeveloper/system19.4.0.354.1759/o.jdeveloper.db.connection.19.3.0.354.1759/connections.json
:您可以将此连接与以下两者一起使用Data Modeller 和 SQLDeveloper 的管理功能。需要在 customUrl 中指定所有端口、dbname 和 sslmode,因为 SQLDeveloper 不会在通过 JDBC 发送的内容中包含 sslmode,因此您必须手动构建它。
I think this question needs an updated answer, because both PostgreSQL and SQLDeveloper have been updated several times since it was originally asked.
I've got a PostgreSQL instance running in Azure, with SSLMODE=Require.
While I've been using DBeaverCE to access that instance and generate an ER Diagram, I've gotten really familiar with SQLDeveloper, which is now at v19.4.
The instructions about downloading the latest PostgreSQL JDBC driver and where to place it are correct. What has changed, though, is where to configure your DB access.
You'll find a file
$HOME/.sqldeveloper/system19.4.0.354.1759/o.jdeveloper.db.connection.19.3.0.354.1759/connections.json
:You can use this connection with both Data Modeller and the admin functionality of SQLDeveloper. Specifying all the port, dbname and sslmode in the customUrl are required because SQLDeveloper isn't including the sslmode in what it sends via JDBC, so you have to construct it by hand.
我通过将用户名放入“用户名”字段(无密码)并单击“选择数据库”来获取要填充的数据库列表。不适用于空白的用户名字段,我只能通过这种方式连接到我的用户数据库。
(这是使用 SQL Developer 4.0.0.13、Postgres.app 9.3.0.0 和 postgresql-9.3-1100.jdbc41.jar,FWIW。)
I got the list of databases to populate by putting my username in the Username field (no password) and clicking "Choose Database". Doesn't work with a blank Username field, I can only connect to my user database that way.
(This was with SQL Developer 4.0.0.13, Postgres.app 9.3.0.0, and postgresql-9.3-1100.jdbc41.jar, FWIW.)
Oracle SQL Developer 2020-02 支持 PostgreSQL,但这只是基础知识,通过在 jdbc 目录下添加 postgreSQL 驱动程序并通过添加为第 3 方驱动程序进行配置。
支持的功能:
不支持的功能:
可悲的是 Oracle 应该只更改此视图后面的查询,以防万一PostgreSql 连接数。例如,对于索引,他们需要使用此查询: select * from pg_catalog.pg_indexes;
Oracle SQL Developer 2020-02 support PostgreSQL, but it is just the basics by adding postgreSQL driver under jdbc dir and configure by adding as a 3rd party driver.
The supported functionality:
Not supported functionalities:
The sad thing is Oracle should only change the queries behind this view in case of PostgreSql connections. For example for indexes they need to use this query: select * from pg_catalog.pg_indexes;
也许 Oracle SQL Developer 连接到 postgresql 时存在一些错误。但是我成功地将 postgresql 与 navicat 连接起来。(我的 postgresql 用户名和数据库名称不同
Maybe there are some bugs in Oracle SQL Developer when it connect to the postgresql.However I connect postgresql with navicat successfully.(My postgresql username and database name are different
主机=本地主机/postgres?如果您需要架构/数据库使用,则为我工作:
localhost/postgres?currentSchema=myschema
ex: localhost/postgres?currentSchema=public
连接后,您还可以使用
[选择数据库]按钮并下拉
我们其他人的sql开发人员postgres jdbc url
host= localhost/postgres? worked for me if you need a schema/database use:
localhost/postgres?currentSchema=myschema
ex: localhost/postgres?currentSchema=public
once connected, you can also use the
[Choose Database] button and pull down
sql developer postgres jdbc url for the rest of us