The error message says that the database "webmodel" cannot be accessed. However, your database key is "mydb". You did not define any connection properties for the database "webmodel". Try syncing the two database names.

If this sill does not work, can you post the stack trace of the exception you are getting ?

   Thomas

On Thu, 11 Oct 2007, Anas Mughal wrote:

I keep on getting the error:
SEVERE: Could not open a connection to the database webmodel

I am able to connect from java using the same settings that I am trying in
my torque.properties file. Please advise what is wrong.

Here is my torque.properties file:

torque.database.default=mydb
torque.database.mydb.adapter=oracle

torque.database.mydb.driver=oracle.jdbc.driver.OracleDriver
torque.database.mydb.url=jdbc:oracle:thin:@127.0.0.1:1521:xe
torque.database.mydb.username=webmodel
torque.database.mydb.password=webmodel

#Using commons-dbcp
torque.dsfactory.mydb.factory =
org.apache.torque.dsfactory.SharedPoolDataSourceFactory
torque.dsfactory.mydb.connection.driver = oracle.jdbc.driver.OracleDriver
torque.dsfactory.mydb.connection.url = jdbc:oracle:thin:@127.0.0.1:1521:xe
torque.dsfactory.mydb.connection.user = webmodel
torque.dsfactory.mydb.connection.password = webmodel



I am running this as a stand-alone application. (Not in any app server.)

Here is my Java code that connects successfully to the database:

           Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
           con = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1
:1521:XE",
               "webmodel", "webmodel");

if(!con.isClosed())
               System.out.println("Successfully connected to Oracle");


Please advise as I am stuck at this point.
Best Regards.
--
Anas Mughal


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to