4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

eclipseでoracleに接続する!

Last updated at Posted at 2018-06-10

eclipseでの開発が長かったので、これ以外のIDEは慣れていないのです。

というわけで復習も兼ねて、、

Mavenが好きだけど、jdbcは提供されていない(?)ので、
ここからjarをダウンロードして、外部jarに追加。
http://download.oracle.com/otn/utilities_drivers/jdbc/10205/ojdbc14.jar

oracleインストールの中でインスタンス生成までするので、
↓で接続文字列を確認。ポートは1521。

SQLコマンドラインから実行
SELECT DBID,NAME,DB_UNIQUE_NAME,CURRENT_SCN,LOG_MODE FROM V$DATABASE

DBID NAMEが接続文字列。

これを設定!

main
Class.forName("oracle.jdbc.driver.OracleDriver");
// Oracle8iに接続
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "system", "password");
// ステートメントを作成
Statement stmt = conn.createStatement();
4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?