I know that this question was discussed not for the first time, but they did not help me, please help (preferably in detail). I have created an EE web project on intellij IDEA. Connected with MySQL (photo below) Then I write this code in index.jsp
<%
try
{
Class.forName("com.mysql.jdbc.Driver"); //load driver
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/dbuser","root","root"); //create connection
if(request.getParameter("btn_login")!=null) //check login button click event not null
{
String dbemail,dbpassword;
String email,password;
email=request.getParameter("txt_email"); //txt_email
password=request.getParameter("txt_password"); //txt_password
PreparedStatement pstmt=null; //create statement
pstmt=con.prepareStatement("select * from login where email=? AND password=?"); //sql select query
pstmt.setString(1,email);
pstmt.setString(2,password);
ResultSet rs=pstmt.executeQuery(); //execute query and store in resultset object rs.
if(rs.next())
{
dbemail=rs.getString("email");
dbpassword=rs.getString("password");
if(email.equals(dbemail) && password.equals(dbpassword))
{
session.setAttribute("login",dbemail); //session name is login and store fetchable database email address
response.sendRedirect("welcome.jsp"); //after login success redirect to welcome.jsp page
}
}
else
{
request.setAttribute("errorMsg","invalid email or password"); //invalid error message for email or password wrong
}
con.close(); //close connection
}
}
catch(Exception e)
{
out.println(e);
}
%>
And after running I have this error
"The server time zone value 'Öåíòðàëüíàÿ Àçèÿ (çèìà)' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support."
P.S: In Itellej IDEA time zone is UTC
, and I'm also tried change in mysql
SET @@global.time_zone = '+00:00';