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. Thank you for this useful script! It works very we
View Tutorial          By: Giuseppe at 2010-12-09 05:35:43

2. Thanks for the help, however I am having some diff
View Tutorial          By: Andrew at 2008-09-30 14:51:14

3. if i want to write my gmail address how can i prov
View Tutorial          By: asmcn at 2011-12-27 19:40:49

4. </application>
<uses-permission an

View Tutorial          By: saurabh at 2012-01-17 05:00:21

5. super j2me introduction
View Tutorial          By: govinth at 2012-02-05 09:33:18

6. How can i download the comm.API .
pls tel

View Tutorial          By: Sajeer kc at 2015-01-16 04:12:28

7. hayz.
it soo hard to program,
but be

View Tutorial          By: bamz at 2008-09-22 20:31:23

8. hi,
when i run the code i got the exception

View Tutorial          By: arjun at 2014-09-18 10:25:18

9. Except for when you're programming low level hardw
View Tutorial          By: Jonathan H at 2012-05-10 08:46:48

10. Is it possible to create a Reader class without lo
View Tutorial          By: bs at 2010-10-11 05:42:34