create procedure school_dmo.stud(in bk_cd char(10))
select bank_cd,bank_nm ,branch_cd,bank_hnm ,user_cd ,update_dt,update_flag, branch_nm ,city_nm
from bankmst
;
エラー:
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '()' at line 1"
jspファイル
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
Connection con = null;
CallableStatement cstmt=null;
String BatchCode=request.getParameter("bank_cd");
try {
cstmt=con.prepareCall("{call stud(?)}");
cstmst.setString(1,bank_cd);
cstmt.registerOutParameter(2, Types.INTEGER);
cstmt.executeUpdate();
int val = cstmt.getInt(3);
if (val == 1) {
out.println("<h2 align='center'> bank_cd Successfully added</h2>");
}
else {
out.println("<h2 align='center'> bank_cd already Exists</h2>");
}
}
catch(Exception e){
e.printStackTrace();
}
finally {
cstmt.close();
con.close();
}
</body>
</html>