LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-21-2023, 10:53 AM   #1
Thales90
LQ Newbie
 
Registered: Sep 2023
Posts: 2

Rep: Reputation: 0
Connect to mysql db in linux mint using vscode


I am writing a java app using vscode on linux mint 21. Trying to connect to a local mysql database i get the error "java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/mydb".I installed the mysql-connector-j_8.1.0-1debian11_all.deb package i found at https://dev.mysql.com/downloads/connector/j/ (choosing debian linux as os) and than linked both
mysql-connector-j-8.1.0.jar
mysql-connector-java-8.1.0.jar
to the reference library of my project in vscode.

Also tried the "platform indipendent" jar.

The url should be correct, so is there anything else i should do?

Edit:

i used the command

export CLASSPATH=/usr/share/java/mysql-connector-j-8.1.0.jar:$CLASSPATH

but still get the error

Re-Edit:

it's fine if i include the -classpath command line.

At this point the question would be:

How do i avoid to manually add the -classpath command?

Last edited by Thales90; 09-21-2023 at 11:33 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Mint 20.1, VSCode - Doesn't recognize OpenJDK SlowCoder Linux - Software 4 06-22-2021 09:22 AM
Pycharm or VSCode - or Atom or Anaconda - which system to run on a linux box rincon Linux - Newbie 3 01-01-2021 12:19 PM
LXer: Program IoT systems using Python with this VSCode plugin for RTOS LXer Syndicated Linux News 0 07-08-2020 09:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration