2017-11-27 1 views
0

누구든지 나를 도와 줄 수 있습니까? 이 문제를 해결하기 위해 내가해야 할 일은 무엇입니까?MySQL 및 Eclipse와의 연결 문제

try 
     { 
      /*Connect to MySQL database */ 
      Connection conn = DriverManager.getConnection(127.0.0.1, root, psswrd); 
      System.out.println("Connection established..."); 
      System.out.println(); 

Error: Multiple markers at this line - The left-hand side of an assignment must be a variable - Syntax error on token ".0", invalid AssignmentOperator - root cannot be resolved to a variable

답변

0

연결 문자열이 형식이어야합니다 : jdbc:mysql://127.0.0.1:3306/db_name, 당신은 다음과 같은 연결을 설정하기 전에 MySQL의 JDBC 드라이버를로드해야합니다

Class.forName("com.mysql.jdbc.Driver");