将一台PC上安装的Oracle数据库从另一台计算机连接到Java应用程序 [英] Connecting to Oracle database installed on one pc to the java application from another machine
问题描述
我已经在计算机上安装了Oracle 12c(桌面类),并且可以通过同一台计算机上的sql developer使用它.现在如何在局域网中从另一台计算机(对于Java应用程序)使用同一数据库?我尝试使用jdbc瘦驱动程序,如下所示:jdbc:oracle:thin:@10.0.11.69:1521:orcl
其中10.0.11.69是我的IP地址,其中安装了Oracle.我是否需要安装任何安装了oracle(10.0.11.69)的服务器才能从另一台计算机连接到我的数据库?
我从过去的3天开始尝试这种方法,并提到了许多相同模型的问题,但没有一个解决了我的问题.
我的tnsnames.ora描述如下:
I've installed Oracle 12c (desktop class) on my machine, and I can use it via sql developer on the same machine. Now how can I use the same database from another machine (for java application) in the LAN? I tried using the jdbc thin driver as follows: jdbc:oracle:thin:@10.0.11.69:1521:orcl
where 10.0.11.69 is my ip address where Oracle is installed. Do i need to install any server where oracle is installed(10.0.11.69) to connect to my db from another machine?
I'm trying this from past 3 days and referred to many questions of the same model but none solved my issue.
My tnsnames.ora description is as follows:
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
谢谢.
推荐答案
感谢以下链接,研究了很长时间之后,我发现我需要在listener.ora文件中添加我的LAN地址(10.0.11.69),以解决我的问题.
after researching for a long time I found that I need to add my LAN address(10.0.11.69) in the listener.ora file which solves my problem.
所以我的listener.ora现在看起来像这样:
so my listener.ora will looks like this now:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST=
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.11.69)(PORT = 1521))
)
)
)
这篇关于将一台PC上安装的Oracle数据库从另一台计算机连接到Java应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!