001    /**
002     * 
003     * Copyright 2005 Pawel Tucholski
004     *
005     * Licensed under the Apache License, Version 2.0 (the "License"); 
006     * you may not use this file except in compliance with the License. 
007     * You may obtain a copy of the License at 
008     * 
009     * http://www.apache.org/licenses/LICENSE-2.0
010     * 
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS, 
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
014     * See the License for the specific language governing permissions and 
015     * limitations under the License. 
016     * 
017     **/
018    package org.activemq.store.jdbc.adapter;
019    
020    import org.activemq.store.jdbc.StatementProvider;
021    
022    /**
023     * JDBC Adapter for Informix database.
024     * Because Informix database restricts length of composite primary keys, length of 
025     * <i>container name</i> field and <i>subscription id</i> field must be reducted to 150 characters.
026     * Therefore be sure not to use longer names for container name and subscription id than 150 characters. 
027     */
028    public class InformixJDBCAdapter extends BlobJDBCAdapter {
029    
030        public static StatementProvider createStatementProvider() {
031            DefaultStatementProvider answer = new DefaultStatementProvider();
032            answer.setContainerNameDataType("VARCHAR(150)");
033            answer.setSubscriptionIdDataType("VARCHAR(150)");
034            answer.setLongDataType("INT8");
035            answer.setBinaryDataType("BYTE");
036            return answer;
037        }   
038            
039            public InformixJDBCAdapter() {
040                    this(createStatementProvider());
041            }
042            
043            public InformixJDBCAdapter(StatementProvider provider) {
044                    super(provider);
045            }
046    }