hibernate.cfg.xml
<hibernate-configuration>
<session-factory >
<property name="hibernate.connection.url">jdbc:mysql://localhost/test</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">111111</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<mapping resource="com/test/hibernate/User.hbm.xml"/>
</session-factory>
</hibernate-configuration>

---------------------------------------------------------------------------------------------------
public class ExportDB {
public static void main(String[] args) {
Configuration cfg = new Configuration().configure();
SchemaExport export = new SchemaExport(cfg);
export.create(true, true);
}
}

---------------------------------------------------------------------------------------------------
通过SchemaExport来生成表的时候报以下错误
Exception in thread "main" java.lang.UnsatisfiedLinkError: no net in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at sun.security.action.LoadLibraryAction.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.InetAddress.<clinit>(Unknown Source)
at org.hibernate.id.AbstractUUIDGenerator.<clinit>(AbstractUUIDGenerator.java:22)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.hibernate.id.IdentifierGeneratorFactory.class$(IdentifierGeneratorFactory.java:25)
at org.hibernate.id.IdentifierGeneratorFactory.<clinit>(IdentifierGeneratorFactory.java:75)
at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:152)
at org.hibernate.cfg.Configuration.iterateGenerators(Configuration.java:641)
at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:752)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:93)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:61)
at com.test.hibernate.ExportDB.main(ExportDB.java:9)