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. /*Web.xml File */

&lt;?xml vers

View Tutorial          By: Pavan Barot at 2010-07-11 23:32:35

2. Hi i have studied these programs.
but unabl

View Tutorial          By: Karuna at 2008-03-30 08:46:00

3. /* File name : Employee.java */
public abst

View Tutorial          By: Anonymous at 2012-11-16 12:23:17

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

5. Pl provide me code to send sms using USB modems.
View Tutorial          By: Prayag Singh at 2010-09-27 22:50:34

6. Hi : Pulkit Malviya .I think that book has coding
View Tutorial          By: Anand at 2012-11-04 14:13:50

7. Session Bean = client data is maintained upto pred
View Tutorial          By: Chetankumar at 2012-05-19 11:12:17

8. Precise information in the article, however it wou
View Tutorial          By: Ketan at 2009-06-23 05:07:39

9. Thanks
View Tutorial          By: Akhilesh at 2010-04-05 11:31:17

10. Very good
View Tutorial          By: dizh at 2014-02-21 07:48:19