package customer;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Scanner;

public class Search_Customer {
	public void search_Customer(){
		Class.forName("oracle.jdbc.driver.OracleDriver");
		String url = "jdbc:oracle:thin:@192.168.10.21:1521:orcl";
		Connection con = null;
		Statement stmt = null;
		ResultSet rs = null;
		String sql;
		Statement fstmt = null;
		ResultSet frs = null;
		String fsql;
		try{
			con = DriverManager.getConnection(url, "dvd","1111"); 
			Scanner scan = new Scanner(System.in);
			while(true){
				System.out.println("고객조회창");
				System.out.print("고객명 : ");
				String name = scan.next();

				sql = "SELECT * FROM member";
				stmt = con.createStatement(); 
				rs = stmt.executeQuery(sql);
				fsql = "SELECT * FROM family";
				fstmt = con.createStatement(); 
				frs = fstmt.executeQuery(fsql);

				while(rs.next()){
					if (rs.getString(2).equals(name)){
						System.out.print(rs.getInt(1)+"\t");
						System.out.print(rs.getString(2)+"\t\t");
						System.out.print(rs.getString(3)+"\t");
						System.out.print(rs.getInt(4)+"\t");
						System.out.print(rs.getInt(5)+"\t");
						while(frs.next()){
							if(rs.getInt(1)==frs.getInt(1)){
								System.out.print(frs.getString(2)+"\t\t");
								System.out.print(frs.getString(3));
							}
						}
						System.out.println("");
					}
					else {
						System.out.println("검색된 고객이 없습니다.");
					}
				}
			}
		}
		catch(Exception err){
			err.printStackTrace();
		}
		finally{
			if(frs != null) try{frs.close();}catch(Exception err){}
			if(rs != null) try{rs.close();}catch(Exception err){}
			if(fstmt != null) try{fstmt.close();}catch(Exception err){}
			if(stmt != null) try{stmt.close();}catch(Exception err){}
			if(con != null) try{con.close();}catch(Exception err){}
		}
		return;
		
	}
}

@@ -1,25 +1,4 @@
-package customer;%0D%0A%0D%0A
 impo
@@ -54,16 +54,52 @@
 nager;%0D%0A
+import java.sql.PreparedStatement;%0D%0A
 import j
@@ -192,57 +192,85 @@
 ass 
-Search_Customer %7B%0D%0A%09public void search_Customer()
+DB1 %7B%0D%0A%09public static void main(String%5B%5D args) throws ClassNotFoundException 
 %7B%0D%0A%09
@@ -1046,24 +1046,94 @@
 ls(name))%7B%0D%0A
+%09%09%09%09%09%09System.out.println(%22%EA%B3%A0%EA%B0%9D%EB%B2%88%ED%98%B8%5Ct%EA%B3%A0%EA%B0%9D%EB%AA%85%5Ct%5Ct%EC%A3%BC%EC%86%8C%5Ct%5Ct%5Ct%EB%82%98%EC%9D%B4%5Ct%EC%A0%84%ED%99%94%EB%B2%88%ED%98%B8%5Ct%EA%B0%80%EC%A1%B1%5Ct%5Ct%EA%B4%80%EA%B3%84%22);%0D%0A
 %09%09%09%09%09%09System
@@ -1155,24 +1155,26 @@
 etInt(1)+%22%5Ct
+%5Ct
 %22);%0D%0A%09%09%09%09%09%09S
@@ -2037,26 +2037,13 @@
 %09%7D%0D%0A
-%09%09return;%0D%0A%09%09%0D%0A
 %09%7D%0D%0A
-
 %7D%0D%0A
+%0D%0A

Update Search_Customer.java