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. This article is clearly showing the beauty of the
View Tutorial          By: ashok at 2012-02-25 12:51:01

2. how to connect database simple method
View Tutorial          By: kavimozhian at 2013-04-08 11:14:29

3. we are getting an error saying that " the sta
View Tutorial          By: chaitra at 2014-03-20 10:53:02

4. Plz send me steps to configure and run project to
View Tutorial          By: sandeep kale at 2009-04-08 07:23:45

5. actually very good site. I learned more & more
View Tutorial          By: shiranthi at 2012-07-12 12:18:38

6. Hi there is two ways you can get information.

View Tutorial          By: Sathyam at 2008-12-15 02:01:22

7. Can you please tell me about parameter and validat
View Tutorial          By: Atul at 2010-09-08 04:48:00

8. what about memory in case of struts 2 at a time nu
View Tutorial          By: lakku at 2010-08-13 06:24:02

9. Nice one.your example proves that if you are apply
View Tutorial          By: Nisarg pathak at 2015-09-30 17:23:37

10. thats good. but not for the begineers. because in
View Tutorial          By: jaywant topno at 2009-10-31 10:05:43