Re: Modifying Properties for an EOF JDBC-connection
Re: Modifying Properties for an EOF JDBC-connection
- Subject: Re: Modifying Properties for an EOF JDBC-connection
- From: Hugi Thordarson <email@hidden>
- Date: Wed, 20 May 2009 09:23:59 +0000
Thanks - but this overrides the connection dictionary; I'l looking at
the connection properties (it's a JDBC thing)...
I'll posta notification once I get this working :)
Cheers,
- Hugi
// Hugi Thordarson
// http://hugi.karlmenn.is/
On 19.5.2009, at 17:38, Gustavo Adolfo Pizano wrote:
Hello..
I think this is quite similar to what I was looking but on a LDAP
server.. what I did was the follwoing:
EOModel model = EOModelGroup.defaultGroup().modelNamed("LDAPModel");
NSMutableDictionary<String, String> overrides = new
NSMutableDictionary<String, String>();
overrides.takeValueForKey("ldap://localhost:389/
cn=internal,cn=Users,o=xws", "serverUrl");
EODatabaseContext.forceConnectionWithModel(model, overrides,
defaultEditingContext());
now note that the line overrides.takeValueForKey(value,key), the key
"serverUrl: I got making an NSLog before
like this.. from the EO prgramming guide
EOModel model = EOModelGroup.defaultGroup().modelNamed("RealEstate");
NSLog.out.appendln("connection dictionary keys:" +
model.connectionDictionary().allKeys());
NSMutableDictionary overrides = new NSMutableDictionary();
overrides.takeValueForKey("brent", "username");
overrides.takeValueForKey("secret", "password");
EODatabaseContext.forceConnectionWithModel(model, overrides, new
EOEditingContext());
I hope this helps you.
Gus
On May 19, 2009, at 7:17 PM, Hugi Thordarson wrote:
Hi all.
I need to set a property for the Oracle JDBC-driver, can anyone
tell me how to do that?
This is wat I've tried (without success):
---------
EOModel model = EOModelGroup.defaultGroup().modelNamed( "MyModel" );
EODatabaseContext dbc =
EODatabaseContext.registeredDatabaseContextForModel( model, ec );
JDBCAdaptor adaptor = (JDBCAdaptor)dbc.adaptorContext().adaptor();
adaptor.connectionProperties().put( "oracle.jdbc.ReadTimeout",
5000 );
System.out.println( adaptor.connectionProperties() );
---------
The last line's sysout will not show the newly added property -
any idea how I can get it in there?
Cheers,
- hugi
// Hugi Thordarson
// http://hugi.karlmenn.is/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden