Solved

how to insert data in oracle 10g using java code

Posted on 2007-04-08
4
199 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 26

Expert Comment

by:mrcoffee365
Comment Utility
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
Comment Utility
>>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
Comment Utility
gusses what
I have to insert
sql>commit;
after I insert my data in the database?? why??
0
 
LVL 26

Accepted Solution

by:
mrcoffee365 earned 500 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
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.
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now