MATLAB Answers

Error using database.j​dbc.connec​tion/selec​t (line 74) Invalid connection.

9 views (last 30 days)
Oleh Chaharyn
Oleh Chaharyn on 2 May 2019
Answered: Bob Hickish on 18 May 2020
I can't connect to database using jdbc driver:
Error using database.jdbc.connection/select (line 74)
Invalid connection.
I tried to reinstall driver, updated javaclasspath but it doesn't work.
Is there any solution?

  0 Comments

Sign in to comment.

Answers (1)

Bob Hickish
Bob Hickish on 18 May 2020
I'm not sure if we had the same issue, but I managed to resolve mine by using these three functions in this order:
opts = configureJDBCDataSource('Vendor','PostgreSQL')
opts = setConnectionOptions(opts,"DataSourceName","PostgreSQL",..)
conn = database(databasename,username,password,driver,url)
I then checked I was connected to the database with: isopen(conn)

  0 Comments

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!