Jsp et mysql

Résolu
khadylaye - 19 août 2012 à 15:55
cs_laurent1024 Messages postés 987 Date d'inscription mardi 31 mai 2005 Statut Membre Dernière intervention 30 août 2012 - 20 août 2012 à 09:08
slt je veut me connecter a ma base de donnée avec une page jsp mais ca m'affiche comme erreurs (string cannot be resolved to a type) pouvez vous m'aider .voici mon code:


<%@ page import="java.sql.*" %>
<%
string connectionURL=
"jdbc:mysql://localhost:3306/etudiant";
Connection connection =null;
Statement statement =null;
ResultSet rs = null;
%>
<html>
<head>
<title>Exemple</title>
</head>


<% Class.forName("con.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection(connectionURL,"root","");
statement = connection.createStatement();
rs = statement.executeQuery("select* from etudiants"):
while (rs.next()){
out.println(rs.getSting("nom"));}
rs.close();
%>

</html>

2 réponses

cs_Julien39 Messages postés 6414 Date d'inscription mardi 8 mars 2005 Statut Modérateur Dernière intervention 29 juillet 2020 371
20 août 2012 à 09:05
Salut,

C'est juste un problème de majuscule :
string connectionURL
String connectionURL
3
cs_laurent1024 Messages postés 987 Date d'inscription mardi 31 mai 2005 Statut Membre Dernière intervention 30 août 2012 25
20 août 2012 à 09:08
Bonjour

"String" pas "string".
3
Rejoignez-nous