Commits

Anonymous committed d275082

For sybase, check db product name too

git-svn-id: http://svn.opensymphony.com/svn/propertyset/trunk@147bf3cbcdd-1c1a-0410-9a68-d6f521e3fa7b

  • Participants
  • Parent commits 29edb6d

Comments (0)

Files changed (1)

File src/java/com/opensymphony/module/propertyset/database/JDBCPropertySet.java

     String globalKey;
     String tableName;
     private String driverName;
+    private String productName;
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
 
     private void setValues(PreparedStatement ps, int type, String key, Object value) throws SQLException, PropertyException {
         // Patched by Edson Richter for MS SQL Server JDBC Support!
-        if (driverName == null) {
+        if ((driverName == null) || (productName == null)) {
             try {
                 this.driverName = ps.getConnection().getMetaData().getDriverName().toUpperCase();
+                this.productName = ps.getConnection().getMetaData().getDatabaseProductName().toUpperCase();
             } catch (Exception e) {
                 this.driverName = "";
             }
 
         // Patched by Edson Richter for MS SQL Server JDBC Support!
         // Oracle support suggestion also Michael G. Slack
-        if ((this.driverName.indexOf("SQLSERVER") >= 0) || (this.driverName.indexOf("ORACLE") >= 0)) {
+        if ((this.driverName.indexOf("SQLSERVER") > -1) || (this.driverName.indexOf("ORACLE") > -1)) {
             ps.setNull(3, Types.BINARY);
-        } else if (this.driverName.indexOf("SYBASE") >= 0) {
+        } else if ((this.driverName.indexOf("SYBASE") > -1) || (this.productName.indexOf("SYBASE") > -1)) {
             ps.setNull(3, Types.VARBINARY);
         } else {
             ps.setNull(3, Types.BLOB);