View Full Version : MySQL and PostgreSQL connections

01-27-2010, 10:39 PM

I have a site which runs on PostgreSQL. The site also has a forum, using the
software from http://www.phorum.org.

I'm now trying to migrate the site to quercus. While I succeeded with the postgresql part, I'm now having troubles with the mysql part...

I created a JDBC Connection & connection pool in Glassfish v3 admin gui which I can ping there.

When I try to create the mysql-connection in the forum, like this:
$conn = mysqli_connect("java:comp/env/jdbc/lyrixPhorum");
I get this error message:

Warning: A link to the server could not be established. url=jdbc:mysql://java:comp/env/jdbc/lyrixPhorum:3306/?characterEncoding=ISO8859_1 driver=com.mysql.jdbc.Driver org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. [mysqli_connect]

Thats very strange. MySQL and PostgreSQL exceptions are mixed up, also it states mysqli_connect althought I'm using mysql_connect...

Any Ideas are greatly appreciated!

01-28-2010, 06:09 PM
Are you trying to use both MySQL and Postgres in the same application? If so, I don't think we have clean way of using them simultaneously outside of Resin. If you can separate the MySQL pages from the Postgres pages, you might be able to use two QuercusServlets with different databases, but if a single page/request uses both, we might have to make some modifications.


01-28-2010, 07:22 PM
Yes, I'm using both in one application.

I got it working by removing the database init param in web.xml. Now it creates connections on its own (although I will need to find out how to use connection pools with quercus.. jndi lookup fails).

The only thing I'm struggling with right now is, that the mysql connection seems to enfore iso-8859-1, but I need it to be unicode/utf-8.. is there a
way to override this? unicode.semantics=on does not have any effect.

p.s.: Could someone of you please disable moderation for me? Its quite annoying to wait a day for a new topic to appear, especially when one wants to post new information regarding the case.

01-29-2010, 12:41 AM
Ok, I'm now writing hooks for "phorum" to do utf8_encode() on all strings.. its quite annoying as it is not be necessary in mod_php, but at least it works now.

However, I came across a blocker:

I can disable the code in phorum, others may not. There is already a solution in the quercus source, but its commented out.