Hello fellow Experts,
i have two database with the following tables
customers and scrub.
customers table has folowing:
id customers
Phone
First Name
Last name
Address
City
State
Zipcode
Email
Investment
Source
Assign
Statue
CustomerNotes
Scrub has the following
idscrub
First
Last
What i am trying to do is compare the scrub Database with the customer Database and find all the matchs to delete them out of customer database.
So far my code work for first record in customer them stops. I been changed code and still get the same results.
if there an easier way please let me know.
i have 3355 names to take out of the 77005 customer database.
I working with jsp and mysql.
Thanks for your time,
CT
i have two database with the following tables
customers and scrub.
customers table has folowing:
id customers
Phone
First Name
Last name
Address
City
State
Zipcode
Investment
Source
Assign
Statue
CustomerNotes
Scrub has the following
idscrub
First
Last
What i am trying to do is compare the scrub Database with the customer Database and find all the matchs to delete them out of customer database.
So far my code work for first record in customer them stops. I been changed code and still get the same results.
if there an easier way please let me know.
i have 3355 names to take out of the 77005 customer database.
I working with jsp and mysql.
Thanks for your time,
CT
Code:
<%@ page import="java.sql.*"%> <%@ page import="javax.servlet.*"%> <% String connectionURL = "jdbc:mysql://localhost:3306/bjc?user=;password="; Connection connection = null; Connection Mconnection = null; Statement statement = null; Statement Mstatement = null; ResultSet rs = null; ResultSet Mrs = null; Class.forName("com.mysql.jdbc.Driver").newInstance(); Mconnection = DriverManager.getConnection(connectionURL, "root", "password"); connection = DriverManager.getConnection(connectionURL, "root", "password"); Mstatement = Mconnection.createStatement(); statement = connection.createStatement(); Mrs = Mstatement.executeQuery("SELECT * FROM scrub"); rs = rs = statement.executeQuery("SELECT * FROM customers"); String holder1 = null; String holder1a = null; String holder2 = null; String holder2a = null; int idholder = 0; int temp = 0; while (rs.next()){ idholder = rs.getInt("idcustomer"); while (Mrs.next()){ holder1 = Mrs.getString("last"); holder2 = rs.getString("Last Name"); holder1a = Mrs.getString("First"); holder2a = rs.getString("First Name"); out.println(idholder); out.println(" "); out.println(temp); out.println(" "); out.println(holder1a); out.println(" "); out.println(holder1); out.println(" "); out.println(holder2a); out.println(" "); out.println(holder2); out.println("<br>"); if (holder2.equalsIgnoreCase(holder1) && holder2a.equalsIgnoreCase(holder2)){ out.println("row "+idholder+" "+holder2a+" "+holder2+"\n"); } } temp++; } rs.close(); statement.close(); connection.close(); %>
Comment