Comment on Tutorial - JSP Example to connect to MS SQL database and retrieve records By Abinaya



Comment Added by : Rahul

Comment Added at : 2012-08-18 12:26:39

Comment on Tutorial : JSP Example to connect to MS SQL database and retrieve records By Abinaya
PLZ HELP ME WITH THIS.. WHEN I RUN THE FILE ON APACHE SERVER, AN EXCEPTION IS GENERATED. THE EXCEPTION IS:
Exception: [Microsoft][ODBC Driver Manager] Invalid string or buffer length
PLEASE., PLEASE DO HELP ME...

<%@ page import="java.sql.*" %>
<%
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:SystemDsn;user=sa;password=.");
Statement ps=con.createStatement();

ResultSet rs=ps.executeQuery("select * from link_sql");
out.println("<table>");

while(rs.next())
{
out.println("<tr><td>");
out.println("<a href='"+rs.getString("link")+"'>"+rs.getString("anchor")+"</a>");
out.println("</td></tr>");
}
out.println("</table>");
}
catch(Exception e)
{
out.println("Exception: "+e.getMessage());
}

%>


View Tutorial



Ask a Question

Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. wow amzing
View Tutorial          By: Anonymous at 2009-04-23 01:44:43

2. method overloading possible across classes????
View Tutorial          By: Rohit at 2011-01-26 20:23:02

3. Good examples for beginners.
View Tutorial          By: Sagar at 2009-10-16 01:04:46

4. lllllllllllllllllllllllllllllike
View Tutorial          By: duck at 2015-04-10 19:19:47

5. the ans is good.now i cleared my dout.and the exam
View Tutorial          By: siva at 2011-12-07 14:00:13

6. Just read the first page, It really attractive. Le
View Tutorial          By: Md. Sumon Bappi at 2015-05-13 10:47:00

7. good example need some more explanation on notify
View Tutorial          By: prashant at 2009-09-08 19:29:54

8. Hi Ramalak, I m getting the error
Thu Dec 1

View Tutorial          By: srikar at 2008-12-18 02:05:56

9. Good explanation with simple language and style. N
View Tutorial          By: Ismail. MC at 2009-03-31 04:46:04

10. Hi Its very useful ad nice article Thanks
View Tutorial          By: Hanish at 2011-07-22 13:12:23