<%@ include file="left.jsp" %>
|
|
<%@ include file="setconn.jsp" %>
<%@ page import="java.sql.*, javax.sql.*, oracle.jdbc.pool.*, javax.servlet.*, javax.servlet.http.* ,java.io.* , java.util.*, oracle.sql.* " %>
<%
String t_filename ="";
String t_pathname ="";
String t_request_data = request.getPathInfo();
int t_end = t_request_data.length();
boolean get_filename = false;
boolean get_pathname = false;
for ( int i = t_request_data.length() - 2; i > -1 ; i-- ) {
if ( t_request_data.substring(i, i+1).equals("/") ) {
if ( !get_filename ) {
t_filename = t_request_data.substring( i+1,t_end);
get_filename = true;
t_end = i;
} else if ( !get_pathname ) {
t_pathname = t_request_data.substring( i+1,t_end);
get_pathname = true;
break;
}
}
}
//out.println(request.getPathInfo());
//out.println(request.getRequestURI());
//out.println(t_filename);
//out.println(t_pathname);
String t_state_id = "";
String t_state_name = "";
String t_catolog_id = "";
String t_catolog_name = "";
//String username = "";
//String showresult ="";
String id = "";
int numrow = 0;
String c_show ="";
String v_c_show ="";
String catalog ="";
String v_catalog ="";
String pre_catalog ="";
String title ="";
String url ="";
String reclink ="";
String desc ="";
String state = "";
String t_state = "";
String contname ="";
String email ="";
String createtime = "";
String sql = "";
try
{
// out.println("bbbbbbbb ");
Connection conn = cods.getConnection();
// out.println("aaaaaa " + username);
sql = " select a.id, "
+ " nvl(a.catolog,'null'), nvl(a.c_show,'null'), nvl(a.email,'null'), nvl(a.title,'null'),"
+ " nvl(a.contname,'null'), nvl(a.url,'null'), nvl(a.reclink,'null'), nvl(a.maindesc,'null'), "
+ " nvl(a.state,'null'), to_char(a.createtime,'MM/DD/YYYY HH:MI:SS'), "
+ " nvl(b.id,'null'), nvl(b.name,'null'), nvl(c.id,'null'), nvl(c.name,'null') "
+ " from linkdata a,link_state b,link_catolog c"
+ " where a.c_show = 'Y' "
+ " and a.catolog = c.id "
+ " and a.state = b.idname "
+ " and c.loc_name = '" + t_pathname + "' "
+ " and b.loc_name = '" + t_filename + "' "
+ " order by a.state, a.id desc ";
// out.println(sql);
Statement stmt = conn.createStatement ();
ResultSet rset = stmt.executeQuery (sql);
%>
|
|
<%
while (rset.next()) {
try {
if (rset.getString(1).equals("null"))
id=rset.getString(1) ;
else
id = "0";
} catch(Exception e) {
System.out.println("Exception(select,qry):"+e);
}
try {
if (!rset.getString(2).equals("null"))
catalog =rset.getString(2) ;
else
catalog = "";
} catch(Exception e) {
System.out.println("Exception(select,qry):"+e);
}
if ( catalog.equals("1")) {
v_catalog = "Real Estate";
} else if ( catalog.equals("2")) {
v_catalog = "Finance";
} else if ( catalog.equals("3")) {
v_catalog = "Insurance";
} else if ( catalog.equals("4")) {
v_catalog = "Home Design";
} else if ( catalog.equals("5")) {
v_catalog = "Home Construction";
} else if ( catalog.equals("6")) {
v_catalog = "Search Engine";
} else if ( catalog.equals("7")) {
v_catalog = "Shopping";
} else if ( catalog.equals("8")) {
v_catalog = "Bussiness";
} else if ( catalog.equals("9")) {
v_catalog = "Law";
} else {
v_catalog = "Miscellaneous";
}
try {
if (!rset.getString(3).equals("null"))
c_show=rset.getString(3) ;
else
c_show = "";
} catch(Exception e) {
System.out.println("Exception(select,qry):"+e);
}
if ( c_show.equals("I") ) {
v_c_show = "Initial";
}
else if ( c_show.equals("Y") ) {
v_c_show = "Listed";
} else {
v_c_show = "Not Listed";
}
try {
if (!rset.getString(4).equals("null"))
email=rset.getString(4) ;
else
email = "";
} catch(Exception e) {
System.out.println("Exception(select,qry):"+e);
}
try {
if (!rset.getString(5).equals("null"))
title =rset.getString(5) ;
else
title = "";
} catch(Exception e) {
System.out.println("Exception(select,qry):"+e);
}
try {
if (!rset.getString(6).equals("null"))
contname=rset.getString(6) ;
else
contname = "";
} catch(Exception e) {
System.out.println("Exception(select,qry):"+e);
}
try {
if (!rset.getString(7).equals("null"))
url = rset.getString(7) ;
else
url = "";
} catch(Exception e) {
System.out.println("Exception(select,qry):"+e);
}
try {
if (!rset.getString(8).equals("null")) {
reclink=rset.getString(8) ;
} else {
reclink = "";
}
} catch(Exception e) {
System.out.println("Exception(select,qry):"+e);
}
try {
if (!rset.getString(9).equals("null")) {
desc=rset.getString(9) ;
} else {
desc = "";
}
} catch(Exception e) {
System.out.println("Exception(select,qry):"+e);
}
try {
if (!rset.getString(10).equals("null")) {
state=rset.getString(10) ;
} else {
state = "";
}
} catch(Exception e) {
System.out.println("Exception(select,qry):"+e);
}
try {
if (!rset.getString(12).equals("null")) {
t_state_id=rset.getString(12) ;
} else {
t_state_id = "";
}
} catch(Exception e) {
System.out.println("Exception(select,qry):"+e);
}
try {
if (!rset.getString(13).equals("null")) {
t_state_name = rset.getString(13) ;
} else {
t_state_name = "";
}
} catch(Exception e) {
System.out.println("Exception(select,qry):"+e);
}
try {
if (!rset.getString(14).equals("null")) {
t_catolog_id=rset.getString(14) ;
} else {
t_catolog_id = "";
}
} catch(Exception e) {
System.out.println("Exception(select,qry):"+e);
}
try {
if (!rset.getString(15).equals("null")) {
t_catolog_name =rset.getString(15) ;
} else {
t_catolog_name = "";
}
} catch(Exception e) {
System.out.println("Exception(select,qry):"+e);
}
if ( state.equals("ZZ")) {
t_state = "Location: International";
} else if ( state.equals("AB")) {
t_state = "Location: National";
} else if ( state.equals("")) {
t_state = "";
} else {
t_state = "Location: " + state;
}
%>
<%
if (!v_catalog.equals(pre_catalog)) {
pre_catalog = v_catalog;
%>
|
| Categories: <%= t_catolog_name %> |
|
| Location: <%= t_state_name %> |
|
<%
}
%>
| <%= title %>
|
| <%= desc %> |
|
<%
}
rset.close();
stmt.close();
conn.close();
}
catch (SQLException esql )
{
out.println (" Select Sql Error :" + esql.getMessage());
}
catch (Exception e )
{
out.println ("Exception: " + e.getMessage());
}
%>
|
|
|
If you have any questions or comments, please feel free to Contact Us!
|
|