Java Server Page

JSP Projects

JSP Project

Write a program that display the value store into SQL server database".
Previous Home Next
adplus-dvertising

Save as a Conn_library.tld
<?xml version="1.0" encoding="UTF-8"?> <taglib version="2.1" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"> <tlib-version>1.0</tlib-version> <short-name>conn_library</short-name> <uri>/WEB-INF/tlds/Conn_library</uri> <tag> <name>QueryTag</name> <tag-class>r4r.co.in.QueryTag</tag-class> <body-content>scriptless</body-content> <attribute> <name> databaseURI</name> <required>true</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>name</name> <required>true</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>password</name> <required>true</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>className</name> <required>true</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>query</name> <required>true</required> <rtexprvalue>false</rtexprvalue> </attribute> </tag> </taglib>
 Save as a QueryTag.java
*/ Program used for TagHandler */
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib uri="/WEB-INF/tlds/Conn_library.tld" 
prefix="conn_library"%>
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>r4r.co.in</title> </head> <body> <H1 style="font-style: oblique; color: appworkspace"> R4R Tech Soft!SQL Connectivity </H1> <conn_library:QueryTag className="com.mysql.jdbc.Driver" databaseURI="jdbc:mysql:///r4r" name="root" password="sachin" query="select *from INFO" /> </body> </html>
Save as a connection.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib uri="/WEB-INF/tlds/Conn_library.tld"  prefix="conn_library"%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>r4r.co.in</title>
    </head>
    <body>
        <H1 style="font-style: oblique; color: appworkspace">
R4R Tech Soft!SQL Connectivity </H1>

        <conn_library:QueryTag className="com.mysql.jdbc.Driver" 
databaseURI="jdbc:mysql:///r4r"
   name="root" password="sachin" query="select *from INFO" />

    </body>
</html>

Output:
Previous Home Next