• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate Configuration ODBC SQL Server  RSS feed

ivan deselt
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

String URL = "jdbcdbc: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:

<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">jdbcdbc:dsnmay</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password">may</property>

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?
Sumit Bisht
Ranch Hand
Posts: 331
Python Ruby Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you are getting a "Invalid Descriptor Index" problem, It could be due to wrong numbering of columns in table an as needed by the caller.
Also, if it is feasible, can you use a jdbc driver to access the database ?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!