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. rms programe
View Tutorial          By: hardik at 2008-03-28 23:06:58

2. No it won't work...
View Tutorial          By: Arin at 2012-08-17 09:59:40

3. help me for learning to programing with java

View Tutorial          By: hemn at 2008-11-25 03:12:19

4. @Sonal, as long as the image is stored in a server
View Tutorial          By: alex at 2012-11-07 07:25:40

5. You have to run the compiled PortScanner with two
View Tutorial          By: KRook at 2009-10-15 04:11:53

6. thanks
View Tutorial          By: Tejaswini C at 2011-12-23 17:57:03

7. java.lang.IllegalArgumentException means usually t
View Tutorial          By: Seink at 2008-11-12 11:03:00

8. My Friend,

Thank you so much for ex

View Tutorial          By: Bikash at 2010-05-30 00:15:26

9. How can I delete the data that I have entered into
View Tutorial          By: selina at 2011-08-15 05:15:45

10. im having problems with showDialog(int) who can i
View Tutorial          By: Samuel at 2013-06-30 05:13:38