I wish to build wanted db in wanted location programly in java.

    public class DerbyCreateTable {
 public static void main(String [] args) {
Connection con = null;
try {
  con = DriverManager.getConnection(
    "jdbc:derby://localhost/TestDB");

 // Creating a database table
  Statement sta = con.createStatement(); 
  int count = sta.executeUpdate(
    "CREATE TABLE HY_Address (ID INT, StreetName VARCHAR(20),"
    + " City VARCHAR(20))");
  System.out.println("Table created.");
  sta.close();        

  con.close();        
} catch (Exception e) {
  System.err.println("Exception: "+e.getMessage());
}
}
}

but how do i setup where you can create it and just how to creat the brand new location which i want ? thanks

You're almost there. First you have to load the motive force, for instance

private static String embeddedDriver = "org.apache.derby.jdbc.EmbeddedDriver";

then inside your primary

Class.forName(embeddedDriver).newInstance();

Second you should utilize a URL such as this to specify an area around the file system

jdbc:derby:/dir/to/create/database;create=true