<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.Connection"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!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=UTF-8">
<title>여기에 제목을 입력하십시오</title>
</head>
<body>
<%
String artist = request.getParameter("artist");
String title = request.getParameter("title");
Connection conn = null;
Statement stmt = null;
try{
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection("jdbc:mysql://localhost:8888mdb","mdb","1234");
if(conn==null)
throw new Exception("DB연결 실패");
stmt=conn.createStatement();
ResultSet rs = stmt.executeQuery("select*from mdb where artist='"+artist+"'");
if(!rs.next()){
out.println("해당하는것 없음");
}else{
rs.previous();
}
while(rs.next()){
String artistt = rs.getString("artist");
out.print("artist"+artistt);
}
}finally{
}
%>
</body>
</html>
DB에 있는 내용을 이용해서 검색을 참조 하면서 해보았는데 어디서 부터 생긴 오류인지 ...
Driver 부분인거 같은데 도통 모르겠네요 ㅠㅠ