auto database creation in hibernate with mysql
<p>this is my code, where i done mistake. while running Test.java am getting error like "The requested resource is not available". i kept all this files in same package </p>

<p><strong>hibernate.cfg.xml</strong></p>

<pre><code>&lt;hibernate-configuration&gt;
   &lt;session-factory&gt;
    &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
     &lt;property name="hibernate.connection.url"&gt; jdbc:mysql://localhost:3306/studentdb &lt;/property&gt;
    &lt;property name="hibernate.connection.username"&gt;root&lt;/property&gt;
   &lt;property name="hibernate.connection.password"&gt;root&lt;/property&gt;
 &lt;property name="connection.pool_size"&gt; 1&lt;/property&gt; 

   &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
  &lt;property name="hbm2ddl.auto"&gt;create&lt;/property&gt;
  &lt;property name="show_sql"&gt;true&lt;/property&gt;


   &lt;!-- List of XML mapping files --&gt;
   &lt;mapping resource="student.hbm.xml"/&gt;

   &lt;/session-factory&gt;
&lt;/hibernate-configuration&gt;
</code></pre>

<p><strong>Test.java</strong></p>

<pre><code>public class Test {

    public static void main(String[] args) {
        Configuration cfg=new Configuration();
        cfg.configure("hibernate.cfg.xml");
        cfg.buildSessionFactory();
    }

}
</code></pre>

<p><strong>student.hbm.xml</strong></p>

<pre><code>&lt;hibernate-mapping&gt;
&lt;class name="com.javathub.Student" table="stu_details"&gt;
&lt;id name="id"&gt;
&lt;generator class="assigned"&gt;&lt;/generator&gt;
&lt;/id&gt;
&lt;property name="name"&gt;&lt;/property&gt;
&lt;property name="branch"&gt;&lt;/property&gt;
&lt;property name="fee"&gt;&lt;/property&gt;
&lt;/class&gt;


&lt;/hibernate-mapping&gt;
</code></pre>

<p><strong>Student.java</strong></p>

<pre><code>public class Student {
    private int id;
    private String name;
    private String branch;
    private double fee;
    public Student(){

    }
    public Student(int id, String name, String branch, double fee) {
        super();
        this.id = id;
        this.name = name;
        this.branch = branch;
        this.fee = fee;
    }
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getBranch() {
        return branch;
    }
    public void setBranch(String branch) {
        this.branch = branch;
    }
    public double getFee() {
        return fee;
    }
    public void setFee(double fee) {
        this.fee = fee;
    }

}
</code></pre>

<p>please help me, thanks in advance</p>