Re: DataNode connect to socket path?

From: Twan Kogels (twa..wansoft.com)
Date: Tue Jul 20 2004 - 03:45:37 EDT

  • Next message: Cristiano Cumer: "cayenne and eclipse pde"

    Hello Andrus,

    Thanks for the reply. I contacted the system admin and he wasn't very happy
    about it ;-) It seems that doing it over tcp/ip is slower and more
    insecure, but he will config it. We also have postgresql running, would
    this be a better choice for a production environment?

    Twan

    At 23:05 16-7-2004, you wrote:
    >Hi Twan,
    >
    > From Connector/J docs
    >(http://dev.mysql.com/doc/connector/j/en/index.html):
    >
    >"MySQL Connector/J can only communicate with MySQL using TCP/IP, as
    >Java does not support Unix domain sockets."
    >
    >So it seems like you are out of luck, since "Java doesn't support it".
    >But hey, nothing prevents you from continuing to use a regular
    >connection URL like jdbc:mysql://localhost/...
    >
    >Andrus
    >
    >
    >On Jul 16, 2004, at 4:06 AM, Twan Kogels wrote:
    >>Hi there,
    >>
    >>I'm at the point where i can deploy my webapplication to a production
    >>server. But i have a problem with the connection string i use to
    >>connect to the mysql database.
    >>
    >>On the test server this is:
    >>======================
    >><driver project-version="1.1" class="com.mysql.jdbc.Driver">
    >> <url value="jdbc:mysql://p400/proj"/>
    >> <connectionPool min="1" max="1" />
    >> <login userName="________" password="___________"/>
    >></driver>
    >>======================
    >>
    >>On the production server i need to connect to a socket on the local
    >>file system:
    >>======================
    >><driver project-version="1.1" class="com.mysql.jdbc.Driver">
    >> <url
    >> value="jdbc:mysql://localhost:/var/run/mysqld/mysqld.sock/proj"/>
    >> <connectionPool min="1" max="1" />
    >> <login userName="______" password="_________"/>
    >></driver>
    >>======================
    >>
    >>This gives me a:
    >>======================
    >>javax.servlet.ServletException: [v.1.1M7_1 June 15 2004] Global
    >>exception.
    >> at
    >>org.apache.struts.action.RequestProcessor.processException(RequestProce
    >>ssor.java:545)
    >> at
    >>org.apache.struts.action.RequestProcessor.processActionPerform(RequestP
    >>rocessor.java:486)
    >> at
    >>org.apache.struts.action.RequestProcessor.process(RequestProcessor.java :274)
    >> at
    >>org.apache.struts.action.ActionServlet.process(ActionServlet.java: 1482)
    >> at
    >>org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
    >>
    >>org.objectstyle.cayenne.CayenneRuntimeException: [v.1.1M7_1 June 15
    >>2004] Global exception.
    >> at
    >>org.objectstyle.cayenne.access.util.SelectObserver.nextGlobalException(
    >>SelectObserver.java:214)
    >> at
    >>org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java: 322)
    >> at
    >>org.objectstyle.cayenne.access.DataDomain.performQueries(DataDomain.jav
    >>a:654)
    >> at
    >>org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.j
    >>ava:1325)
    >> at
    >>org.objectstyle.cayenne.access.Transaction.performQueries(Transaction.j
    >>ava:176)
    >> at
    >>org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.j
    >>ava:1284)
    >> at
    >>org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.jav
    >>a:1499)
    >>
    >>Caused by: java.sql.SQLException: Cannot load connection class because
    >>of underlying exception: 'java.lang.NumberFormatException: For input
    >>string: "/"'.
    >> at
    >>com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java: 355)
    >> at
    >>org.objectstyle.cayenne.conn.DriverDataSource.getConnection(DriverDataS
    >>ource.java:151)
    >> at
    >>org.objectstyle.cayenne.conn.PooledConnectionImpl.reconnect(PooledConne
    >>ctionImpl.java:126)
    >> at
    >>org.objectstyle.cayenne.conn.PooledConnectionImpl.getConnection(PooledC
    >>onnectionImpl.java:163)
    >> at
    >>org.objectstyle.cayenne.conn.PoolManager.getConnection(PoolManager.java :434)
    >> at
    >>org.objectstyle.cayenne.conn.PoolManager.getConnection(PoolManager.java :385)
    >>======================
    >>
    >>In PHP i always use:
    >>======================
    >>$db = mysql_pconnect ("localhost:/var/run/mysqld/mysqld.sock",
    >>"_______", "___________");
    >>======================
    >>
    >>I can't seem to figure out on how to specify a path to a socket in the
    >>"DataNode.driver.xml". Maybe i'm searching for the wrong thing but
    >>google didn't find the answer too.
    >>
    >>Does anybody know a solution to this problem?
    >>
    >>Cheers,
    >>Twan Kogels
    >>
    >>
    >



    This archive was generated by hypermail 2.0.0 : Tue Jul 20 2004 - 03:43:16 EDT