• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

How to connect Oracle with Java

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am completely new to Oracle with basic sql plus knowledge. I have installed Oracle 10g Release 2 and java 1.6 .
All i want to do is to connect Oracle with Java so that i can send queries and retrieve results. I found that we need a jdbc driver
and a odbc driver for connecting. How can i get them and how to install ? Or should i use another type of driver ?
Does Oracle have a server ?if yes , should I use it for accessing the database?

Can someone explain?

Thanks in advance.

 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Daniel William wrote:I found that we need a jdbc driver
and a odbc driver for connecting. How can i get them and how to install ? Or should i use another type of driver ?


Oracle also distributes jdbc drivers : Oracle Jdbc Drivers

Daniel William wrote:
Does Oracle have a server ?if yes , should I use it for accessing the database? Can someone explain?


What kind of server do you expect? Do you mean a bundled application server with 10gR2 database setup? Please state it clearly. But in order to connect to database within your java code you don't need any server. Just have your database and tns listener running and follow any jdbc tutorial if necessary. This might be helpful for oracle specific how-to's : JDBC How-To Documents

Regards,

Fatih.
 
Daniel William
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok.i understood that i dont need a server to connect oracle with java.

i have created an Oracle database .

i have a java program which uses jdbc -odbc driver set for connecting it with Oracle.

there are 4 types of jdbc drivers . only one type can be used for connecting with odbc driver.
which type should i use and how can i configure it to work with odbc.?

i am just using a stand alone Java application program.

 
Fatih Keles
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why don't you use jdbc thin driver? Why are you using odbc? Is it on purpose?

Regards,

Fatih.
 
Daniel William
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
its because i have used it in our lab session. i didnt have this difficulty of installing ,as it was set and configured by our admin.
i also did all programs using this driver set.
so to switch to thin driver i need learn about its syntax in java.

now whats the use of thin driver ? is it the right one for simple java programs?

 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To turn your question on its head: what is the use of the JDBC-ODBC bridge? It is (by Sun's own admission) not what you would call a first choice for JDBC. If there is a vendor specific equivalent is is much easier to just use that.

The Orcale thin driver is a type 4 driver, so you need no extra configuration. I would always use it when working with Oracle.
 
We find this kind of rampant individuality very disturbing. But not this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic