Mercurial > hg > ltpda
view m-toolbox/classes/+utils/@jmysql/dbconnTojconn.m @ 43:bc767aaa99a8
CVS Update
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Tue, 06 Dec 2011 11:09:25 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
% DBCONNTOJCONN convert a MATLAB database connection to a java db connection. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % DESCRIPTION: DBCONNTOJCONN convert a MATLAB database toolbox connection % to a java db connection. % % CALL: jconn = utils.jmysql.dbconnTojconn(dbconn); % % INPUTS: % dbconn - a database toolbox connecton % % OUTPUTS: % jconn - a connection object like that returned from % utils.jmysql.connect. % % % VERSION: $Id: dbconnTojconn.m,v 1.1 2009/07/28 06:46:09 hewitson Exp $ % % HISTORY: 24-05-2007 M Hewitson % Creation % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function jconn = dbconnTojconn(conn) if nargin ~= 1 || ~isa(conn, 'database') error('### The first argument should be a database connection'); end r = regexp(conn.URL, '//(.+)/', 'tokens'); host = r{1}; db = conn.Instance; user = conn.UserName; jconn = utils.jmysql.connect(host, db, user, ''); end