HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html"
charset=windows-1252">

<TITLE>
The Title
</TITLE>
</HEAD>
<BODY  BGCOLOR=#CCCCFF>

<%@ page  language="java"  import="java.sql.*"
session="true"  %>

<%@ page import="java.sql.ResultSet" %>

<%@ page import="java.sql.DatabaseMetaData" %>

<%@ page import="java.sql.ResultSetMetaData" %>
<%@ page import="java.lang.*" %>





<jsp:useBean  id="db"  scope="application"
class="package3.DBBean" >
</jsp:useBean>


<jsp:setProperty  name="db"  property="*" />


<%! int numcols,numrows;
    String current_table="vertical";
    ResultSet rus=null;
    ResultSetMetaData rsmd=null;
    String current_table1;
    DatabaseMetaData dbm=null;

    Connection cc;
     Statement stmt=null;
     String sql=null;
     String b=null;
     String c=null;
    String ss="select * from ";

%>

<%
  String name=request.getParameter("USER");
  out.println("HELLO"+name);


  try
  {
   cc=db.getConnect();
   }catch (ClassNotFoundException e)
   {
     throw new ServletException("drivers not
found",e);
   }





current_table1=request.getParameter("tablename").toUpperCase();
 System.out.println(current_table1);
 dbm=cc.getMetaData();

 sql=ss+current_table1;
 rus = db.getexecSQL(sql);
%>

<IMG SRC="/package1/vicinity.gif" HEIGHT=40
WIDTH=100><SPACER SIZE=50>
<H2>
</H2>
<FORM METHOD="POST" ACTION="addjsp.jsp">
<TABLE  BORDER=2  ALIGN=CENTER WIDTH="545"
BGCOLOR="PINK" COLS=3 CELLPADDING=0 CELLSPACING=6>
<CAPTION ALIGN=TOP>
  <BIG><BIG><H2> DATA MAINTENANCE   </H2>
     <%= current_table1 %> DATA
  </BIG></BIG>
</CAPTION>
<TR><INPUT TYPE="SUBMIT" NAME=RETRIVE VALUE="RETRIVE">
<INPUT TYPE="SUBMIT" NAME=INSERT VALUE="INSERT"
onclick=return insertRecord("insert")>
<INPUT TYPE="SUBMIT" NAME=UPDATE VALUE="UPDATE"><INPUT
TYPE="SUBMIT" NAME=DELETE VALUE="DELETE"></TR>

 <BR></BR><TR BGCOLOR=#AAEEFF>
 <%
   ResultSetMetaData rsmd=null;
   rsmd = rus.getMetaData();
   numcols=rsmd.getColumnCount();


   ResultSet
rs=dbm.getColumns(null,null,current_table1,null);

   for (int colnum=1;colnum<=numcols;colnum++)
   {
  %>

  <TH><%= rsmd.getColumnName(colnum).toUpperCase()%>
</TH>
<%
}
%>





<%
  while (rus.next())
 {
   %>


<TR>
<%
   for (int columns=1;columns<=numcols;columns++)
   {
   %>
   <TD ALIGN=CENTER><input type="text" name="a"
value="<%= rus.getString(columns).toUpperCase()
%>"></td>
<%
 }
  numrows=numrows+1;

 %>

 </TR>
<%
System.out.println(numrows);
 }

  rus.close();
  db.close();
%>

</TABLE>

</BODY>
</HTML>


__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to