일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- openmeetings
- db
- 아파치 openmeetings
- centos7
- apache openmeetings
- 웹화상회의
- zoom api
- AWS
- java
- zoom 서버통신
- tomcat
- postgresql
- 화상회의
- 줌 녹화
- 줌 개발
- 줌 채팅
- zoom OkHttp
- zoom OkHttpClient
- JSP
- 아파치 오픈미팅
- mysql
- zoom
- zoom sdk
- 리눅스
- wildfly
- 명령어
- 데이터베이스
- jboss
- centos
- ubuntu
- Today
- Total
StartIT
jsp, postgresql 연동으로 db를 tomcat서버에서 접근하기(delete) 본문
//delete-do.jsp//
<%@ page contentType="text/html; charset=utf-8" import=" java.sql.*" %>
<%
request.setCharacterEncoding("utf-8");
String num=resquest.getParameter("num");
String url = "jdbc:postgresql://서버주소/디비명";
String usr = "유저명";
String pwd = "password";
try
{
Class.forName("org.postgresql.Driver");
connection con = DriverManager.getConnection(url,usr,pwd);
String sql = "DELETE FROM 테이블명 where num=?";
PreparedStatement pstmt = con.prepareStatement(sql);
pstmt.setInt(1,Integer.parseInt(num));
pstmt.executeUpdate();
pstmt.close();
con.close();
}
catch(ClassNotFountException e)
{
out.println(e);
}
catch(SQLException e)
{
out.println(e);
}
response.sendRedirect("list.jsp");
%>
참고:
https://hahahia.tistory.com/95?category=446168
JSP, DB연동을 이용한 회원리스트 구현(계정삭제)
/* list.jsp 일부분(전체 소스는 여기로) */ Number ID Name password 비고 <% while(rs.next()) { %> <%= rs.getInt("idx") /*ⓖ*/%> <%=rs.getString(2)%> <%= rs.getString(3) /*ⓗ*/%> <%=rs.getString("pwd"..
hahahia.tistory.com
'Server > centos' 카테고리의 다른 글
jsp, postgresql 연동으로 db를 tomcat서버에서 접근하기(update) (0) | 2020.06.29 |
---|---|
jsp, postgresql 연동으로 db를 tomcat서버에서 접근하기(Insert) (0) | 2020.06.29 |
centos7 명령어들 (0) | 2020.06.29 |
jsp, postgresql 연동으로 db를 tomcat서버에서 접근하기(select) (0) | 2020.06.29 |
centos7 tui,gui 변경 (0) | 2020.06.29 |