最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

jsp中調(diào)用類的方法,總是報(bào)錯,數(shù)據(jù)庫連接一切正常,用main方法調(diào)用類的方法就沒問題~~~~??!

package com.PIM.dao;public class UserDao {????public boolean exsit(String name) throws SQLException { Connection conn=DBUtil.getConnection(); String sql="" + " select * from imooc_goddess " + " where user_name=? "; PreparedStatement ptmt=conn.prepareStatement(sql); ptmt.setString(1, name); ResultSet rs=ptmt.executeQuery(); if(rs!=null){ return true; } else{ return false; }}jsp 頁面:<%@ page language="java" import="java.util.* ,com.PIM.dao.*,com.PIM.model.*" contentType ="text/html; charset=utf-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String password = null;?request.setCharacterEncoding("utf-8"); //只是針對POST方式提交的請求,對GET方式無效。?response.setContentType("text/html;charset=utf-8");?UserDao ud= new UserDao();//報(bào)錯的地方~~~~~~~~~~~~~~~?。。。。。。?!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~?boolean a = ud.exsit("565203087");//寫死,數(shù)據(jù)庫中有這條數(shù)據(jù)。但是調(diào)用總是報(bào)錯。 if(a){ request.getRequestDispatcher("main.jsp").forward(request,response);//服務(wù)器內(nèi)部轉(zhuǎn)發(fā) } else{ response.sendRedirect("Registion.jsp");//請求重定向 }%>main 方法:UserDao ud = new UserDao();boolean a = ud.exsit("565203087"); System.out.println(a);//一切正常,服務(wù)臺能返回true????
查看完整描述

1 回答

?
敞篷帥哥

TA貢獻(xiàn)9條經(jīng)驗(yàn) 獲得超1個(gè)贊

把報(bào)錯內(nèi)容貼出來瞅瞅。

查看完整回答
反對 回復(fù) 2015-11-30
  • 1 回答
  • 0 關(guān)注
  • 2376 瀏覽

添加回答

了解更多

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號