Posts

Showing posts from January, 2009

glogin.sql,in 10g

In Oracle 10g, the glogin.sql and login.sql are run whenever you connect to a new user.

This is the glogin.sql additions that I am using in 10g:

set verify off termout off head off feed off

col login_prompt new_value welcome

SELECT upper(SYS_CONTEXT('USERENV','SERVER_HOST')
||' '
|| SYS_CONTEXT('USERENV','CURRENT_USER')
||'@'
|| SYS_CONTEXT('USERENV','DB_NAME')) login_prompt
FROM DUAL
;


set sqlprompt "_user'@'_connect_identifier> "

set verify on termout on head on feed on
prompt ************************************
prompt WELCOME TO &&welcome
prompt ************************************
prompt
set echo off serveroutput on size 100000 line 100 trims on

Connecting Oracle Server using JDBC

There is a small difference of the connection string when the target is SID or SERVICE
jdbc:oracle:driver_type:[username/password]@//host_name:port_number:SID_NAME

jdbc:oracle:driver_type:[username/password]@//host_name:port_number/SERVICE_NAME
Colon means SID
Slash means Service name