Serena Zhou

Ranch Hand
+ Follow
since Dec 13, 2003
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 Serena Zhou

I used a stored procedure to add a record to the SQL Server 2000 DB, In my stored procedure I want to return the ID if the record has been successfully added,
/*********************************************************
statement = con.prepareCall("{?=call spAddEmployee(?, ?)}");
statement.registerOutParameter(1, Types.INTEGER);
statement.setString(1, ...);
...
int result = statmemt.executeQuery();

My spAddEMployee:

CREATE PROCEDURE dbo.spAddEmployee(
@ID char(20),
@Name, char(30)
)
declare
AS INSERT INTO VendorInventory (ID, Name)
VALUES(@ID, @Name)
Return @ID
GO
**********************************************************/
But from the tutorial, I found that the callable statement will return the number of rows been added(or updated), is there anyway I can return the value I specified in the stored procedure?

Thanks!
Help, I've got following exception when I was running a web application, but everytime if I debug through it(WSAD5.0.1), I won't get this exception.

Can anybody explain that's why?

Thanks!


[6/2/05 16:28:52:063 CDT] 7b9824a2 SystemOut O **** Error in Controller: java.net.SocketException: Connection reset by peer: socket write error
[6/2/05 16:28:52:921 CDT] 7b9824a2 WebGroup E SRVE0026E: [Servlet Error]-[Controller]: java.lang.IllegalStateException: Cannot forward. Response already committed. (Servlet 2.3, SRV 8.4)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:160)
at dis.ar.ervrm.Controller.doPost(Controller.java:285)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:258)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:872)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:491)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:173)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:199)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:331)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:432)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:343)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:592)

18 years ago
Hi,

I've searched this through this forum but didn't find the answer, anybody has tried to debug javascript through WSAD5? I got this irritating script error, any help is appreciated.
18 years ago
In a JSP form, I want to give one of the drop down box's select value from DB based on the value that user has chosen from another drop down box, So that If I have chosen Unit A from Unit drop down box, the Employee drop down box will only show the employees from Unit A instead of all the employees from whole organization(Say in DB, they are tables with foreign key referring to each other )

Is there any way to do it?

Thanks!
18 years ago
JSP
May I ask if you have got the answer for this? I am facing the same problem.
Thanks!
I ran into a problem and need some help.

When I was debugging a problem in WSAD 5.0, I can not find the session variables in the variables section. I want to debug if these session variables are still holding correct values step by step.

Thank you in advance!
19 years ago
Thanks,
Jeanne and Masoud. I'm using WSAD 5.1.1.
19 years ago
Hi,

This might be a silly question. But there are many times after I have made the changes to the servlet, rebuild the project. The web application is still using the old file.

Anybody can help me to explian what needs to be done and thanks!
19 years ago
Thanks for your answer. Have another quesion here:

How to copy by value instead of by reference for object?
19 years ago
I know that "String is immutable". But how was that implemented? How if I want to have some class immutable like String?


Thanks!
19 years ago
Hi all,
I am starting to prepare for SCBCD, I noticed that for SCWCD and SCJP, SCJD, they have 1.4version test. But SCBCD has only 1.3 version. Can anybody tell me why and when might 1.4 come out?

Thanks!
Thanks for all the help I've got from JavaRanch.
Passed with score of 83. The questions are more straightforward than many of the mock exams.
19 years ago
On Page 537 of K&B book, the third statement is:

When the sleep or wait is over, or an object's lock becomes available, the thread can only reenter the runnable state. It will go directly from waiting to running.

(Shouldn't the thread go to runnable or ready status instead of running?)
Thanks!
Yeah, Thanks!
String is immutable and StringBuffer is not.