-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: Reverse Engineering with SQLExpress
PostPosted: Thu Apr 19, 2007 8:26 am 
Newbie

Joined: Wed Oct 25, 2006 8:28 am
Posts: 11
Hi all,

I am trying to reverse engineering by business objects from SQLExpress Database found on a remote host.

I have the following configs :

hibernate.cfg.xml



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory name="ForecastingSessionFactory">
<property name="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="hibernate.connection.url">jdbc:sqlserver://192.168.2.35\\sqlexpress</property>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="hibernate.default_schema">ForecastingAndIventoryV2</property>
<property name="hibernate.connection.password">sa</property>
<property name="hibernate.connection.username">mypassword</property>
</session-factory>
</hibernate-configuration>




I also created a console config where I added the sqljdbc.jar in the classpath


But when i try to look for the tables found in the database using the design view for hibernate.reveng.xml it cannot fetch any !!

I tested my connection to the remote SQLExpress server via a plain JDBC connection and it works.

Can anyone help me out with this


Cheers,
Jankee Yogesh
Software Developer
www.m-itc.net


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 19, 2007 12:22 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
any errors, logs etc ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 20, 2007 1:12 am 
Newbie

Joined: Wed Oct 25, 2006 8:28 am
Posts: 11
Eclipse does not give any errors ... is there any logs that hibernate tools generate ?

Regards,
Jankee Yogesh
Software Developer
M-ITC LTD


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 20, 2007 4:58 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
in the error log view should be something if there is an error.

Maybe your db don't allow you to read meatadata without specifying it's catalog/schema first ? do that by setting deault_schema/default_catalog

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 20, 2007 1:13 pm 
Newbie

Joined: Wed Oct 25, 2006 8:28 am
Posts: 11
Already tried that before .... but it did not work .... I completely forgot the error view ... thnx for the tip ... i will try it out when i get back to office .... Have a nice week end ;0)

Regards,
Jankee Yogesh,
Software Developer
M-ITC LTD


Top
 Profile  
 
 Post subject: Just Successfully Reverse Engineered from SQLExpress 2005
PostPosted: Tue May 15, 2007 3:02 pm 
Newbie

Joined: Thu Oct 26, 2006 3:03 pm
Posts: 1
Hi, I just successfully reversed engineered from MS SQL Express 2005. The JDBC connection to SQL Express is tricky. By default TCP/IP connections are not enabled and it will select a non-standard port once you do enable TCP/IP. See the SQL Server Configuration Manger for setting up the DB so that you can access it. I also used the sqljdbc_1.2 JDBC driver from Microsoft (type 4). I recommend you do a simple JUnit test to make sure you have the right connection string and then paste that into your hibernate.cfg.xml.

My connection URL looked like something like this

Code:
jdbc:sqlserver://localhost:1594;databaseName=XXXX


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 15, 2007 8:41 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Sometimes geting the JDBC connection correctly working is the biggest hurdle. This should go into the information about target databases so others can benefit [and we can point them to it].

http://www.hibernate.org/383.html


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.