You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Marl Atkins <ma...@softlinksys.com> on 2006/11/28 17:36:13 UTC

Help! Can't connect to DBase

Hi:

I've got an Applet based application that I've been working on for about 3
months.
It creates a Derby database from a MySql database.
It's been working fine.

Today, for no apparent reason, the Applet can't connect to the Derby
database.
If I use an application with a main proc. in the NetBeans IDE, it still
works fine.

I've tried deleting and recreating the database, rebooting . . . 
The Applet *seems* to be creating the database but then it won't connect to
it in the next session.
I connected to it successfully with Squirrel but it didn't see any tables.

Again, this worked and as far as I recall, I didn't change any code.
It still works in the IDE. With the Applet it's apparantly returning null
when I try to create a connection object.

I'm running Windows 2000 Pro; my browser is IE 6

Is there an error I could trap besides Exception?
I'm just looking for some ideas, hoping maybe you've run into something like
this.
Right now I'm lost. I have no idea how to solve it.

Marl K. Atkins
Microsoft Certified Professional
SoftLink Systems, Inc.
(407) 388-1886 


RE: Help! Can't connect to DBase

Posted by Marl Atkins <ma...@softlinksys.com>.
Hmm, I downloaded the 10.2 version and signed it.
I replaced the one I was using with the new one.
Now it works again.

The scary thing is that it just up and quit working.
I didn't replace the jar or alter it in any way.
I sure hope that doesn't happen again.

Well, thanks for your help:o)






-----Original Message-----
From: David.Vancouvering@Sun.COM [mailto:David.Vancouvering@Sun.COM] On
Behalf Of David Van Couvering
Sent: Tuesday, November 28, 2006 7:08 PM
To: Derby Discussion
Subject: Re: Help! Can't connect to DBase

- Can you send the stack trace for the NullPointerException?  I'd be curious
to see if it's happening inside Derby or if it's happening in your code
because ds.getConnection() returned null

- If you're running Derby 10.2, you can go to the lib directory and say
'java -jar derbyrun.jar sysinfo'.  If you're running 10.1 then you can go do
'java -cp derbytools.jar org.apache.derby.tools.sysinfo'

David

Marl Atkins wrote:
> Yea, it's tough for me to pin down.
> The actual error I'm getting is nullPointerException.
> I get it when I try to create the connection object:
> 
> -------------------
> public java.sql.Connection openDBase() throws Exception
>     {
>         ds = new EmbeddedDataSource();
>         ds.setDatabaseName("CTMCDBase");
>         try 
>         {
>             oCn = ds.getConnection();
>             return oCn;
>         } 
>         catch (Exception exp) 
>         {
>             throw new Exception("Error in CliDBaseConn.openDBase: " +
> exp.getMessage());            
>         }
>         finally
>         {
>             oCn = null;
>         }
>     }
>     
> -----------------------
> 
> I don't know how to run sysinfo.
> If you can tell me where to get the signed derby.jar that you're using 
> that might help.
> I had to sign this one myself so I'm not 100% confident with it.
> Again, this app has been working fine and now out of the blue, it 
> throws that nullPointerException.
> 
> -----Original Message-----
> From: David.Vancouvering@Sun.COM [mailto:David.Vancouvering@Sun.COM] 
> On Behalf Of David Van Couvering
> Sent: Tuesday, November 28, 2006 1:04 PM
> To: Derby Discussion
> Subject: Re: Help! Can't connect to DBase
> 
> It would be very helpful to provide further information around "can't 
> connect."  What's the error message and the stack trace?
> 
> Also, please run sysinfo and provide that information, knowing which 
> version is key.  I have been running Derby in an applet for a sample 
> app I am using, and it's never had a problem.
> 
> David
> 
> Marl Atkins wrote:
>> Hi:
>>
>> I've got an Applet based application that I've been working on for 
>> about 3 months.
>> It creates a Derby database from a MySql database.
>> It's been working fine.
>>
>> Today, for no apparent reason, the Applet can't connect to the Derby 
>> database.
>> If I use an application with a main proc. in the NetBeans IDE, it 
>> still works fine.
>>
>> I've tried deleting and recreating the database, rebooting . . . 
>> The Applet *seems* to be creating the database but then it won't 
>> connect to it in the next session.
>> I connected to it successfully with Squirrel but it didn't see any
tables.
>>
>> Again, this worked and as far as I recall, I didn't change any code.
>> It still works in the IDE. With the Applet it's apparantly returning 
>> null when I try to create a connection object.
>>
>> I'm running Windows 2000 Pro; my browser is IE 6
>>
>> Is there an error I could trap besides Exception?
>> I'm just looking for some ideas, hoping maybe you've run into 
>> something like this.
>> Right now I'm lost. I have no idea how to solve it.
>>
>> Marl K. Atkins
>> Microsoft Certified Professional
>> SoftLink Systems, Inc.
>> (407) 388-1886
>>
>>
> 
> 


Re: Help! Can't connect to DBase

Posted by David Van Couvering <da...@vancouvering.com>.
- Can you send the stack trace for the NullPointerException?  I'd be 
curious to see if it's happening inside Derby or if it's happening in 
your code because ds.getConnection() returned null

- If you're running Derby 10.2, you can go to the lib directory and say 
'java -jar derbyrun.jar sysinfo'.  If you're running 10.1 then you can 
go do 'java -cp derbytools.jar org.apache.derby.tools.sysinfo'

David

Marl Atkins wrote:
> Yea, it's tough for me to pin down.
> The actual error I'm getting is nullPointerException.
> I get it when I try to create the connection object:
> 
> -------------------
> public java.sql.Connection openDBase() throws Exception
>     {
>         ds = new EmbeddedDataSource();
>         ds.setDatabaseName("CTMCDBase");
>         try 
>         {
>             oCn = ds.getConnection();
>             return oCn;
>         } 
>         catch (Exception exp) 
>         {
>             throw new Exception("Error in CliDBaseConn.openDBase: " +
> exp.getMessage());            
>         }
>         finally
>         {
>             oCn = null;
>         }
>     }
>     
> -----------------------
> 
> I don't know how to run sysinfo.
> If you can tell me where to get the signed derby.jar that you're using that
> might help.
> I had to sign this one myself so I'm not 100% confident with it.
> Again, this app has been working fine and now out of the blue, it throws
> that nullPointerException.
> 
> -----Original Message-----
> From: David.Vancouvering@Sun.COM [mailto:David.Vancouvering@Sun.COM] On
> Behalf Of David Van Couvering
> Sent: Tuesday, November 28, 2006 1:04 PM
> To: Derby Discussion
> Subject: Re: Help! Can't connect to DBase
> 
> It would be very helpful to provide further information around "can't
> connect."  What's the error message and the stack trace?
> 
> Also, please run sysinfo and provide that information, knowing which version
> is key.  I have been running Derby in an applet for a sample app I am using,
> and it's never had a problem.
> 
> David
> 
> Marl Atkins wrote:
>> Hi:
>>
>> I've got an Applet based application that I've been working on for 
>> about 3 months.
>> It creates a Derby database from a MySql database.
>> It's been working fine.
>>
>> Today, for no apparent reason, the Applet can't connect to the Derby 
>> database.
>> If I use an application with a main proc. in the NetBeans IDE, it 
>> still works fine.
>>
>> I've tried deleting and recreating the database, rebooting . . . 
>> The Applet *seems* to be creating the database but then it won't 
>> connect to it in the next session.
>> I connected to it successfully with Squirrel but it didn't see any tables.
>>
>> Again, this worked and as far as I recall, I didn't change any code.
>> It still works in the IDE. With the Applet it's apparantly returning 
>> null when I try to create a connection object.
>>
>> I'm running Windows 2000 Pro; my browser is IE 6
>>
>> Is there an error I could trap besides Exception?
>> I'm just looking for some ideas, hoping maybe you've run into 
>> something like this.
>> Right now I'm lost. I have no idea how to solve it.
>>
>> Marl K. Atkins
>> Microsoft Certified Professional
>> SoftLink Systems, Inc.
>> (407) 388-1886
>>
>>
> 
> 

RE: Help! Can't connect to DBase

Posted by Marl Atkins <ma...@softlinksys.com>.
Yea, it's tough for me to pin down.
The actual error I'm getting is nullPointerException.
I get it when I try to create the connection object:

-------------------
public java.sql.Connection openDBase() throws Exception
    {
        ds = new EmbeddedDataSource();
        ds.setDatabaseName("CTMCDBase");
        try 
        {
            oCn = ds.getConnection();
            return oCn;
        } 
        catch (Exception exp) 
        {
            throw new Exception("Error in CliDBaseConn.openDBase: " +
exp.getMessage());            
        }
        finally
        {
            oCn = null;
        }
    }
    
-----------------------

I don't know how to run sysinfo.
If you can tell me where to get the signed derby.jar that you're using that
might help.
I had to sign this one myself so I'm not 100% confident with it.
Again, this app has been working fine and now out of the blue, it throws
that nullPointerException.

-----Original Message-----
From: David.Vancouvering@Sun.COM [mailto:David.Vancouvering@Sun.COM] On
Behalf Of David Van Couvering
Sent: Tuesday, November 28, 2006 1:04 PM
To: Derby Discussion
Subject: Re: Help! Can't connect to DBase

It would be very helpful to provide further information around "can't
connect."  What's the error message and the stack trace?

Also, please run sysinfo and provide that information, knowing which version
is key.  I have been running Derby in an applet for a sample app I am using,
and it's never had a problem.

David

Marl Atkins wrote:
> Hi:
> 
> I've got an Applet based application that I've been working on for 
> about 3 months.
> It creates a Derby database from a MySql database.
> It's been working fine.
> 
> Today, for no apparent reason, the Applet can't connect to the Derby 
> database.
> If I use an application with a main proc. in the NetBeans IDE, it 
> still works fine.
> 
> I've tried deleting and recreating the database, rebooting . . . 
> The Applet *seems* to be creating the database but then it won't 
> connect to it in the next session.
> I connected to it successfully with Squirrel but it didn't see any tables.
> 
> Again, this worked and as far as I recall, I didn't change any code.
> It still works in the IDE. With the Applet it's apparantly returning 
> null when I try to create a connection object.
> 
> I'm running Windows 2000 Pro; my browser is IE 6
> 
> Is there an error I could trap besides Exception?
> I'm just looking for some ideas, hoping maybe you've run into 
> something like this.
> Right now I'm lost. I have no idea how to solve it.
> 
> Marl K. Atkins
> Microsoft Certified Professional
> SoftLink Systems, Inc.
> (407) 388-1886
> 
> 


Re: Help! Can't connect to DBase

Posted by David Van Couvering <da...@vancouvering.com>.
It would be very helpful to provide further information around "can't 
connect."  What's the error message and the stack trace?

Also, please run sysinfo and provide that information, knowing which 
version is key.  I have been running Derby in an applet for a sample app 
I am using, and it's never had a problem.

David

Marl Atkins wrote:
> Hi:
> 
> I've got an Applet based application that I've been working on for about 3
> months.
> It creates a Derby database from a MySql database.
> It's been working fine.
> 
> Today, for no apparent reason, the Applet can't connect to the Derby
> database.
> If I use an application with a main proc. in the NetBeans IDE, it still
> works fine.
> 
> I've tried deleting and recreating the database, rebooting . . . 
> The Applet *seems* to be creating the database but then it won't connect to
> it in the next session.
> I connected to it successfully with Squirrel but it didn't see any tables.
> 
> Again, this worked and as far as I recall, I didn't change any code.
> It still works in the IDE. With the Applet it's apparantly returning null
> when I try to create a connection object.
> 
> I'm running Windows 2000 Pro; my browser is IE 6
> 
> Is there an error I could trap besides Exception?
> I'm just looking for some ideas, hoping maybe you've run into something like
> this.
> Right now I'm lost. I have no idea how to solve it.
> 
> Marl K. Atkins
> Microsoft Certified Professional
> SoftLink Systems, Inc.
> (407) 388-1886 
> 
>