473,382 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

how to coonect java program to oracle database

i am trying to connect my java program to oracle but i am nt able to do that . please help me to do that
Mar 27 '07 #1
1 1808
i am trying to connect my java program to oracle but i am nt able to do that . please help me to do that
in j2se one package is ther java.sql which contains all the interfaces
which facilitates not only to connect with data base but also to interact with
data base.
steps to connect to any data base
1)create the driver object
2) register the driver.
3)connect database
java.sql.Driver d=new oracle.jdbc.driver.OracleDriver();
java.sql.DriverManager.registerDriver(d);
java.sql.Connection con=DriverManager.getConnection("jdbc:oracle:thin: @localhost:1521:orcl","scott","tiger");


now your java prog is connected to Oracle 8i.
one thing driver is specific to the DAtabase.
for oracle the set CLASSPATH pointing classes12.jar
similarly for other databasesi f you want to connect. you have to set the jar file to CLASSPATH.
hope this will help you to connect.
Mar 28 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Dave Brueck | last post by:
Below is some information I collected from a *small* project in which I wrote a Python version of a Java application. I share this info only as a data point (rather than trying to say this data...
1
by: Chris | last post by:
Our company developed the last couple of years a development tool: using this tool we configure and program (using SQL, and Java-Script) very, very easy an application. The output of the effort is...
2
by: Suresh Tri | last post by:
Hi all, I am interested in extracting the class or jar files which are stored as java stored procedures in Oracle. But I want to know if these are stored as references to external files in...
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
2
by: Guest1234 | last post by:
Hello, I have a function in Java that stores the Date in Oracle Database, If i Try to store todays Date (19/06/2007) it takes well in Java Program but its stores 18/06/2007 in Oracle Database. My...
63
by: s0suk3 | last post by:
I've been programming Python for a couple of years now. Now I'm looking to move on to either C++ or Java, but I'm not sure which. Which one do you think will be a better transition for a Python...
1
by: Dusan Chromy | last post by:
J. W. <someone@comcast.comwrote in message news:<gvqbhv4l68d03l3oo941lkcen6e3tltlne@4ax.com>... Oh, the reasons are numerous. I wrote a SP in Java recently which publishes messages to a JMS...
2
by: khalidanwar123 | last post by:
i am getting the following error while updating a clob field. ERROR java.sql.SQLException: Data size bigger than max size forthis type: 4003 19:28:27,499 ERROR at...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.