Title: connection string for oracle mysql db Post by: Daniele A. on September 18, 2013, 11:12:19 am hi
i have two server: 192.168.0.1 with mysql server with a database "mytest" 192.168.0.2 with BDL runtime enviroment the string below work fine (i tested it) if the db and BDL are in the same server but if i have two distinct server one for db and one for BDL which is the correct syntax for the connection string? database "mytest+driver='dbmmys50x',username='root',password='sysadm'" Title: Re: connection string for oracle mysql db Post by: Sebastien F. on September 18, 2013, 11:38:45 am Hello Daniele,
The connection-string parameters have been introduced for testing/debugging purpose. You can read this here: https://4js.com/online_documentation/fjs-fgl-manual-html/User/Connections.html#DS_ODI_CPCSTR Here some advices: 1) Consider using CONNECT TO with USER / USING clause instead of DATABASE. 2) Do no hard-code clear passwords in your source code, of course. 3) Use a simple database name in your programs, and define the real database source in dbi.database.simple_name.source FGLPROFILE entry. In your case, you should define the MySQL database name (mytest), plus the host and the port (if different from the default): dbi.database.mydb.source = "mytest@192.168.0.1:port" You can then easily change the real db name or host in FGLPROFILE, without re-compiling your programs. 4) Configure the database driver in FGLPROFILE instead of hard-coding in the source. dbi.database.mydb.driver = "dbmmys50x" 5) Put DB username/password in variables, typically asked in a login dialog. CONNECT TO mydb USER v_username USING v_password 6) It's good practice to centralize the database connection in a custom function, and call this function in all programs, so if you want to change the connection method it's easy. 7) Consider reading carefully the documentation: https://4js.com/online_documentation/fjs-fgl-manual-html/User/Connections.html 8) If you still want to use connection string parameters (for testing/debugging), try to add the host / IP address: DATABASE "mytest@192.168.0.1+driver='dbmmys50x',username='root',password='sysadm'" Seb Title: Re: connection string for oracle mysql db Post by: Daniele A. on September 18, 2013, 11:46:59 am Hi Sebastien,
thanks for your exaustive explanation i will keep in mind your suggestions bye |