1.JDBC 编程步骤:
加载驱动程序; Class.forName(driverClass)
加载Mysql驱动:Class.forName("com.mysql.jdbc.Driver")
2.获取数据库连接
DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/imooc","root","123456")
3.创建Statement 对象
conn,createStatement();
4创建数据库
create table imooc_goddess(
id int primary key auto_increment,
user_name varchar(30) not null,
sex int,
age int,
birthday date,
email varchar(30),
mobile varchar(11),
create_user varchar(30),
create_date date,
update_user varchar(30),
update_date date,
isdel int
)engine=innodb default charset=utf8 auto_increment=1;
alter database databaseweb default character set 'utf8';
set character_set_client='utf8';
set character_set_connection='utf8';
set character_set_results='utf8';