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. Reading the above comments and questions I have my
View Tutorial          By: running on toaster at 2013-04-23 02:20:43

2. i want to need SCJD Dums. so please help me that w
View Tutorial          By: Dayamay singh at 2009-01-03 00:07:06

3. i don't know anything about computer..........
View Tutorial          By: Ami weds Pappu....... at 2013-02-14 04:00:11

4. nice
View Tutorial          By: pran at 2013-07-16 05:03:19

5. Good work. Although it would be nicer if you can p
View Tutorial          By: frisked09 at 2011-05-26 23:52:34

6. Thanks for help
View Tutorial          By: Asha at 2014-12-20 08:25:48

7. you have extended class Abc within class Abc

View Tutorial          By: SUNIL SHAH at 2012-05-25 06:17:23

8. nice
View Tutorial          By: utkarsh at 2015-03-10 03:18:26

9. string strInsert = "Insert into [Sheet1$](F1,
View Tutorial          By: Sagar at 2011-05-12 06:47:13

10. This is totally great. Your explaination make me u
View Tutorial          By: Cipom at 2010-04-11 18:41:04