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. thanks for he info, was looking everywhere for som
View Tutorial          By: John at 2011-05-16 11:28:54

2. Nice article. Really helpful in understanding the
View Tutorial          By: Sundar at 2011-12-18 11:15:07

3. the example program is very simple to understand a
View Tutorial          By: Zubilu at 2010-10-06 00:19:13

4. How to fetch a value from a database in dropdown b
View Tutorial          By: lara at 2014-11-19 09:02:43

5. This is a great tutorial. I have a slight problem,
View Tutorial          By: Vix at 2010-11-22 13:42:03

6. I want to send a message using mobile browser to s
View Tutorial          By: Richa Bhatia at 2009-12-08 22:33:36

7. Thanks, it was really helpful.
But wouldn't

View Tutorial          By: Ron at 2010-06-27 14:22:36

8. Good explanation
View Tutorial          By: Siddesh at 2012-07-12 03:53:07

9. thanx it i very helpful 4 me as i m new with java
View Tutorial          By: akminder at 2011-08-09 05:09:19

10. I want a code to receive message from GSM modem us
View Tutorial          By: Mayur at 2011-04-05 00:00:05