Vijay Rajaram

Greenhorn
+ Follow
since Nov 17, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Vijay Rajaram

yes, that would work but that is not what I want to do. Reason: What if someone adds a new argument in the stored proc? The stored procs are usually used by many people in real time. And for some requirement they would need a new argument (of course with default value) added to the proc.
Database: MS SQL Server
Java: 1.6

The stored proc which my frontend would use has 3 input parameters with default values (NULL) for all 3 parameters.



But my frontend would use just only 1 parameter out of 3. For this I have my JDBC code like this using the named parameter feature.



I get an error "The index 3 is out of range."

This JDBC code works fine if I pass all 3 parameters (or) if I pass only the first parameter login_id. I don�t think the JDBC CallableStatement requires same number of parameters as the backend strored proc.
Hi,

Does anyone know whether the file serving attribute (extendedDocumentRoot) is supported by Websphere on ZOS environment??

Regards,
- VJ
20 years ago
The connection object which you have created has to be stored in the servlet context and whenever you need a DB connection get the connection object from the servlet context.
By the way if you want to know the usage of the ServletContextListener, this is what you need to do.
Create a class which impliment the ServletContextListener interface and configure this class in the web.xml.
- VJ
[ February 23, 2004: Message edited by: Vijay Rajaram ]
21 years ago
Hi,
Can someone validate my observation on the configuration of various event listeners?
The classes which implement the interfaces HttpSessionAttributeListener, HttpSessionListener, ServletContextAttributeListener, ServletContextListener has to be configured in the web.xml to get notified of their events.
Where as the classes for the interface HttpSessionActivationListener or HttpSessionBindingListener are not required to be configured in the web.xml and all the objects of those classes which implement these interface and which exist in the current session get notified of its event.
Is my assumption valid?
Thanks,
- VJ
21 years ago
Michel,
Your approach of using in init-param should be working, may be the code snippet which tries to get the initialisation parameter might need to be reviewed. So post that code. Mean while, you have a special provision for these kind of requirement in the web.xml. i.e you can use environmental entries in the web.xml. as given below

Then you can use this environment entry anywhere in your application as given below

Hope this would meet your requirement.
- VJ
[ January 26, 2004: Message edited by: Vijay Rajaram ]
21 years ago
To my knowledge the HttpSessionAttributeListener interface is useful only to get notified whenever an attribute is added/removed/changed in the session. In fact you have interface (HttpSessionBindingListener) which can be used to get notified when a session gets expired or invalidated. But you don�t have anything handy for your requirement. Please let us know your logic of using HttpSessionAttributeListener for this requirement. In my way, the best way to do is to invalidate the session when closing the browser rather than keeping it in the server till you create the next session or session timeout. You can do this by calling a java script function in the onUnload event of the page and invalidate the session using invalidate() method of the session object.
Note: onUnload function would be triggered even when you close the browser.
If someone have a better solution to the requirement or any conflict to my view, please let me know.
- VJ
21 years ago
Hmm I guess this pop logic wont workout...
Unless it is invisible the end users might close the popup. This would create some locking problem in my app. Bear, I wouldn�t be able to go for any frames due to some restrictions we have in our app.
Ok let me make some adjustment in my application architecture.
Thanks for ur suggestions.
The purpose raised out of some limitations in our mainframe connectivity framework. I need to trigger an event in the background when a user moves out of my page (Clicks some other link). I wouldn�t be able to trigger the mainframe event from the clicked hyperlink as it is going to be some other applications link, which I shouldn�t modify. So I planed to open an invisible popup from the onUnload() event of my page. From that popup I would trigger my mainframe event and close the popup on completion.
[ December 01, 2003: Message edited by: Vijay Rajaram ]
[ December 01, 2003: Message edited by: Vijay Rajaram ]
Hello,
I need to open a popup window, which is invisible. Is it possible?
Regards,
- VJ
Hi,
I need to generate a UNIQUE and RANDOM number say for a transaction number and password generation. If I use the Random class like
Random ranObj = new Random();
int tranNumber = ranObj.nextInt();
Does this would always give a UNIQUE number? Coz I need to store this in the database table in a primary key column in identify the transaction.
Is there�s a better way which would guarantee the uniqueness across the application lifetime?
Thanks,
- VJ
21 years ago
Hi,
I�m using a DB2 database. I�ve set the auto commit to false for my JDBC connection. In a for loop I�m preparing a insert statement and inserting the record. When I�m out of the for loop I�m committing the entire transaction.
The problem is:
I�m inserting the record in the order, say 1, 2, 3, 4 in the for loop. But when I actually look into the table its in the reverse order i.e 4, 3, 2, 1.
Is this the default behaviour of JDBC with auto commit set to false? Is there�s any way to change it? Or does it depend on the JDBC driver??
Thanks,
- VJ