J ai cette erreur sur mon code, je ne vois pas pourquoi...

javax.servlet.ServletException: [Microsoft][Gestionnaire de pilotes ODBC] État de curseur non valide

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<%@ page import="java.sql.*"%>
<html>
<head>
<title>APANO</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/stylecss.css" type="text/css">
</head>
 
<body bgcolor="#FFFFFF" text="#000000">
<%
Connection con = null;
try
{
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        String url = "jdbc:odbc:apano";
        con = DriverManager.getConnection(url);
}
catch (ClassNotFoundException e)
{
        %>System.err.println ("Exception : ClassNotFoundException - Driver non chargé !");<%
}
catch (SQLException e)
{  
        %>System.err.println("SQL Exception !");<%
}
%>
<%
Statement stmt = con.createStatement();
String queryVers = "SELECT Max(ID_VERSION) FROM T_Version;";
ResultSet rsVersion = stmt.executeQuery(queryVers);
%>
<table width="100%" border="0">
  <tr bgcolor="#FFCC00"> 
    <td colspan="6" height="5"> 
      <div align="right"></div>
    </td>
  </tr>
  <tr> 
    <td width="26%" nowrap> 
 
      <div align="left">APANO Version <%= rsVersion.getString(1) %> - LogicaCMG Pau</div>
    </td>
    <td width="7%">&nbsp;</td>
    <td width="19%">&nbsp;</td>
    <td width="19%">&nbsp;</td>
    <td width="29%" nowrap> 
      <div align="right">
<%
rsVersion.close();
%>	    
</div>
    </td>
  </tr>
</table>
<%
con.close();
%>
</body>
</html>