This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Tomcat and the fly likes MySql Connection through socket file mysql.sock Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "MySql Connection through socket file mysql.sock" Watch "MySql Connection through socket file mysql.sock" New topic
Author

MySql Connection through socket file mysql.sock

Muhammad Ghufran
Greenhorn

Joined: Jul 20, 2005
Posts: 8
Hi,
I have running MySql server on Linux it is confiured by tmp/mysql.sock for connecting client. I am unable to configure tomcat to connect MySql server thorought mysql.sock. The tomcat server is also running on same Linux box. I am able to connect Mysql via Mysql client utility. I am able to connect tomcat if MySql is configured for TCP/IP but I want to connect with filesystem. Following is my server.xml

<Context path="/navex" docBase="navex" debug="5" reloadable="true" crossContext="true">

<Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_navex_log." suffix=".txt" timestamp="true"/>

<Resource name="jdbc/xxxxx" scope="Shareable" type="javax.sql.DataSource"/>

<ResourceParams name="jdbc/xxxx">
<parameter>
<name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>org.gjt.mm.mysql.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/xxxx?autoReconnect=true</value>
</parameter>
<parameter>
<name>username</name>
<value>xxxxx</value>
</parameter>
<parameter>
<name>password</name>
<value>xxxxx</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>20</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>10</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>-1</value>
</parameter>
</ResourceParams>
</Context>

Please Help me what should I use in url in order to connect with mysq.sock.

Thanks for any help in advance.

Ghufran
 
wood burning stoves
 
subject: MySql Connection through socket file mysql.sock