Home  >  Article  >  Database  >  eclipse-求助!jdbc连接mysql的问题!

eclipse-求助!jdbc连接mysql的问题!

WBOY
WBOYOriginal
2016-06-06 09:41:531065browse

mysqleclipse数据库

在eclipse里连接mysql数据库,启动tomcat后在console栏里显示Usage: RealmBase -a [-e ] ,并没有按照预想的显示连接成功的提示。这是怎么回事呢?
代码如下:
package Dao;

import java.sql.*;
public class connection {
public static void main(String args[]) {
String url="jdbc:mysql://localhost:3306/design";
String user="root";
String password="1234";
try{
Class.forName("com.mysql.jdbc.Driver");
Connection conn=DriverManager.getConnection(url, user, password);
System.out.print("SUCCESS!");
Statement stat=conn.createStatement();
}catch(Exception e){
e.printStackTrace();
}
}
}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn