Update external Database

Hi Team, Is there any way to update an external table through Mendix? We can connect to external DB via mendix using DB replication,wherein we can only read the contents of Database. But I need to update some column of that table. Is it possible? Thanks in Advance
2 answers

Of course you can in a Java action. Preferred way of doing is would be to have whatever application owns this other database expose a webservice that allows you to do this. If you really need to directly write to the external database there are a couple of things to take into account:

  • you need to set up proper connection pooling, which is kinda hard but doable
  • you need to consider what other applications use the database and if it's an issue their database cache will not know you're writing to the database
  • you are creating a dependency to be in the vicinity of this external database, meaning you can't easily move to the cloud
  • you couple your application with database column names existing in an external database (which you do anyway using db replication module)
  • you are going to write your own database queries so you need to know what you are doing or you will introduce sql injection vulnerabilities
    • to be able to test this properly you need to have the same otap version of this external database as for you own application

If you still want to do this at least consider using stored procedures and using an account that can only access these stored procedures. This is safer and reduces the coupling between your application and the internal database structure.


Current solution could be the Database Connector, however: most of Nikel's points still stand.