# How to handle database connections dynamically with Servoy?

**URL:** <https://forum.servoy.com/t/how-to-handle-database-connections-dynamically-with-servoy/11934>\
**Category:** Classic Servoy\
**Created:** [March 22, 2010, 1:03pm UTC](https://forum.servoy.com/t/how-to-handle-database-connections-dynamically-with-servoy/11934 "2010-03-22T13:03:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nisalaperera](https://avatars.discourse-cdn.com/v4/letter/n/90db22/32.png) [@nisalaperera](https://forum.servoy.com/u/nisalaperera)\
**Post date:** [March 22, 2010, 1:03pm UTC](https://forum.servoy.com/t/how-to-handle-database-connections-dynamically-with-servoy/11934/1 "2010-03-22T13:03:32Z")

</div>

Can I handle database connections dynamically(in runtime), using solution model or any other way in servoy?

In my case, I’m trying to connect to two databases, which are having same name, but in two different servers.  
So I couldn’t use databaseManager.switchServer(‘crm’, ‘crm1’).

Anyone can help on this?

---

<div class="post-metadata">

**Author:** ![mboegem](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/mboegem/32/4399_2.png) [@mboegem](https://forum.servoy.com/u/mboegem)\
**Post date:** [March 22, 2010, 1:34pm UTC](https://forum.servoy.com/t/how-to-handle-database-connections-dynamically-with-servoy/11934/2 "2010-03-22T13:34:56Z")

</div>

databaseManager.switchServer(‘crm’, ‘crm1’) is using ‘named servers’ as I conclude of the statusbar help of this function.  
seems to me you have to define 2 server connections:  
1 - crm, pointing to ip1/crm.db  
2 - crm1, pointing to ip2/crm.db

then call switchServer at startup
