ResultSet returns NOTHING
New to JSP and its environment. I am trying to connect a MS SQL database. Which gives no error same time, it does not return any thing.
I tried to change the table name from the coding so that it prompt me wrong table name. But it never bothers. It means that it is even not compiling the DriverManager line. Even, I removed the classpath entries, it compiled and gave no results.. Just a guess..
Please help me the experts.
The code is given below -
<%@pageimport ="java.sql.*, java.io.*, java.util.*" %>
<%
Connection con =null;
String ss =null;
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
//DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
//Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://SANTULAN:1433;","User=meenu;","Password=meenu;");
con = DriverManager.getConnection("jdbc:microsoft:sqlserver://SANTULAN:1433;User=s;Password=zed;");
out.println("Got Connection");
String str1 = ("Select * from dbo.users");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(str1);
while (rs.next())
{
ss = rs.getString("login");
out.println(ss);
};
}
catch (SQLException e1)
{
System.err.println(e1.toString());
}
catch (ClassNotFoundException e2)
{
System.err.println(e2.toString());
}
catch (Exception e3)
{
System.err.println(e3.toString());
}
out.println("Hello");
out.println(ss);
%>

