Prepared statement alternatives for this middle-man program?
Posted
by
user2813274
on Programmers
See other posts from Programmers
or by user2813274
Published on 2014-08-20T15:28:04Z
Indexed on
2014/08/20
16:34 UTC
Read the original article
Hit count: 291
I have an program that is using a prepared statement to connect and write to a database working nicely, and now need to create a middle-man program to insert between this program and the database. This middle-man program will actually write to multiple databases and handle any errors and connection issues.
I would like advice as to how to replicate the prepared statements such as to create minimal impact to the existing program, however I am not sure where to start. I have thought about creating a "SQL statement class" that mimics the prepared statement, only that seems silly.
The existing program is in Java, although it's going to be networked anyways so I would be open to writing it in just about anything that would make sense. The databases are currently MySQL, although I would like to be open to changing the database type in the future.
My main question is what should the interface for this program look like, and does doing this even make sense?
A distributed DB would be the ideal solution, but they seem overly complex and expensive for my needs. I am hoping to replicate the main functionality of a distributed DB via this middle-man. I am not too familiar with sql-based servers distributing data (or database in general...) - perhaps I am fighting an uphill battle by trying to solve it via programming, but I would like to make an attempt at least.
© Programmers or respective owner