I need to know how to access two tables which has some reference values within the table.I need the Java Code to Fetch Both the tables values which are same and have to display it
There is no code of Java to fetch data from databases. Obviously, it is the SQL statements. You want to fetch data from two tables based upon the reference value; So, think about Database object Views or write down Joins (select query).
sql="select a.col1,a.col2,b.col1,b.col2 from table1 a, table2 b where a.col1=b.col1";
// Load a driver
// Establish DB Connection
System.out.println(rs.getString(1) + " " + rs.getString(2) + ....);