아제발요살려주세요
30
2019-09-10 01:21:44
5
208

jsp 파일로 mysql 테이블 만들려고 하는데요


<%@ page language="java" contentType="text/html; charset=EUC-KR"

    pageEncoding="EUC-KR" import="java.sql.*" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">

<title>Insert title here</title>

</head>

<body>


<%



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

Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/web","root","wow2019");


Statement st = con.createStatement();




String sql="create table member( "

+"userid varchar(15) not null primary key,"

+"pwd varchar(15) not null, "

+"userirum char(8) not null,"

+"useremail varchar(20) not null,"

+"sample4_postcode varchar(100) not null, "

+"sample4_roadAddress varchar(100) not null, "

+"userAddress varchar(100) not null,"

+"usertel varchar(20) not null);";


st.executeUpdate(sql);


con.close();

st.close();


out.print("member 테이블이 생성되었습니다.");

%>

</body>

</html>



코드입니다


mysql 만들때 아이디 admin 으로하고 비밀번호도 wow2019로 했는데

Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/web","root","wow2019");


이 구문에서 오류가 나네요 ㅜㅜ


그래서 직접  mysql에서도 


CREATE TABLE member ( 

userid varchar(15) not null,

pwd varchar(15) not null,

userirum char(8) not null,

useremail varchar(20) not null,

sample4_postcode varchar(100) not null, 

sample4_roadAddress varchar(100) not null, 

userAddress varchar(100) not null,

usertel varchar(20) not null,

PRIMARY KEY (userid)

);



이렇게 입력해도 똑같네요 코딩초보라 뭐가 오륜지 모르겠습니다 

0
0