PDA

View Full Version : [ubuntu] JSP to Oracle with type 4 driver... problem.



obedraju
October 16th, 2011, 06:50 PM
Hello...

Am using 'eclipse indigo' for web applications on ubuntu.
In jsp page I've written the following code.
-----------------------------------------------------------------
<%@page import="java.sql.*;"%>
<%
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin: @localhost:1521:xe","system","obedraju");
PreparedStatement ps = con.prepareStatement("create table emp(Id varchar2(29)");

System.out.println("Loading driver");
}
catch(Exception s)
{}

%>
hello
-----------------------------------------------------------------

I'm getting output on page as 'hello' but table is not created on database.

I've added ojdbc14.jar on eclipse.

folder>build path>configure build path>libraries>add external jar>ojdbc14.jar 'ok'.

Restarted.

Can some one help me plz..!!!