1 24 25 package org.objectweb.cjdbc.scenario.raidb1; 26 27 import org.objectweb.cjdbc.common.sql.metadata.MetadataContainer; 28 import org.objectweb.cjdbc.common.stream.CJDBCStream; 29 import org.objectweb.cjdbc.common.stream.encoding.Base64; 30 import org.objectweb.cjdbc.controller.backend.DatabaseBackend; 31 import org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase; 32 import org.objectweb.cjdbc.scenario.templates.Raidb1Template; 33 34 40 public class StaticMetaDataScenario extends Raidb1Template 41 { 42 public void testDisplayMetadata() throws Exception 43 { 44 45 DatabaseBackend backend = mainVdb.getAndCheckBackend("localhost", 46 VirtualDatabase.NO_CHECK_BACKEND); 47 48 long start = System.currentTimeMillis(); 49 MetadataContainer container = backend.getDatabaseStaticMetadata(); 50 long end = System.currentTimeMillis(); 51 int bytes = CJDBCStream.countBytes(container); 52 System.out.println("It took me :" + (end - start) 53 + " ms to collect the data. The object takes up:" + bytes 54 + " bytes of memory."); 55 56 String arigatou = "�り���"; 57 String result = new String (Base64 58 .decode(Base64.encode(arigatou.getBytes()))); 59 assertEquals(arigatou, result); 60 } 61 } | Popular Tags |