What is the size of a blog?
how to connect to oracle 10g using oci driver with jdk1.6.0
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What is interesting here?
• Duels
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Register!

QAIX > Oracle database development > how to connect to oracle 10g using oci driver with jdk1.6.0 13 August 2009 08:06:03

  Top users: 
  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Модератор:

Topic is moderated by the author — avinash.

how to connect to oracle 10g using oci driver with jdk1.6.0

avinash 23 May 2009 21:33:23
i am new oracledatabase combine with java programing .
i tired this program .

----code-----
import java.sql.*;
public class OracleOciConnection­
{
public static void main(String args[])
{
try
{

Class.forName("orac­le.jdbc.driver.Oracl­eDriver");
Connection con = DriverManager.getCo­nnection("jdbc:oracl­e:oci8:@","hr","hr")­;
System.out.println(­"connected to oracle using oci driver");
con.close();
}
catch(Exception ex)
{
ex.printStackTrace(­);
}
}

it successfully complies but on execution it gives an error
C:\java>java OracleOciConnection­
java.lang.ClassNotF­oundException: oracle.jdbc.driver.­Oracle.Driver
at java.net.URLClassLo­ader$1.run(URLClassL­oader.java:200)
at java.security.Acces­sController.doPrivil­eged(Native Method)
at java.net.URLClassLo­ader.findClass(URLCl­assLoader.java:188)
at java.lang.ClassLoad­er.loadClass(ClassLo­ader.java:306)
at sun.misc.Launcher$A­ppClassLoader.loadCl­ass(Launcher.java:26­8)
at java.lang.ClassLoad­er.loadClass(ClassLo­ader.java:251)
at java.lang.ClassLoad­er.loadClassInternal­(ClassLoader.java:31­9)
at java.lang.Class.for­Name0(Native Method)
at java.lang.Class.for­Name(Class.java:164)­
at OracleOciConnection­.main(OracleOciConne­ction.java:9)
can any tell me how to solve this problem
i changed path ,classpath many times
i search many sites but sloved my problem .

so plz tell me step by step connection to database
i am using oracle10g and jdk1.6.0 . i have also install jdk1.5.0
and also tell me what option to chose in ODBC Data Source Administrator window
Add comment
Guest 7 July 2009 08:17:20 permanent link ]
 
Connection con = DriverManager.getCo­nnection("jdbc:oracl­e:oci@XE","hr","hr")­ ;

and set the class path =C:\oraclexe\app\or­acle\product\10.2.0\­server\jdbc\lib\ojdb­c14.jar

if you have installed oracle 10g in c:/ drive
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или законы РФ. Ваш ip-адрес записывается.


QAIX > Oracle database development > how to connect to oracle 10g using oci driver with jdk1.6.0 13 August 2009 08:06:03

see also:
Help with file not writing
Maxing out sessions?
check server status...please help
pass tests:
see also:
Share: How to convert AVCHD videos to…
All in one Video Converter Platinum
Free video converter with Two real-time…

  Copyright © 2001—2010 QAIX
Идея: Монашёв Михаил.
Авторами текстов, изображений и видео, размещённых на этой странице, являются пользователи сайта.
See Help and FAQ in the community support.qaix.com.
Write in the community about the bugs you have noticedbugs.qaix.com.
Write your offers and comments in the communities suggest.qaix.com.
Information for parents.
Пишите нам на .
If you would like to report an abuse of our service, such as a spam message, please .
Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .