struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cenk <cenk1...@yahoo.com>
Subject getConnection?
Date Tue, 28 Aug 2007 08:30:36 GMT
Hello,

I have a problem to get connection.It keeps catching exception? Any ideas?

....
 String driverClass = ResourceManager.getString("database.driver");
 String dbUrl = ResourceManager.getString("database.url");
 String dbUser = ResourceManager.getString("database.user");
 String dbPassword = ResourceManager.getString("database.password");
 try{
     Class.forName(driverClass);
     con = DriverManager.getConnection(dbUrl,dbUser,dbPassword);
 }catch(Exception exp){
     System.err.println("Could not connect to database.\n" +exp.getMessage());
 }
....

Here is the application resources.properties
#database connection properties
database.driver = COM.ibm.db2.jdbc.app.DB2Driver
database.url = jdbc:db2:YES
database.user = db2admin
database.password = db2admin


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message