Skip to content

Commit dc5158d

Browse files
committed
- Improved error message in Model.init()
git-svn-id: svn://192.168.0.80/JavaXT/javaxt-core@1254 2c7b0aa6-e0b2-3c4e-bb4a-8b65b6c465ff
1 parent f3c2b4e commit dc5158d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/javaxt/sql/Model.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,11 +779,20 @@ public static void init(Class c, ConnectionPool connectionPool) throws SQLExcept
779779
}
780780

781781

782-
//Add database metadata
782+
//Get database connection
783783
Connection conn = null;
784784
try{
785785
conn = connectionPool.getConnection();
786+
}
787+
catch(Exception e){
788+
SQLException ex = new SQLException("Failed to acquire database connection");
789+
ex.setStackTrace(e.getStackTrace());
790+
throw ex;
791+
}
792+
786793

794+
//Get database metadata
795+
try{
787796

788797
//Get reserved keywords associated with the database
789798
String[] keywords = Database.getReservedKeywords(conn);

0 commit comments

Comments
 (0)