hi,
This might seem a bit trivial,but i am just not able to connect to a db
i have set the classpath to tools.jar as well as jsdk.jar...
JSP's code works fine except for recognising the sql related keywords..
i know it has got  to do with importing java.sql packages ,but it is not
happening..
here is the code below...can anyone show me where the problem might be..
thanks,
naveen

<HTML>

<HEAD><TITLE>
A JSP APPLICATION
</TITLE></HEAD>
<BODY BGCOLOR="white">

<%out.println("it prints");%>
<%@ page language="java" import="java.sql.*" %>

<%
 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
 Connection c = DriverManager.getConnection("jdbc:odbc:naveen","dba","sql");
 Statement st=c.createStatement();
 ResultSet rs=st.executeQuery("Select Name,ID,Place,Dgn from employee");

%>
<table>
 <% while(rs.next())
     { %>
   <tr>
   <td><%=rs.getInt("ID")%></td>
   <td><%=rs.getString("Name")%></td>
   <td><%=rs.getString("Place")%></td>
   <td><%=rs.getString("Dgn")%></td>
   </tr>

  <%}%>
 </table>


</BODY>
</HTML>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to