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. It may be good ,when you stressed on the point why
View Tutorial          By: Kishore Mylavarapu at 2011-05-25 01:28:50

2. Thanks...
View Tutorial          By: SHUVO at 2015-07-01 21:20:47

3. i need to use sms and to creat using java so it is
View Tutorial          By: Abdulkerim at 2009-09-07 05:29:15

4. If you are working with the multi-threaded program
View Tutorial          By: Prithvi at 2010-01-07 10:24:12

5. just remember to add
<uses-permission an

View Tutorial          By: Mouad at 2013-07-22 10:47:27

6. // Using the comma.
class Comma {
pu

View Tutorial          By: jatin kapoor at 2011-01-22 03:43:10

7. pls help me .....its hard to understand for me th
View Tutorial          By: heidi at 2010-06-27 02:31:29

8. nice one superb..
View Tutorial          By: Rajesh B at 2011-02-01 21:59:56

9. hi,
i am download 5 files and instantiate

View Tutorial          By: ganesh kumar at 2008-09-23 05:27:16

10. really great, goes more in depth than cplusplus.co
View Tutorial          By: ss80 at 2008-07-02 06:45:47