Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 15th, 2005, 01:08 PM
Registered User
 
Join Date: Nov 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Websphere DB2

Hi,
I am using websphere 5 to connect to my DB2 server. I have not installed DB2 client in the system, where i am having websphere.

I am using the following code to connect to DB2 server using Version 5 data Source, which i created thru' admin console.

        Context context = null;
        DataSource datasource = null;
        String JNDI_NAME = null;
        String providerURL = "iiop://localhost:2809/";
        try {
            //get the JNDI name from property file
            JNDI_NAME = conrad.getJndiName();
            Hashtable ht = new Hashtable();
            //add all constants to separte file
            ht.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory);
            ht.put(Context.PROVIDER_URL, providerURL);
            context = new InitialContext(ht);
            JNDI_NAME=conrad.getJndiName();
            //JNDI_NAME="jdbc/ConRad";
            System.out.println("Context Details..................");
            System.out.println(context.getClass());
            datasource = (DataSource) context.lookup("jdbc/conrad");
            System.out.println("Datasource Details**************");
            System.out.println("Ds "+datasource);
            System.out.println(datasource.getConnection().getM etaData().getUserName());


It is showing me this error

[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R javax.servlet.ServletException: SQLConnect
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.servlet.StrictServletInsta nce.doService(StrictServletInstance.java:143)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet._service(StrictLifecycleServlet.java:174)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.servlet.IdleServletState.s ervice(StrictLifecycleServlet.java:313)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet.service(StrictLifecycleServlet.java:116)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstance.se rvice(ServletInstance.java:258)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.servlet.ValidServletRefere nceState.dispatch(ValidServletReferenceState.java: 42)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstanceRef erence.dispatch(ServletInstanceReference.java:40)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.handleWebAppDispatch(WebAppRequestDispatcher. java:872)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.dispatch(WebAppRequestDispatcher.java:491)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.forward(WebAppRequestDispatcher.java:173)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.metlife.us.ins.conrad.integration.ControllerSe rvlet.doPost(ControllerServlet.java:105)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.servlet.StrictServletInsta nce.doService(StrictServletInstance.java:110)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet._service(StrictLifecycleServlet.java:174)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.servlet.IdleServletState.s ervice(StrictLifecycleServlet.java:313)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet.service(StrictLifecycleServlet.java:116)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstance.se rvice(ServletInstance.java:258)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.servlet.ValidServletRefere nceState.dispatch(ValidServletReferenceState.java: 42)
[11/15/05 22:02:00:130 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstanceRef erence.dispatch(ServletInstanceReference.java:40)
[11/15/05 22:02:00:146 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.handleWebAppDispatch(WebAppRequestDispatcher. java:872)
[11/15/05 22:02:00:146 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.dispatch(WebAppRequestDispatcher.java:491)
[11/15/05 22:02:00:146 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.forward(WebAppRequestDispatcher.java:173)
[11/15/05 22:02:00:146 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForwar d(WebAppInvoker.java:79)
[11/15/05 22:02:00:146 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleIn vocationHook(WebAppInvoker.java:199)
[11/15/05 22:02:00:146 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.cache.invocation.CachedInv ocation.handleInvocation(CachedInvocation.java:71)
[11/15/05 22:02:00:146 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.srp.ServletRequestProcesso r.dispatchByURI(ServletRequestProcessor.java:182)
[11/15/05 22:02:00:146 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.oselistener.OSEListenerDis patcher.service(OSEListener.java:331)
[11/15/05 22:02:00:146 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.webcontainer.http.HttpConnection.handle Request(HttpConnection.java:56)
[11/15/05 22:02:00:146 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.http.HttpConnection.readAndHandleReques t(HttpConnection.java:432)
[11/15/05 22:02:00:146 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.http.HttpConnection.run(HttpConnection. java:343)
[11/15/05 22:02:00:146 GMT+05:30] cf1aedb SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:592)

Do i need to have DB2 client installed in the PC where i am having websphere?

Please help me in resolving this.

Please mail your replies to my id vijayakumar_o_a@yahoo.com.

Thanks,
Vijay

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Db2 Biju6 SQL Server 2000 0 September 23rd, 2007 09:53 PM
Date From DB2 gog SQL Server 2000 6 April 30th, 2007 06:13 AM
Trigger in DB2 htyeoh SQL Language 0 March 13th, 2007 09:09 PM
Help w/ DB2 Triggers rrr24 Access 1 September 21st, 2004 01:13 AM
asp and DB2 beta611 Classic ASP Basics 0 August 20th, 2003 09:22 AM



All times are GMT -4. The time now is 07:38 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.