Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JDBC and Relational Databases
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
JDBC and Relational Databases
Why am I getting a null Result set with a stored procedure
Alejandro Barrero
Ranch Hand
Posts: 502
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I am very new to stored procedures. I do not know what I am doing wrong. The stored procedure is:
ALTER PROCEDURE [dbo].[usp_Scheduled_Task_Log_Using_ID_select] @time DATETIME, @int2 INT, @str VARCHAR(10) OUTPUT, @int1 INT OUTPUT AS BEGIN SET NOCOUNT ON; SET ANSI_PADDING ON; SET ANSI_WARNINGS ON; SET IMPLICIT_TRANSACTIONS OFF; SET CURSOR_CLOSE_ON_COMMIT OFF; SET ARITHABORT ON; SET CONCAT_NULL_YIELDS_NULL ON; SET NUMERIC_ROUNDABORT OFF; SELECT * FROM Scheduled_Task_Log WHERE Scheduled_Date_Time <= @time AND Notification_Status_ID = @int2 END
my
Java
code is:
public ResultSet deliveryStampString(Timestamp currentTimeStamp, int pendingStatusId) throws NotificationServiceException { ResultSet result = null; String callableString = "{call usp_Scheduled_Task_Log_ID_select (?,?,?.?)}"; Connection conn = getConnection(); CallableStatement callableStatement; try { callableStatement = conn.prepareCall(callableString); callableStatement.setTimestamp(1, currentTimeStamp); callableStatement.setInt(2, pendingStatusId); callableStatement.registerOutParameter(4, java.sql.Types.VARCHAR); callableStatement.registerOutParameter(3, java.sql.Types.INTEGER); result = callableStatement.executeQuery(); } catch (SQLException e) { throw new NotificationServiceException(NotificationServiceException.SQL_EXCEPTION); } return result; }
I just can' figure out why result has a null value.
Your help will be greatly appreciated,
Alejandro Barrero
Your help will be greatly appreciated,
Alejandro Barrero
James Boswell
Bartender
Posts: 1051
5
I like...
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Alejandro
It looks to me like the
string
you are using to call your procedure is incorrect. You have a '.' character instead of a ','.
Alejandro Barrero
Ranch Hand
Posts: 502
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thank you very much for your help.
Your help will be greatly appreciated,
Alejandro Barrero
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Newbie needs help with "Object has been closed" exception
Problem with a stored procedure (SQL Server)
DataDirect Driver : Error " [DataDirect][SQLServer JDBC Driver]Invalid parameter binding(s)"
RowSet over ResultSet - Need explanation
JPA + Stored Procedure
More...