@@ -0,0 +1,1386 @@
+package org.judal.examples.java.jdbc;%0D%0A%0D%0Aimport org.junit.Test;%0D%0A%0D%0Aimport java.text.SimpleDateFormat;%0D%0Aimport java.util.Date;%0D%0Aimport java.util.HashMap;%0D%0Aimport java.util.Map;%0D%0A%0D%0Aimport org.judal.examples.java.model.Course;%0D%0Aimport org.judal.storage.query.relational.RelationalQuery;%0D%0Aimport org.judal.storage.table.RecordSet;%0D%0A%0D%0Apublic class E31_ConvertToXMLJSON %7B%0D%0A%0D%0A%09@SuppressWarnings(%22unused%22)%0D%0A%09@Test%0D%0A%09public void demo() throws Exception %7B%0D%0A%09%09%0D%0A%09%09setUp();%0D%0A%0D%0A%09%09Course c = new Course();%0D%0A%09%09%0D%0A%09%09c.load(1);%0D%0A%0D%0A%09%09Map%3CString,String%3E attribs = new HashMap%3CString,String%3E();%0D%0A%09%09attribs.put(%22timestamp%22, new Date().toString());%0D%0A%09%09%0D%0A%09%09SimpleDateFormat dateFormat = new SimpleDateFormat(%22yyyy-MM-DD%22);%0D%0A%09%09%0D%0A%09%09String courseAsXML = c.toXML(%22  %22, attribs, dateFormat, null, null);%0D%0A%0D%0A%09%09try (RelationalQuery%3CCourse%3E qry = new RelationalQuery%3C%3E(Course.class)) %7B%0D%0A%09%09%09qry.setResult(%22*%22);%0D%0A%09%09%09qry.setFilter(%221=1%22);%0D%0A%09%09%09%09%09%09%0D%0A%09%09%09RecordSet%3CCourse%3E courses = qry.fetch();%0D%0A%09%09%09%0D%0A%09%09%09String coursesAsXML = courses.toXML(%22  %22, dateFormat, null, null);%0D%0A%09%09%09%0D%0A%09%09%09String coursesAsJSON = courses.toJSON();%0D%0A%09%09%7D%0D%0A%09%09%0D%0A%09%09tearDown();%0D%0A%09%7D%0D%0A%09%0D%0A%09public static void setUp() throws Exception %7B%0D%0A%09%09E10_WriteCSVDataIntoTheDatabase.setUp();%0D%0A%09%09E10_WriteCSVDataIntoTheDatabase.insertCoursesIntoDatabase();%0D%0A%09%7D%0D%0A%0D%0A%09public static void tearDown() throws Exception %7B%0D%0A%09%09E10_WriteCSVDataIntoTheDatabase.tearDown();%0D%0A%09%7D%09%0D%0A%09%0D%0A%7D%0D%0A

Add JSON and XML printers