Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 74502 invoked from network); 3 Feb 2009 13:47:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Feb 2009 13:47:24 -0000 Received: (qmail 96764 invoked by uid 500); 3 Feb 2009 13:47:12 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 96738 invoked by uid 500); 3 Feb 2009 13:47:12 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 96727 invoked by uid 99); 3 Feb 2009 13:47:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 05:47:12 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [91.121.203.225] (HELO r12857.ovh.net) (91.121.203.225) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 13:47:04 +0000 Received: from static-105-250.blueline.mg ([41.204.105.250] helo=lab.vectoris.fr) by r12857.ovh.net with esmtpa (Exim 4.69) (envelope-from ) id 1LULbr-0004k7-Qo for users@tomcat.apache.org; Tue, 03 Feb 2009 14:46:40 +0100 Received: from localhost ([127.0.0.1] helo=lab.vectoris.fr) by lab.vectoris.fr with esmtp (Exim 4.69) (envelope-from ) id 1LULbh-0002py-9Q for users@tomcat.apache.org; Tue, 03 Feb 2009 16:46:29 +0300 Message-ID: <49884AB5.3090005@lab.vectoris.fr> Date: Tue, 03 Feb 2009 16:46:29 +0300 From: "Mihamina Rakotomandimby (R12y)" User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: tomcat only query localhost database References: <4987C74B.4050107@lab.vectoris.fr> <4987EE96.2050101@lab.vectoris.fr> In-Reply-To: Content-Type: multipart/mixed; boundary="------------020100010700070809080000" X-Virus-Checked: Checked by ClamAV on apache.org --------------020100010700070809080000 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Gregor Schneider wrote: > Sorry, but you're providing too few informations. > > - please post the file /etc/tomcat6/Catalina/localhost/webappName.xml > (masquerade the user-id / password!) > - please post the piece of code where the said webapp tries to create > the database-connection. (A more readable version is attached) public static Connection getConnection() throws SQLException { try { if (null == s_dataSource) { try { Context envCtx = (Context) new InitialContext(); if(envCtx == null ) throw new Exception("ERROR - No Context"); s_dataSource = (DataSource) envCtx.lookup("java:comp/env/jdbc/norpassDBPool"); } catch (NamingException e) { e.printStackTrace(); throw e; } } return s_dataSource.getConnection(); } catch(Exception e) { try { Class.forName("org.gjt.mm.mysql.Driver"); } catch (ClassNotFoundException e1) { e1.printStackTrace(); } Connection con = DriverManager.getConnection("jdbc:mysql://localhost/baseName", "login", "password"); con.setAutoCommit(false); return con; } } -- Chef de projet chez Vectoris http://www.google.com/search?q=mihamina+rakotomandimby --------------020100010700070809080000 Content-Type: text/x-java; name="java.java" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="java.java" cHVibGljIHN0YXRpYyBDb25uZWN0aW9uIGdldENvbm5lY3Rpb24oKSB0aHJvd3MgU1FMRXhj ZXB0aW9uIAp7CiAgICB0cnkgewogICAgICAgIGlmIChudWxsID09IHNfZGF0YVNvdXJjZSkg CiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIHRyeSAKICAgICAgICAgICAgICAgICAg ICB7CiAgICAgICAgICAgICAgICAgICAgICAgIENvbnRleHQgZW52Q3R4ID0gKENvbnRleHQp IG5ldyBJbml0aWFsQ29udGV4dCgpOwogICAgICAgICAgICAgICAgICAgICAgICBpZihlbnZD dHggPT0gbnVsbCApCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhj ZXB0aW9uKCJFUlJPUiAtIE5vIENvbnRleHQiKTsKICAgICAgICAgICAgICAgICAgICAgICAg c19kYXRhU291cmNlID0gKERhdGFTb3VyY2UpIGVudkN0eC5sb29rdXAoImphdmE6Y29tcC9l bnYvamRiYy9ub3JwYXNzREJQb29sIik7CiAgICAgICAgICAgICAgICAgICAgfSAKICAgICAg ICAgICAgICAgIGNhdGNoIChOYW1pbmdFeGNlcHRpb24gZSkgCiAgICAgICAgICAgICAgICAg ICAgewogICAgICAgICAgICAgICAgICAgICAgICBlLnByaW50U3RhY2tUcmFjZSgpOwogICAg ICAgICAgICAgICAgICAgICAgICB0aHJvdyBlOwogICAgICAgICAgICAgICAgICAgIH0KICAg ICAgICAgICAgfQogICAgICAgIHJldHVybiBzX2RhdGFTb3VyY2UuZ2V0Q29ubmVjdGlvbigp OwogICAgfQogICAgY2F0Y2goRXhjZXB0aW9uIGUpIAogICAgICAgIHsKICAgICAgICAgICAg dHJ5IAogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgIENsYXNzLmZvck5h bWUoIm9yZy5nanQubW0ubXlzcWwuRHJpdmVyIik7CiAgICAgICAgICAgICAgICB9IAogICAg ICAgICAgICBjYXRjaCAoQ2xhc3NOb3RGb3VuZEV4Y2VwdGlvbiBlMSkgCiAgICAgICAgICAg ICAgICB7CiAgICAgICAgICAgICAgICAgICAgZTEucHJpbnRTdGFja1RyYWNlKCk7CiAgICAg ICAgICAgICAgICB9CiAgICAgICAgICAgIAogICAgICAgICAgICBDb25uZWN0aW9uIGNvbiA9 IAogICAgICAgICAgICAgICAgRHJpdmVyTWFuYWdlci5nZXRDb25uZWN0aW9uKCJqZGJjOm15 c3FsOi8vbG9jYWxob3N0L2Jhc2VOYW1lIiwgCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgImxvZ2luIiwgCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgInBhc3N3b3JkIik7CiAgICAgICAgICAgIGNvbi5zZXRBdXRv Q29tbWl0KGZhbHNlKTsKICAgICAgICAgICAgcmV0dXJuIGNvbjsKICAgICAgICB9Cn0= --------------020100010700070809080000 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org --------------020100010700070809080000--