java变量接收怎么 弄例:DriverManager.getConnection(url, unername, password)
packagefff;importjava.sql.DriverManager;importjava.sql.SQLException;publicclassMYed{s...
package fff;
import java.sql.DriverManager;
import java.sql.SQLException;
public class MYed {
static String url = "jdbc:mysql://localhost/test";
static String unername = "root";
static String password ="root";
static String driver = "com.mysql.jdbc.driver";
public static void main(String[] args)throws ClassCastException, ClassNotFoundException, SQLException {
Class.forName(driver);//注册驱动
DriverManager.getConnection(url, unername, password);
-----------
}
} 展开
import java.sql.DriverManager;
import java.sql.SQLException;
public class MYed {
static String url = "jdbc:mysql://localhost/test";
static String unername = "root";
static String password ="root";
static String driver = "com.mysql.jdbc.driver";
public static void main(String[] args)throws ClassCastException, ClassNotFoundException, SQLException {
Class.forName(driver);//注册驱动
DriverManager.getConnection(url, unername, password);
-----------
}
} 展开
2个回答
2015-12-16
展开全部
程序是要完成什么 功能的,需求是什么 。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询