Create table using JDBC Statement API

Program to create a table in oracle database using JDBC’s java.sql.Statement API.

 Output:

Log-in to SQL-PLUS with user name/password and see whether the EMPLOYEE table is created or not.

Tableindb

 

 

 

 

 

 

 

 

Note:From JDBC 4.0 (from Java6) onwards we no need to load data base driver jar using class.forName();

Just add the database driver jar (ojdbc6.jar for oracle) in the class path. It will load when Drivermanager.getConnection() method called.

How to add database jar to class path:  Right Click on project -> Properties -> Java Build Path

Click on Add External JAR, add ojbdc6.jar and click on ok.

classpath

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Posted in jdbc.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">