package servlet;
import java.sql.Connection;
import java.sql.adminManager;
import java.util.List;
import java.util.ArrayList;
public class AdminDBUtil {
public static List<Admin> validate(String username,String password){
ArrayList<Admin> Ad = new ArrayList <> ();
String url = "jdbc:mysql://localhost:3306/vehiclereservationsystem";
String user = "root";
String pass ="username";
//create database connection
try{
Class.forName("com.mysql.jdbc.admin");
Connection con = adminManager.getConnection(url,user,pass);
}catch(Exception e){
e.printStackTrace();
}
//validate
return Ad;
}
}
I'm a JSP beginner and I'm trying to make a connection to my database "vehiclereservationsystem", table - admin, I already created my Admin.java class and servlet file(servlet didn't complete still), somehow , my adminManager.getConnection() doesn't work, I mean, the class name adminManager is underlined, shows something is wrong in my library or something related to that.
- The database software I use for this - mysql workbench 8.0CE
- Java 1.8
- Tomcat V9
- Eclipse Neon 3
- I will also upload an image of my IDE to show the JAR files I added to my WEB-INF library and referenced library.
- My other issue is, why isn't there the section called "class path" in the "Java build path".
Someone please give me some support, any support is very much appreciated, I tried to find for forums, it's hard to locate what this issue is.
Aucun commentaire:
Enregistrer un commentaire