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. Its really good and helpfull..........
chee

View Tutorial          By: sumit at 2009-04-28 05:17:17

2. Great tutorial
View Tutorial          By: Stephen at 2014-07-21 12:08:32

3. Great Description. Helped a lot.
View Tutorial          By: Dee2019nc at 2009-11-08 18:26:22

4. thank you
View Tutorial          By: latif mohammad khan at 2013-01-18 09:53:18

5. i can saved when i run the program...
but w

View Tutorial          By: kathleen ashley at 2010-08-02 05:22:46

6. So, is it possible to use the getClass() and getRe
View Tutorial          By: cee at 2014-11-29 14:27:10

7. wow...great MAN
View Tutorial          By: Er Sounderarajan at 2013-03-13 07:29:58

8. what is the return type for clicker method? The pr
View Tutorial          By: Gautam at 2013-10-14 15:36:27

9. good going java samples
View Tutorial          By: Rajesh at 2010-08-17 03:36:12

10. easy to understand
View Tutorial          By: shanthi at 2011-01-02 21:25:51