Ip And Port Divertion Through Iptables

Hi To All,
I want to Route my web application to Mysql Database through a proxy server.so for this which approach should i use
1)iptables
2)squid

if Iptables how can i make this worked .this is the ip network i'm having

web application---------Proxy server-----------------Mysql Database
10.0.0.2                       10.0.0.4                                  10.0.0.6

i should make it work that web application(10.0.0.2) should route to proxy server(10.0.0.4) for database objects but should get the query objects from the Database(10.0.0.6)