SunQuest
           Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 9th, 2004, 05:35 AM
basigio basigio is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 2 basigio User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
SQL string is not Query

Hi,
I have a problem...I have a j2ee application that execute with a JSP page a SQL QUERY this application execute query on DB with DB9i this application work but with DB10g don't work.
If I execute a SELECT query with the JDBC(jdbc driver for 9i) connect on DB10g the Query work but if I execute the INSERT or UPDATE query JSP don't work and I receving this error
"SQL string is not Query".
Why???
I write the source code of my JSP:
__________________________________

<%@page import="java.sql.*, java.io.*, javax.naming.*, javax.sql.*, oracle.jdbc.driver.*,java.util.*,java.net.*"%>

<%
//--------------------- DICHIRAZIONI VARIABILI NECESSARIE PER LA CONNESSIONE AL DB -----------
String dbase="jdbcracle:thin:@localhost:1521:test";


String login="test";
String pwd="test123";

// -------------------- DRIVER JDBC ----------------------------------------
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Class.forName("oracle.jdbc.driver.OracleDriver");

out.println("Test <br>");

String QueryProt = "INSERT INTO TEST_CEDA (ID) VALUES (?)";

Connection con_d;
PreparedStatement ps_d;
Statement stmt_d;
ResultSet rs_d;

String Prot="";
String Protoc="";


con_d = DriverManager.getConnection(dbase,login,pwd);
stmt_d = con_d.createStatement();
// rs_d = stmt_d.executeQuery(QueryProt,11);
ps_d=con_d.prepareStatement(QueryProt);
ps_d.setInt(1,100);
rs_d= ps_d.executeQuery();

if(rs_d.next())
{

//Prot=rs_d.getString("id");
rs_d.close();stmt_d.close();con_d.close();
//out.println("ciao "+Prot);
}

else
{
rs_d.close();stmt_d.close();con_d.close();
out.println("ciao no");
}
%>
__________________________________
Best Regards

Basilisco Giorgio

Servizi di Rete CDS
Università degli Studi di Napoli Federico II
Via Cinthia - Complesso Universitario Monte S.Angelo - Ed. Centri Comuni

Reply With Quote
  #2  
Old July 9th, 2004, 06:00 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,711 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 Days 5 h 22 m 58 sec
Reputation Power: 259
Why don't you try the new driver first? (i.e. 10g driver to 10g database?) I've experiences several problems using drivers that didn't match the db version.
See http://otn.oracle.com/software/tech...jdbc/index.html for downloads.

Reply With Quote
  #3  
Old July 9th, 2004, 06:42 AM
basigio basigio is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 2 basigio User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
re:

I have try tha install the driver jdbc10g on my ApplicationServer (I have copy the file, that I have download of your link,in the folder of my applicationServer)but these don't work.
I have a question the my JSPapplication can use the your driver 10g and don't use the driver10g of my ApplicationServer?

Reply With Quote
  #4  
Old July 22nd, 2004, 09:38 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,711 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 Days 5 h 22 m 58 sec
Reputation Power: 259
If you are using Tomcat you can put the jdbc driver in the /contextname/WEB-INF/lib folder where it will be available for that specific application only.

Reply With Quote
  #5  
Old July 22nd, 2004, 10:55 PM
swstephe swstephe is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Location: Brunei, Borneo Island, South East Asia
Posts: 9 swstephe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to swstephe
The drivers are correct. A "query" is a SELECT -- it returns a series of rowsets, INSERT, UPDATE and DELETE are DML statements, not queries, they don't return rowsets. If you want to execute DML you should call "execute" instead of "executeQuery". That's a lot easier than installing updated drivers.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > SQL string is not Query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway