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



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. Very informative and simple to understand. Thank y
View Tutorial          By: Rosa Vladivord at 2012-12-23 13:00:52

2. yesh this is very help full for every body.
View Tutorial          By: venkat at 2010-06-29 12:18:57

3. It is working. Thank u dear!!!
View Tutorial          By: Ashwani Rana at 2009-04-02 03:56:17

4. is this code applicable if I used USB GSM Modem? a
View Tutorial          By: Rania at 2010-09-14 12:33:15

5. I need complete steps for execution
Severa

View Tutorial          By: DASAn at 2011-08-10 10:10:36

6. I faced an exception "java.net.connectExcepti
View Tutorial          By: Sandhya Rani Vellanki at 2010-11-15 00:39:24

7. I am getting this error with Minecraft; Feed the B
View Tutorial          By: LadyKianna at 2013-03-11 05:52:54

8. dear i have different files of ms access 2010 like
View Tutorial          By: neeo at 2012-01-16 07:02:20

9. Hi Kartikeyan and all,

can you plea

View Tutorial          By: Piyush at 2008-11-14 07:24:16

10. its good and well performance
View Tutorial          By: siva.c at 2014-09-02 08:18:19