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 not correct. Two-way synchronizat
View Tutorial          By: Travis at 2015-07-14 12:28:32

2. hi , sending of sms is failing. Please help me in
View Tutorial          By: sudhakar at 2009-06-19 09:39:55

3. Thanks for the code it save's me a lot of work, ho
View Tutorial          By: Wishkah at 2009-09-04 00:29:16

4. Dude I want to send sms using GSM Mobile connected
View Tutorial          By: Funmarkaz at 2009-08-23 02:59:50

5. i like java language.
View Tutorial          By: deepika at 2014-09-22 15:11:39

6. Nice basics. Very helpful
View Tutorial          By: Gorav at 2011-11-11 12:46:28

7. Very good article thanks for sharing.
View Tutorial          By: priti at 2012-08-29 11:32:07

8. how to declare Array ?? in LINUX
i m try th

View Tutorial          By: Chand at 2012-03-18 06:47:09

9. The example program by itself doesn't solve any pu
View Tutorial          By: Fazal at 2008-03-17 21:23:10

10. IN the above program at the line in ineerclass's p
View Tutorial          By: Narasimha at 2009-10-14 06:30:26