Matlab JDBC to SQL Server

Posted on 2011-10-28
Last Modified: 2016-03-02
Hi, experts

I would like to connect Matlab to SQL Server. this is my environment.

OS: 64 Bits Windows 7
SQL Server: SQL Server 2008 R2 64 bits
Matlab 2011b 64 bit

To my understanding, based on my environment, ODBC is not going to work. So I try to use JDBC. Please see my screen capture.
I have add sqljdbc.jar to classpath.txt and looks like I successfuy create the conn object. but why still not work.
could you please help me about this. thanks in advance.
Question by:rmtogether
    LVL 15

    Accepted Solution

    It looks like your jdbc driver is not setup properly. The driver property of connection is empty.
    I would recommend to use dynamic java class path with javaaddpath command.

    You can check if connection is established with isconnection function.
    If it returns true get cursor object.

    Author Closing Comment

    thanks. I have to also enable TCP 1433 from sql server configuration.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    If you haven’t already, I encourage you to read the first article ( in my series to gain a basic foundation of R and R Studio.  You will also find the …
    This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
    The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
    The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now