LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 10-16-2011, 01:52 PM   #1
obedraju
LQ Newbie
 
Registered: Oct 2011
Location: Hyderabad
Posts: 18

Rep: Reputation: Disabled
JSP to Oracle with type 4 driver... problem.


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("jdbcracle: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..!!!
 
Old 10-18-2011, 01:48 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Whether you're coding in JSP's or using Oracle or you happen to have a "type 4" JDBC driver or whether you're using Eclipse is COMPLETELY IRRELEVANT!!!!!!

General Troubleshooting steps:

1. Make sure you can connect to Oracle (e.g. from sqlplus, or equivalent) from the same client, to the same server, with the same username and password.

2. Make sure your syntax is correct

3. Make sure you've got full logging enabled on both your Oracle server, and your Servlet client, and examine the logs.

However....

Q: Why do you think "con.prepareStatement()" is sufficient to execute a statement?

Q: What do you think "prepareStatement()" is supposed to do?

Look at this tutorial - it might help explain where you're going wrong:

http://download.oracle.com/javase/tu.../prepared.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
JSP to Oracle with type 4 driver... problem obedraju Linux - Software 2 10-15-2011 10:54 AM
simple jsp problem. pinga123 Linux - Newbie 1 08-27-2010 07:05 AM
Tomcat jsp problem shan_nathan Linux - Software 1 12-28-2007 03:17 PM
JSP and MySQL - unable to load JDBC driver jun_tuko Programming 2 09-05-2006 12:02 PM
about Jakarta Struts, Jsp's and Tomcat.... problem iterating in a jsp poeta_boy Programming 2 09-06-2005 03:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 05:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration