?
Solved

how to insert data in oracle 10g using java code

Posted on 2007-04-08
4
Medium Priority
?
207 Views
Last Modified: 2013-12-18
how to insert data in oracle 10g using java code??
I tried this link but no output shows when I run the code!!
http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/namedparam/usingoraclenamedparameterapis.html#use

I want simple tutorial or code to show that
0
Comment
Question by:fm134
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 27

Expert Comment

by:mrcoffee365
ID: 18873771
The  link you provided  is to a simple tutorial and code.

Did you follow all of the instructions?  You created a table, inserted records (and it was committed, right?)?

Then compile your code, make sure that your database connection string goes to the database you just created the table and data in?

If you think you did all of that, post the code you wrote, and the output you got (e.g., if you ran it from a command line, then the command line.  If from an IDE, then the console log).
0
 

Author Comment

by:fm134
ID: 18874667
>>Did you follow all of the instructions?  You created a table, inserted records (and it was committed, right?)?
yes
>>Then compile your code, make sure that your database connection string goes to the database you just created the table and data in?
How can I make sure that it goes to my database.I only change the connection string.
// Set database URL details.
String url = "jdbc:oracle:thin:@localhost:1521:orcl";

// Get the database connection.
conn = DriverManager.getConnection(url,"system","pass");

I tried the exapmle code in the link and no out put coms!!

the run::
C:\>java oracle.otnsamples.jdbc.UsingOracleNamedParameters

C:\>
0
 

Author Comment

by:fm134
ID: 18874839
gusses what
I have to insert
sql>commit;
after I insert my data in the database?? why??
0
 
LVL 27

Accepted Solution

by:
mrcoffee365 earned 2000 total points
ID: 18875684
Is this the first time you have used a database?  Or maybe the first time you've used Oracle?

See this short documentation on committing transactions to Oracle:
http://www.adp-gmbh.ch/ora/concepts/transaction.html

If it worked for you, then that's great.  And now you know more about the basics of using Oracle, too.
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question