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. Good
View Tutorial          By: sandesh at 2009-10-01 01:15:29

2. Thanks a lot!
The main reason why we need t

View Tutorial          By: SA at 2011-06-24 15:00:13

3. In the above program, the instance variables like
View Tutorial          By: Abhikumar.M at 2012-08-02 17:25:55

4. Thanks,
But i would like to use an array li

View Tutorial          By: Gustavo at 2011-06-15 21:03:20

5. Sir i am doing b.tech and i want to know about Gar
View Tutorial          By: waseem at 2010-10-10 01:28:42

6. it absolutely very usefull for me
Thanks

View Tutorial          By: sudhir Kr Singh at 2012-07-24 05:17:52

7. good one
View Tutorial          By: saurabh at 2012-01-17 04:43:29

8. Hi all, i have tried above code, but am getting fo
View Tutorial          By: shalini Iyer at 2008-04-22 01:20:32

9. very nice
View Tutorial          By: prasad at 2009-11-11 05:03:16

10. Hi, You need to place a control on your form

View Tutorial          By: Ranjit at 2010-02-09 02:29:40