Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 15th, 2005, 01:08 PM
Registered User
 
Join Date: Nov 2005
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






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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.