0% found this document useful (0 votes)
118 views13 pages

Source Code: Distributed Datamining in Credit Card Fraud Detection Source Code

Uploaded by

mahesheiruvuri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
118 views13 pages

Source Code: Distributed Datamining in Credit Card Fraud Detection Source Code

Uploaded by

mahesheiruvuri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 13

Distributed DataMining in Credit Card Fraud Detection Source Code

SOURCE CODE

Login Handler
/*
* loginservlet.java
*
* Created on Oct 3, 2007, 11:31:53 AM
*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

import java.io.*;
import java.net.*;
import javax.servlet.*;
import javax.servlet.http.*;

/**
*
* @author Administrator
*/
public class LoginHandler extends HttpServlet {

/**
* Processes requests for both HTTP <code>GET</code> and
<code>POST</code> methods.
* @param request servlet request
* @param response servlet response
*/
protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
String userid = request.getParameter("userid");
String password = request.getParameter("password");

64
Sri Sai college of IT & Management
Distributed DataMining in Credit Card Fraud Detection Source Code

String target="fail.jsp";
Dao dao = new Dao();
if(dao.logincheck(userid, password)){
target = "adminpanel.jsp";
}
else
{
target = "fail.jsp";
}
RequestDispatcher rd =
request.getRequestDispatcher(target);
rd.forward(request, response);
/* TODO output your page here
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet loginservlet</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Servlet loginservlet at " +
request.getContextPath () + "</h1>");
out.println("</body>");
out.println("</html>");
*/
out.close();
}

// <editor-fold defaultstate="collapsed" desc="HttpServlet


methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
* @param request servlet request
* @param response servlet response
*/
/* protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);

65
Sri Sai college of IT & Management
Distributed DataMining in Credit Card Fraud Detection Source Code

}*/

/**
* Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}

/**
* Returns a short description of the servlet.
*/
public String getServletInfo() {
return "Short description";
}
// </editor-fold>
}

User Beans

/*
* UserBean.java
*
* Created on Oct 3, 2007, 12:24:39 PM
*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author Administrator

66
Sri Sai college of IT & Management
Distributed DataMining in Credit Card Fraud Detection Source Code

*/
public class UserBean {
private String username;
private String password;
private String role;
public UserBean() {
}
public void setUserName(String username){
this.username = username;

}
public void setPassword(String password){
this.password = password;
}
public void setRole(String role){
this.role = role;
}
public String getUserName(){
return username;
}
public String getPassword() {
return password;
}
public String getRole(){
return role;
}
}

Administrator
/*
* dao.java
*
* Created on Oct 3, 2007, 11:33:50 AM
*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
67
Sri Sai college of IT & Management
Distributed DataMining in Credit Card Fraud Detection Source Code

import java.sql.*;
/**
*
* @author Administrator
*/
public class Dao {
private String url="jdbc:oracle:thin:@localhost:1521:orcl";
private String driver="oracle.jdbc.driver.OracleDriver";
private String userid="ccdata";
private String password="ccdata";
private Connection con=null;
private ResultSet rs;
private Statement stmt;
public Dao() {
try
{
Class.forName(driver);
con = DriverManager.getConnection(url,userid,password);

}
catch(ClassNotFoundException cnfe){
cnfe.printStackTrace();
}
catch(SQLException sqle){
sqle.printStackTrace();
}

}
public boolean logincheck(String user, String password){
String sql = "Select * from users where ID='"+user+"' and
password='"+password+"' and role='admin'";
System.out.println(sql);
boolean flag=false;
try
{
stmt = con.createStatement();
rs = stmt.executeQuery(sql);

68
Sri Sai college of IT & Management
Distributed DataMining in Credit Card Fraud Detection Source Code

if(rs.next()){
flag = true;
}
else
flag = false;
}
catch(SQLException sqle){
sqle.printStackTrace();
}
return flag;
}

Index
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
<title>template: home</title>
<meta http-equiv="content-type" content="text/html; charset=iso-
8859-1" />

<!-- **** layout stylesheet **** -->


<link rel="stylesheet" type="text/css" href="style/style.css" />

<!-- **** colour scheme stylesheet **** -->


<link rel="stylesheet" type="text/css" href="style/colour.css" />

</head>

<body>
<div id="main">
<div id="header">

69
Sri Sai college of IT & Management
Distributed DataMining in Credit Card Fraud Detection Source Code

<div id="logo"><h1>company logo goes here</h1></div>


<div id="address"><p>company name<br />company address 1,
company address 2, company address 3<br />tel: 0101 010
010</p></div>
</div>
<div id="menu">
<!-- rounded corners - top **** -->
<div class="rtop"><div class="r1"></div><div
class="r2"></div><div class="r3"></div><div class="r4"></div></div>
<ul>
<!-- **** INSERT NAVIGATION ITEMS HERE (use id="selected" to
identify the page you're on **** -->
<li><a id="selected" href="#">welcome</a></li>
<li><a href="#">page 1</a></li>
<li><a href="#">page 2</a></li>
<li><a href="#">page 3</a></li>
<li><a href="#">contact us</a></li>
</ul>
<!-- rounded corners - bottom **** -->
<div class="rbottom"><div class="r4"></div><div
class="r3"></div><div class="r2"></div><div class="r1"></div></div>
</div>
<div class="sidebar">
<div class="sidebaritem">
<!-- rounded corners - top **** -->
<div class="rtop"><div class="r1"></div><div
class="r2"></div><div class="r3"></div><div class="r4"></div></div>
<h1>latest news</h1>
<!-- **** INSERT NEWS ITEMS HERE **** -->
<h2>01.09.2006</h2>
<p>This is where you can put your latest news.</p>
<p><a href="#">read more ...</a></p>
<p></p>
<h2>01.09.2006</h2>
<p>This is where you can put your latest news.</p>
<p><a href="#">read more ...</a></p>
<!-- rounded corners - bottom **** -->

70
Sri Sai college of IT & Management
Distributed DataMining in Credit Card Fraud Detection Source Code

<div class="rbottom"><div class="r4"></div><div


class="r3"></div><div class="r2"></div><div class="r1"></div></div>
</div>
<div class="sidebaritem">
<!-- rounded corners - top **** -->
<div class="rtop"><div class="r1"></div><div
class="r2"></div><div class="r3"></div><div class="r4"></div></div>
<h1>additional links</h1>
<div class="sbilinks">
<!-- **** INSERT ADDITIONAL LINKS HERE **** -->
<ul>
<li><a href="http://www.opendesigns.org">open
designs</a></li>
<li><a
href="http://www.w3schools.com/xhtml/default.asp">learn
XHTML</a></li>
<li><a
href="http://www.w3schools.com/css/default.asp">learn CSS</a></li>
<li><a href="http://www.mozilla.com/firefox">get
firefox</a></li>
</ul>
</div>
<!-- rounded corners - bottom **** -->
<div class="rbottom"><div class="r4"></div><div
class="r3"></div><div class="r2"></div><div class="r1"></div></div>
</div>
<div class="sidebaritem">
<!-- rounded corners - top **** -->
<div class="rtop"><div class="r1"></div><div
class="r2"></div><div class="r3"></div><div class="r4"></div></div>
<h1>other information</h1>
<!-- **** INSERT OTHER INFORMATION HERE **** -->
<p>
This space can be used for additional information such as
a contact phone number, address
or maybe even a graphic.
</p>

71
Sri Sai college of IT & Management
Distributed DataMining in Credit Card Fraud Detection Source Code

<!-- rounded corners - bottom **** -->


<div class="rbottom"><div class="r4"></div><div
class="r3"></div><div class="r2"></div><div class="r1"></div></div>
</div>
</div>
<div id="content">
<h1>Introduction</h1>
<!-- **** INSERT PAGE content_container HERE **** -->
<p>
This website template is released as an 'open source' design
(under the
<a href="http://creativecommons.org/licenses/by/2.5">
Creative Commons
Attribution 2.5</a> licence), which means that you are free
to download and
use it for anything you want (including modifying and
amending it).
All I ask is that you leave the 'design by dcarter' link in
the footer of the
template, but other than that...
</p>
<p>
The css curved edges are based on <a
href="http://www.html.it/articoli/nifty/index.html">
Nifty Corners</a> (rounded corners without images By
Alessandro Fulciniti).
</p>
<p>
This standards compliant template is written entirely in
XHTML 1.1 and CSS,
and can be validated using the links in the footer.
</p>
<p>
You can view my other 'open source' template designs
<a href="http://www.dcarter.co.uk/templates.html">here</a>.
</p>
<h1>Example Elements</h1>

72
Sri Sai college of IT & Management
Distributed DataMining in Credit Card Fraud Detection Source Code

<h2>Bold Text</h2>
<p><strong>this is an example of bold text</strong></p>
<h2>Italics</h2>
<p><i>this is an example of italic text</i></p>
<h2>Links</h2>
<p><a href="index.html">this is an example link</a></p>
<h2>Block Quotes</h2>
<blockquote>
<p>
Some blockquote text. Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua.
</p>
</blockquote>
<h2>Unordered Lists</h2>
<ul>
<li>list item 1</li>
<li>list item 2</li>
</ul>
<br />
<h2>Ordered Lists</h2>
<ol>
<li>list item 1</li>
<li>list item 2</li>
</ol>
<br />
<h2>Images</h2>
<p>images can be placed on the left, in the center or on the
right.</p>
<span class="left"><img src="style/graphic.jpg" alt="example
graphic" /></span>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud

73
Sri Sai college of IT & Management
Distributed DataMining in Credit Card Fraud Detection Source Code

exercitation ullamco laboris nisi ut aliquip ex ea commodo


consequat. Duis aute
irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla
pariatur.
</p>
<span class="center"><img src="style/graphic.jpg" alt="example
graphic" /></span>
<span class="right"><img src="style/graphic.jpg" alt="example
graphic" /></span>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute
irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla
pariatur.
</p>
</div>
<div class="sidebar">
<div class="sidebaritem">
<!-- rounded corners - top **** -->
<div class="rtop"><div class="r1"></div><div
class="r2"></div><div class="r3"></div><div class="r4"></div></div>
<h1>latest news</h1>
<!-- **** INSERT NEWS ITEMS HERE **** -->
<h2>01.09.2006</h2>
<p>This is where you can put your latest news.</p>
<p><a href="#">read more ...</a></p>
<p></p>
<h2>01.09.2006</h2>
<p>This is where you can put your latest news.</p>
<p><a href="#">read more ...</a></p>
<!-- rounded corners - bottom **** -->

74
Sri Sai college of IT & Management
Distributed DataMining in Credit Card Fraud Detection Source Code

<div class="rbottom"><div class="r4"></div><div


class="r3"></div><div class="r2"></div><div class="r1"></div></div>
</div>
<div class="sidebaritem">
<!-- rounded corners - top **** -->
<div class="rtop"><div class="r1"></div><div
class="r2"></div><div class="r3"></div><div class="r4"></div></div>
<h1>additional links</h1>
<div class="sbilinks">
<!-- **** INSERT ADDITIONAL LINKS HERE **** -->
<ul>
<li><a href="http://www.opendesigns.org">open
designs</a></li>
<li><a
href="http://www.w3schools.com/xhtml/default.asp">learn
XHTML</a></li>
<li><a
href="http://www.w3schools.com/css/default.asp">learn CSS</a></li>
<li><a href="http://www.mozilla.com/firefox">get
firefox</a></li>
</ul>
</div>
<!-- rounded corners - bottom **** -->
<div class="rbottom"><div class="r4"></div><div
class="r3"></div><div class="r2"></div><div class="r1"></div></div>
</div>
<div class="sidebaritem">
<!-- rounded corners - top **** -->
<div class="rtop"><div class="r1"></div><div
class="r2"></div><div class="r3"></div><div class="r4"></div></div>
<h1>other information</h1>
<!-- **** INSERT OTHER INFORMATION HERE **** -->
<p>
This space can be used for additional information such as
a contact phone number, address
or maybe even a graphic.
</p>

75
Sri Sai college of IT & Management
Distributed DataMining in Credit Card Fraud Detection Source Code

<!-- rounded corners - bottom **** -->


<div class="rbottom"><div class="r4"></div><div
class="r3"></div><div class="r2"></div><div class="r1"></div></div>
</div>
</div>
<div id="footer">
copyright &copy; company name | <a
href="#">email@emailaddress</a> | <a
href="http://validator.w3.org/check?uri=referer">XHTML 1.1</a> | <a
href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> | <a
href="http://www.dcarter.co.uk">design by dcarter</a>
</div>
</div>
</body>
</html>

76
Sri Sai college of IT & Management

You might also like