All,

I really need some help. Here is a snippet of code that in no way works. Can you help?
I really just want to set up a JNDI filesystem binding for a SQL Server 2000 connection pool,
I was able to register and use the simple datasource in a similar fashion without any probs. The
problem with the code below is that the PoolingDataSource is apparently the wrong object
to bind (tell me what the right one is, pretty please?). The error message I get is:
Exception: javax.naming.OperationNotSupportedException: Can only bind References or Referenceable objects
javax.naming.NamingException: resolved: null, unresolved: null

Desire:
1. Create a new SQL Server 2000 Connection Pool
2. Bind it to a Filesystem JNDI Service Provider
3. Use it in another java app.

Thanks,

Will

--------------------------snip

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory");
env.put(Context.PROVIDER_URL, "file:///d:/jndi-rootcontext");
Context ctx = new InitialContext(env);
SQLServerDataSource ds = new SQLServerDataSource();
ds.setServerName("emerald");
ds.setPortNumber(1433);
ds.setDatabaseName("yobob");
ds.setUser("jimbo");
ds.setPassword("misty233");
ds.setDescription("yobob- jimbo Connection");
ObjectPool connectionPool = new GenericObjectPool(null);
ConnectionFactory connectionFactory = new DataSourceConnectionFactory(ds);
PoolableConnectionFactory poolableConnectionFactory =
new PoolableConnectionFactory(connectionFactory, connectionPool, null, null, false, true);
PoolingDataSource poolingDataSource = new PoolingDataSource(connectionPool);
ctx.bind("jdbcPool" + File.separator + "yobobPool", poolingDataSource);
ctx.close();


--------------------------pet



--
To unsubscribe, e-mail: <mailto:commons-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-user-help@;jakarta.apache.org>

Reply via email to