Solved

how to insert data in oracle 10g using java code

Posted on 2007-04-08
4
205 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 500 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

690 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