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
Solved

how to insert data in oracle 10g using java code

Posted on 2007-04-08
4
203 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

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.  …
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 how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

856 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