AddSQLiteToPath.m 727 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
function AddSQLiteToPath()
    %CHECKJARPATH Summary of this function goes here
    %   Detailed explanation goes here

    %% ensure that the sqlite jar file is on the path
    dynamicPaths = javaclasspath('-dynamic');
    bfIsLoaded = false;
    if (~isempty(dynamicPaths))
        for i=1:length(dynamicPaths)
            [~,name,~] = fileparts(dynamicPaths{i});
            if (strcmpi('sqlite-jdbc-3.14.2.1',name))
                bfIsLoaded = true;
                break
            end
        end
    end

    if (~bfIsLoaded)
        curPath = mfilename('fullpath');
        [pathstr,~,~] = fileparts(curPath);
        javaaddpath(fullfile(pathstr,'sqlite-jdbc-3.14.2.1.jar'),'-end');
    end
end