tnsnames

How to connect JDBC to tns oracle

你。 提交于 2019-11-27 01:54:05
I can connect from plsql to database using tns file Now I want to connect to the database from my Java using JDBC. What I tried: I search google and I find that I have to using this connection String: "jdbc:oracle:thin:@//host:port))/tnsfile)"; My computer name is myPC The port that is written in the tnsfile is 5151 So I tried this connection String "jdbc:oracle:thin:@//myPC:5151))/tnsfile" but I got this Exception java.sql.SQLRecoverableException: IO ERROR: SO Exception was generated What am I doing wrong? How to connect my JDBC to the database using tns file? You have to set a property named

Why would Oracle.ManagedDataAccess not work when Oracle.DataAccess does?

天涯浪子 提交于 2019-11-26 22:35:43
问题 I'm developing a very simple application which I intend to use to troubleshoot an issue I am having on a few machines but before I even got that far I ran into a few issues, including cpu architecture differences and Oracle database libraries. I have a database server listed in tnsnames.ora , sitting in my C:\oracle\11g\network\admin directory. If I tnsping this server I get the desired response. If I code my C# program to connect to this server with the following code using Oracle.DataAccess

How to connect JDBC to tns oracle

爷,独闯天下 提交于 2019-11-26 09:48:43
问题 I can connect from plsql to database using tns file Now I want to connect to the database from my Java using JDBC. What I tried: I search google and I find that I have to using this connection String: \"jdbc:oracle:thin:@//host:port))/tnsfile)\"; My computer name is myPC The port that is written in the tnsfile is 5151 So I tried this connection String \"jdbc:oracle:thin:@//myPC:5151))/tnsfile\" but I got this Exception java.sql.SQLRecoverableException: IO ERROR: SO Exception was generated

TNS-12505: TNS:listener does not currently know of SID given in connect descriptor

痞子三分冷 提交于 2019-11-26 04:41:56
问题 I\'m trying to connect to Oracle 10.2.0 from NetBeans, using the following connection string: jdbc:oracle:thin:@localhost:1521:XE The weirdest part is that everything worked fine, until the one of the reboots. I started getting this TNS-12505 errors all the time; look at the final entries in my listener.log : TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production on 14-APR-2011 13:46:48 Copyright (c) 1991, 2005, Oracle. All rights reserved. System parameter file is D:\\oraclexe\\app\