Hello,
Long time since this mail was written, but I tried the repro today and
am unable to reproduce the error. I had to change the repro slightly.
Does anyone know if this ever was or still is a problem?
I tried with various older Derby releases.
If I don't hear anything new, I will assume the reported issue is no
longer a problem.
--
Kristian
Adi Schwalb wrote:
Hi
My system is : Windows XP
Java Standard Edition 6.0 (or 1.6)
and Sun's FileSystemContextProvider (for Jndi)
The Problem is,that i can not store the ClientDataSource and
ClientConnectionPoolDataSource
in the jndi context. A simple code fragment is added here :
import javax.naming.Context;
import import javax.naming.InitialContext;
import org.apache.derby.jdbc.ClientDataSource;
import org.apache.derby.jdbc.ClientConnectionPoolDataSource;
public class test
{
try
{
Context ctx = new InitialContext();
ctx.addToEnvironment( Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.fscontext.RefFSContextFactory" );
ClientDataSource cds = new ClientDataSource();
// ClientConnectionPoolDataSource cds = new
ClientConnectionPoolDataSource();
cds.setUser("test");
cds.setPassword("test");
cds.setDatabaseName("tests;create=true");
cds.setServerName("localhost");
cds.setPortNumber(1527);
// In method bind (or rebind) it comes to an NullPointerException
ctx.bind( "db/derby/mydatas/test" , cds );
ctx.removeFromEnvironment(Context.INITIAL_CONTEXT_FACTORY);
ctx.close();
}
catch(Exception e)
{
}
}
With other databases, ORACLE,POSTGRES and MYSQL there is no problem to
run this.The DataSource
ist correct stored in the filesystem jndi context.Here an example for
Oracle :
mport javax.naming.Context;
import import javax.naming.InitialContext;
import oracle.jdbc.pool.OracleDataSource;
import oracle.jdbc.pool.OracleConnectionPoolDataSource;
public class test
{
try
{
Context ctx = new InitialContext();
ctx.addToEnvironment( Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.fscontext.RefFSContextFactory" );
OracleDataSource cds = new OracleDataSource();
// OracleConnectionPoolDataSource cds = new
OracleConnectionPoolDataSource();
cds.setUser("test");
cds.setPassword("test");
cds.setURL("jdbc:oracle:thin:@localhost:1521:tests");
// In method bind (or rebind) it comes to an NullPointerException
ctx.bind( "db/oracle/mydatas/test" , cds );
ctx.removeFromEnvironment(Context.INITIAL_CONTEXT_FACTORY);
ctx.close();
}
catch(Exception e)
{
}
}
------------------------------------------------------------------------
Kennt man wirklich jeden über 3 Ecken?
<http://de.rd.yahoo.com/evt=48210/*http://de.answers.yahoo.com/question/index;_ylc=X3oDMTEydHM5a3RpBF9TAzIxMTQ3MTgyMDIEc2VjA21haWwEc2xrA3RhZ2xpbmU-?qid=20061121073350AAVzb59>
Die Antworten gibt's bei Yahoo! Clever
<http://de.rd.yahoo.com/evt=48210/*http://de.answers.yahoo.com/question/index;_ylc=X3oDMTEydHM5a3RpBF9TAzIxMTQ3MTgyMDIEc2VjA21haWwEc2xrA3RhZ2xpbmU-?qid=20061121073350AAVzb59>.