December 1, 2012

CUBRID Connection strings

Hi again!
...Ever had to deal with CUBRID connection strings...? :)
...Ever had to spend you time digging the net to find the precious connection strings syntax...?
Well, if you did, and if you need to have this information easily available at your fingers - here it is! (...and no, doesn't have support for CUBRID yet... :()

So I created a small script which will build your CUBRID connection string - just enter the connection data pieces and voila` - you got it! :)

One more thing - at the end of this blog post you will find all the links you need to the available online documentation and some quick connection strings examples.

Connection data:

User id:
Other data:

CUBRID connection string:

Be aware, for some drivers you can connect either using a connection string, either providing the connection information to the specific connect drivers method(s).

For example, in PHP you can connect in both ways:
Specific driver method:  
    $conn = cubrid_connect("localhost", 33000, "demodb", "public", "");
Connection string method:
    $con = cubrid_connect_with_url("cci:CUBRID:localhost:33000:demodb:dba::?autocommit=true");

If you would like to see listed more information about the drivers connection specific methods, let me know and I will post a separate blog.

See you next time! :)

Quick examples reference (let's assume the user "dba" has the password "pwd"):

Driver Connection string
JDBC jdbc:cubrid:localhost:33000:demodb:dba:pwd
.NET server=localhost;database=demodb;port=33000;user=public;password=pwd
OLE DB Provider=CUBRID.OLEDBProvider;Location=localhost;Data Source=demodb;User Id=dba;Password=pwd;Port=33000
Ruby @con = Cubrid.connect('db_name', 'host', port, 'db_user', 'db_password')
Python CUBRID:localhost:33000:demodb:dba:pwd:
PHP cci:CUBRID:localhost:33000:demodb:dba:pwd:?autocommit=true
PDO cubrid:host=;port=33000;dbname=demodb
Perl DBI:cubrid:database=demodb;host=localhost;port=33000;autocommit=true

1 comment: