Can't connect a servlet to a mysql database (jdbc)

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;
public class LoginServletJDBC extends HttpServlet{
     public void doGet(HttpServletRequest request,HttpServletResponse response)
     throws ServletException,IOException{
          sendLoginForm(response,false);     }
     public void sendLoginForm(HttpServletResponse response,boolean error)
     throws ServletException,IOException{
          response.setContentType("text/html");
          PrintWriter out = response.getWriter();
          out.println("<html><head>");
          out.println("<title>Login</title>");
          out.println("</head>");
          out.println("<body>");
          out.println("<center>");
          if(error)
               out.println("<b>Failed login. Please try again</b>");
          out.println("<br><br>");
          out.println("<h2>Login page</h2>");
          out.println("<br>Please enter your username and password");
          out.println("<br><br>");
          out.println("<form method=post>");
          out.println("<table>");
          out.println("<tr>");
          out.println("<td>Username : </td>");
          out.println("<td><input type=text name=userName></td>");
          out.println("</tr>");
          out.println("<tr>");
          out.println("<td>Password : </td>");
          out.println("<td><input type=password name=password></td>");
          out.println("</tr>");
          out.println("<tr>");
          out.println("<td align=right colspan=3>");
          out.println("<input type=submit value=Login></td>");
          out.println("</tr>");
          out.println("</table>");
          out.println("</form>");
          out.println("</center>");
          out.println("</body></html>");
public void doPost(HttpServletRequest request,HttpServletResponse response)
     throws ServletException,IOException{
          String userName = request.getParameter("userName");
          String password = request.getParameter("password");
          if(login(userName,password)){
               RequestDispatcher rd = request.getRequestDispatcher("AnotherServlet");
               rd.forward(request,response);
          else{
               sendLoginForm(response,true);
     boolean login(String userName,String password){
          try{
               String url = "jdbc:mysql://localhost:3306/Users";
               Class.forName("com.mysql.jdbc.Driver");
               Connection con = DriverManager.getConnection(url,"root","");
               //System.out.println("got connection");
               Statement s = con.createStatement();
               String sql = "select userName from Users where userName='"+userName+"and password='"+password+"';";
               ResultSet rs = s.executeQuery(sql);
               if(rs.next()){
                    rs.close();
                    s.close();
                    con.close();
                    return true;
               rs.close();
               s.close();
               con.close();
          catch(ClassNotFoundException e){
               System.out.println(e.toString());
          catch(SQLException e){
               System.out.println(e.toString());
          catch(Exception e){
               System.out.println(e.toString());
          return false;
}so ...
here i'm trying to connect to Users mysql database (i use Tomcat 4.1 and mysql servers and clients 4.0.1-alpha)
where is the problem ? when i run this servlet (http://localhost:8080/example/servlet/LoginServletJDBC ) it works ;
BUT when i type an username and a password (any user&pass) my servlet doesn't connect to the database (become a infinite loop without output ; i mean no any errors and exceptions)
i try other think : i changed the database with unexisting database and the result was that i was expected (Unknow database 'unexistingdatabase' )
what i miss ?
please... can anyone help me...
thank`s in advance

The wireless security setting that the Actiontec modem/router is using may be different...and not compatible....than the setting that the Comcast product was using.
If you think that might the case, and you have the time to troubleshoot......
Temporarily, turn off the wireless security on the Actiontec modem/router
Reset an AirPort Express back to default settings, then see if it will connect using no security and allow an Internet connection when you do the Ethernet port test in the post above again.
If the AirPort Express cannot connect correctly using no security on the wireless network.....then it is a no brainer to know that it will never connect when security is enabled.  So, if the AirPort will not connect using no security, you may have an incompatibility issue between the Actiontec and Apple products.
However, if the AirPort Express connects OK with no security, then this tells you that you will need to use a different setting for security on the Actiontec...the same that the Comcast router was using before.....so the Express will have a better chance of connecting.
That setting would be something like WPA/WPA2 Personal, or the same setting stated another way would be WPA-PSK-TKIP.

Similar Messages

  • Can not connect Fusion Web Application with MySQL database

    Hello to everybody, I have installed jDeveloper since 3 days ago and I am still not able to run a simple web application just to try! I have worked previously with Eclipse and NetBeans but none of them had sooo much errors related to everything. I pasted the JDBC driver everywhere in the jdeveloper folders, to JDK and JRE. To be clear, I created a Fusion Web Application, created an AppModule, tested the conncection with the database and it was fine, created a simple jsf page and added one DataView from the AppModuleDataControl to the jsf file. Everything is ok and when I want to run the jsf file I receive this error:
    <May 2, 2013 12:13:18 PM CEST> <Notice> <Diagnostics> <BEA-320068> <Watch 'UncheckedException' with severity 'Notice' on server 'DefaultServer' has triggered at May 2, 2013 12:13:18 PM CEST. Notification details:
    WatchRuleType: Log
    WatchRule: (SEVERITY = 'Error') AND ((MSGID = 'WL-101020') OR (MSGID = 'WL-101017') OR (MSGID = 'WL-000802') OR (MSGID = 'BEA-101020') OR (MSGID = 'BEA-101017') OR (MSGID = 'BEA-000802'))
    WatchData: DATE = May 2, 2013 12:13:18 PM CEST SERVER = DefaultServer MESSAGE = [ServletContext@16349538[app:test2 module:test2-ViewController-context-root path:/test2-ViewController-context-root spec-version:2.5]] Servlet failed with Exception
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.NoClassDefFoundError, msg=com/mysql/jdbc/DatabaseMetaData
         at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:4739)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2536)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2346)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3245)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:571)
         at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:234)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:504)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:499)
         at oracle.adf.model.bc4j.DCJboDataControl.initializeApplicationModule(DCJboDataControl.java:517)
         at oracle.adf.model.bc4j.DCJboDataControl.getApplicationModule(DCJboDataControl.java:867)
         at oracle.adf.model.binding.DCDataControl.setErrorHandler(DCDataControl.java:487)
         at oracle.jbo.uicli.binding.JUApplication.setErrorHandler(JUApplication.java:261)
         at oracle.adf.model.BindingContext.put(BindingContext.java:1318)
         at oracle.adf.model.binding.DCDataControlReference.getDataControl(DCDataControlReference.java:247)
         at oracle.adf.model.BindingContext.instantiateDataControl(BindingContext.java:1020)
         at oracle.adf.model.dcframe.DataControlFrameImpl.doFindDataControl(DataControlFrameImpl.java:1645)
         at oracle.adf.model.dcframe.DataControlFrameImpl.internalFindDataControl(DataControlFrameImpl.java:1514)
         at oracle.adf.model.dcframe.DataControlFrameImpl.findDataControl(DataControlFrameImpl.java:1474)
         at oracle.adf.model.BindingContext.internalFindDataControl(BindingContext.java:1150)
         at oracle.adf.model.BindingContext.get(BindingContext.java:1103)
         at oracle.adf.model.binding.DCParameter.evaluateValue(DCParameter.java:82)
         at oracle.adf.model.binding.DCParameter.getValue(DCParameter.java:111)
         at oracle.adf.model.binding.DCBindingContainer.getChildByName(DCBindingContainer.java:2743)
         at oracle.adf.model.binding.DCBindingContainer.internalGet(DCBindingContainer.java:2791)
         at oracle.adf.model.binding.DCExecutableBinding.get(DCExecutableBinding.java:115)
         at oracle.adf.model.binding.DCUtil.findSpelObject(DCUtil.java:329)
         at oracle.adf.model.binding.DCBindingContainer.evaluateParameterWithElCheck(DCBindingContainer.java:1473)
         at oracle.adf.model.binding.DCBindingContainer.findDataControl(DCBindingContainer.java:1603)
         at oracle.adf.model.binding.DCIteratorBinding.initDataControl(DCIteratorBinding.java:2542)
         at oracle.adf.model.binding.DCIteratorBinding.getDataControl(DCIteratorBinding.java:2477)
         at oracle.adf.model.binding.DCIteratorBinding.refresh(DCIteratorBinding.java:4444)
         at oracle.adf.model.binding.DCExecutableBinding.refreshIfNeeded(DCExecutableBinding.java:341)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.isAttributeUpdateable(JUCtrlValueBinding.java:1707)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.isAttributeUpdateable(JUCtrlValueBinding.java:1826)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.isUpdateable(JUCtrlValueBinding.java:2722)
         at oracle.adfinternal.view.faces.model.AdfELResolver._isReadOnly(AdfELResolver.java:130)
         at oracle.adfinternal.view.faces.model.AdfELResolver.isReadOnly(AdfELResolver.java:147)
         at oracle.adfinternal.view.faces.model.AdfELResolverProxy.isReadOnly(AdfELResolverProxy.java:78)
         at com.sun.faces.el.DemuxCompositeELResolver._isReadOnly(DemuxCompositeELResolver.java:293)
         at com.sun.faces.el.DemuxCompositeELResolver.isReadOnly(DemuxCompositeELResolver.java:322)
         at com.sun.el.parser.AstValue.isReadOnly(Unknown Source)
         at com.sun.el.ValueExpressionImpl.isReadOnly(Unknown Source)
         at com.sun.faces.facelets.el.TagValueExpression.isReadOnly(TagValueExpression.java:120)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer._getUncachedReadOnly(EditableValueRenderer.java:476)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.cacheReadOnly(EditableValueRenderer.java:406)
         at oracle.adfinternal.view.faces.renderkit.rich.LabeledInputRenderer.beforeEncode(LabeledInputRenderer.java:128)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:510)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer._encodeFormItem(PanelFormLayoutRenderer.java:1088)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer.access$100(PanelFormLayoutRenderer.java:50)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1604)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1523)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:318)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:283)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer._encodeChildren(PanelFormLayoutRenderer.java:420)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer.encodeAll(PanelFormLayoutRenderer.java:208)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at oracle.adfinternal.view.faces.component.AdfViewRoot.encodeAll(AdfViewRoot.java:91)
         at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:399)
         at org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.renderView(ViewDeclarationLanguageFactoryImpl.java:350)
         at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
         at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
         at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:165)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:1035)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:342)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:236)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:509)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused By: java.lang.NoClassDefFoundError: com/mysql/jdbc/DatabaseMetaData
         at weblogic.jdbc.wrapper.DatabaseMetaData_com_mysql_jdbc_DatabaseMetaData.getDatabaseProductVersion(Unknown Source)
         at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1198)
         at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:6838)
         at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:298)
         at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:329)
         at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:203)
         at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolConnect(ApplicationPoolMessageHandler.java:600)
         at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:417)
         at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:9053)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:4606)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2536)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2346)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3245)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:571)
         at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:234)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:504)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:499)
         at oracle.adf.model.bc4j.DCJboDataControl.initializeApplicationModule(DCJboDataControl.java:517)
         at oracle.adf.model.bc4j.DCJboDataControl.getApplicationModule(DCJboDataControl.java:867)
         at oracle.adf.model.binding.DCDataControl.setErrorHandler(DCDataControl.java:487)
         at oracle.jbo.uicli.binding.JUApplication.setErrorHandler(JUApplication.java:261)
         at oracle.adf.model.BindingContext.put(BindingContext.java:1318)
         at oracle.adf.model.binding.DCDataControlReference.getDataControl(DCDataControlReference.java:247)
         at oracle.adf.model.BindingContext.instantiateDataControl(BindingContext.java:1020)
         at oracle.adf.model.dcframe.DataControlFrameImpl.doFindDataControl(DataControlFrameImpl.java:1645)
         at oracle.adf.model.dcframe.DataControlFrameImpl.internalFindDataControl(DataControlFrameImpl.java:1514)
         at oracle.adf.model.dcframe.DataControlFrameImpl.findDataControl(DataControlFrameImpl.java:1474)
         at oracle.adf.model.BindingContext.internalFindDataControl(BindingContext.java:1150)
         at oracle.adf.model.BindingContext.get(BindingContext.java:1103)
         at oracle.adf.model.binding.DCParameter.evaluateValue(DCParameter.java:82)
         at oracle.adf.model.binding.DCParameter.getValue(DCParameter.java:111)
         at oracle.adf.model.binding.DCBindingContainer.getChildByName(DCBindingContainer.java:2743)
         at oracle.adf.model.binding.DCBindingContainer.internalGet(DCBindingContainer.java:2791)
         at oracle.adf.model.binding.DCExecutableBinding.get(DCExecutableBinding.java:115)
         at oracle.adf.model.binding.DCUtil.findSpelObject(DCUtil.java:329)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer._encodeFormItem(PanelFormLayoutRenderer.java:1088)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer.access$100(PanelFormLayoutRenderer.java:50)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1604)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1523)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
         at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
         at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:274)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
         at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
         at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1275)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1677)
         at oracle.adfinternal.view.faces.component.AdfViewRoot.encodeAll(AdfViewRoot.java:91)
         at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:399)
         at org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.renderView(ViewDeclarationLanguageFactoryImpl.java:350)
         at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused By: java.lang.ClassNotFoundException: com.mysql.jdbc.DatabaseMetaData
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
         at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
         at weblogic.jdbc.wrapper.DatabaseMetaData_com_mysql_jdbc_DatabaseMetaData.getDatabaseProductVersion(Unknown Source)
         at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1198)
         at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:6838)
         at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:298)
         at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:329)
         at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:203)
         at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolConnect(ApplicationPoolMessageHandler.java:600)
         at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:417)
         at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:9053)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:4606)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2536)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2346)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3245)
         at oracle.adf.model.BindingContext.get(BindingContext.java:1103)
         at oracle.adf.model.binding.DCParameter.evaluateValue(DCParameter.java:82)
         at oracle.adf.model.binding.DCParameter.getValue(DCParameter.java:111)
         at oracle.adf.model.binding.DCBindingContainer.getChildByName(DCBindingContainer.java:2743)
         at oracle.adf.model.binding.DCBindingContainer.internalGet(DCBindingContainer.java:2791)
         at oracle.adf.model.binding.DCExecutableBinding.get(DCExecutableBinding.java:115)
         at oracle.adf.model.binding.DCUtil.findSpelObject(DCUtil.java:329)
         at com.sun.faces.el.DemuxCompositeELResolver.isReadOnly(DemuxCompositeELResolver.java:322)
         at com.sun.el.parser.AstValue.isReadOnly(Unknown Source)
         at com.sun.el.ValueExpressionImpl.isReadOnly(Unknown Source)
         at com.sun.faces.facelets.el.TagValueExpression.isReadOnly(TagValueExpression.java:120)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer._getUncachedReadOnly(EditableValueRenderer.java:476)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.cacheReadOnly(EditableValueRenderer.java:406)
         at oracle.adfinternal.view.faces.renderkit.rich.LabeledInputRenderer.beforeEncode(LabeledInputRenderer.java:128)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:510)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer._encodeFormItem(PanelFormLayoutRenderer.java:1088)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer.access$100(PanelFormLayoutRenderer.java:50)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1604)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1523)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:318)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:283)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer._encodeChildren(PanelFormLayoutRenderer.java:420)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer.encodeAll(PanelFormLayoutRenderer.java:208)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
         at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
         at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:274)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
         at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
         at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1275)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1677)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Please help me if you can! Thank you in advance
    Edited by: 1003357 on May 2, 2013 3:23 AM

    I pasted the JDBC driver everywhere in the jdeveloper folders, to JDK and JRE.
    The MySQL Connector Java JAR files are not found in the runtime class of the web application as indicated by the error message java.lang.NoClassDefFoundError, msg=com/mysql/jdbc/DatabaseMetaData
    Please refer
    http://docs.oracle.com/cd/E15523_01/web.1111/e13737/third_party_drivers.htm#autoId1

  • Problem connecting a webservice to a mysql database

    Hi,
    I am trying to connect a webservice to a mysql database. I am using sun application server 8.1 and Mysql 4.1.
    I have been using the application servers examples to achieve my goals thus far. I have made the following progress.
    - I have got a simple jdbc web application on the application server to access my mysql database.
    - I have got a web service on the application server to work properly, in regards to performing a simple rpc method such as 'sayHello'.
    - I now want my webservice to have similar functionality to the jdbc application. A simple query or update to the database installed on the application server invoked from the webservice deployed on the application server.
    I have been having difficulty in achieveing this. I don't understand why I can't get this to work as i can achieve access to the database from the jdbc app. I am getting the following errors on the application server log:
    [#|2005-03-01T14:22:59.739+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    retrieving_initial_context...|#]
    [#|2005-03-01T14:22:59.789+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    retrieved_initial_context_successfully|#]
    [#|2005-03-01T14:22:59.789+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    recording_the_greeting...|#]
    [#|2005-03-01T14:22:59.789+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    getting_datasource...|#]
    [#|2005-03-01T14:22:59.799+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    got_datasource_successfully|#]
    [#|2005-03-01T14:22:59.799+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    getting_connection...|#]
    [#|2005-03-01T14:22:59.819+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    got_connection_successfully|#]
    [#|2005-03-01T14:22:59.819+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    getting_statement...|#]
    [#|2005-03-01T14:22:59.819+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    got_statement_successfully|#]
    [#|2005-03-01T14:22:59.819+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    executing_query...|#]
    [#|2005-03-01T14:22:59.900+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    could_not_interact_with_db|#]
    [#|2005-03-01T14:22:59.910+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    excpetion: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
    ** BEGIN NESTED EXCEPTION **
    java.io.IOException
    MESSAGE: An established connection was aborted by the software in your host machine
    STACKTRACE:
    java.io.IOException: An established connection was aborted by the software in your host machine
    at sun.nio.ch.SocketDispatcher.read0(Native Method)
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:25)
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:233)
    at sun.nio.ch.IOUtil.read(IOUtil.java:206)
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:207)
    at com.sun.enterprise.server.ss.ASInputStream.read(ASInputStream.java:75)
    at com.sun.enterprise.server.ss.ASInputStream.read(ASInputStream.java:66)
    at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:75)
    at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(Re adAheadInputStream.java:94)
    at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:122)
    at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1842)
    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2292)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2788)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1534)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1625)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:2291)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:2226)
    at com.mysql.jdbc.Statement.executeQuery(Statement.java:1159)
    at goodbyeservice.GoodbyeImpl.sayGoodbye(Unknown Source)
    at goodbyeservice.GoodbyeIF_Tie.invoke_sayGoodbye(GoodbyeIF_Tie.java:54)
    at goodbyeservice.GoodbyeIF_Tie.processingHook(GoodbyeIF_Tie.java:124)
    at com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:321)
    at com.sun.xml.rpc.server.http.JAXRPCServletDelegate.doPost(JAXRPCServletDelegate. java:443)
    at com.sun.enterprise.webservice.JAXRPCServlet.doPost(JAXRPCServlet.java:50)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil terChain.java:257)
    at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterCha in.java:55)
    at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.ja va:161)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain .java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 263)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextVal ve.java:225)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 173)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:13 2)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:184)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.ja va:653)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.ja va:534)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.jav a:403)
    at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
    ** END NESTED EXCEPTION **
    I can't think of what the problem may be other then the following issues:
    - the mysql database would allow access from the jdbc application as it is seen as a local process whereas it may not for the webservice as it is seen as a remote process???
    - I may need to utilize a different datasource class to give the webservice access rights?
    Any help or advice in how this problem might be resolved or even just what it is would help me greatly. Thanks for you time in advance.
    Alvee

    Hi,
    I am trying to connect a webservice to a mysql database. I am using sun application server 8.1 and Mysql 4.1.
    I have been using the application servers examples to achieve my goals thus far. I have made the following progress.
    - I have got a simple jdbc web application on the application server to access my mysql database.
    - I have got a web service on the application server to work properly, in regards to performing a simple rpc method such as 'sayHello'.
    - I now want my webservice to have similar functionality to the jdbc application. A simple query or update to the database installed on the application server invoked from the webservice deployed on the application server.
    I have been having difficulty in achieveing this. I don't understand why I can't get this to work as i can achieve access to the database from the jdbc app. I am getting the following errors on the application server log:
    [#|2005-03-01T14:22:59.739+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    retrieving_initial_context...|#]
    [#|2005-03-01T14:22:59.789+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    retrieved_initial_context_successfully|#]
    [#|2005-03-01T14:22:59.789+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    recording_the_greeting...|#]
    [#|2005-03-01T14:22:59.789+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    getting_datasource...|#]
    [#|2005-03-01T14:22:59.799+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    got_datasource_successfully|#]
    [#|2005-03-01T14:22:59.799+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    getting_connection...|#]
    [#|2005-03-01T14:22:59.819+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    got_connection_successfully|#]
    [#|2005-03-01T14:22:59.819+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    getting_statement...|#]
    [#|2005-03-01T14:22:59.819+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    got_statement_successfully|#]
    [#|2005-03-01T14:22:59.819+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    executing_query...|#]
    [#|2005-03-01T14:22:59.900+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    could_not_interact_with_db|#]
    [#|2005-03-01T14:22:59.910+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    excpetion: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
    ** BEGIN NESTED EXCEPTION **
    java.io.IOException
    MESSAGE: An established connection was aborted by the software in your host machine
    STACKTRACE:
    java.io.IOException: An established connection was aborted by the software in your host machine
    at sun.nio.ch.SocketDispatcher.read0(Native Method)
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:25)
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:233)
    at sun.nio.ch.IOUtil.read(IOUtil.java:206)
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:207)
    at com.sun.enterprise.server.ss.ASInputStream.read(ASInputStream.java:75)
    at com.sun.enterprise.server.ss.ASInputStream.read(ASInputStream.java:66)
    at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:75)
    at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(Re adAheadInputStream.java:94)
    at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:122)
    at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1842)
    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2292)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2788)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1534)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1625)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:2291)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:2226)
    at com.mysql.jdbc.Statement.executeQuery(Statement.java:1159)
    at goodbyeservice.GoodbyeImpl.sayGoodbye(Unknown Source)
    at goodbyeservice.GoodbyeIF_Tie.invoke_sayGoodbye(GoodbyeIF_Tie.java:54)
    at goodbyeservice.GoodbyeIF_Tie.processingHook(GoodbyeIF_Tie.java:124)
    at com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:321)
    at com.sun.xml.rpc.server.http.JAXRPCServletDelegate.doPost(JAXRPCServletDelegate. java:443)
    at com.sun.enterprise.webservice.JAXRPCServlet.doPost(JAXRPCServlet.java:50)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil terChain.java:257)
    at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterCha in.java:55)
    at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.ja va:161)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain .java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 263)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextVal ve.java:225)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 173)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:13 2)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:184)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.ja va:653)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.ja va:534)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.jav a:403)
    at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
    ** END NESTED EXCEPTION **
    I can't think of what the problem may be other then the following issues:
    - the mysql database would allow access from the jdbc application as it is seen as a local process whereas it may not for the webservice as it is seen as a remote process???
    - I may need to utilize a different datasource class to give the webservice access rights?
    Any help or advice in how this problem might be resolved or even just what it is would help me greatly. Thanks for you time in advance.
    Alvee

  • How  to connect .... MYSQL database via JSP

    Hello,
    I am not able to connect mysql database via JSP... everytime i try to connect the database i get the following error .....
    "java.lang.NoClassDefFoundError: org/aspectj/lang/Signature" ..
    my jsp code is ....
    <%@ page import = "java.sql.*" %>
    <%
    Connection conn = null;
    Statement smt = null;
    ResultSet rs = null;
    %>
    <%
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mydatabase","username" ,"password");
    smt = conn.createStatement();
    rs = smt.executeQuery("select * from table");
    out.println("output is "+ rs.getString("my field"));
    rs.close();
    %>
    I have installed ............
    jdk1.5.0_02
    MySQL Server 4.1
    there are two jar files .. i tried with both jar files ..
    mysql-connector-java-3.1.8-bin.jar
    mysql-connector-java-3.1.8-bin-g.jar
    tomcat server 5.5.9
    my path .... is
    C:\Program Files\Java\jdk1.5.0_02\bin;C:\jakarta-tomcat-5.5.9\bin;C:\program files\mysql\mysql server 4.1\bin;
    any help on this error ..at the earliest ..
    ... am worried ..bcoz my deadlines is getting closer .....
    .. step by step .. procedure .. could be helpful ..
    anil

    Find out the JAR which contains the class and add it
    to WEB-INF/classes directory for your web application.WEB-INF/classes directory ..means ..C:\jakarta-tomcat-5.5.9\common\classes .. is that the one i need to keep my jar files ....???????????
    well i have downloaded .. mysql database connector from the website "http://www.mysql.com/products/connector/j/ " .. and i have downloaded MySQL Connector/J 3.1..under which i have downloaded "Source and Binaries (zip)" ..
    anil

  • Can I connect to Oracle server7.1  through Java-JDBC using the latest thin drivers???

    Hey Gurus,
    Please help me .
    MY Current requirement is to connect to multiple oracle 7.1( and other variants) servers running on different operating systems, through Java/JDBC.
    My FIrst question is, can i connect to older versions of database using latest drivers?
    I could connect to the server running on SCO-oracle 7.1 using SQLNet8.1.7 under windows. But the same is not happening when the client is on Linux.But I need to connect from linux
    It says ORA-03113 - End of communication channel.
    What may be th problem.
    If any one could show some pointers where I can get more information about this problem would be helpfull
    THanks
    Lokesh

    I tried the classpath suggestion above (not the one modifying the .xml file) , but it didnt work for me , I am using WLI 10.3.1 and trying to connect DB on 8.1.7 V . I downloaded the classes12.jar and the ojdbc14.jar file from the oracle and placed in lib and the even included the classpath , but i again got the same exception .
    All this while i was selecting the option Oracle Driver Thin from the DataBase Driver when creating the connection pool from console . I tried with "BEA Oracle Driver (Type 4)" and it worked for me .. Although the option "BEA Oracle Driver (Type 4)" lists only the DBs from 9.0.1 to 11 G , but in my case using this driver i am able to connect to Oracle DB 8.1.7 . So all you guys if it classpath doesnt fix the issue try out by selecting Driver , "BEA Oracle Driver (Type 4)" .
    Manoj , this will fix the Connection pool part of the ques, but for the java part Try to load the Driver class "weblogic.jdbc.oracle.OracleDriver" before connecting to DB with Class.forName.
    Thx
    Yatin Mehta

  • How can i connect to a SQL Server 2000 database usgin JSP?

    I need (URGENT) to connect to SQL Server 2000 databse using JSP. I do not know how to program using JSP, so if anyone has any code snippet please let me see it. What i need is to give my site some login/password security.
    Anyone?
    Thx.

    just create an ODBC of your database from control pannel -> administrative tools -> data sources (ODBC) ,double click it .....
    go to the tab SYstem DSN , click on ADD button. select the driver for your connection. it will be the last one in the list "SQL Server".
    click Next then give ur DSN name there, description and Server Name , on next give your username and password of SQL server. when it will be connected to the server celect your database from there and hence there will be an ODBC bridge same as in case of MS Access.
    code for connecting to ODBC is
    // DSN-NAME same as in System DSN.
    // username and password are of your databse
    try
              url = "jdbc:odbc:DSN-NAME";
              Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
              connect = DriverManager.getConnection( url,"username","password" );
              catch ( ClassNotFoundException cnfex ) {
                        setErrorMsg( cnfex.getMessage() );
              catch ( SQLException sqlex ) {
                        setErrorMsg( sqlex.getMessage() );
              catch ( Exception ex ) {
                        setErrorMsg( ex.getMessage() );
    Now you are connected to the SQL Server ..... use connect object for further processing .........

  • Error: when connecting to SAP XI to Mysql database server.

    Hi,
    I am getting this error when am trying to connect SAP XI to Mysql server.
    Can any body tell me how to resolve this error.
    Error during database connection to the database URL 'jdbc:mysql://172.17.120.98:3306/portal' using the JDBC driver 'com.mysql.jdbc.Driver': 'com.sap.aii.adapter.jdbc.sql.DriverManagerException: Cannot establish connection to URL 'jdbc:mysql://172.17.120.98:3306/portal': SAPClassNotFoundException: com.mysql.jdbc.Driver'
    My Databse connection variables as listed below.
    JDBC Driver:com.mysql.jdbc.Driver
    Connection: jdbc:mysql://localhost:3306:portal

    Hi,
    Check wheather JDBC driver for mysql is intalled in your J2ee engine or not. Plz find the threads below.
    http://blog.chinaunix.net/u1/54114/showart_972697.html
    Re: After Delpoying drivers
    also go over the note:
    Note 831162 - FAQ: XI 3.0 / PI 7.0 / PI 7.1 JDBC Adapter
    Note 941317 - known incompatibilities,
    Thanks,
    Venky

  • Can we connect to 1 Users Persistence(User Database) ?

    Hi experts,
    Kindly advise whether it's possible to set up to have > 1 Users persistence(User management database)
    For example, we have 50 users in LDAP and another 20 portal related users in portal system itself(This group of users does not have authorization to be set up in the LDAP)
    Kindly advise.

    Hi Erika ,
    you can have two datasource for validating as in our case we configured two LDAPs and had around 10000 user does not have much impact .
    Refer to this may be useful.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/63/14f5b51a6eff429f2d8b2063400e82/frameset.htm
    Thanx
    Pankaj

  • Is it possible to insert data into a MySQL database with Java?

    Hello everyone!
    I would like to know, if it's possible to insert data into a MySQL database, with a JFrame inside a servlet?
    When the JFrame is first created it calls this method:
         * Connects the servlet with the MySQL database.
        private void connect(){
            try{
                Class.forName("com.mysql.jdbc.Driver");
                connection = DriverManager.getConnection(
                        "jdbc:mysql://localhost:3306/data", "root", "omfg123");
            }catch(ClassNotFoundException cnfe){
                cnfe.printStackTrace();
            }catch(SQLException sqle){
                sqle.printStackTrace();
        }Then, when you click the "Add" button, it executes this code:
                add.addActionListener(new ActionListener(){
                    @Override
                    public void actionPerformed(ActionEvent ae){
                        String employee = employeeName.getText();
                        String[] args = employee.split(" ");
                        firstName = args[0];
                        lastName = args[1];
                        execute();
                });And this is my "execute()" method:
         * Connects the servlet with the MySQL database.
         * - And executes the SQL queries.
        private void execute(){
            try{
                PreparedStatement statement = connection.prepareStatement("insert" +
                        " into employees values(" + firstName + ", " + lastName
                        + ")");
                ResultSet result = statement.executeQuery();
                String fullName = firstName + " " + lastName;
                printer.write("Employee " + fullName + " added.</br>");
            }catch(SQLException sqle){
                sqle.printStackTrace();
        }But when I click the "Add" button, nothing happens.

    This is what I use to insert into mysql. It works on windows.
    try {
                Class.forName("com.mysql.jdbc.Driver");
                String connectionUrl = "jdbc:mysql://" + loadip + "/custsig?" +
                        "user=root&password=";
                Connection con = DriverManager.getConnection(connectionUrl);
                newproc = jTextField1.getText();
                newsoft = jTextField2.getText();
                newdeb = jTextField3.getText();
                newcust = jTextField4.getText();
                if (newcust.equals("")) {
                    errorsig12 = 1;
                    jLabel1.setForeground(new java.awt.Color(255, 0, 0));
                } else if (newsoft.equals("")) {
                    errorsig12 = 1;
                    jLabel2.setForeground(new java.awt.Color(0, 0, 0));
                } else if (newproc.equals("")) {
                    errorsig12 = 1;
                    jLabel3.setForeground(new java.awt.Color(0, 0, 0));
                } else if (newdeb.equals("")) {
                    errorsig12 = 1;
                    jLabel4.setForeground(new java.awt.Color(0, 0, 0));
                if (errorsig12 == 0) {
                    PreparedStatement ps = con.prepareStatement("insert into customer set cust_name = ?,  software = ?, processor = ?, debit = ?");
                    ps.setString(4, newdeb);
                    ps.setString(3, newproc);
                    ps.setString(2, newsoft);
                    ps.setString(1, newcust);
                    int rs = ps.executeUpdate();
            } catch (SQLException eg) {
                System.out.println("SQL Exception: " + eg.toString());
            } catch (ClassNotFoundException cE) {
                System.out.println("Class Not Found Exception: " + cE.toString());
            }

  • Problem connecting my webservice to mysql database

    Hi,
    I am trying to connect a webservice to a mysql database. I am using sun application server 8.1 and Mysql 4.1.
    I have been using the application servers examples to achieve my goals thus far. I have made the following progress.
    - I have got a simple jdbc web application on the application server to access my mysql database.
    - I have got a web service on the application server to work properly, in regards to performing a simple rpc method such as 'sayHello'.
    - I now want my webservice to have similar functionality to the jdbc application. A simple query or update to the database installed on the application server invoked from the webservice deployed on the application server.
    I have been having difficulty in achieveing this. I don't understand why I can't get this to work as i can achieve access to the database from the jdbc app. I am getting the following errors on the application server log:
    [#|2005-03-01T14:22:59.739+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    retrieving_initial_context...|#]
    [#|2005-03-01T14:22:59.789+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    retrieved_initial_context_successfully|#]
    [#|2005-03-01T14:22:59.789+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    recording_the_greeting...|#]
    [#|2005-03-01T14:22:59.789+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    getting_datasource...|#]
    [#|2005-03-01T14:22:59.799+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    got_datasource_successfully|#]
    [#|2005-03-01T14:22:59.799+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    getting_connection...|#]
    [#|2005-03-01T14:22:59.819+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    got_connection_successfully|#]
    [#|2005-03-01T14:22:59.819+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    getting_statement...|#]
    [#|2005-03-01T14:22:59.819+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    got_statement_successfully|#]
    [#|2005-03-01T14:22:59.819+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    executing_query...|#]
    [#|2005-03-01T14:22:59.900+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    could_not_interact_with_db|#]
    [#|2005-03-01T14:22:59.910+0000|INFO|sun-appserver-pe8.1|javax.enterprise.syste m.stream.out|_ThreadID=16;|
    excpetion: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
    ** BEGIN NESTED EXCEPTION **
    java.io.IOException
    MESSAGE: An established connection was aborted by the software in your host machine
    STACKTRACE:
    java.io.IOException: An established connection was aborted by the software in your host machine
    at sun.nio.ch.SocketDispatcher.read0(Native Method)
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:25)
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:233)
    at sun.nio.ch.IOUtil.read(IOUtil.java:206)
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:207)
    at com.sun.enterprise.server.ss.ASInputStream.read(ASInputStream.java:75)
    at com.sun.enterprise.server.ss.ASInputStream.read(ASInputStream.java:66)
    at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:75)
    at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(Re adAheadInputStream.java:94)
    at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:122)
    at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1842)
    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2292)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2788)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1534)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1625)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:2291)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:2226)
    at com.mysql.jdbc.Statement.executeQuery(Statement.java:1159)
    at goodbyeservice.GoodbyeImpl.sayGoodbye(Unknown Source)
    at goodbyeservice.GoodbyeIF_Tie.invoke_sayGoodbye(GoodbyeIF_Tie.java:54)
    at goodbyeservice.GoodbyeIF_Tie.processingHook(GoodbyeIF_Tie.java:124)
    at com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:321)
    at com.sun.xml.rpc.server.http.JAXRPCServletDelegate.doPost(JAXRPCServletDelegate. java:443)
    at com.sun.enterprise.webservice.JAXRPCServlet.doPost(JAXRPCServlet.java:50)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil terChain.java:257)
    at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterCha in.java:55)
    at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.ja va:161)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain .java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 263)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextVal ve.java:225)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 173)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:13 2)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:184)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.ja va:653)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.ja va:534)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.jav a:403)
    at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
    ** END NESTED EXCEPTION **
    I can't think of what the problem may be other then the following issues:
    - the mysql database would allow access from the jdbc application as it is seen as a local process whereas it may not for the webservice as it is seen as a remote process???
    - I may need to utilize a different datasource class to give the webservice access rights?
    Any help or advice in how this problem might be resolved or even just what it is would help me greatly. Thanks for you time in advance.
    Alvee

    The driver is in right place
    Originally I placed him in wrong directory and got an error, indicationg, that Driver class is not found, but then I corrected it, The problem is in connection to database - it doesn't work.
    I tired to load the same driver into Netbeans and could easyli create a connection to database, but I get it not working ander Sun Application server

  • How to connect to mysql database using a proxy

    Folks,
    I wrote a program to connect to both webpage and mysql databases. Because my internet has a firewall (proxy) I set up the internet connection like this:
          System.getProperties().put( "proxySet", "true" );
          System.getProperties().put( "proxyHost", proxyHost);
          System.getProperties().put( "proxyPort", proxyPort);
          Authenticator.setDefault(new MyAuthenticator());The http connection works fine. However the mysql database connection gives me an error:
    com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
    ** BEGIN NESTED EXCEPTION **
    java.net.SocketException
    MESSAGE: java.net.ConnectException: Connection timed out: connect
    STACKTRACE:
    java.net.SocketException: java.net.ConnectException: Connection timed out: connect
            at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
            at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:276)
            at com.mysql.jdbc.Connection.createNewIO(Connection.java:2666)
            at com.mysql.jdbc.Connection.<init>(Connection.java:1531)
            at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at myapplication$LongTask$ActualTask.<init>(app.java:182)
            at myapplication$LongTask$1.construct(app.java:121)
            at myapplication.SwingWorker$2.run(SwingWorker.java:107)
            at java.lang.Thread.run(Unknown Source)
    ** END NESTED EXCEPTION ** What can I do? Do i need to setup a SOCKS Proxies or something?
    Thanks a lot!!

    SOCKS it is.

  • Connecting to multiple mysql databases......

    hi everyone,
    I had some question, if I'm connected to more than one mySQL database, and I want to create such a table at specified database, what syntax should I write at the executeUpdate() statment ?
    thanx
    --------

    hi everyone,
    I had some question, if I'm connected to more than
    one mySQL database, and I want to create such a table
    at specified database, what syntax should I write at
    the executeUpdate() statment ?
    thanx
    --------The only way this question means anything not completely ridiculous is if you are asking the following.
    Your MySQL server is hosting several databases and you want to specify which one in your query.
    Yes you can do this but I don't think I would highly recommend it. The syntax is as follows.
    Creating a table called mytable in a database called testing
    CREATE TABLE testing.mytable  (firstname VARCHAR(20) NOT NULL,
       lastname VARCHAR(20) NOT NULL,
          PRIMARY KEY(firstname,lastname));Basically DATABASENAME.TABLENAME

  • How does J2SE 1.4 connect to Mysql database?

    Could anyone please tell me how to connect J2SE 1.4 to MySql database?
    I tried to modify "CreateCoffees.java", I don't know how to replace the following two statements:
    url = "jdbc:mySubprotocol:myDataSource" and
    Class:forName( myDriver:ClassName);
    Thank you in advance.
    Rayson

    It depends on the JDBC driver you are using. If you don't have one for MySQL try out the MMMySQL driver at http://mmmysql.sourceforge.net/. The doc with it explains how to connect to a database.
    Col

  • Can´t connect to Database in OEMCA

    Hi ...
    I Can´t connect to any user of the database (including SYS or SYSTEM) by the ORACLE Enterprise Manager Console Administrator. I connect with SYSMAN or other administrator accounts ... i ping to the database ... i connect direct with standalone with any user created .... but not with the OEMCA.
    ERROR: ORA 0131 Insufficient Privilegies (ias_admin, SYS, SYSTEM ... all)
    I also have done Preferred Credentials ... when i do this the OEMCA don't run ... and don't return any error ...
    Thank very much

    When i connect direct in sqlpus (dos shell)... as SYS or SYSTEM an execute the statement - select * from v$pwfile_users; -
    The return is
    SYSDB SYSOP
    INTERNAL TRUE TRUE
    SYS TRUE TRUE
    But if i connect in stand-alone as SYS or SYSTEM an then clik in SQL*PLUS Worksheet return this:
    SQL> ERROR:
    ORA-12545: Falha da ligação porque não existe host de destino ou objecto

  • I can't connect DAC client

    hi all,
    I can't connect DAC client, it show error 'oracle.jdbc.drver.OracleDrver driver not availabel'
    help me please .
    thank you
    Edited by: [email protected] on Feb 21, 2010 10:27 PM

    1.) Wrong forum. OBIEE forum is here: Business Intelligence Suite Enterprise Edition
    2.) With the information you are providing in this post...do you really think you will get any useful help? Be precise: http://catb.org/~esr/faqs/smart-questions.html#beprecise

Maybe you are looking for

  • Where EXACTLY are my photos in icloud?

      I am confused about icloud. I understand that when I take a pic with my iPhone it "magically" transfers to the photostream folder in "My Pictures" on my PC by way of icloud. I've mastered the understanding of deleting photos on either/both of these

  • My laptop has a virus, how can i get rid of it?

    My laptop has a virus on it and its called AntiVirus 360. I looked up on google what it is and its a virus that disguises itself as a program to help detect viruses when itself is the virus. I've tried many different programs to try and delete it off

  • Aperture unable to recognize photos on iPhone

    Recently I noticed that Aperture can not see or import photos from my wife's or my iPhone.  It first started over 6 months ago when it would give me an error saying video from my iPhone was an "unsupported format."  Every other app could read it but

  • Valuation price in Purchase requisition

    Hi , I have a material with base unit of measure as CS and Valuation unit of measure as LB ( Pounds ) in material master, Now when I am trying to create a Purchase requisition , system is not allowing to change the base unit of measure (case ) . its

  • PORTAL LOST CONNECT DURING RUN TIME

    This happens while Portal is running. The HTTP server loses its' connection with the database (probably from DAD) a couple of times per day. The more people that access the more down times. I checked everything during the time lost connection: alertl