Re: [Sqlrelay-discussion] Hibernate & sqlrelay
Brought to you by:
mused
From: David M. <dav...@fi...> - 2008-02-11 15:33:30
|
Actually, I'm working on that right now. SQL Relay doesn't yet have a JDBC driver. I started working on it once, but writing a JDBC driver is very complicated. There is an ODBC driver for JDBC though, and ODBC is much easier to code for. So, I'm currently working on an ODBC driver for SQL Relay which will enable it to work with both ODBC and JDBC applications, including Hibernate. The code is in CVS, but it's not complete yet. It "mostly works", and supports features that most people are likely to use but does not fully support the ODBC standard yet. There is another alternative though. If you can find a version of the JDBC driver for mysql that isn't pure Java, ie. that uses libmysqlclient natively, then you can use the drop-in replacement library for mysql as described in: http://sqlrelay.sourceforge.net/sqlrelay/dropin/mysql.html And configure SQL Relay to talk to your mysql database. But the last time I looked for a driver like that I couldn't find it. I'm sure that at one time such a thing existed, but it's since disappeared off of the web. Another, much more highly contrived alternative is to find a version of the JDBC driver for postgresql that uses libpq natively and use the drop-in replacement library for postgresql as described in: http://sqlrelay.sourceforge.net/sqlrelay/dropin/postgresql.html And configure SQL Relay to talk to your mysql database. I believe that the JDBC driver that uses the native postgresql client library is available in the older or archived code on the postgresql site. The postgresql route is the most likely to work. This is the chain now: your app -> hibernate -> jdbc -> mysql db and when using the postgres lib, this would be the chain: your app -> hibernate -> jdbc -> drop-in-replacement-lib-for-postgres -> libsqlrclient -> sqlrelay server -> libmysqlclient -> mysql db It looks weird, but it should work. Let me know what you think :) Dave dav...@fi... On Mon, 2008-02-11 at 06:45 +0200, Craig Main wrote: > Hi all, > > I have a jboss application that uses hibernate for connection pooling > which in turn uses jdbc to connect to a mysql database on a db server. I > would like to start using sqlrelay to better utilize our > backup/replicated database for select queries etc while the primary db > is used for inserts and updates. > > Is there a way to incorporate sqlrelay into this scenario. I don't want > to rewrite the java code to connect directly with sqlrelay. > > Any help will be appreciated. > > Regards > Craig Main > > > To read FirstRand Bank's Disclaimer for this email click on the following address or copy into your Internet browser: > https://www.fnb.co.za/disclaimer.html > > If you are unable to access the Disclaimer, send a blank e-mail to > fir...@fn... and we will send you a copy of the Disclaimer. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > > > __________________________________________________ > D O T E A S Y - "Join the web hosting revolution!" > http://www.doteasy.com __________________________________________________ D O T E A S Y - "Join the web hosting revolution!" http://www.doteasy.com |