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, connectionstrings.com 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:

Host:
Port:
Database:
User id:
Password:
Other data:
Type:

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", "");
or:
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! :)
Bye-bye!
Dee


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

Driver Connection string
JDBC jdbc:cubrid:localhost:33000:demodb:dba:pwd
http://www.cubrid.org/manual/840/en/Connection%20Configuration
.NET server=localhost;database=demodb;port=33000;user=public;password=pwd
http://www.cubrid.org/wiki_apis/entry/connection-string
OLE DB Provider=CUBRID.OLEDBProvider;Location=localhost;Data Source=demodb;User Id=dba;Password=pwd;Port=33000
http://www.cubrid.org/manual/90/en/OLE%20DB%20Programming
Ruby @con = Cubrid.connect('db_name', 'host', port, 'db_user', 'db_password') http://www.cubrid.org/wiki_apis/entry/cubrid-ruby-api-documentation
Python CUBRID:localhost:33000:demodb:dba:pwd:
(CUBRID:host:db_name:db_user:db_password:?properties)

http://www.cubrid.org/wiki_apis/entry/cubrid-python-api-documentation
PHP cci:CUBRID:localhost:33000:demodb:dba:pwd:?autocommit=true
http://www.php.net/manual/en/function.cubrid-connect-with-url.php
ODBC DRIVER=CUBRID Driver;UID=dba;PWD=pwd;FETCH_SIZE=100;PORT=33000;SERVER=127.0.0.1;DB_NAME=demodb;CHARSET=utf-8
http://www.cubrid.org/manual/90/en/ODBC%20Programming#connection
PDO cubrid:host=127.0.0.1;port=33000;dbname=demodb
http://www.cubrid.org/manual/90/en/PDO%20Programming
Perl DBI:cubrid:database=demodb;host=localhost;port=33000;autocommit=true
http://search.cpan.org/~cubrid/DBD-cubrid-8.4.0.0002/cubrid.pm

1 comment: