Matlab-sql Connection Technology

Source: Internet
Author: User

Matlab-sql connection technology [pure code] code block

code block syntax follows standard MATLAB code

 function conn_matlabdb() % Rui 2015.6.27 MATLAB r2013b% Function Description: Establish MATLAB and database SQL connection% using JDBC connection method: Install driver package, add path, restart Matlab% to establish a database connection (based on SQL Server)% Reference Connection http://m.blog.csdn.net/blog/wang_306/37818681Percent input (in this): database name, user name, password, drive name *, local server address *DatabaseName =' Matlabdb '; username =' Matlabuser ';p Assword =' ****** ';d river =' Com.mysql.jdbc.Driver ';d Atabaseurl =' Jdbc:mysql://localhost:3306/matlabdb ';Percent build SQL connectionconn = database (databasename, username, password, driver, databaseurl);p ING (conn);Percent Connection determined: 1 connected | 0 Not ConnectedIsconnection (conn);Percent gain data for cell formatCURS=EXEC (Conn,' select * from Matlabdb.tb_dw_addr ');% ' in SQL statementCurs=fetch (curs);d Atacell =Curs.Data;Percent close connectionClose (curs); Close (conn)
Summarize

No blog, now and later will continue to stay at Zhejiang University of Science and Technology , continue to like code , learn more and more, to their own refueling.
Want to communicate with everyone, my e-mail: [Email protected]

Matlab-sql Connection Technology

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.