我得到的错误就像'无效的描述符索引'使用ResultSetMetadata时

时间:2015-05-30 14:57:00

标签: java jdbc

<html>
<head>
    <title>First Web App</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
    <form action="LoginServlet" method="post">
    <div><h2>My First Webapp</h2></div>
    <p></p>
    <div><h3>User Name:<input type="text" name="username" id="username"></h3></div>
    <p></p>
    <div><h3>Password:<input type="password" name="password" id="password"></h3></div>
    <p></p>
    <input type="submit" value="login" id="loginsubmit"/>
     </form>
</body>

1 个答案:

答案 0 :(得分:0)

ResultSet表格索引从1开始而非0,因此请更改您的for loops这样的

for(int i=1;i<=cnt;++i)
{
    ....
}