• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection to an Oracle database fails

 
Peter Hammar
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is in my properties file:







I only get my Something is wrong message. Do I need anything more then the above?

Regards
H
 
Jan Cumps
Bartender
Posts: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you print the exception message? "Something is wrong" does not give us a lot of info.
You don't show us where and how you create the connection.
 
Peter Hammar
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get this from printstacktrace:



The connection?

 
Jan Cumps
Bartender
Posts: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The exception tells you at what line of the code the error is.
Note: it is a general Java issue (a null pointer exception), not a database issue.
 
Peter Hammar
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The application runs fine if I run it in offline mode; no database connection. The errors are thrown when trying to connect to the database.

Line of code that it don't like when in online mode:



= at pall.PaLLmeny.<init>(PaLLmeny.java:80)

Thoughts?
 
Jan Cumps
Bartender
Posts: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter Hammar wrote:...

Thoughts?
Some variable is null, and something in your code does not like that that variable is null.
 
Karthik Jayachandran
Ranch Hand
Posts: 91
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using an IDE like Eclipse, use the debugger. You will know where the exception is throwing.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic