1 21 22 package org.apache.derbyTesting.functionTests.tests.store; 23 24 import java.sql.*; 25 import java.io.*; 26 import java.util.*; 27 28 34 public class Beetle6038 { 35 36 public static void main(String [] args) 37 throws Exception 38 { 39 String driver = "org.apache.derby.jdbc.EmbeddedDriver"; 40 Class.forName(driver).newInstance(); 41 String dburl = "jdbc:derby:Beetle6038Db;create=true;dataEncryption=true;bootPassword=Thursday;encryptionAlgorithm=DES/CBC/NoPadding"; 42 43 Connection conn = DriverManager.getConnection(dburl); 44 conn.close(); 45 conn = DriverManager.getConnection(dburl); 46 conn.close(); 47 48 Properties serviceProperties = new Properties(); 50 String systemhome = System.getProperty("derby.system.home"); 51 File f = new File(systemhome + File.separatorChar + "Beetle6038Db" + File.separatorChar + "service.properties"); 52 serviceProperties.load(new FileInputStream(f.getCanonicalPath())); 53 54 checkProperty("data_encrypt_algorithm_version",serviceProperties); 56 checkProperty("log_encrypt_algorithm_version",serviceProperties); 57 } 58 59 public static void checkProperty(String name,Properties props) 60 { 61 String value = props.getProperty(name); 62 63 if( value == null ) 64 System.out.println("Test failed!! - "+name + " not set in service.properties as expected"); 65 else 66 System.out.println(name+"="+value); 67 } 68 69 70 } 71 | Popular Tags |