You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by ULS Tech Support <te...@uls.com> on 2009/10/16 23:04:27 UTC
Another issue, jTDS with Tomcat 5.5.9
Hi there,
Tomcat 5.5.9, using jTDS, with SQL Server 2005 i am getting this issue.
2009/10/16 10:47:15 - sql exception:java.sql.SQLException: No current row in
the ResultSet.
This issue doesn't happen with TWFreeTDS (in fact, when i switch to
twfreetds it works fine).. but from my research so far, i may have been
wrong in the way i implemented it.
Here is the code.
public Vector queryPaged4(String strTableExt) throws SQLException {
dbRecords.removeAllElements();
boolean rc = true;
ResultSet rs_info = null;
boolean bTest = false;
DBItems temp = null;
//New **********
/* This will call a stored procedure, pass in the page # and
number to display on each page and will return the results
directly.
*/
CallableStatement call = dbConn.prepareCall("{call sp_PagedItems4
(?,?,?,?,?)}");
call.setString(1, strTableExt);
call.setString(2, filter);
call.setString(3, order);
call.setInt(4, pageNumber);
call.setInt(5, recsPerPage);
if (!call.execute())//Query
{
//No ResultSets Returned;
} else {
try {
rs_info = call.getResultSet();
//Save the total number of records (value) in
queryPagedRecords
queryPagedRecords = rs_info.getInt("TotalRec");
queryPagedMore = rs_info.getInt("MoreRecords");
nLowestID = rs_info.getInt("FirstRec");
nHighestID = rs_info.getInt("LastRec");
if (queryPagedRecords > 0) {
//Test for another resultset.
boolean bTest = false;
bTest = call.getMoreResults();
//Next resultset established, let's get the data!
dbResultSet = call.getResultSet();
while (dbResultSet.next()) {
//System.out.println("2: " +
dbResultSet.getInt("ID"));
rc = true;
//Set the items object based on the resultset.
temp = this.setItemsObject(true, dbResultSet);
dbRecords.addElement(temp);
}
}
} catch (SQLException e) {
System.out.println("SQLException: " + e);
System.out.println("SQLException Message: " +
e.getMessage());
} finally {
rs_info = null;
temp = null;
dbResultSet = null;
}
System.out.println("end");
}
return dbRecords;
}
Basically i'm getting the resultsets, but i'm not able to pull the data from
the resultsets as i get the error when i try and getInt.
Does anyone have any clue on why this is happening, or how i can make this
work?
I did try and modify the code to the following to see if it helped, but
again, i'm still stumped on HOW to retrieve the data from the resultsets.
try {
System.out.println("start...");
int updateCount = 0;
updateCount = call.getUpdateCount();
System.out.println("update count = " + updateCount);
boolean moreResults = true;
while (updateCount >= 0 || moreResults) {
if (!moreResults) {
// just eat it
updateCount = call.getUpdateCount();
System.out.println("\nupdateCount= " + updateCount);
} else {
// get the data
if (rs_info == null) {
rs_info = call.getResultSet();
} else {
dbResultSet = call.getResultSet();
}
//Save the total number of records (value) in
queryPagedRecords
System.out.println("Got Data, how to process??");
} // if ! moreResults else
moreResults = call.getMoreResults();
System.out.println("More Results??");
} // while
//rs_info.setFetchSize();
System.out.println("Lets get data from rs_info");
queryPagedRecords = rs_info.getInt("TotalRec");
queryPagedMore = rs_info.getInt("MoreRecords");
nLowestID = rs_info.getInt("FirstRec");
nHighestID = rs_info.getInt("LastRec");
But it stops at the "queryPagedRecords = rs_info.getInt("TotalRec");"
Thanks in advance to anyone who can help.
...Robin
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Hijacking
Posted by ULS Tech Support <te...@uls.com>.
Sorry, i'll remember this not just for you, but for everyone to specifically
use new for new threads.
--------------------------------------------------
From: "ULS Tech Support" <te...@uls.com>
Sent: Tuesday, October 20, 2009 1:13 PM
To: "Tomcat Users List" <us...@tomcat.apache.org>; <pi...@pidster.com>
Subject: Re: Hijacking
> Fair enough... I didn't think it was a big deal to do that... clicking
> new
> instead of reply... But really, i am still asking a valid question and
> require help...
>
> Didn't realize that this thread hijacking was going to cause someone to
> tell
> me what i did wrong, when i still had a valid question.
>
> But i'll remember that next time for you... Sound good?
>
>
>
> --------------------------------------------------
> From: "Pid" <pi...@pidster.com>
> Sent: Tuesday, October 20, 2009 1:05 PM
> To: <us...@tomcat.apache.org>
> Subject: Hijacking
>
>> On 20/10/2009 19:02, ULS Tech Support wrote:
>>> Tell me how i hijacked my own thread?
>>
>> As I described. See?
>>
>>> This is my own thread.. and i actually modified the last one i sent out,
>>> cleared everything and typed out brand new.
>>
>> Umm, yes, that would be what we call hijacking.
>> You hijacked a thread, then did it again to 'your' new thread.
>>
>> Unless I'm much mistaken you responded to the inestimable Bill
>> Davidson's first "DBCP woes (running out of cursors)" email.
>>
>> Just because you changed the subject and/or body, doesn't mean you
>> started a new thread. Look at the mail headers, or use a mail reader
>> that supports threaded views to see it.
>>
>> p
>>
>>
>>
>>> Thanks for the help.
>>>
>>>
>>>
>>> --------------------------------------------------
>>> From: "Pid" <pi...@pidster.com>
>>> Sent: Tuesday, October 20, 2009 6:11 AM
>>> To: <us...@tomcat.apache.org>
>>> Subject: Re: Another issue, jTDS with Tomcat 5.5.9
>>>
>>>> On 16/10/2009 22:04, ULS Tech Support wrote:
>>>>> Hi there,
>>>>
>>>> Please start a completely new email for each thread. Replacing the
>>>> subject line doesn't count, it's called thread hijacking.
>>>>
>>>> p
>>>>
>>>>
>>>>> Tomcat 5.5.9, using jTDS, with SQL Server 2005 i am getting this
>>>>> issue.
>>>>>
>>>>> 2009/10/16 10:47:15 - sql exception:java.sql.SQLException: No current
>>>>> row in the ResultSet.
>>>>>
>>>>> This issue doesn't happen with TWFreeTDS (in fact, when i switch to
>>>>> twfreetds it works fine).. but from my research so far, i may have
>>>>> been
>>>>> wrong in the way i implemented it.
>>>>>
>>>>> Here is the code.
>>>>>
>>>>> public Vector queryPaged4(String strTableExt) throws SQLException {
>>>>> dbRecords.removeAllElements();
>>>>> boolean rc = true;
>>>>>
>>>>> ResultSet rs_info = null;
>>>>> boolean bTest = false;
>>>>> DBItems temp = null;
>>>>>
>>>>> //New **********
>>>>> /* This will call a stored procedure, pass in the page # and
>>>>> number to display on each page and will return the results
>>>>> directly.
>>>>> */
>>>>>
>>>>> CallableStatement call = dbConn.prepareCall("{call sp_PagedItems4
>>>>> (?,?,?,?,?)}");
>>>>> call.setString(1, strTableExt);
>>>>> call.setString(2, filter);
>>>>> call.setString(3, order);
>>>>> call.setInt(4, pageNumber);
>>>>> call.setInt(5, recsPerPage);
>>>>>
>>>>> if (!call.execute())//Query
>>>>> {
>>>>> //No ResultSets Returned;
>>>>> } else {
>>>>>
>>>>> try {
>>>>> rs_info = call.getResultSet();
>>>>>
>>>>> //Save the total number of records (value) in queryPagedRecords
>>>>> queryPagedRecords = rs_info.getInt("TotalRec");
>>>>> queryPagedMore = rs_info.getInt("MoreRecords");
>>>>> nLowestID = rs_info.getInt("FirstRec");
>>>>> nHighestID = rs_info.getInt("LastRec");
>>>>>
>>>>> if (queryPagedRecords > 0) {
>>>>> //Test for another resultset.
>>>>> boolean bTest = false;
>>>>> bTest = call.getMoreResults();
>>>>> //Next resultset established, let's get the data!
>>>>> dbResultSet = call.getResultSet();
>>>>>
>>>>> while (dbResultSet.next()) {
>>>>> //System.out.println("2: " + dbResultSet.getInt("ID"));
>>>>> rc = true;
>>>>>
>>>>> //Set the items object based on the resultset.
>>>>> temp = this.setItemsObject(true, dbResultSet);
>>>>>
>>>>> dbRecords.addElement(temp);
>>>>> }
>>>>> }
>>>>> } catch (SQLException e) {
>>>>> System.out.println("SQLException: " + e);
>>>>> System.out.println("SQLException Message: " + e.getMessage());
>>>>> } finally {
>>>>> rs_info = null;
>>>>> temp = null;
>>>>> dbResultSet = null;
>>>>> }
>>>>> System.out.println("end");
>>>>> }
>>>>>
>>>>> return dbRecords;
>>>>> }
>>>>>
>>>>> Basically i'm getting the resultsets, but i'm not able to pull the
>>>>> data
>>>>> from the resultsets as i get the error when i try and getInt.
>>>>>
>>>>> Does anyone have any clue on why this is happening, or how i can make
>>>>> this work?
>>>>>
>>>>> I did try and modify the code to the following to see if it helped,
>>>>> but
>>>>> again, i'm still stumped on HOW to retrieve the data from the
>>>>> resultsets.
>>>>>
>>>>> try {
>>>>> System.out.println("start...");
>>>>> int updateCount = 0;
>>>>> updateCount = call.getUpdateCount();
>>>>> System.out.println("update count = " + updateCount);
>>>>> boolean moreResults = true;
>>>>> while (updateCount >= 0 || moreResults) {
>>>>> if (!moreResults) {
>>>>> // just eat it
>>>>> updateCount = call.getUpdateCount();
>>>>> System.out.println("\nupdateCount= " + updateCount);
>>>>> } else {
>>>>> // get the data
>>>>> if (rs_info == null) {
>>>>> rs_info = call.getResultSet();
>>>>> } else {
>>>>> dbResultSet = call.getResultSet();
>>>>> }
>>>>>
>>>>> //Save the total number of records (value) in queryPagedRecords
>>>>> System.out.println("Got Data, how to process??");
>>>>> } // if ! moreResults else
>>>>> moreResults = call.getMoreResults();
>>>>> System.out.println("More Results??");
>>>>> } // while
>>>>>
>>>>> //rs_info.setFetchSize();
>>>>> System.out.println("Lets get data from rs_info");
>>>>> queryPagedRecords = rs_info.getInt("TotalRec");
>>>>> queryPagedMore = rs_info.getInt("MoreRecords");
>>>>> nLowestID = rs_info.getInt("FirstRec");
>>>>> nHighestID = rs_info.getInt("LastRec");
>>>>>
>>>>> But it stops at the "queryPagedRecords = rs_info.getInt("TotalRec");"
>>>>>
>>>>> Thanks in advance to anyone who can help.
>>>>>
>>>>> ...Robin
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Hijacking
Posted by ULS Tech Support <te...@uls.com>.
Fair enough... I didn't think it was a big deal to do that... clicking new
instead of reply... But really, i am still asking a valid question and
require help...
Didn't realize that this thread hijacking was going to cause someone to tell
me what i did wrong, when i still had a valid question.
But i'll remember that next time for you... Sound good?
--------------------------------------------------
From: "Pid" <pi...@pidster.com>
Sent: Tuesday, October 20, 2009 1:05 PM
To: <us...@tomcat.apache.org>
Subject: Hijacking
> On 20/10/2009 19:02, ULS Tech Support wrote:
>> Tell me how i hijacked my own thread?
>
> As I described. See?
>
>> This is my own thread.. and i actually modified the last one i sent out,
>> cleared everything and typed out brand new.
>
> Umm, yes, that would be what we call hijacking.
> You hijacked a thread, then did it again to 'your' new thread.
>
> Unless I'm much mistaken you responded to the inestimable Bill
> Davidson's first "DBCP woes (running out of cursors)" email.
>
> Just because you changed the subject and/or body, doesn't mean you
> started a new thread. Look at the mail headers, or use a mail reader
> that supports threaded views to see it.
>
> p
>
>
>
>> Thanks for the help.
>>
>>
>>
>> --------------------------------------------------
>> From: "Pid" <pi...@pidster.com>
>> Sent: Tuesday, October 20, 2009 6:11 AM
>> To: <us...@tomcat.apache.org>
>> Subject: Re: Another issue, jTDS with Tomcat 5.5.9
>>
>>> On 16/10/2009 22:04, ULS Tech Support wrote:
>>>> Hi there,
>>>
>>> Please start a completely new email for each thread. Replacing the
>>> subject line doesn't count, it's called thread hijacking.
>>>
>>> p
>>>
>>>
>>>> Tomcat 5.5.9, using jTDS, with SQL Server 2005 i am getting this issue.
>>>>
>>>> 2009/10/16 10:47:15 - sql exception:java.sql.SQLException: No current
>>>> row in the ResultSet.
>>>>
>>>> This issue doesn't happen with TWFreeTDS (in fact, when i switch to
>>>> twfreetds it works fine).. but from my research so far, i may have been
>>>> wrong in the way i implemented it.
>>>>
>>>> Here is the code.
>>>>
>>>> public Vector queryPaged4(String strTableExt) throws SQLException {
>>>> dbRecords.removeAllElements();
>>>> boolean rc = true;
>>>>
>>>> ResultSet rs_info = null;
>>>> boolean bTest = false;
>>>> DBItems temp = null;
>>>>
>>>> //New **********
>>>> /* This will call a stored procedure, pass in the page # and
>>>> number to display on each page and will return the results
>>>> directly.
>>>> */
>>>>
>>>> CallableStatement call = dbConn.prepareCall("{call sp_PagedItems4
>>>> (?,?,?,?,?)}");
>>>> call.setString(1, strTableExt);
>>>> call.setString(2, filter);
>>>> call.setString(3, order);
>>>> call.setInt(4, pageNumber);
>>>> call.setInt(5, recsPerPage);
>>>>
>>>> if (!call.execute())//Query
>>>> {
>>>> //No ResultSets Returned;
>>>> } else {
>>>>
>>>> try {
>>>> rs_info = call.getResultSet();
>>>>
>>>> //Save the total number of records (value) in queryPagedRecords
>>>> queryPagedRecords = rs_info.getInt("TotalRec");
>>>> queryPagedMore = rs_info.getInt("MoreRecords");
>>>> nLowestID = rs_info.getInt("FirstRec");
>>>> nHighestID = rs_info.getInt("LastRec");
>>>>
>>>> if (queryPagedRecords > 0) {
>>>> //Test for another resultset.
>>>> boolean bTest = false;
>>>> bTest = call.getMoreResults();
>>>> //Next resultset established, let's get the data!
>>>> dbResultSet = call.getResultSet();
>>>>
>>>> while (dbResultSet.next()) {
>>>> //System.out.println("2: " + dbResultSet.getInt("ID"));
>>>> rc = true;
>>>>
>>>> //Set the items object based on the resultset.
>>>> temp = this.setItemsObject(true, dbResultSet);
>>>>
>>>> dbRecords.addElement(temp);
>>>> }
>>>> }
>>>> } catch (SQLException e) {
>>>> System.out.println("SQLException: " + e);
>>>> System.out.println("SQLException Message: " + e.getMessage());
>>>> } finally {
>>>> rs_info = null;
>>>> temp = null;
>>>> dbResultSet = null;
>>>> }
>>>> System.out.println("end");
>>>> }
>>>>
>>>> return dbRecords;
>>>> }
>>>>
>>>> Basically i'm getting the resultsets, but i'm not able to pull the data
>>>> from the resultsets as i get the error when i try and getInt.
>>>>
>>>> Does anyone have any clue on why this is happening, or how i can make
>>>> this work?
>>>>
>>>> I did try and modify the code to the following to see if it helped, but
>>>> again, i'm still stumped on HOW to retrieve the data from the
>>>> resultsets.
>>>>
>>>> try {
>>>> System.out.println("start...");
>>>> int updateCount = 0;
>>>> updateCount = call.getUpdateCount();
>>>> System.out.println("update count = " + updateCount);
>>>> boolean moreResults = true;
>>>> while (updateCount >= 0 || moreResults) {
>>>> if (!moreResults) {
>>>> // just eat it
>>>> updateCount = call.getUpdateCount();
>>>> System.out.println("\nupdateCount= " + updateCount);
>>>> } else {
>>>> // get the data
>>>> if (rs_info == null) {
>>>> rs_info = call.getResultSet();
>>>> } else {
>>>> dbResultSet = call.getResultSet();
>>>> }
>>>>
>>>> //Save the total number of records (value) in queryPagedRecords
>>>> System.out.println("Got Data, how to process??");
>>>> } // if ! moreResults else
>>>> moreResults = call.getMoreResults();
>>>> System.out.println("More Results??");
>>>> } // while
>>>>
>>>> //rs_info.setFetchSize();
>>>> System.out.println("Lets get data from rs_info");
>>>> queryPagedRecords = rs_info.getInt("TotalRec");
>>>> queryPagedMore = rs_info.getInt("MoreRecords");
>>>> nLowestID = rs_info.getInt("FirstRec");
>>>> nHighestID = rs_info.getInt("LastRec");
>>>>
>>>> But it stops at the "queryPagedRecords = rs_info.getInt("TotalRec");"
>>>>
>>>> Thanks in advance to anyone who can help.
>>>>
>>>> ...Robin
>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Hijacking
Posted by Pid <pi...@pidster.com>.
On 20/10/2009 19:02, ULS Tech Support wrote:
> Tell me how i hijacked my own thread?
As I described. See?
> This is my own thread.. and i actually modified the last one i sent out,
> cleared everything and typed out brand new.
Umm, yes, that would be what we call hijacking.
You hijacked a thread, then did it again to 'your' new thread.
Unless I'm much mistaken you responded to the inestimable Bill
Davidson's first "DBCP woes (running out of cursors)" email.
Just because you changed the subject and/or body, doesn't mean you
started a new thread. Look at the mail headers, or use a mail reader
that supports threaded views to see it.
p
> Thanks for the help.
>
>
>
> --------------------------------------------------
> From: "Pid" <pi...@pidster.com>
> Sent: Tuesday, October 20, 2009 6:11 AM
> To: <us...@tomcat.apache.org>
> Subject: Re: Another issue, jTDS with Tomcat 5.5.9
>
>> On 16/10/2009 22:04, ULS Tech Support wrote:
>>> Hi there,
>>
>> Please start a completely new email for each thread. Replacing the
>> subject line doesn't count, it's called thread hijacking.
>>
>> p
>>
>>
>>> Tomcat 5.5.9, using jTDS, with SQL Server 2005 i am getting this issue.
>>>
>>> 2009/10/16 10:47:15 - sql exception:java.sql.SQLException: No current
>>> row in the ResultSet.
>>>
>>> This issue doesn't happen with TWFreeTDS (in fact, when i switch to
>>> twfreetds it works fine).. but from my research so far, i may have been
>>> wrong in the way i implemented it.
>>>
>>> Here is the code.
>>>
>>> public Vector queryPaged4(String strTableExt) throws SQLException {
>>> dbRecords.removeAllElements();
>>> boolean rc = true;
>>>
>>> ResultSet rs_info = null;
>>> boolean bTest = false;
>>> DBItems temp = null;
>>>
>>> //New **********
>>> /* This will call a stored procedure, pass in the page # and
>>> number to display on each page and will return the results
>>> directly.
>>> */
>>>
>>> CallableStatement call = dbConn.prepareCall("{call sp_PagedItems4
>>> (?,?,?,?,?)}");
>>> call.setString(1, strTableExt);
>>> call.setString(2, filter);
>>> call.setString(3, order);
>>> call.setInt(4, pageNumber);
>>> call.setInt(5, recsPerPage);
>>>
>>> if (!call.execute())//Query
>>> {
>>> //No ResultSets Returned;
>>> } else {
>>>
>>> try {
>>> rs_info = call.getResultSet();
>>>
>>> //Save the total number of records (value) in queryPagedRecords
>>> queryPagedRecords = rs_info.getInt("TotalRec");
>>> queryPagedMore = rs_info.getInt("MoreRecords");
>>> nLowestID = rs_info.getInt("FirstRec");
>>> nHighestID = rs_info.getInt("LastRec");
>>>
>>> if (queryPagedRecords > 0) {
>>> //Test for another resultset.
>>> boolean bTest = false;
>>> bTest = call.getMoreResults();
>>> //Next resultset established, let's get the data!
>>> dbResultSet = call.getResultSet();
>>>
>>> while (dbResultSet.next()) {
>>> //System.out.println("2: " + dbResultSet.getInt("ID"));
>>> rc = true;
>>>
>>> //Set the items object based on the resultset.
>>> temp = this.setItemsObject(true, dbResultSet);
>>>
>>> dbRecords.addElement(temp);
>>> }
>>> }
>>> } catch (SQLException e) {
>>> System.out.println("SQLException: " + e);
>>> System.out.println("SQLException Message: " + e.getMessage());
>>> } finally {
>>> rs_info = null;
>>> temp = null;
>>> dbResultSet = null;
>>> }
>>> System.out.println("end");
>>> }
>>>
>>> return dbRecords;
>>> }
>>>
>>> Basically i'm getting the resultsets, but i'm not able to pull the data
>>> from the resultsets as i get the error when i try and getInt.
>>>
>>> Does anyone have any clue on why this is happening, or how i can make
>>> this work?
>>>
>>> I did try and modify the code to the following to see if it helped, but
>>> again, i'm still stumped on HOW to retrieve the data from the
>>> resultsets.
>>>
>>> try {
>>> System.out.println("start...");
>>> int updateCount = 0;
>>> updateCount = call.getUpdateCount();
>>> System.out.println("update count = " + updateCount);
>>> boolean moreResults = true;
>>> while (updateCount >= 0 || moreResults) {
>>> if (!moreResults) {
>>> // just eat it
>>> updateCount = call.getUpdateCount();
>>> System.out.println("\nupdateCount= " + updateCount);
>>> } else {
>>> // get the data
>>> if (rs_info == null) {
>>> rs_info = call.getResultSet();
>>> } else {
>>> dbResultSet = call.getResultSet();
>>> }
>>>
>>> //Save the total number of records (value) in queryPagedRecords
>>> System.out.println("Got Data, how to process??");
>>> } // if ! moreResults else
>>> moreResults = call.getMoreResults();
>>> System.out.println("More Results??");
>>> } // while
>>>
>>> //rs_info.setFetchSize();
>>> System.out.println("Lets get data from rs_info");
>>> queryPagedRecords = rs_info.getInt("TotalRec");
>>> queryPagedMore = rs_info.getInt("MoreRecords");
>>> nLowestID = rs_info.getInt("FirstRec");
>>> nHighestID = rs_info.getInt("LastRec");
>>>
>>> But it stops at the "queryPagedRecords = rs_info.getInt("TotalRec");"
>>>
>>> Thanks in advance to anyone who can help.
>>>
>>> ...Robin
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Another issue, jTDS with Tomcat 5.5.9
Posted by ULS Tech Support <te...@uls.com>.
Tell me how i hijacked my own thread?
This is my own thread.. and i actually modified the last one i sent out,
cleared everything and typed out brand new.
Thanks for the help.
--------------------------------------------------
From: "Pid" <pi...@pidster.com>
Sent: Tuesday, October 20, 2009 6:11 AM
To: <us...@tomcat.apache.org>
Subject: Re: Another issue, jTDS with Tomcat 5.5.9
> On 16/10/2009 22:04, ULS Tech Support wrote:
>> Hi there,
>
> Please start a completely new email for each thread. Replacing the
> subject line doesn't count, it's called thread hijacking.
>
> p
>
>
>> Tomcat 5.5.9, using jTDS, with SQL Server 2005 i am getting this issue.
>>
>> 2009/10/16 10:47:15 - sql exception:java.sql.SQLException: No current
>> row in the ResultSet.
>>
>> This issue doesn't happen with TWFreeTDS (in fact, when i switch to
>> twfreetds it works fine).. but from my research so far, i may have been
>> wrong in the way i implemented it.
>>
>> Here is the code.
>>
>> public Vector queryPaged4(String strTableExt) throws SQLException {
>> dbRecords.removeAllElements();
>> boolean rc = true;
>>
>> ResultSet rs_info = null;
>> boolean bTest = false;
>> DBItems temp = null;
>>
>> //New **********
>> /* This will call a stored procedure, pass in the page # and
>> number to display on each page and will return the results
>> directly.
>> */
>>
>> CallableStatement call = dbConn.prepareCall("{call sp_PagedItems4
>> (?,?,?,?,?)}");
>> call.setString(1, strTableExt);
>> call.setString(2, filter);
>> call.setString(3, order);
>> call.setInt(4, pageNumber);
>> call.setInt(5, recsPerPage);
>>
>> if (!call.execute())//Query
>> {
>> //No ResultSets Returned;
>> } else {
>>
>> try {
>> rs_info = call.getResultSet();
>>
>> //Save the total number of records (value) in queryPagedRecords
>> queryPagedRecords = rs_info.getInt("TotalRec");
>> queryPagedMore = rs_info.getInt("MoreRecords");
>> nLowestID = rs_info.getInt("FirstRec");
>> nHighestID = rs_info.getInt("LastRec");
>>
>> if (queryPagedRecords > 0) {
>> //Test for another resultset.
>> boolean bTest = false;
>> bTest = call.getMoreResults();
>> //Next resultset established, let's get the data!
>> dbResultSet = call.getResultSet();
>>
>> while (dbResultSet.next()) {
>> //System.out.println("2: " + dbResultSet.getInt("ID"));
>> rc = true;
>>
>> //Set the items object based on the resultset.
>> temp = this.setItemsObject(true, dbResultSet);
>>
>> dbRecords.addElement(temp);
>> }
>> }
>> } catch (SQLException e) {
>> System.out.println("SQLException: " + e);
>> System.out.println("SQLException Message: " + e.getMessage());
>> } finally {
>> rs_info = null;
>> temp = null;
>> dbResultSet = null;
>> }
>> System.out.println("end");
>> }
>>
>> return dbRecords;
>> }
>>
>> Basically i'm getting the resultsets, but i'm not able to pull the data
>> from the resultsets as i get the error when i try and getInt.
>>
>> Does anyone have any clue on why this is happening, or how i can make
>> this work?
>>
>> I did try and modify the code to the following to see if it helped, but
>> again, i'm still stumped on HOW to retrieve the data from the resultsets.
>>
>> try {
>> System.out.println("start...");
>> int updateCount = 0;
>> updateCount = call.getUpdateCount();
>> System.out.println("update count = " + updateCount);
>> boolean moreResults = true;
>> while (updateCount >= 0 || moreResults) {
>> if (!moreResults) {
>> // just eat it
>> updateCount = call.getUpdateCount();
>> System.out.println("\nupdateCount= " + updateCount);
>> } else {
>> // get the data
>> if (rs_info == null) {
>> rs_info = call.getResultSet();
>> } else {
>> dbResultSet = call.getResultSet();
>> }
>>
>> //Save the total number of records (value) in queryPagedRecords
>> System.out.println("Got Data, how to process??");
>> } // if ! moreResults else
>> moreResults = call.getMoreResults();
>> System.out.println("More Results??");
>> } // while
>>
>> //rs_info.setFetchSize();
>> System.out.println("Lets get data from rs_info");
>> queryPagedRecords = rs_info.getInt("TotalRec");
>> queryPagedMore = rs_info.getInt("MoreRecords");
>> nLowestID = rs_info.getInt("FirstRec");
>> nHighestID = rs_info.getInt("LastRec");
>>
>> But it stops at the "queryPagedRecords = rs_info.getInt("TotalRec");"
>>
>> Thanks in advance to anyone who can help.
>>
>> ...Robin
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Another issue, jTDS with Tomcat 5.5.9
Posted by Pid <pi...@pidster.com>.
On 16/10/2009 22:04, ULS Tech Support wrote:
> Hi there,
Please start a completely new email for each thread. Replacing the
subject line doesn't count, it's called thread hijacking.
p
> Tomcat 5.5.9, using jTDS, with SQL Server 2005 i am getting this issue.
>
> 2009/10/16 10:47:15 - sql exception:java.sql.SQLException: No current
> row in the ResultSet.
>
> This issue doesn't happen with TWFreeTDS (in fact, when i switch to
> twfreetds it works fine).. but from my research so far, i may have been
> wrong in the way i implemented it.
>
> Here is the code.
>
> public Vector queryPaged4(String strTableExt) throws SQLException {
> dbRecords.removeAllElements();
> boolean rc = true;
>
> ResultSet rs_info = null;
> boolean bTest = false;
> DBItems temp = null;
>
> //New **********
> /* This will call a stored procedure, pass in the page # and
> number to display on each page and will return the results
> directly.
> */
>
> CallableStatement call = dbConn.prepareCall("{call sp_PagedItems4
> (?,?,?,?,?)}");
> call.setString(1, strTableExt);
> call.setString(2, filter);
> call.setString(3, order);
> call.setInt(4, pageNumber);
> call.setInt(5, recsPerPage);
>
> if (!call.execute())//Query
> {
> //No ResultSets Returned;
> } else {
>
> try {
> rs_info = call.getResultSet();
>
> //Save the total number of records (value) in queryPagedRecords
> queryPagedRecords = rs_info.getInt("TotalRec");
> queryPagedMore = rs_info.getInt("MoreRecords");
> nLowestID = rs_info.getInt("FirstRec");
> nHighestID = rs_info.getInt("LastRec");
>
> if (queryPagedRecords > 0) {
> //Test for another resultset.
> boolean bTest = false;
> bTest = call.getMoreResults();
> //Next resultset established, let's get the data!
> dbResultSet = call.getResultSet();
>
> while (dbResultSet.next()) {
> //System.out.println("2: " + dbResultSet.getInt("ID"));
> rc = true;
>
> //Set the items object based on the resultset.
> temp = this.setItemsObject(true, dbResultSet);
>
> dbRecords.addElement(temp);
> }
> }
> } catch (SQLException e) {
> System.out.println("SQLException: " + e);
> System.out.println("SQLException Message: " + e.getMessage());
> } finally {
> rs_info = null;
> temp = null;
> dbResultSet = null;
> }
> System.out.println("end");
> }
>
> return dbRecords;
> }
>
> Basically i'm getting the resultsets, but i'm not able to pull the data
> from the resultsets as i get the error when i try and getInt.
>
> Does anyone have any clue on why this is happening, or how i can make
> this work?
>
> I did try and modify the code to the following to see if it helped, but
> again, i'm still stumped on HOW to retrieve the data from the resultsets.
>
> try {
> System.out.println("start...");
> int updateCount = 0;
> updateCount = call.getUpdateCount();
> System.out.println("update count = " + updateCount);
> boolean moreResults = true;
> while (updateCount >= 0 || moreResults) {
> if (!moreResults) {
> // just eat it
> updateCount = call.getUpdateCount();
> System.out.println("\nupdateCount= " + updateCount);
> } else {
> // get the data
> if (rs_info == null) {
> rs_info = call.getResultSet();
> } else {
> dbResultSet = call.getResultSet();
> }
>
> //Save the total number of records (value) in queryPagedRecords
> System.out.println("Got Data, how to process??");
> } // if ! moreResults else
> moreResults = call.getMoreResults();
> System.out.println("More Results??");
> } // while
>
> //rs_info.setFetchSize();
> System.out.println("Lets get data from rs_info");
> queryPagedRecords = rs_info.getInt("TotalRec");
> queryPagedMore = rs_info.getInt("MoreRecords");
> nLowestID = rs_info.getInt("FirstRec");
> nHighestID = rs_info.getInt("LastRec");
>
> But it stops at the "queryPagedRecords = rs_info.getInt("TotalRec");"
>
> Thanks in advance to anyone who can help.
>
> ...Robin
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Another issue, jTDS with Tomcat 5.5.9
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Robin,
On 10/16/2009 5:04 PM, ULS Tech Support wrote:
> Hi there,
It appears you are being ignored. There are several possible reasons:
1. You hijacked someone else's thread by replying to an unrelated
message but asking a new one.
2. You re-hijacked your own thread by replying to your first question
with another question.
3. Your latest question has nothing to do with Tomcat. It's all JDBC
code. This is not the proper forum to ask for JDBC help.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkrce9IACgkQ9CaO5/Lv0PDH3ACfQm8+BSyEku+zaqqBGYhvsv9Q
864Anj9NQXaOqPb1inSPzNdKbM/OlDI8
=HHYj
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org