• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

MySQL Named Pipe connection possible? **RESOLVED**

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I am an absolute newbie to jForum, but followed the configuration directions. Unfortunately, I use named pipes to connect my own servlets to my MySQL DB, but do not see any way to tell jForum to do so. I was wondering if this was possible, because I can't open any unnecessary ports on the server (I don't entirely own it, and thats one of the rules). Sorry for the newbie question, but I've searched the forums, googled it, and am at a total loss. Are named pipe connections even possible now?

(Win 2003 Server, MySQL 5, Apache 2, Java 6, Tomcat 6, jForum 2.1.8 )

*I asked this in Questions, but I think this is a more appropriate place to ask.


--EDIT--

Thank you all for looking, but I finally got it
I grepped through all the code, and figured out that the solution requires no coding at all! For those of you in the same situation as me, try the following. (NO CODING REQUIRED, dont worry)

locate the mysql.properties file on your webserver, it should be in
{installed webapp root diectory}/WEB-INF/config/database/mysql

make a backup copy of the file, and open the original

the second to last last line of the file should read (without the line breaks):

database.connection.string=jdbc\:mysql\://${database.connection.host}\:${database.connection.port}/${database.connection.dbname}
?user\=${database.connection.username}&password\=${database.connection.password}&autoReconnect\=true${mysql.unicode}
${mysql.encoding}&useNewIO\=false&zeroDateTimeBehavior\=convertToNull&useServerPrepStmts\=false&dumpQueriesOnException\=true
&jdbcCompliantTruncation\=false


erase that entire entry (DO NOT obliterate the small mysql.encoding field below it) and paste in its place the following:
(Don't forget to remove the line breaks I have added for visibility!!)

database.connection.string=jdbc\:mysql\://${database.connection.host}\:${database.connection.port}/${database.connection.dbname}
?socketFactory\=com.mysql.jdbc.NamedPipeSocketFactory&user\=${database.connection.username}&password\=${database.connection.password}
&autoReconnect\=true${mysql.unicode}${mysql.encoding}&useNewIO\=false&zeroDateTimeBehavior\=convertToNull&useServerPrepStmts\=false
&dumpQueriesOnException\=true&jdbcCompliantTruncation\=false


save the file, and try the installation again

Thats It! The security and speed of a named pipe connection in jForum!

** Thats the quick and dirty method. I will try to post a patch to the code to allow this to be automated, but between exams, a job, and a GF, it might be a very, very long time.
[originally posted on jforum.net by DBhero]
 
    Bookmark Topic Watch Topic
  • New Topic