Prepared Statement and Stored Procedure

F

francan00

For SQL in my web applications I use PreparedStatement object alot in
my JDBC working with Oracle 9i.

I also heard the term Stored Procedure. What is the difference between
Stored Procedure and Prepared Statement?
 
A

Arne Vajhøj

For SQL in my web applications I use PreparedStatement object alot in
my JDBC working with Oracle 9i.

I also heard the term Stored Procedure. What is the difference between
Stored Procedure and Prepared Statement?

What is the difference between a Ford car and an apple ?

:)

PreparedStatement is something you use to execute SQL statement.

A stored procedures is something that most database have (in sligthly
incompatible syntax) that allow you to write "SQL scripts" within
the database (actually in Oracle you can write stored procedures
in Java as well but ...).

To execute a store procedure you would use CallableStatement.

Arne
 
V

Viks

What is the difference between a Ford car and an apple ?

:)

PreparedStatement is something you use to execute SQL statement.

A stored procedures is something that most database have (in sligthly
incompatible syntax) that allow you to write "SQL scripts" within
the database (actually in Oracle you can write stored procedures
in Java as well but ...).

To execute a store procedure you would use CallableStatement.

Arne

Just to add to Arne's reply, PreparedStatement are pre-compiled SQL
statements and can be run multiple times with different arguments.

A stored procedure is synonymous to funtions/proc in an programming
language. It takes arguments , has a return type and has a specific
buisness logic to perform.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,088
Latest member
JeremyMedl

Latest Threads

Top