Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: connection string for oracle mysql db  (Read 10455 times)
Daniele A.
Posts: 28

« on: September 18, 2013, 11:12:19 am »

i have two server:     with mysql server   with a database "mytest"     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'"
Sebastien F.
Four Js
Posts: 512

« Reply #1 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:

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@"

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:

8) If you still want to use connection string parameters (for testing/debugging), try to add the host / IP address:

   DATABASE "mytest@'dbmmys50x',username='root',password='sysadm'"

Daniele A.
Posts: 28

« Reply #2 on: September 18, 2013, 11:46:59 am »

Hi Sebastien,
thanks for your exaustive explanation

i will keep in mind your suggestions

Pages: [1]
  Reply  |  Print  
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines