September 30, 2009

TOTD #107: Connect to Oracle database using NetBeans

Categories: javaee, netbeans, totd

TOTD #106 explained how to install Oracle database 10g R2 on Mac OS X. This Tip Of The Day will explain how to connect Oracle database with NetBeans to leverage all the goodness provided by NetBeans for Java EE application development, Rails, and others.

  1. Download Oracle JDBC Drivers, specifically ojdbc14.jar. (ojdbc6.jar is recommended to be used with GlassFish v3).
  2. Using NetBeans 6.8 M1, in Services tab, right-click on "Databases" and select "New Connection…" as shown:

  3. Expand "Name:" and select "New Driver…":

  4. Click on "Add…" and choose the recently downloaded JDBC driver JAR file as shown below:

    and click on "OK".

  5. Enter the database values as shown below:

    The password is "hr" for the sample HR database. Clicking on "Show JDBC URL" also shows the complete JDBC URL. Click on "OK".

  6. Select the "HR" schema as shown below:

    and click on "OK". The complete list of schemas is now shown in the "Databases" node as shown below:

  7. Expand the "HR" node and the complete list of tables is visible now:

    Expanding each table shows you the complete definition as shown:

  8. Right-click on "COUNTRIES" table and select "View Data…"

    and the result is shown as:

    Additionally, you can execute any SQL command by selecting "Execute Command…":

A complete archive of all the TOTDs is available here.

Subsequent blogs will show how to write a Java EE application to access the Oracle database.

Technorati: totd oracle database netbeans

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot
Related posts:
  1. TOTD #108: Java EE 6 web application (JSF 2.0 + JPA 2.0 + EJB 3.1) using Oracle, NetBeans, and GlassFish
  2. TOTD #25: Rails application with PostgreSQL database using NetBeans
  3. TOTD #106: How to install Oracle Database 10g on Mac OS X (Intel) ?
  4. TOTD #15: Delete/Update Row from Database using jMaki Data Table
  5. TOTD #38: Creating a MySQL Persistence Unit using NetBeans IDE

1 Comment »

  1. [...] #105 explained how to install Oracle database 10g R2 on Mac OS X. TOTD #106 explained how to connect this Oracle database using NetBeans. This Tip Of The Day will explain how [...]

    Pingback by TOTD #108: Java EE 6 web application (JSF 2.0 + JPA 2.0 + EJB 3.1) using Oracle, NetBeans, and GlassFish « Miles to go … — October 1, 2009 @ 11:49 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress
45879 visits from Sep 11, 2009