Connecting to an Oracle Database

原创 2005年06月02日 14:52:00

This example uses an Oracle JDBC driver to connect to an Oracle database instance located at 127.0.0.0:1521 with an sid called mydatabase.

    Connection connection = null;
    try {
        // Load the JDBC driver
        String driverName = "oracle.jdbc.driver.OracleDriver";
        Class.forName(driverName);
    
        // Create a connection to the database
        String serverName = ;
        String portNumber = ;
        String sid = ;
        String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
        String username = ;
        String password = ;
        connection = DriverManager.getConnection(url, username, password);
    } catch (ClassNotFoundException e) {
        // Could not find the database driver
    } catch (SQLException e) {
        // Could not connect to the database
    }

Connecting to Container Databases (CDB) and Pluggable Databases (PDB) in Oracle Database 12c

Connecting to the root of a container database is the same as that of any previous database instance...

How to Add the JVM Component to an Existing Oracle Database (Doc ID 1461562.1)

Applies to: Oracle Server - Enterprise Edition - Version 11.2.0.1.0 and later Information in this...

1 Introduction to the Oracle Database

1 Introduction to the Oracle Database---------------------------------------------------------------...
  • yyzh535
  • yyzh535
  • 2011年02月24日 00:11
  • 1284

How to manage Oracle Database User profile

SQL> set linesize 200 SQL> col TEMPORARY_TABLESPACE for a25 SQL> col DEFAULT_TABLESPACE for a25   ...

Important Changes to Oracle Database Patch Sets Starting With 11.2.0.2 [ID 1189783.1]

 Important Changes to Oracle Database Patch Sets Starting With 11.2.0.2 [ID 1189783.1] Modified 13-S...

How to Configure DG4MSQL (Oracle Database Gateway for MS SQL Server) 64bit Unix OS (Linux, Solaris,

How to Configure DG4MSQL (Oracle Database Gateway for MS SQL Server) 64bit Unix OS (Linux, Solaris, ...

How to install Oracle Database Server software silently with customized listener configuration

Applies to: Oracle Universal Installer - Version: 10.2.0.1 and later   [Release: 10.2 and later ] ...

1 Introduction to Oracle Database读书笔记

文章出处 Home / Database / Oracle Database Online Documentation 11g Release 2 (11.2) / Database Administ...

HOW TO GET ORACLE DATABASE IDENTIFIER (DBID)

DBID stands for database identifier. Which is a unique identifier for each oracle database running.w...
  • t0nsha
  • t0nsha
  • 2012年06月06日 14:33
  • 1194

How to Export and Import Oracle Database Statistics Information

Some times  not convenient to the database for analyisis when the database have a large mount of dat...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Connecting to an Oracle Database
举报原因:
原因补充:

(最多只允许输入30个字)