| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: A little help connecting to oracle from java. Anyone? Please!!? :-)
On Sun, 11 Aug 2002 21:21:21 +0800, Sybrand Bakker wrote
(in message <ulcqa9f3sffa79_at_corp.supernews.com>):
>
> "Simon Harvey" <noThanks_at_pdf.com> wrote in message
> news:3d563604_7_at_news.teranews.com...
>> Another thing that might provide a clue to this is that I can connect
>> SQL Plus with the name dayton but not the name dayton.homenet. Shouldnt I
>> able to do both. I'm sitting at the machine which has oracle on it. >> Just as a reminder my tnsnames entry is: >> >> >> DAYTON = >> (DESCRIPTION = >> (ADDRESS_LIST = >> (ADDRESS = (PROTOCOL = TCP)(HOST = aegis)(PORT = 1521)) >>> >> (CONNECT_DATA = >> (SERVICE_NAME = dayton.homenet) >>> >>> >> >> Thanks >> Simon >> >>
ok here is some code that will get you cvonnected to hte oracel database it returns a connection handle.
public static Connection getConnectionUsingDriverManager() throws Exception {
Class.forName(JDBC_DRIVER);
Connection conn = DriverManager.getConnection(DB_URL, DB_USER,
DB_PWD);
conn.setAutoCommit(false);
return conn;
static String DB_PORT=":1521:orcl";
static String DB_USER = "user name in here";
static String DB_PWD = "password in here";
Received on Sun Aug 11 2002 - 17:36:28 CDT
![]() |
![]() |