DATABASE-EXPLORER-A-JAVA-PROJECTDatabase explorer java project is a CSE Final year project which will be useful for students who are interested in developing database related projects. The main idea for developing this project is to implement a user friendly graphical user interface for handling database functionality with out using a console. This application will be useful for software programmers who use oracle data base regularly while developing application  like Banking System a Database Project and HRM DATABASE MANAGEMENT  project. 

Database is the place where information is stored in the form of tables so in order to organize database information users should log int o oracle database using console and execute queries which will be a time taking task. In order to over come this problem a web based front end application is implemented. Using this application programmers can log in to database and perform every operations.

[cc lang=”php” tab_size=”2″ lines=”40″]package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import java.io.*;
import java.util.*;

public final class createtable_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {

Connection con;PreparedStatement pst;
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

private static java.util.List _jspx_dependants;

private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor _jsp_annotationprocessor;

public Object getDependants() {
return _jspx_dependants;
}

public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
}

public void _jspDestroy() {
}

public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {

PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;

try {
response.setContentType(“text/html;charset=UTF-8”);
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;

out.write(“\n”);
out.write(“\n”);
out.write(“\n”);
out.write(“<!DOCTYPE HTML PUBLIC \”-//W3C//DTD HTML 4.01 Transitional//EN\”\n”);
out.write(” \”http://www.w3.org/TR/html4/loose.dtd\”>\n”);
out.write(” \n”);
out.write(“\n”);
out.write(“<html>\n”);
out.write(” <head>\n”);
out.write(” <meta http-equiv=\”Content-Type\” content=\”text/html; charset=UTF-8\”>\n”);
out.write(” <title>Create Table Page</title>\n”);
out.write(” <script language=\”javascript\”>\n”);
out.write(” dCol=’#0000CC’;//date colour.\n”);
out.write(“fCol=’#99099′;//face colour.\n”);
out.write(“sCol=’000000′;//seconds colour.\n”);
out.write(“mCol=’000000′;//minutes colour.\n”);
out.write(“hCol=’#660033′;//hours colour.\n”);
out.write(“ClockHeight=40;\n”);
out.write(“ClockWidth=40;\n”);
out.write(“ClockFromMouseY=0;\n”);
out.write(“ClockFromMouseX=100;\n”);
out.write(“d=new Array(\”SUNDAY\”,\”MONDAY\”,\”TUESDAY\”,\”WEDNESDAY\”,\”THURSDAY\”,\”FRIDAY\”,\”SATURDAY\”);\n”);
out.write(“m=new Array(\”JANUARY\”,\”FEBRUARY\”,\”MARCH\”,\”APRIL\”,\”MAY\”,\”JUNE\”,\”JULY\”,\”AUGUST\”,\”SEPTEMBER\”,\”OCTOBER\”,\”NOVEMBER\”,\”DECEMBER\”);\n”);
out.write(“date=new Date();\n”);
out.write(“day=date.getDate();\n”);
out.write(“year=date.getYear();\n”);
out.write(“if (year < 2000) year=year+1900;\n”);
out.write(“TodaysDate=\” \”+d[date.getDay()]+\” \”+day+\” \”+m[date.getMonth()]+\” \”+year;\n”);
out.write(“D=TodaysDate.split(”);\n”);
out.write(“H=’…’;\n”);
out.write(“H=H.split(”);\n”);
out.write(“M=’…..’;\n”);
out.write(“M=M.split(”);\n”);
out.write(“S=’…..’;\n”);
out.write(“S=S.split(”);\n”);
out.write(“Face=’1 2 3 4 5 6 7 8 9 10 11 12′;\n”);
out.write(“font=’Arial’;\n”);
out.write(“size=1;\n”);
out.write(“speed=0.6;\n”);
out.write(“ns=(document.layers);\n”);
out.write(“ie=(document.all);\n”);
out.write(“Face=Face.split(‘ ‘);\n”);
out.write(“n=Face.length;\n”);
out.write(“a=size*10;\n”);
out.write(“ymouse=0;\n”);
out.write(“xmouse=0;\n”);
out.write(“scrll=0;\n”);
out.write(“props=\”<font face=\”+font+\” size=\”+size+\” color=\”+fCol+\”><B>\”;\n”);
out.write(“props2=\”<font face=\”+font+\” size=\”+size+\” color=\”+dCol+\”><B>\”;\n”);
out.write(“Split=360/n;\n”);
out.write(“Dsplit=360/D.length;\n”);
out.write(“HandHeight=ClockHeight/4.5\n”);
out.write(“HandWidth=ClockWidth/4.5\n”);
out.write(“HandY=-7;\n”);
out.write(“HandX=-2.5;\n”);
out.write(“scrll=0;\n”);
out.write(“step=0.06;\n”);
out.write(“currStep=0;\n”);
out.write(“y=new Array();x=new Array();Y=new Array();X=new Array();\n”);
out.write(“for (i=0; i < n; i++){y[i]=0;x[i]=0;Y[i]=0;X[i]=0}\n”);
out.write(“Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();\n”);
out.write(“for (i=0; i < D.length; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0}\n”);
out.write(“if (ns){\n”);
out.write(“for (i=0; i < D.length; i++)\n”);
out.write(“document.write(‘<layer name=\”nsDate’+i+’\” top=0 left=0 height=’+a+’ width=’+a+’><center>’+props2+D[i]+'</font></center></layer>’);\n”);
out.write(“for (i=0; i < n; i++)\n”);
out.write(“document.write(‘<layer name=\”nsFace’+i+’\” top=0 left=0 height=’+a+’ width=’+a+’><center>’+props+Face[i]+'</font></center></layer>’);\n”);
out.write(“for (i=0; i < S.length; i++)\n”);
out.write(“document.write(‘<layer name=nsSeconds’+i+’ top=0 left=0 width=15 height=15><font face=Arial size=3 color=’+sCol+’><center><b>’+S[i]+'</b></center></font></layer>’);\n”);
out.write(“for (i=0; i < M.length; i++)\n”);
out.write(“document.write(‘<layer name=nsMinutes’+i+’ top=0 left=0 width=15 height=15><font face=Arial size=3 color=’+mCol+’><center><b>’+M[i]+'</b></center></font></layer>’);\n”);
out.write(“for (i=0; i < H.length; i++)\n”);
out.write(“document.write(‘<layer name=nsHours’+i+’ top=0 left=0 width=15 height=15><font face=Arial size=3 color=’+hCol+’><center><b>’+H[i]+'</b></center></font></layer>’);\n”);
out.write(“}\n”);
out.write(“if (ie){\n”);
out.write(“document.write(‘<div id=\”Od\” style=\”position:absolute;top:0px;left:0px\”><div style=\”position:relative\”>’);\n”);
out.write(“for (i=0; i < D.length; i++)\n”);
out.write(“document.write(‘<div id=\”ieDate\” style=\”position:absolute;top:0px;left:0;height:’+a+’;width:’+a+’;text-align:center\”>’+props2+D[i]+'</B></font></div>’);\n”);
out.write(“document.write(‘</div></div>’);\n”);
out.write(“document.write(‘<div id=\”Of\” style=\”position:absolute;top:0px;left:0px\”><div style=\”position:relative\”>’);\n”);
out.write(“for (i=0; i < n; i++)\n”);
out.write(“document.write(‘<div id=\”ieFace\” style=\”position:absolute;top:0px;left:0;height:’+a+’;width:’+a+’;text-align:center\”>’+props+Face[i]+'</B></font></div>’);\n”);
out.write(“document.write(‘</div></div>’);\n”);
out.write(“document.write(‘<div id=\”Oh\” style=\”position:absolute;top:0px;left:0px\”><div style=\”position:relative\”>’);\n”);
out.write(“for (i=0; i < H.length; i++)\n”);
out.write(“document.write(‘<div id=\”ieHours\” style=\”position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:’+hCol+’;text-align:center;font-weight:bold\”>’+H[i]+'</div>’);\n”);
out.write(“document.write(‘</div></div>’);\n”);
out.write(“document.write(‘<div id=\”Om\” style=\”position:absolute;top:0px;left:0px\”><div style=\”position:relative\”>’);\n”);
out.write(“for (i=0; i < M.length; i++)\n”);
out.write(“document.write(‘<div id=\”ieMinutes\” style=\”position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:’+mCol+’;text-align:center;font-weight:bold\”>’+M[i]+'</div>’);\n”);
out.write(“document.write(‘</div></div>’)\n”);
out.write(“document.write(‘<div id=\”Os\” style=\”position:absolute;top:0px;left:0px\”><div style=\”position:relative\”>’);\n”);
out.write(“for (i=0; i < S.length; i++)\n”);
out.write(“document.write(‘<div id=\”ieSeconds\” style=\”position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:’+sCol+’;text-align:center;font-weight:bold\”>’+S[i]+'</div>’);\n”);
out.write(“document.write(‘</div></div>’)\n”);
out.write(“}\n”);
out.write(“(ns)?window.captureEvents(Event.MOUSEMOVE):0;\n”);
out.write(“function Mouse(evnt){\n”);
out.write(“ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;\n”);
out.write(“xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX;\n”);
out.write(“}\n”);
out.write(“(ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;\n”);
out.write(“function ClockAndAssign(){\n”);
out.write(“time = new Date ();\n”);
out.write(“secs = time.getSeconds();\n”);
out.write(“sec = -1.57 + Math.PI * secs/30;\n”);
out.write(“mins = time.getMinutes();\n”);
out.write(“min = -1.57 + Math.PI * mins/30;\n”);
out.write(“hr = time.getHours();\n”);
out.write(“hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360;\n”);
out.write(“if (ie){\n”);
out.write(“Od.style.top=window.document.body.scrollTop;\n”);
out.write(“Of.style.top=window.document.body.scrollTop;\n”);
out.write(“Oh.style.top=window.document.body.scrollTop;\n”);
out.write(“Om.style.top=window.document.body.scrollTop;\n”);
out.write(“Os.style.top=window.document.body.scrollTop;\n”);
out.write(“}\n”);
out.write(“for (i=0; i < n; i++){\n”);
out.write(” var F=(ns)?document.layers[‘nsFace’+i]:ieFace[i].style;\n”);
out.write(” F.top=y[i] + ClockHeight*Math.sin(-1.0471 + i*Split*Math.PI/180)+scrll;\n”);
out.write(” F.left=x[i] + ClockWidth*Math.cos(-1.0471 + i*Split*Math.PI/180);\n”);
out.write(” }\n”);
out.write(“for (i=0; i < H.length; i++){\n”);
out.write(” var HL=(ns)?document.layers[‘nsHours’+i]:ieHours[i].style;\n”);
out.write(” HL.top=y[i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll;\n”);
out.write(” HL.left=x[i]+HandX+(i*HandWidth)*Math.cos(hrs);\n”);
out.write(” }\n”);
out.write(“for (i=0; i < M.length; i++){\n”);
out.write(” var ML=(ns)?document.layers[‘nsMinutes’+i]:ieMinutes[i].style;\n”);
out.write(” ML.top=y[i]+HandY+(i*HandHeight)*Math.sin(min)+scrll;\n”);
out.write(” ML.left=x[i]+HandX+(i*HandWidth)*Math.cos(min);\n”);
out.write(” }\n”);
out.write(“for (i=0; i < S.length; i++){\n”);
out.write(” var SL=(ns)?document.layers[‘nsSeconds’+i]:ieSeconds[i].style;\n”);
out.write(” SL.top=y[i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll;\n”);
out.write(” SL.left=x[i]+HandX+(i*HandWidth)*Math.cos(sec);\n”);
out.write(” }\n”);
out.write(“for (i=0; i < D.length; i++){\n”);
out.write(” var DL=(ns)?document.layers[‘nsDate’+i]:ieDate[i].style;\n”);
out.write(” DL.top=Dy[i] + ClockHeight*1.5*Math.sin(currStep+i*Dsplit*Math.PI/180)+scrll;\n”);
out.write(” DL.left=Dx[i] + ClockWidth*1.5*Math.cos(currStep+i*Dsplit*Math.PI/180);\n”);
out.write(” }\n”);
out.write(“currStep-=step;\n”);
out.write(“}\n”);
out.write(“function Delay(){\n”);
out.write(“scrll=(ns)?window.pageYOffset:0;\n”);
out.write(“Dy[0]=Math.round(DY[0]+=((ymouse)-DY[0])*speed);\n”);
out.write(“Dx[0]=Math.round(DX[0]+=((xmouse)-DX[0])*speed);\n”);
out.write(“for (i=1; i < D.length; i++){\n”);
out.write(“Dy[i]=Math.round(DY[i]+=(Dy[i-1]-DY[i])*speed);\n”);
out.write(“Dx[i]=Math.round(DX[i]+=(Dx[i-1]-DX[i])*speed);\n”);
out.write(“}\n”);
out.write(“y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);\n”);
out.write(“x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);\n”);
out.write(“for (i=1; i < n; i++){\n”);
out.write(“y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);\n”);
out.write(“x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);\n”);
out.write(“}\n”);
out.write(“ClockAndAssign();\n”);
out.write(“setTimeout(‘Delay()’,40);\n”);
out.write(“}\n”);
out.write(“if (ns||ie)window.onload=Delay;\n”);
out.write(“\n”);
out.write(” </script>\n”);
out.write(” </head>\n”);
out.write(” “);
out.write(“\n”);
out.write(“\n”);
out.write(” “);

try
{
StringBuffer sb=new StringBuffer();
String dbname=request.getParameter(“dbname”);
String tname=request.getParameter(“tabname”);
String aname=request.getParameter(“aname”);
String apass=request.getParameter(“apass”);
sb.append(“create table “+tname+”(“);

String[] pname=request.getParameterValues(“txt”);
//for(int i=0;i<pname.length;i++)
String[] pdtype=request.getParameterValues(“size”);
String[] pname1=request.getParameterValues(“country”);

for(int i=0,j=0,k=0;((i<pname.length) && (j<pname1.length) && (k<pdtype.length));i++,j++,k++)
{
sb.append(pname[i]+” “+pname1[j]+pdtype[k]+”,”);
}
sb.deleteCharAt(sb.lastIndexOf(“,”));
sb.append(“)”);
con=DriverManager.getConnection(“jdbc:mysql://localhost:3306/”+dbname,aname,apass);
Statement st=con.createStatement();
boolean b=st.execute(sb.toString());
if(b==false)
response.sendRedirect(“UserMain.html”);
else
out.println(“Table not created”);
out.println(sb.toString());
}
catch(Exception e)
{
}
finally
{
// con.close();
}
/*String tabname=request.getParameter(“tabname”);
String dbname=request.getParameter(“dbname”);
String field1=request.getParameter(“textfield_a”);
String field2=request.getParameter(“textfield_a_2”);
String field3=request.getParameter(“textfield_a_3”);
String field4=request.getParameter(“textfield_a_4”);
String type1=request.getParameter(“selectme”);
String type2=request.getParameter(“selectme_2”);
String type3=request.getParameter(“selectme_3”);
String type4=request.getParameter(“selectme_4”);
String dims1=request.getParameter(“textfield_b”);
String dims2=request.getParameter(“textfield_a_2_2”);
String dims3=request.getParameter(“textfield_a_3_3”);
String dims4=request.getParameter(“textfield_a_4_4”);
StringBuffer sb=new StringBuffer();
sb.append(“create table “+tabname+”(“);
if(field1.equals(null) || field1==”” && dims1.equals(null) || dims1==””)
{

// sb.append(” “);
return;
}
if(field1!=null && type1.equals(“date”))
sb.append(“”+field1+” “+type1);
else
sb.append(“”+field1+” “+ type1+”(“+dims1+”)”);

if(field2.equals(null) || field2==”” && dims2.equals(null) || dims2==””)
{
//sb.append(” “);
return;
}
if(field2!=null && type2.equals(“date”))
sb.append(“,”+field2+” “+type2);
else
sb.append(“,”+field2+” “+ type2+”(“+dims2+”)”);

if(field3.equals(null) || field3==”” && dims3.equals(null) || dims3==””)
{
//sb.append(” “);
return;
}
if(field3!=null && type3.equals(“date”))
sb.append(“,”+field3+” “+type3);
else
sb.append(“,”+field3+” “+ type3+”(“+dims3+”)”);

if(field4.equals(null) || field4==”” && dims4.equals(null) || dims4==””)
{
//sb.append(” “);
return;
}
if(field4!=”” && type4.equals(“date”))
sb.append(“,”+field4+” “+type4);
else
sb.append(“,”+field4+” “+ type4+”(“+dims4+”)”);
sb.append(“)”);
out.println(sb);

/* con=DriverManager.getConnection(“jdbc:derby://class-4:1527/olddb”);
Statement st=con.createStatement();
boolean b=st.execute(sb.toString());
if(b==false)
out.println(“Table created”);
else
out.println(“Table not created”);
*/

out.write(“\n”);
out.write(“\n”);
out.write(“\n”);
out.write(“</html>\n”);
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
[/cc] Graphical user interface is designed with a left side bar where tables and related information is displayed in the form of links.Users can select tables from the sidebar to display content inside the table. Basically while developing large applications searching for tables will be confusing, in order to overcome this problem search feature is implemented. Users can use settings like username, password, database name, IP address of the database server,Port number of the database. Settings can be modified just by enabling and disabling check boxes. Using this GUI user can modify,delete,create,drop,select table information. 

EXISTING SYSTEM

In many companies programmers use console based database organization which is a not user friendly method. Executing queries, deleting information from database using this method can take lot of time. In some cases users should move locations to perform database operations.

PROPOSED SYSTEM

Proposed database explorer is a user friendly graphical user interface which will be easily accessible to operate database with minimal settings. This application will save time and risk. Users need not move from place to place to modify database details. Every operation can be done through this application.

download Project Report,Project code and paper presentation of  CSE Database explorer java project  .