bijoy bose

Ranch Hand
+ Follow
since Mar 27, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by bijoy bose

I am sure its because your JDBC drivers does not have scrolling feature because you are using and older version. download j2se1.4.2 or higher it will bring scrolling feature automatically to your JDBC....hope thats answer your problem!!

regards
Bijoy
Thanks FOlKs ATLAST I got it running....actually it was the problem in the driver itself, I was using J2SE 1.4.1 version whereas JDBC 2.0 and above only handles/extends scrollabilty feature in it. so all i have to do is to change my JDK from 1.4.1 to J2SE 1.4.2 version


THANKS to all of you!!!

HI jeanne

thanks for help first... but do you think I will achieve scrolling feature if i use Rowset or CachedRowSet??

thanks for any help in advance
i believe you have to set it up path manually from ODBC data administrator from your control panel..Did you have set it up like this already??
i have another question: 1) is JDBC DBC driver does allow scrolling feature because whenever i am using DeleteRow() methode of ResultSet class i am getting and exception specified above. 2)and is there any place i can download this driver or does it come with JDK1.4.2 version....i am basically using Jcreator PRO as my development IDE.

thanks
Bijoy
Jeanne, i agree because i am getting this kind of warning:

SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state

do you know how to handle this exception
Thanks Carol...though i have tried UpdateDate() method earlier but i was sending instance of util.date thats y i was getting an error but now i got it!

rsAcd.UpdateDate(int columnIndex, SQl.Date);
rsAcd.UpdateRow();

this code worked for me finally.

Thanks folks...

But i wanna know why is that whenever i use DeleteRow() method of ResultSet class i gives me "invalid cursor state" even though it is deleting the row from the Db.

i am guessing in the last loop in the while Loop, when it deletes a row Say the last row of the Table and as we know whenver it deletes a row it increments by one position. now when cursor again goes back to
---> while(rsAcd.next()) position, it may tries to locate the next available row in which case it is already ahead of last row.... i believe thats when it fires the exception "invalid cursor state".

am i guessing rt or is there something else??

Thanks for any help!!
i am sorry i am supposed to say somthing on ypdating problem....just ignore the other question!!


the problem is i am trying to update a date column in a specific row...so when i am trying to set a date in a specific column in a specific row, i am using UpdateLong(columnindex, date). method of resultset class it is not updating. i mean nothing is changed in the actuall DB
i am getting an SQL exception if i delete any row by using DeleteRow() method of ResultSet class. exception is: "Invalid Cursor State". But the code is actulally doing the work i.e is deleting the row from DB
I followed your Idea of deleting a row by an sql command instead of using a delete method of ResultSet - [DeleteRow() methode]. the idea worked very well..
but in the else portion i again have to delete a specific row based on some criteria and i can't use the same way for it (i.e. SQL command) and i have to use the deleteRow methode. The problem is though it is working but it is givin an SQL error/warning "invalid cursor state". can anyone tell me why?

Thanks
but it is not updating ...and i cant figure out why...is there is any problem with connection (con) or statement (stmtA)?
i am sorry for giving little confusing code...i hope this what are looking at...

try
{
con = DriverManager.getConnection(url, "", "");
stmtA = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);

queryx ="Select * From cleanTableA order by START_DATE";
ResultSet rsAcd = stmtA.executeQuery(queryx);
while(rsAcd.next())
{
if(!dod.equals(""))
{
........
}
if (StartDate.after(TmpStudyEnd))
{
rsAcd.deleteRow();
rsAcd.previous(); .......
}
else
{
Date EndD = rsAcd.getDate(3);
if(EndD.after(TmpStudyEnd))
{
EndD = TmpStudyEnd;
df2 = DateFormat.getDateInstance(DateFormat.SHORT);
String tmpend = df2.format(EndD);
------> rsAcd.updateLong(3, java.sql.Date.parse(tmpend));
}

}
this -> line is not working....it is trying to update the date in the 3rd column of the Table (DB i mean)

i will really appreciate if some one can pull me up from this great trouble i am in.....Thanks for any help i get


Bijoy