There's nothing JDBC-specific about web services. You need to create and call a WS that takes a userID parameter, and which then returns the user name -if any- that goes along with it. So the JDBC code would be in the WS implementation class (presumably the WS somehow knows which DB to access, and has the required passwords etc.).
Is this the only DB call you need to make? In general, it doesn't seem like a good idea to access a DB remotely through a WS. Why does it need to be a WS?
Here we have an application(XYZ) with some JDBC calls. Now there is a need to replace these JDBC calls with webservices.
Based on your explanation, I usnderstood that
1) Need to create a web service which takes the userid as input and retruns user name.
2) Need to invoke the webservice from the class where I have JDBC code previously (in XYZ application).
3) In the webservice implementation class, need to place the existing JDBC code and return the user name as response of the webservice. (webservice implementation class Contains all the DB inforamtion like UN, Passwods ..etc)
Requesting you to correct me if I'm deviating/wrong.
As per the requirement,by using webservices we need to execute the statements and stored procedures. Can you please suggest me the best approach, if any.
Joined: Mar 22, 2005
Well, I was asking why you need to replace JDBC with WS. It just doesn't seem like a good idea, especially not if you have several JDBC calls.
What kind of application is this - a desktop app? Why can't it use JDBC? Does the app run outside of a firewall?
Joined: Nov 02, 2005
Yes, I have several JDBC calls(like SELECT, INSERT, UPDATE ..etc and stored procedures also) in my application. This is a web application.
Is the above mentioned approach correct, if there are more JDBC calls ? As per the requirement, Webservices need to interact with some other applications also.
Suggest me if there is any alternate or if I'm wrong.
Joined: Mar 22, 2005
You keep saying that it's a requirement, but I'm asking why it's a requirement. If it's a web app, then in all likelihood the database is on the same network as the web app, which makes the whole exercise a bit pointless, IMO. So I'm thinking I'm missing something - that's why I'm asking why it needs to be done.