title: Get table dependency order in jdbc
body: <p>I have a set of tables [A,B,C,D] in MySQL Database </p>
  
  <p>The dependency is as follows
  B->C->A and D->A
  that is, A has a PrimaryKey , C has a foreign key which points A's Primary key and B has a Foreign key which points C's primary key and similarly D has a foreign key which points A's primary key.</p>
  
  <p>I need to get the dependency sorted tables list so that I don't get problems during insertion</p>
  
  <p>How do I get the table list as [A,C,B,D] through JDBC ? </p>