Programming/jsp2014. 4. 1. 18:32
"jdbc:oracle:thin:@myhost:1521:orcl"

jdbc를 통해 (java)
oracle db에 (database server type)
thin driver를 통해
myhost 라는 서버에
1521 번 포트로
orcl 데이터베이스에 접속(database name)



Understanding the Forms of getConnection()

Specifying a Databse URL, User Name, and Password

The following signature takes the URL, user name, and password as separate parameters:

getConnection(String URL, String user, String password);

Where the URL is of the form:
  jdbc:oracle:<drivertype>:@<database>

The following example connects user scott with password tiger to a database with SID orcl through port 1521 of host myhost, using the Thin driver.

Connection conn = DriverManager.getConnection
  ("jdbc:oracle:thin:@myhost:1521:orcl", "scott", "tiger");

------------
Oralce provides four types of JDBC driver.

Thin Driver, a 100% Java driver for client-side use without an Oracle installation, particularly with applets. The Thin driver type is thin. To connect user scott with password tiger to a database with SID (system identifier) orcl through port 1521 of host myhost, using the Thin driver, you would write :
  Connection conn = DriverManager.getConnection
  ("jdbc:oracle:thin:@myhost:1521:orcl", "scott", "tiger");
  
OCI Driver for client-side use with an Oracle client installation. The OCI driver type is oci. To connect user scott with password tiger to a database with SID (system identifier) orcl through port 1521 of host myhost, using the OCI driver, you would write :
  Connection conn = DriverManager.getConnection
  ("jdbc:oracle:oci:@myhost:1521:orcl", "scott", "tiger");
  
Server-Side Thin Driver, which is functionally the same as the client-side Thin driver, but is for code that runs inside an Oracle server and needs to access a remote server, including middle-tier scenarios. The Server-Side Thin driver type is thin and there is no difference in your code between using the Thin driver from a client application or from inside a server.
 
Server-Side Internal Driver for code that runs inside the target server, that is, inside the Oracle server that it must access. The Server-Side Internal driver type is kprb and it actually runs within a default session. You are already "connected". Therefore the connection should never be closed.
To access the default connection, write:
  DriverManager.getConnection("jdbc:oracle:kprb:");
  or:
  DriverManager.getConnection("jdbc:default:connection:");

[링크 : http://docs.oracle.com/cd/E11882_01/appdev.112/e13995/oracle/jdbc/OracleDriver.html

'Programming > jsp' 카테고리의 다른 글

jsp / tomcat connection pool  (0) 2014.04.02
jsp jdbc 기본 코드  (0) 2014.04.01
jsp action tag / <jsp:useBean  (0) 2014.03.31
jsp cookie  (0) 2014.03.31
jsp 액션 태그 - <jsp:  (0) 2014.03.28
Posted by 구차니