My java keeps saying that the <BR> is unterminated
Why ?
It is just a string
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<jsp:directive.page import="java.sql.*" />
<HTML>
<HEAD>
<TITLE>JDBC scriptlet example</TITLE>
</HEAD>
<BODY>
<jsp:scriptlet>
Class.forName("com.mysql.jdbc.Driver");
Connection connection =
DriverManager.getConnection("jdbc:mysql://localhost:3306/smtrack", "", "");
Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery("select region from
sm04022005");
int numCols = rs.getMetaData().getColumnCount ();
while (rs.next())
{
out.print(" Region=" + rs.getString("region") + "<br>");
}
statement.close();
connection.close();
</jsp:scriptlet>
<jsp:expression>numCols</jsp:expression>
</BODY>
</HTML>
Andrew Rich - 18 Feb 2005 12:01 GMT
while (rs.next())
{
<![CDATA[
out.print(" Region=" + rs.getString("region") + "<br>");
]]>
}
fixed it
My java keeps saying that the <BR> is unterminated
Why ?
It is just a string
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<jsp:directive.page import="java.sql.*" />
<HTML>
<HEAD>
<TITLE>JDBC scriptlet example</TITLE>
</HEAD>
<BODY>
<jsp:scriptlet>
Class.forName("com.mysql.jdbc.Driver");
Connection connection =
DriverManager.getConnection("jdbc:mysql://localhost:3306/smtrack", "", "");
Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery("select region from
sm04022005");
int numCols = rs.getMetaData().getColumnCount ();
while (rs.next())
{
out.print(" Region=" + rs.getString("region") + "<br>");
}
statement.close();
connection.close();
</jsp:scriptlet>
<jsp:expression>numCols</jsp:expression>
</BODY>
</HTML>