Hai all... I'm newbie in hibernate technology, and i have a question about hibernate configuration.
First i'm using Netbean to create web application. I'm using
struts , spring and hibernate. i'm stuck in hibernate configuration. Database i'm using is SQL Server, and it is on other network. so far i can established connection by writing the
java code like :
public static Connection getConnection() throws Exception {
Driver d = (Driver)Class.forName
("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
String URL = "jdbc:odbc:dsnmay";
con = DriverManager.getConnection(URL, "sa", "may");
return (Connection) con;
}
i create odbc data source as well. then when i try to use hibernate, this is the setting i made:
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="hibernate.connection.driver_class">sun.jdbc.odbc.JdbcOdbcDriver</property>
<property name="hibernate.connection.url">
jdbc:odbc:dsnmay</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password">may</property>
</session-factory>
</hibernate-configuration>
then when i create hibernate reverse engineering wizard, there's no tables load...
same thing happens in intelij,
test connection success but refresh tables , error
JDBC operation failed
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index
i already have tables in my database and i wanna use hibernate and also create a mapping files from my database. any idea?