On 2011-06-27, at 12:53 PM, Calven Eggert wrote:

> I use my own code.
> 
> Oracle connection info is in the eomodel.

Then  you should be able to do the exact same thing in the MSSQL model.  You 
won't need any code at all.  It just works.  It is not flexible, but it does 
just work.

> 
> the MSSQL model only has one entity and yes, it's unique. (FYI, the purpose 
> of the app is to export records from MSQSL and import into Oracle)

I do exactly the same thing with MSSQL and FrontBase.  But I use a model 
connector from our frameworks, so I don't have to do anything special to get 
the models to connect.  :-)



Chuck


> 
> (Of course the cop-out is to have the records in the single table in the 
> MSSQL database copied to an Oracle database and then I don't have to worry 
> about the MSSQL Database :-)
> 
> On 2011-06-27, at 3:48 PM, Chuck Hill wrote:
> 
>> 
>> On 2011-06-27, at 12:45 PM, Calven Eggert wrote:
>> 
>>> both connections in the same application.
>>> 
>>> Not using Wonder.
>> 
>> Are you using anything, or just your own code?    If the answer is "just my 
>> own code", let me suggest leveraging something else.  You don't have to 
>> drink all of the kool-aid to use Wonder.  You DO have to eat some of the 
>> pudding though.
>> 
>> Do you have the Oracle connection info in a Properties or .plist file, or 
>> just in the EOModel?
>> 
>> The MS SQL model has different entity names, right?
>> 
>> 
>>> Will look at forceConnectionWIthModel.
>> 
>> That is probably not the most right answer, but it may work.
>> 
>> 
>> Chuck
>> 
>> 
>>> On 2011-06-27, at 3:35 PM, Chuck Hill wrote:
>>> 
>>>> Hi Calven,
>>>> 
>>>> Are you trying to connect to both at the same time from the same instance? 
>>>>  Or are these two different apps?
>>>> 
>>>> How do you set the Oracle connection dictionary?  If you are using Wonder 
>>>> or GVC stuff, this will get set on this line:
>>>>> modelGroup.addModelWithPathURL(msaiqModelURL);
>>>> due to notifications.  The solution depends on the answers to the question 
>>>> above.
>>>> 
>>>> See also EODatabaseContext
>>>> public static EODatabaseContext forceConnectionWithModel(EOModel model,
>>>>                    NSDictionary overrides, EOEditingContext editingContext)
>>>> 
>>>> 
>>>> Chuck
>>>> 
>>>> 
>>>> On 2011-06-27, at 12:25 PM, Calven Eggert wrote:
>>>> 
>>>>> Hi, All
>>>>> 
>>>>> I've modified a JavaApplication that connects to an Oracle database to 
>>>>> also get records from a MSSQLServer database.  I've added my additional 
>>>>> model and I can't seem to connect to the MSSQLServer database.  I've 
>>>>> searched the archives and I can't find the basic information needed to 
>>>>> connect to a MSSQLServer.
>>>>> 
>>>>> I've done this:
>>>>>         adaptor1 = new JDBCAdaptor("JavaJDBCAdaptor");
>>>>>         database1 = new EODatabase(adaptor1);
>>>>>         dbContext1 = new EODatabaseContext(database1);
>>>>>         java.net.URL msaiqModelURL = new 
>>>>> java.net.URL(modelPath+"/MosaiqModel.eomodeld"); 
>>>>>         EOModel model1 = modelGroup.addModelWithPathURL(msaiqModelURL);
>>>>>         adaptor1.setConnectionDictionary(model1.connectionDictionary());
>>>>>         database1.addModel(model1);
>>>>> 
>>>>> In the eomodel:
>>>>> URL=jdbc:microsoft:sqlserver://x.x.x.x:1433;
>>>>> User=user
>>>>> Password= Password
>>>>> Driver=com.microsoft.jdbc.sqlserver.SQLServerDriver
>>>>> 
>>>>> 
>>>>> I've also added the driver to the project:
>>>>> sqljdbc4.jar
>>>>> 
>>>>> 
>>>>> when I do this:
>>>>> EOFetchSpecification spec = new EOFetchSpecification("MyTable", null, 
>>>>> null);
>>>>> return ec.objectsWithFetchSpecification(spec);
>>>>> 
>>>>> I get the msg:
>>>>> java.lang.IllegalStateException: _obtainOpenChannel -- 
>>>>> com.webobjects.eoaccess.EODatabaseContext 
>>>>> com.webobjects.eoaccess.EODatabaseContext@194835fb: failed to open 
>>>>> database channel.  Check your connection dictionary, and ensure your 
>>>>> database is correctly configured.
>>>>> 
>>>>> When I look at adaptor1, from above, the values are all related to 
>>>>> oracle.  (Oracle JDBC Driver, etc) Hmmm,  I removed the sqljdbc4.jar from 
>>>>> the project and I get the same error, so that tells me that it's still 
>>>>> trying to connect via the oracle driver.  what can i do to get it to use 
>>>>> the MSSQLServer driver?
>>>>> 
>>>>> Calven
>>>>> 
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> Do not post admin requests to the list. They will be ignored.
>>>>> Webobjects-dev mailing list      ([email protected])
>>>>> Help/Unsubscribe/Update your Subscription:
>>>>> http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
>>>>> 
>>>>> This email sent to [email protected]
>>>> 
>>> 
>> 
> 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to