This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • 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

JDBC with oracle

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone! could anyone please tell me how i can do database connectivity using the oracle database.
Following is the code i wrote but the table "rosm" just does'nt get updated



thanks a lot in advance,
Ravissant
 
Ravissant Markenday
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi again, well i figured it out by myself,but then again i have some doubts.I found 2 approaches of which i could get only one working.
First, the approach i could'nt get, im including only the code snippents i did'nt understant:



could anyone please descriptively tell me what "jdbc:oracle:thin:@training:1521:Oracle" is?

Moving on to the second approach:



could anyone please tell me what the DSN exactly does?
Also I'd really appreciate it if someone could tell me the exact difference between the two approaches.

Thanks a lot,
Ravissant
 
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Ravissant,

first question: jdbcracle:thin:@training:1521:Oracle is the URL of your database.
jdbc = connection type
oracle = your database
thin = drivertype
training = machinename
1521 = portnumber
Oracle = databasename

second question: jdbc:odbc:Mydsn_oracle
Mydsn_oracle is the name of your ODBC-datasource
(should be somewhere in settings - control panel - administrative tools)

third question: difference between those two:
The first tries to connect to the database using the Oracle driver, the second one uses the JDBC-ODBC bridge as driver (not meant for production-code)

Hope this helps,
Herman
 
Whatever you say buddy! And I believe this tiny ad too:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic