Home > front end >  For help! References about the constructor
For help! References about the constructor

Time:12-21

Quick collapse, do you have a bug can card at home a day, and this is when the teacher don't let I began to write graduation thesis, and predecessors, please teach me
Issue the following

Org. Apache. Jasper. JasperException: Unable to compile class for JSP:

The JSP file: [/./showhistory. JSP] is a mistake in the first line [56]
The constructor History (String, String, float, float, float, float, Date, String) is undefined

Code:
<% @ page language="Java" contentType="text/HTML. Charset=utf-8 "
PageEncoding="utf-8"
The import="Java. SQL. *"
The import="Java. Util. *"
The import="Floyd. *
"%>

//can be initially, but later I joined a parameter in the method of constructing, has been shown may not be the



Title

<body background="backgroundpic. JPG" & gt;

<% request. The setCharacterEncoding (" utf-8 ");
The Object name=session. The getAttribute (" name ");
Object the password=session. The getAttribute (" password ");

%>




<%
The String URL="JDBC: mysql://localhost: 3306/carcontrollner";
Final String USERNAME="root";
Final String PWD="723428";

Try {
Class.forName("com.mysql.jdbc.Driver");
} the catch (Exception e) {}
The Connection Connection=DriverManager. GetConnection (URL, USERNAME, PWD);


String SQL="select * from history where the username=?" ;
PreparedStatement PSTMT=connection. PrepareStatement (SQL);

PSTMT. SetObject (1, name);


The ResultSet rs=PSTMT. ExecuteQuery ();

The History the History=new History ();



List Historys=new ArrayList<> (a);


While (rs), next ()) {
The history=new history (rs. Get string (history_id "), rs. Get string (" username "), rs. GetFloat (" length_preference "), rs. GetFloat (" danger_preference "), rs. GetFloat (" time_preference "), rs. GetFloat (" crossing_preference "), rs, getDate (" datetime "), rs. Get string (" historypath "));
Historys. Add (history);
}
%>








<%

Int count=0;
For (the History a: historys) {
count++;
String id=a.u sername;
%>












<%}
%>









<% %=a.h istory_id & gt; <% %=a.u sername & gt; <% %=a.h istorypath & gt; <% %=a. ength_preference & gt; <% %=a.t ime_preference & gt; <% %=a.t raffic_preference & gt; <% %=a.c rossing_preference & gt; <% %=a. d. atetime & gt;






History. The JSP
Package Floyd.

import java.util.Date;

Public class History {
Public String history_id;
Public String username;
Public float length_preference;
Public float traffic_preference;
Public float time_preference;
Public float crossing_preference;
Public Date datetime;
Public String historypath;

@ Override
Public String toString () {
The return History "[username=" + username + ", length_preference="+ length_preference +", traffic_preference="
+ traffic_preference + ", time_preference="+ time_preference +", crossing_preference="
+ crossing_preference + "] ";
}



Public History (String a,
Float b,
Float c,
Float d,
Float e) {

The username=a;
Length_preference=b;
Traffic_preference=c;
Time_preference=d;
Crossing_preference=e;



}


Public History (
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related