473,379 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

updateString error in PostgreSQL7.4 with JDBC

Hi,
I have a problem with PostgreSQL 7.4. (With the old one 7.3 no probllem.)

I create a connection and a statement :
Class.forName("org.postgresql.Driver");
conn = DriverManager.getConnection(
O_Constants.DB_CONNECTION_URL,
O_Constants.DB_CONNECTION_USERNAME,
O_Constants.DB_CONNECTION_PASSWORD);
st = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITI VE,
ResultSet.CONCUR_UPDATABLE);
rs = st.executeQuery("select * ...";

Then:
rs.updateString(20 , ...);

The error is:
org.postgresql.util.PSQLException: Cannot update the result set because
it is either before the start or after the end of the results.
at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.update Value(AbstractJdbc2ResultSet.java:1595)
at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.update String(AbstractJdbc2ResultSet.java:1193)
at admin.ValidationRequest.doGet(ValidationRequest.ja va:43)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at
org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:256)
at
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
at
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
at
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(St andardContext.java:2422)
at
org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.in voke(ErrorDispatcherValve.java:171)
at
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:163)
at
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
at
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
at
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(Co yoteAdapter.java:199)
at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyo teHandler.java:324)
at
org.apache.jk.common.HandlerRequest.invoke(Handler Request.java:395)
at org.apache.jk.common.ChannelSocket.invoke(ChannelS ocket.java:673)
at
org.apache.jk.common.ChannelSocket.processConnecti on(ChannelSocket.java:615)
at
org.apache.jk.common.SocketConnection.runIt(Channe lSocket.java:786)
at
org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:536)

The JDBC is:
pg74.215.jdbc3.jar

If you have any comments, please help.
Thanks...
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #1
2 3139
It is ok. I fetch the row with no problem.
The error is only in update types like updateString , updateRow,
updateInt...

ps.You are right JDBC list is appropriate.
Richard Huxton wrote:
Suha Onay wrote:
Hi,
I have a problem with PostgreSQL 7.4. (With the old one 7.3 no
probllem.)

You might get a better response from the jdbc list.
I create a connection and a statement :
Class.forName("org.postgresql.Driver");
conn = DriverManager.getConnection(
O_Constants.DB_CONNECTION_URL,
O_Constants.DB_CONNECTION_USERNAME,
O_Constants.DB_CONNECTION_PASSWORD);
st = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITI VE,
ResultSet.CONCUR_UPDATABLE);
rs = st.executeQuery("select * ...";

Then:
rs.updateString(20 , ...);

The error is:
org.postgresql.util.PSQLException: Cannot update the result set
because it is either before the start or after the end of the results.

What happens if you fetch a row first?


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #2


On Wed, 10 Nov 2004, Suha Onay wrote:
st = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITI VE,
ResultSet.CONCUR_UPDATABLE);
rs = st.executeQuery("select * ...";

Then:
rs.updateString(20 , ...);

The error is:
org.postgresql.util.PSQLException: Cannot update the result set because
it is either before the start or after the end of the results.

You must be on a row (or the insert row) to update it, you have not shown
any positioning methods (like next()) being called on the ResultSet so it
is left positioned before the first row. I don't know what the 7.3 driver
was actually doing, but this error is the expected behavior of the driver,
unless of course you are doing something else you haven't shown us.

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Steve | last post by:
Hi; I went to the microsoft site to try to find a guide to the error messages that the jdbc drivers give ( for sqlserver 2000 ). I had no luck. Does anyone know if there is such a guide? ...
1
by: Patrick Hatcher | last post by:
Doing an upgrade on RH 8 box from 7.3.4 to 7.4 from source. The installation appeared go smoothly. I tried to reinstall my database using psql -d someda -f data.file and I get the error message:...
0
by: Murray Bryant | last post by:
I am having problems with contrib/tablefunc in postgresql 7.4.1 on freebsd when i try to make install i get the errors below. I am unable to make the 7.3 -> 7.4 transition until i can get the...
1
by: sid_mulpuru | last post by:
I am trying to read data from a DB2 Blob Data type Field (using wsad 5.1.0) using getBlob() which when executed gives an SQL Exception 2005-01-07 15:48:40,506 ERROR - Error in...
1
by: Praveen | last post by:
Hi, I have installed WebSphere Portal on AIX and connected to DB2 on a remote machine, Getting the followin errors when trying to get the values from database thru applications installed on...
2
by: Richard | last post by:
Our web programmer was looking in his application log an found the following error: 2006-08-31 16:33:35,129 ERROR org.hibernate.util.JDBCExceptionReporter - < SQL0723N An error occurred in a...
6
by: meru | last post by:
Hi The highlighted below is the sample code I used for calling my stored procedure. Callable statement cstmt = conn.prepareCall( BEGIN STOREDPROCNAME(?,?,?);END;); ArrayDescriptor...
1
by: ajos | last post by:
hi evrybdy, the problem is:- i had this running before in jsp but when i changed the jsp page using struts tags there occoured a problem... when i enter values in the 2 text boxes and click enter...
2
by: khalidanwar123 | last post by:
i am getting the following error while updating a clob field. ERROR java.sql.SQLException: Data size bigger than max size forthis type: 4003 19:28:27,499 ERROR at...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.