velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbris...@apache.org
Subject svn commit: r1799929 - /velocity/engine/trunk/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java
Date Mon, 26 Jun 2017 15:43:30 GMT
Author: cbrisson
Date: Mon Jun 26 15:43:30 2017
New Revision: 1799929

URL: http://svn.apache.org/viewvc?rev=1799929&view=rev
Log:
[engine] Allow DataSourceResourceLoader getReader() customization

Modified:
    velocity/engine/trunk/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java

Modified: velocity/engine/trunk/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java?rev=1799929&r1=1799928&r2=1799929&view=diff
==============================================================================
--- velocity/engine/trunk/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java
(original)
+++ velocity/engine/trunk/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java
Mon Jun 26 15:43:30 2017
@@ -262,7 +262,7 @@ public class DataSourceResourceLoader ex
 
             if (rs.next())
             {
-                Reader reader = rs.getCharacterStream(templateColumn);
+                Reader reader = getReader(rs, templateColumn);
                 if (reader == null)
                 {
                     throw new ResourceNotFoundException("DataSourceResourceLoader: "
@@ -526,4 +526,13 @@ public class DataSourceResourceLoader ex
         return ps.executeQuery();
     }
 
+    /**
+     * Gets a reader from a result set's column
+     */
+    protected Reader getReader(ResultSet resultSet, String column)
+        throws SQLException
+    {
+        return resultSet.getCharacterStream(column);
+    }
+
 }



Mime
View raw message