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. Great job!
Lot of things cleared...

View Tutorial          By: alok at 2009-03-18 10:45:25

2. grazie!!!
View Tutorial          By: Egidio De Lorenzo at 2011-04-20 12:07:25

3. How to fix this Error.....

org.apac

View Tutorial          By: james prabhakaran at 2014-12-02 13:08:30

4. hi i unable to retrive am getting below excepti
View Tutorial          By: vignesh at 2015-03-25 17:14:58

5. nice example 2 uderstand
View Tutorial          By: nilesh doshi at 2011-05-09 01:24:24

6. Hi all people...If i need to read a sms from the m
View Tutorial          By: Omarsi12 at 2009-09-06 17:11:15

7. This can also prevent Outlook from using the autod
View Tutorial          By: Morgster79 at 2012-03-21 05:07:42

8. hi.I am new in j2me and really want to learn more
View Tutorial          By: snehal at 2011-12-01 11:46:22

9. For me it is executing without error, But not send
View Tutorial          By: Vijay at 2011-02-19 01:51:08

10. I'm coding a webservice and this is exactly what I
View Tutorial          By: Cristian at 2014-11-14 12:52:34