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. i am using the same code to read data from an RFID
View Tutorial          By: JayS at 2015-02-03 21:31:36

2. Your explanation is good but, it will be better i
View Tutorial          By: Jabaraj at 2010-03-22 06:02:33

3. Hi All,

Can any one please let me k

View Tutorial          By: Deepak at 2015-03-19 15:24:40

4. Thank you for this useful script!
View Tutorial          By: opencart module at 2011-01-03 21:21:37

5. Hi Sir...
sir i am a student and I am work

View Tutorial          By: Sanzu at 2013-02-12 09:13:01

6. what is the meaning of instantiated in abstract cl
View Tutorial          By: Manikandan MP at 2011-12-20 15:17:38

7. Hi I have Fixed - "NoSuchPortException"
View Tutorial          By: vijay at 2011-02-19 01:44:37

8. Answer for Comment 4 :

" n=n++

View Tutorial          By: NewB_of_java at 2012-02-16 16:52:05

9. good job
View Tutorial          By: gopi at 2008-07-01 02:02:48

10. Support for serial ports is platform dependent and
View Tutorial          By: Sal at 2009-09-15 15:51:55