jsp數(shù)據(jù)庫注冊性別
```jsp
<%@ page language="java" contentType="text/html; charset=UTF-" pageEncoding="UTF-"%>
<%
String gender = request.getParameter("gender");
%>
<%
if(request.getMethod().equals("POST")) {
try {
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:/mydb", "root", "password");
PreparedStatement pstmt = conn.prepareStatement("INSERT INTO users (gender) VALUES (?)");
pstmt.setString(, gender);
pstmt.executeUpdate();
} catch (Exception e) {
out.println(e.getMessage());
}
}
%>
```
然而,這個問題的具體解決方案會依賴于你的具體需求和技術(shù)棧。你使用了某些Web框架如Spring MVC,處理方式可能會有所不同。