0

in my maven project, I am having an error in jdbc. the code is given below. I am using the dependency :

<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
"dependency"

"groupId"org.springframework"/groupId"

"artifactId" spring-jdbc "/artifactId"

"version" 5.2.7.RELEASE "/version"

here is my java code:

public class Main {

public static void main(String[] args) {
    try {
        String DATABASE_URL = "jdbc:mysql://localhost:3306/java";
        Connection connection = DriverManager.getConnection(DATABASE_URL, "root", "1234");

    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

}

EDIT: I am using SQL 8, with JDK 11.

Ultron
  • 11
  • 1
  • 4
  • MySql version? Does it work if you tried to connect to that url with sqlplus? – WoAiNii Jun 15 '20 at 18:40
  • Almost, but I don't have a /WEB-INF/lib folder. can You tell me what to do? Mine is a quick start project in eclipse. I havent heard of sql plus, can u pls send me a link about that? – Ultron Jun 16 '20 at 04:03
  • Thanks , I read other answers and that finally worked! Thank you so much! – Ultron Jun 16 '20 at 04:54

0 Answers0