Home » Developer & Programmer » JDeveloper, Java & XML » Cant connect to 11g database (RDBMS 11.2, Win7 x64, JDev10135)
Cant connect to 11g database [message #458312] Fri, 28 May 2010 10:21 Go to next message
hristo
Messages: 258
Registered: May 2007
Senior Member
Hi!

Im using JDev10135 and trying to develop (well, small changes of an existing app) a application that shall connect to my 11g database (on my laptop).
When running in offline mode (no DB connection everythings runs ok) but when trying, my connection fails with:

java.lang.NullPointerException
	at pall.data.DbConnection.<init>(DbConnection.java:51)
	at pall.data.DataCommon.<init>(DataCommon.java:148)
	at pall.PaLLmeny.<init>(PaLLmeny.java:80)
	at pallehandel.PaLLehandel.<init>(PaLLehandel.java:45)
	at pallehandel.PaLLehandel.main(PaLLehandel.java:139)


Very strange errors as they dont seems do have anything to do with an db connection.

The connection:
	try {
  	dbcon = new DbConnection(bundle.getString("DRIVER"),bundle.getString("testURL"),"test","test");
  	} catch (java.sql.SQLException ex) {
		DataCommon.handleError("DataCommon() new DbConnection()", ex, "Cant connect to DB", true, true, parent);
		 
     System.exit(0);
	} catch (Exception e) {
      DataCommon.handleError("DataCommon() new DbConnection()", e, "Cant connect to DB", true, true, parent);
       e.printStackTrace();
     System.exit(0);

The printstack gives the error you saw earlier.

The resource.properties file:

DRIVER=oracle.jdbc.OracleDriver
testURL=jdbc:oracle:thin:@ATT-M4400.pyroit.local:1521:TEST

USER=test
PASS=test


So, how do I proceed? I can connect with the user/passw with SQLPLUS.

This app works fine when connecting to the database located on the server. But I took an export of the schema and put it in my 11201 database (the server one is 10203) and now it don't work. The customers VPN is so slow, I cant use it. Thats why I want to have the database on my computer.

Any ideas?

Regards
H

[Updated on: Fri, 28 May 2010 11:28] by Moderator

Report message to a moderator

Re: Cant connect to 11g database [message #458331 is a reply to message #458312] Fri, 28 May 2010 11:29 Go to previous messageGo to next message
Michel Cadot
Messages: 67134
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Try to put the strings that are inside the file into the connection string as constants to see if the error really comes from Oracle (nothing prove it in your post) or from another error:
DbConnection("oracle.jdbc.OracleDriver", "jdbc:oracle:thin:@ATT-M4400.pyroit.local:1521:TEST", "test", "test");

Regards
Michel

[Updated on: Fri, 28 May 2010 11:30]

Report message to a moderator

Re: Cant connect to 11g database [message #458348 is a reply to message #458331] Fri, 28 May 2010 13:49 Go to previous messageGo to next message
hristo
Messages: 258
Registered: May 2007
Senior Member
Hi!

I replaced my DBconnection with what you provided, still the same error. Sad

The interesting thing is that I have only changed the connect strings. All the other code is untouched. So, there must be some strange thing with my local DB.

Regards
H

[Updated on: Fri, 28 May 2010 13:51]

Report message to a moderator

Re: Cant connect to 11g database [message #458397 is a reply to message #458348] Sat, 29 May 2010 09:16 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
What is on line 5 of your DbConnection?
Looks like some init method, that might expect something to be set.
Re: Cant connect to 11g database [message #458543 is a reply to message #458397] Mon, 31 May 2010 03:15 Go to previous messageGo to next message
hristo
Messages: 258
Registered: May 2007
Senior Member
What do you mean, which line is that?
Re: Cant connect to 11g database [message #458608 is a reply to message #458543] Mon, 31 May 2010 11:33 Go to previous messageGo to next message
Alessandro Rossi
Messages: 166
Registered: September 2008
Location: Rome
Senior Member
What driver or framework are you using that defines class pall.data.DbConnection?

I use JDev quite often but I always opted for the standard oracle one with the classe oracle.jdbc.OracleConnection or the Sun one with java.sql.Connection.

Are you sure that SQLExceptions aren't catched (and eventually bad handled) inside the DbConnection constructor for an unexpected situation (like case sensitive authentication)?


Bye Alessandro

[Updated on: Mon, 31 May 2010 11:34]

Report message to a moderator

Re: Cant connect to 11g database [message #458620 is a reply to message #458543] Mon, 31 May 2010 13:11 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
hristo wrote on Mon, 31 May 2010 10:15
What do you mean, which line is that?

It is the line throwing the Exception, as you can see from the stacktrace. I suspect (and so does Alessandro) that you use some custom DbConnection class. Therefor I asked you what is on line 5 in that clase, as that line throws the NPE.
If you don't have the source code for it, use a decompiler to see what it is failing on.
Previous Topic: Javamail - Attaching an embedded email
Next Topic: small problem with XMLSerialize
Goto Forum:
  


Current Time: Thu May 28 04:04:03 CDT 2020