Hello all,
I've got the following tables :
CREATE TABLE Student
(
Student_ID serial PRIMARY KEY,
First_Name varchar(50),
Last_Name varchar(50),
UNIQUE (First_Name, Last_Name)
);
CREATE TABLE Address
(
First_Name varchar(50),
Last_Name varchar(50),
Address varchar(50),
PRIMARY KEY (First_Name, Last_Name),
FOREIGN KEY (First_Name, Last_Name) REFERENCES student (First_Name,Last_Name)
);
And some code like :
Driver driver = (Driver)Class.forName("org.postgresql.Driver").newInstance();
DriverManager.registerDriver(driver);
String url = "jdbc:postgresql:test";
Connection con = DriverManager.getConnection(url, "mof", "");
DatabaseMetaData meta = con.getMetaData ();
ResultSet metaRS = meta.getImportedKeys(null, null, "address");
while (metaRS.next())
System.out.println("FK_C == " + metaRS.getString("FKCOLUMN_NAME"));
Which only gives me :
FK_C == first_name
How am I supposed to find out about "Last_Name" ?
Mof.