Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Using PostgreSQL for MySQL app

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my company bought some years ago a web-product (I don't have the source) for computing statistics and so on. The backend used is  a mysql database. The structure is not complex (around 20 table) and few relationship among tables. Now  our company migrated to postgree and this app is the only one using mysql. We asked the product company to privide us a new version whis postgree as backend, but for different reason they don't want to do it. So I would like to know if it exists some tools/ libraries or implementing a code layer to continue to use our app as it is, but using a postgree backend, in a certain way to cheat with the app simulating a connection to mysql and converting the mysql call (select/write/update etc.) in a postgree calls.

Thanks for the help
   
 
Sheriff
Posts: 26948
83
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just happened to run across a link to this very old blog post: Sneaking in JDBC Drivers. Heinz Kabutz knows what he's talking about but on the other hand the article is over 10 years ago and things have changed somewhat in the JDBC world since then. However the general idea is that you force your own JDBC driver to be loaded first, and then have it intercept calls from the other driver and forward those calls on to your preferred database. That could be more complicated than the example in the blog post but it may or may not be doable for what you need.
 
Saloon Keeper
Posts: 7224
169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the open source P6spy library does something similar.
 
Rancher
Posts: 4801
50
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is also assuming that there are no dialect specific issues in the SQL used in the code.  That is, no SQL statements that are part of MySQL (including functions) but not part of Postgres.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic