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



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. Excellent
View Tutorial          By: Dev at 2008-08-01 02:41:25

2. Unable to connect with https:\\localhost:8443 but
View Tutorial          By: gopala krishna at 2012-04-02 07:17:09

3. Very good example .. i ve written this program . P
View Tutorial          By: gomz at 2011-09-26 12:33:54

4. its a good example
View Tutorial          By: Sonal at 2009-03-25 08:35:10

5. Hi, thi's sursh laveti, actually I'm getting a pro
View Tutorial          By: suresh l at 2015-06-24 07:53:19

6. After a great struggle I am able to successfully c
View Tutorial          By: raghu at 2012-01-04 15:10:07

7. hello all,
i have this error.
Except

View Tutorial          By: daniel at 2012-08-12 18:50:04

8. Such a nice site for clear and explains the concep
View Tutorial          By: Sandeep at 2011-05-22 06:34:42

9. I am able to iterate the list.Now i want to print
View Tutorial          By: akanksha at 2012-09-26 05:25:12

10. Hi,
Even if the while loops (in Producer an

View Tutorial          By: Pranay at 2012-09-19 19:08:45