<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-36937276</id><updated>2012-01-23T22:28:31.207Z</updated><category term='RequestFactory'/><category term='JPA'/><category term='NexusDB'/><category term='GWT'/><category term='10.1.2'/><category term='SQL'/><category term='PL/SQL'/><category term='Hibernate'/><category term='Gnome Shell Gnome3 Dialogs'/><category term='Application Express'/><category term='Oracle'/><category term='TT'/><category term='10g'/><category term='XE'/><category term='H2'/><category term='BLOBs'/><category term='OC4J'/><category term='gnome'/><category term='FF2'/><category term='New'/><category term='Gutsy'/><category term='Application Server'/><category term='delete'/><category term='Derby'/><category term='Feisty'/><category term='BRANCH_TO_PAGE_ACCEPT'/><category term='mc'/><category term='DisclosurePanel'/><category term='SSL'/><category term='Xalan'/><category term='Oracle Tricks'/><category term='Java Stored Procedures'/><category term='Oracle FAQ'/><category term='FlashFiler'/><category term='Audi'/><category term='undelete'/><category term='ext3'/><category term='IE6'/><category term='Google Web Toolkit'/><category term='PDF'/><category term='Oracle Tips'/><category term='Migration'/><category term='HSQLDB'/><category term='XML'/><category term='Apex Tips'/><category term='Migrate'/><category term='Oracle 11g'/><category term='Java'/><category term='Widgets'/><category term='DBMS_UTILITY'/><category term='Groovy'/><category term='JDBC'/><category term='Xceres'/><category term='ext2'/><category term='Apex'/><category term='servlets'/><category term='DB'/><category term='Linux'/><category term='10.1.3'/><category term='ODBC'/><category term='Ubuntu'/><category term='Databases'/><category term='JBOSS'/><title type='text'>Jack of Everything; Master of Nothing</title><subtitle type='html'>Java, JEE, Application Express, GWT, Oracle, Linux, Web Development</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-36937276.post-4273406056854413427</id><published>2012-01-23T22:28:00.000Z</published><updated>2012-01-23T22:28:31.216Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gnome Shell Gnome3 Dialogs'/><title type='text'>Gnome 3 Rant (and fix for modal dialogs)</title><content type='html'>Back in the Gnome 2 days I used to love using Linux as my main developer machine but since Ubuntu and Gnome decided to build a mobile/cell phone interface for desktop PCs its gone back to the dark old days.&lt;br /&gt;
&lt;br /&gt;
After Ubuntu switched to Unity I decided to jump ship to Linux Mint. Now Mint and most of the other big distros have gone Gnome 3, I'm left frustrated. These frustrations would be even worse if I'd chosen Fedora or SUSE as they don't offer the gnome shell extensions that make life bearable.&lt;br /&gt;
&lt;br /&gt;
All the progress that was made with Gnome 2 and Compiz just seems to have been thrown away. The compiz-effects combined with Gnome 2 made for an awesome combination that&amp;nbsp;rivalled&amp;nbsp;anything I saw in Windows 7 or Mac OSX. They also kept me productive.&amp;nbsp;Even Windows 8 will provide both a classic look and feel as well as there new Metro UI.&amp;nbsp;With the exception of KDE based distros, Mint are the only distro that are trying to provide a choice to its consumers out of the box.&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;I don't know what has gone on with Nautilus but they have succeeded in making a newer version worse than the version that came before. However, that is a rant for another day.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;Fortunately what I really like about Mint is that they know who the target market for Linux is/was: developers, administrators and tinkerers. These are the type of people who need (and can deal with) a multi-tasking OS that can open more than one window at a time.&lt;br /&gt;
&lt;br /&gt;
The new modal dialogs (a "feature" of gnome 3) have been really annoying me lately so I went on a hunt to find out how I could revert back to the traditional style of dialog. You know they type of dialog with a window bar that allows you to move it around the screen. Seriously everyone I know can deal with this concept. Let the developer choose the intent!&lt;br /&gt;
&lt;br /&gt;
The solution is simple: gconf-editor to the rescue. Just open gconf-editor and untick /desktop/gnome/shell/windows/attach_modal_dialogs. Press Alt + F2, type r and press Enter (reloads gnome shell). Now you have the normal behavior back.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-4273406056854413427?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/4273406056854413427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=4273406056854413427' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/4273406056854413427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/4273406056854413427'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2012/01/gnome-3-rant-and-fix-for-modal-dialogs.html' title='Gnome 3 Rant (and fix for modal dialogs)'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-152146084697476799</id><published>2011-06-21T10:23:00.002Z</published><updated>2011-06-21T10:29:42.129Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='JBOSS'/><category scheme='http://www.blogger.com/atom/ns#' term='GWT'/><category scheme='http://www.blogger.com/atom/ns#' term='DisclosurePanel'/><category scheme='http://www.blogger.com/atom/ns#' term='Widgets'/><category scheme='http://www.blogger.com/atom/ns#' term='IE6'/><title type='text'>GWT : DisclosurePanel Images, IE6 and SSL</title><content type='html'>I recently worked on a project where we were using standard GWT Disclosure Panels and Tree components. When the application was sitting behind SSL we found that the arrow images were not visible in IE6. What was more frustrating was that in every other browser the images displayed correctly. &lt;br /&gt;
&lt;br /&gt;
&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;a href="http://1.bp.blogspot.com/-eBks-KwveYE/TgBxmS6buHI/AAAAAAAACRM/W3rIuMSMfCg/s1600/1.JPG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" i$="true" src="http://1.bp.blogspot.com/-eBks-KwveYE/TgBxmS6buHI/AAAAAAAACRM/W3rIuMSMfCg/s1600/1.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;After a lot (and I mean a lot) of time I stumbled across the &lt;a href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/ui/ImageBundle.html"&gt;API documentation&lt;/a&gt; for image bundles which is the mechanism/technique Google have used to package up images for widgets into a composite image that help reduce calls to the server and speed up the user experience. &lt;/div&gt;In summary, the problem is that GWT makes use an activeX control to process png transparency on IE6. Internet Explorer specifies that files which require&amp;nbsp;the plugin for viewing must be cached to disk by the browser. By default the HTTP headers set by&amp;nbsp;the&amp;nbsp;GWT servlets&amp;nbsp;when the image is requested specify that the payload should not be cached. The image then&amp;nbsp;never stored to disk (cached) and the activeX control cannot process the image and display it to the page. &lt;br /&gt;
&lt;br /&gt;
The solution is actually quite simple. You need to create an additional servlet that executes when image resources are requested. This is done by setting up a servlet in the web.xml with a file filter.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java; ruler:true;"&gt;package xxxx.xxxxx.xxxxx;

public class ImageServlet extends HttpServlet {

 private boolean isIE6(final HttpServletRequest request){
  final String userAgent = ((HttpServletRequest) request).getHeader("User-Agent");
  return userAgent.contains("MSIE 6");
 }

 protected doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {

  if (isIE6(request) ){
   response.setHeader("Cache-Control", "");
   response.setHeader("Pragma", "" );

   // This should be some date in the future. Dynamically create the
   // date part of the string to be something in the future e.g.
   // sysdate + 1
   response.setHeader("Expires","Thu, 1 Jan 2013 00:00:00 ");
  }

  final String uri = request.getRequestURI();

  // Extract the icon name
  final String iconName = uri.substring(request.getContextPath().length(), uri.length() );

  // Supply the icon back to the browser
  continueProcessing(request, response, iconName);
 }

 protected void continueProcessing(final HttpServletRequest request
    , final HttpServletResponse response
    , final String iconName){

  final ServletContext context = getServletContext();
  final InputStream is  = context.getResourceAsStream(iconName);
  final OutputStream os = response.getOutputStream();
  response.setContentType("image/png");

  byte[] = new byte[8912];

  while (true){
   final int l = is.read(b);
   if (l &amp;lt; 0)
    break;
   os.write(b,0,l);
  }
 }
}
&lt;/pre&gt;The servlet itself should look something like that below : &lt;br /&gt;
&lt;pre class="brush:xml; ruler:true;"&gt;&lt;servlet&gt;
 &lt;servlet-name&gt;ImageServlet&lt;/servlet-name&gt;
 &lt;servlet-class&gt;xxxx.xxxxx.xxxxxx.ImageServlet&lt;/servlet-class&gt;
&lt;/servlet&gt;
&lt;servlet-mapping&gt;
 &lt;servlet-mapping&gt;ImageServlet&lt;/servlet-mapping&gt;
 &lt;url-pattern&gt;*.png&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
&lt;/pre&gt;&lt;br /&gt;
You then need to set up the servlet mapping in your web.xml so that all png requests get routed through this new servlet. The example could be improved by adding caching of images requested. This would also speed up load performance of your application for images that are requested more than once.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-152146084697476799?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/152146084697476799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=152146084697476799' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/152146084697476799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/152146084697476799'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2011/06/gwt-disclosurepanel-images-ie6-and-ssl.html' title='GWT : DisclosurePanel Images, IE6 and SSL'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-eBks-KwveYE/TgBxmS6buHI/AAAAAAAACRM/W3rIuMSMfCg/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-4157035467544309977</id><published>2011-06-04T01:43:00.000Z</published><updated>2011-06-04T01:43:57.907Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='RequestFactory'/><category scheme='http://www.blogger.com/atom/ns#' term='JBOSS'/><category scheme='http://www.blogger.com/atom/ns#' term='GWT'/><category scheme='http://www.blogger.com/atom/ns#' term='JPA'/><title type='text'>JBOSS, GWT and Request Factory : Unknown Entity Exception</title><content type='html'>I've been playing around with RequestFactory, GWT's data centric transport/serialization mechanism and was really struggling to set up a new project that could pull data from an existing set of database tables and I wanted to share my experiences if you decide to use an existing schema.&lt;br /&gt;
&lt;br /&gt;
The tutorial can be found over on the GWT&amp;nbsp;developer &lt;a href="http://goo.gl/TDtPO"&gt;documentation&lt;/a&gt;&amp;nbsp;and&amp;nbsp;I don't want repeat what can be found there.&lt;br /&gt;
&lt;br /&gt;
I decided to use an Oracle XE database and the world famous HR sample database, creating JPA entities for the EMPLOYEES and DEPARTMENTS tables.&lt;br /&gt;
&lt;br /&gt;
JPA/Hibernate benefits from having a version column that is updated each time the object is persisted. RequestFactory uses this to determine whether changes have happened on the entity.&lt;br /&gt;
&lt;br /&gt;
The first problem I encountered was that I kept seeing "Unknown&amp;nbsp;Entity Exception" in the server logs (JBoss-6.0.0-Final). This was eventually solved by ensuring that the employees table had a "VERSION" column of type NUMBER(38). The annotated JPA class also requires the type to be of type Integer (Use the boxed/wrapper type and not int).&lt;br /&gt;
&lt;br /&gt;
Initially I tried using Long for the "VERSION" column however that produces more errors in the logs and it was quickly evident this needs to be set to an Integer to be compatible with the @Version annotation.&lt;br /&gt;
&lt;br /&gt;
Below is my entity definition that maps to the employees table.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java; ruler:true;"&gt;@Entity
@Table(name = "EMPLOYEES", schema = "HR")
public class Employees implements Serializable {

 private static final long serialVersionUID = 1717056757381711656L;
 private static final Logger logger = Logger.getLogger(Employees.class);

 @Id
 @Column(name = "EMPLOYEE_ID")
 @NotNull
 private Long id;

 @Column(name = "VERSION")
 @Version
 private Integer version;

 @Column(name = "FIRST_NAME")
 private String firstName;

 @Column(name = "LAST_NAME")
 private String lastName;

 public Long getId() { return id; }

 public void setId(Long id) { this.id = id; }
 
 public Integer getVersion() { return version; }

 public void setVersion(Integer version) {this.version = version;&amp;nbsp;}
.....
}
&lt;/pre&gt;&lt;br /&gt;
Finally you'll need to ensure that all rows in your schema are initialized with a default version. A simple update statement solves this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java; ruler:true;"&gt;update EMPLOYEE set version = 0;
&lt;/pre&gt;&lt;br /&gt;
While trying to solve this problem google searches led me down the garden path suggesting that one checks the JPA annotated class imports javax.persistence.Entity and not org.hibernate.persistence.Entity. Other searches suggested it was a incorrect configuration when using non-container based persistence. This was also not the problem as I was using a JTA datasource. The configuration for which is below.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:xml; ruler:true;"&gt;&lt;datasources&gt;
  &lt;local-tx-datasource&gt;
    &lt;jndi-name&gt;hrDS&lt;/jndi-name&gt;
    &lt;connection-url&gt;jdbc:oracle:thin:@localhost:1521:xe&lt;/connection-url&gt;
    &lt;driver-class&gt;oracle.jdbc.driver.OracleDriver&lt;/driver-class&gt;
    &lt;user-name&gt;HR&lt;/user-name&gt;
    &lt;password&gt;password&lt;/password&gt;
    &lt;exception-sorter-class-name&gt;org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter&lt;/exception-sorter-class-name&gt;
      &lt;metadata&gt;
         &lt;type-mapping&gt;Oracle9i&lt;/type-mapping&gt;
      &lt;/metadata&gt;
  &lt;/local-tx-datasource&gt;
&lt;/datasources&gt;
&lt;/pre&gt;&lt;br /&gt;
My persistence.xml file was as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:xml; ruler:true;"&gt;&lt;persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"&gt;
    &lt;persistence-unit name="em" transaction-type="JTA"&gt;
        &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
        &lt;jta-data-source&gt;java:hrDS&lt;/jta-data-source&gt;
        &lt;properties&gt;
            &lt;property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"&gt;
            &lt;property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9iDialect"&gt;
            &lt;property name="hibernate.hbm2ddl.auto" value="validate"&gt;
            &lt;property name="hibernate.show_sql" value="true"&gt;   
        &lt;/property&gt;&lt;/property&gt;&lt;/property&gt;&lt;/property&gt;&lt;/properties&gt;
    &lt;/persistence-unit&gt;
&lt;/persistence&gt; 
&lt;/pre&gt;&lt;br /&gt;
Again hope that helps someone else out there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-4157035467544309977?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/4157035467544309977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=4157035467544309977' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/4157035467544309977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/4157035467544309977'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2011/06/jboss-gwt-and-request-factory-unknown.html' title='JBOSS, GWT and Request Factory : Unknown Entity Exception'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-237016327081727187</id><published>2011-01-24T22:29:00.001Z</published><updated>2011-01-24T22:30:24.178Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='H2'/><category scheme='http://www.blogger.com/atom/ns#' term='BLOBs'/><category scheme='http://www.blogger.com/atom/ns#' term='servlets'/><title type='text'>Accessing BLOBs and Servlets, Serving Images Stored in H2</title><content type='html'>In a previous &lt;a href="http://kristianjones.blogspot.com/2011/01/blobs-with-groovy-and-h2-and-your.html"&gt;post&lt;/a&gt; I looked at how to store images in a H2 database using groovy. The example served as nothing more than a little bit of fun. I just wondered how you'd go about doing it and wanted to explore how to get this done in groovy and H2, so wrote a script to load some images into the database.&lt;br /&gt;
&lt;br /&gt;
After this I thought well how can we make use of these from a web application. In this post I'll take a look at how to serve up images through a servlet so that we can display them in a web page. I was more interested in the perceived speed of such a technique over storing the file on the file system and I must say it actually didn't feel that slow.&lt;br /&gt;
&lt;br /&gt;
The code is as follows:&lt;br /&gt;
&lt;pre class="brush:java; ruler:true;"&gt;public class GetImage extends HttpServlet {

 private static final long serialVersionUID = -3505939293849012116L;

 protected void doGet(HttpServletRequest request, HttpServletResponse response) 
       throws ServletException, IOException {

  String beerId = com.google.common.base.Preconditions.checkNotNull(request.getParameter("id"));

  InitialContext ctx;
  DataSource ds = null;
  Connection connection = null;
  PreparedStatement stmt = null;

  try {
   ctx = new InitialContext();
   ds = (DataSource) ctx.lookup("java:/beerDS");
   connection = ds.getConnection();

   String sql = "select image1, image1_content_type " +
     "from beer where id = ? and rownum() = 1";

   stmt = connection.prepareStatement(sql);

   stmt.setInt(1, Integer.valueOf(beerId));
   stmt.execute();

   ResultSet rs = stmt.getResultSet();

   while (rs.next()) {
    byte[] bytes = rs.getBytes("image1");
    String contentType = rs.getString("image1_content_type");
    int length = bytes.length;
    response.setContentType(contentType);
    response.setContentLength(length);
    response.getOutputStream().write(bytes);
   }
   response.getOutputStream().flush();
   response.getOutputStream().close();

  } catch (NamingException e) {
   e.printStackTrace();
  } catch (SQLException e) {
   e.printStackTrace();
  } catch (NullPointerException npe) {
   return;
  } finally {

   if (connection != null)
    try {
     connection.close();
    } catch (SQLException e) {
     e.printStackTrace();
    }
   if (stmt != null)
    try {
     stmt.close();
    } catch (SQLException e) {
     e.printStackTrace();
    }
  }
 }
}

&lt;/pre&gt;&lt;br /&gt;
A few things to note include:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;You can't write multiple images to the response, not if you wan't something that can be understood by a browser. You refer to the servlet like any other file when using the url html or dynamic content. To access the image in a html page you would use a standard img tag as follows, like in the following example :&lt;br /&gt;
&lt;/li&gt;
&lt;pre class="brush: html; ruler: true;"&gt;&lt;img src="http://localhost:8080/SERVLETS_JSP_examples/my/getImage?id=22" /&gt;
&lt;/pre&gt;&lt;li&gt;For the link to work, you'll need an entry in your web.xml (or Guice server module configuration - which is a really kool way to get rid of web.xml entirely) that ensures theres a mapping between "/my/*" url pattern and the GetImage servlet.&lt;/li&gt;
&lt;li&gt;The underlying example uses my beer database configured as a data source as described in a &lt;a href="http://kristianjones.blogspot.com/2011/01/configuring-h2-data-source-in-jboss-6.html"&gt;this post&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;You'll need to ensure there is a blob in the database for the beer with ID 22 in the beer table. See my &lt;a href="http://kristianjones.blogspot.com/2011/01/blobs-with-groovy-and-h2-and-your.html"&gt;groovy script example&lt;/a&gt; that looks at how to get images into the database.&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-237016327081727187?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/237016327081727187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=237016327081727187' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/237016327081727187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/237016327081727187'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2011/01/accessing-blobs-with-servlets-and.html' title='Accessing BLOBs and Servlets, Serving Images Stored in H2'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-2640041433018784726</id><published>2011-01-23T19:05:00.005Z</published><updated>2011-01-23T20:18:40.608Z</updated><title type='text'>Configuring a H2 Data Source in JBOSS 6</title><content type='html'>&lt;p&gt;In this post I'll look at setting up a data source for JBOSS so that you can use a JNDI lookup to connect to your database from your web application. It's really easy and takes no time at all. JBOSS includes some example datasource configurations under JBOSS_HOME/docs/examples/jca that you can copy and edit for your own purposes. &lt;/p&gt;&lt;p&gt;I copied the hsqldb-ds.xml to my server profile under JBOSS_HOME/server/all/deploy and edited it as follows :&lt;/p&gt;&lt;pre class="brush:xml; ruler:true;"&gt;&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;datasources&gt;
   &lt;local-tx-datasource&gt;
      &lt;jndi-name&gt;beerDS&lt;/jndi-name&gt;
      &lt;connection-url&gt;jdbc:h2:tcp://localhost/~/BEER&lt;/connection-url&gt;

      &lt;driver-class&gt;org.h2.jdbcx.JdbcDataSource&lt;/driver-class&gt;
      &lt;user-name&gt;sa&lt;/user-name&gt;
      &lt;password&gt;&lt;/password&gt;

      &lt;!-- The minimum/max connections in a pool/sub-pool. --&gt;
      &lt;min-pool-size&gt;5&lt;/min-pool-size&gt;
      &lt;max-pool-size&gt;20&lt;/max-pool-size&gt;

      &lt;idle-timeout-minutes&gt;0&lt;/idle-timeout-minutes&gt;
      &lt;prepared-statement-cache-size&gt;32&lt;/prepared-statement-cache-size&gt;

   &lt;/local-tx-datasource&gt;
&lt;/datasources&gt;
&lt;/pre&gt;&lt;br /&gt;
H2 is compatible with the HSQLDB drivers but they recommend using the H2 driver so thats the first thing I changed.&lt;br /&gt;
&lt;pre class="brush:xml ; ruler:true"&gt;&lt;driver-class&gt;org.h2.jdbcx.JdbcDataSource&lt;/driver-class&gt;
&lt;/pre&gt;I then changed the connection url and specified my database, “BEER” in this case.&lt;br /&gt;
&lt;pre class="brush:xml; ruler:true"&gt;&lt;connection-url&gt;jdbc:h2:tcp://localhost/~/BEER&lt;/connection-url&gt;
&lt;/pre&gt;The configuration shown also sets up a connection pool which should help optimise performance. &lt;br /&gt;
&lt;br /&gt;
Before you can use H2 from within your web application you need to make sure the H2*.jar is on the classpath. I copied my h2*.jar to JBOSS_HOME/common/lib. &lt;br /&gt;
&lt;br /&gt;
Ensure your database is started and use the following code to get a handle to a connection you can then work with in your servlet code:&lt;br /&gt;
&lt;pre class="brush:java; ruler:true"&gt;InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("java:/beerDS");
Connection connection = ds.getConnection();
&lt;/pre&gt;&lt;br /&gt;
You can then use the connection to query the database using sql or use JPA persistence and the JDNI name java:/beerDS.&lt;br /&gt;
&lt;br /&gt;
These examples use my &lt;a href="http://www.zaneta.co.uk/kj/beer.sql"&gt;Beer database&lt;/a&gt; I set up in the previous post. This script will allow you to get a H2 sample database up and running. See my &lt;a href="http://kristianjones.blogspot.com/2011/01/blobs-with-groovy-and-h2-and-your.html"&gt;previous post &lt;/a&gt; for more details&lt;br /&gt;
&lt;a href=&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-2640041433018784726?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/2640041433018784726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=2640041433018784726' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/2640041433018784726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/2640041433018784726'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2011/01/configuring-h2-data-source-in-jboss-6.html' title='Configuring a H2 Data Source in JBOSS 6'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-5588290792443062049</id><published>2011-01-23T00:58:00.009Z</published><updated>2011-01-23T19:05:20.117Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='H2'/><category scheme='http://www.blogger.com/atom/ns#' term='Databases'/><category scheme='http://www.blogger.com/atom/ns#' term='HSQLDB'/><category scheme='http://www.blogger.com/atom/ns#' term='Groovy'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>BLOBS with Groovy and H2 [or your database of choice – Oracle, MySQL]</title><content type='html'>&lt;p&gt;I am slowly building a couple of environments and set of applications that will allow me to explore techniques, design patterns (as-well as re-learn those forgotten ones) and test drive shiny new technologies like GWT and Grails. More of a reference set for myself than anything else.&lt;/p&gt;&lt;p&gt;As part of this I've needed to set up a database and application server. I decided on H2 as I feel it might be useful for some other pet projects I have in mind. I grabbed a free dataset from &lt;a href="http://www.freebase.com"&gt;www.freebase.com&lt;/a&gt; who provide open source data-sets. I massaged the structure and normalised it into a couple of tables and added the appropriate primary keys. I chose a dataset that most people could relate to, beer.&lt;/p&gt;&lt;p&gt;Just for fun I thought I would try storing logo's against a given beer inside the database to keep everything self contained and to see how H2 performed. &lt;/p&gt;&lt;p&gt;Having dipped in and out of groovy and taking time to learn the rudimentary basics I haven't found much of an opportunity to use it and it seemed a nice fit for &lt;br /&gt;
this as I can imagine it is something you might want to script.&lt;/p&gt;The code is as follows :&lt;br /&gt;
&lt;pre class="brush: groovy; toolbar:true;"&gt;import groovy.sql.Sql

println "---- A working test of writing a blob into a H2 DB ----";

sql = Sql.newInstance("jdbc:h2:tcp://localhost/~/BEER;MAX_LENGTH_INPLACE_LOB=4096;COMPRESS_LOB=LZF ", "sa","", "org.h2.Driver" );

try {
 File f = new File("/tmp/stella.jpg");
 InputStream fis = new FileInputStream(f);

 def image_type = "image/jpeg";
 def updateStatement = "update beer set image1 = ? , image1_content_type = ? where id = ? ";
 def ps = sql.connection.prepareStatement(updateStatement);
 
// Set the BLOB with the FileInputStream
 ps.setBinaryStream(1, fis, (int)f.length());
 ps.setObject(2, image_type);
 ps.setObject(3, "22")  // Pilsner - 926, Stella - 22
 ps.execute()

 sql.commit()
} catch (Exception e) {
 println "Failed: $e"
 sql.rollback()
} finally {
 sql.connection.close()
}
println("finished");

&lt;/pre&gt;&lt;br /&gt;
The uploaded file has some extra comments explaining whats happening but there is a few things to note:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;You can swap the jdbc url and h2 driver for those of your own database&lt;/li&gt;
&lt;li&gt;You need to ensure the jdbc url is correct&lt;/li&gt;
&lt;li&gt;The jdbc drivers must be on the class path&lt;/li&gt;
&lt;li&gt;The jdbc url here specifies the H2 optimisations for working with LOBs&lt;/li&gt;
&lt;li&gt;It is a good idea to store the mime-type in case we decide to serve this up over the web later.&lt;/li&gt;
&lt;li&gt;You'll need a copy of my database for this to work &lt;a href="http://www.zaneta.co.uk/kj/beer.sql"&gt;beer db&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
The sql script was a direct export of my database so you should just be able to run it from the standard web interface that comes with H2 when you start it. You can start H2 by double clicking on the H2*.jar if you have jars associated with the Java 6 runtime. &lt;br /&gt;
&lt;br /&gt;
To run it should be as simple as : &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: bash; toolbar:true;"&gt;$ groovy -cp "/path/to/h2-XXXXX.jar" write-blob.groovy
&lt;/pre&gt;&lt;br /&gt;
&lt;strong&gt;Files&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt; &lt;a href="http://www.zaneta.co.uk/kj/beer.sql"&gt;beer.sql&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.zaneta.co.uk/kj/write-blob.groovy"&gt;write-blob.groovy&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-5588290792443062049?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/5588290792443062049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=5588290792443062049' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/5588290792443062049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/5588290792443062049'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2011/01/blobs-with-groovy-and-h2-and-your.html' title='BLOBS with Groovy and H2 [or your database of choice – Oracle, MySQL]'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-6605845626834504165</id><published>2011-01-22T23:53:00.001Z</published><updated>2011-01-22T23:53:21.174Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='H2'/><category scheme='http://www.blogger.com/atom/ns#' term='Databases'/><title type='text'>Java Databases</title><content type='html'>I've been playing around with some database engines based purely on Java recently (H2, HSQLDB and Apache Derby) and I've been pleasantly surprised. The one I'd like to concentrate on here is &lt;a href="http://www.h2database.com/"&gt;H2&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
It lists an impressive set of features especially compared to other databases. There is also a more &lt;a href="http://www.h2database.com/html/features.html#comparison"&gt;detailed comparison&lt;/a&gt; on the H2 website &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_4_8wS9HY_bI/TTttyOnvwbI/AAAAAAAACQg/VfCfikyy5Og/s1600/dbs.jpeg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="130" width="320" src="http://1.bp.blogspot.com/_4_8wS9HY_bI/TTttyOnvwbI/AAAAAAAACQg/VfCfikyy5Og/s320/dbs.jpeg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
However what I most like is its size. The whole distribution is less than 1.2 MB and that includes a reasonably sophisticated web front end for running queries and inspecting the databases. Its also seems incredibly fast (considering its written in Java) and especially so when compared to Derby though I only have anecdotal evidence for this from my experience building a couple of sample projects.&lt;br /&gt;
&lt;br /&gt;
If you haven't tried it already, I really recommend giving it a go as its incredibly easy to get applications up and running with especially in Java.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-6605845626834504165?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/6605845626834504165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=6605845626834504165' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/6605845626834504165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/6605845626834504165'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2011/01/java-databases.html' title='Java Databases'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_4_8wS9HY_bI/TTttyOnvwbI/AAAAAAAACQg/VfCfikyy5Og/s72-c/dbs.jpeg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-8358683391162271622</id><published>2011-01-13T21:47:00.017Z</published><updated>2011-01-13T22:59:02.003Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Derby'/><category scheme='http://www.blogger.com/atom/ns#' term='GWT'/><category scheme='http://www.blogger.com/atom/ns#' term='Google Web Toolkit'/><category scheme='http://www.blogger.com/atom/ns#' term='Hibernate'/><category scheme='http://www.blogger.com/atom/ns#' term='JPA'/><title type='text'>GWT and JRE managed persistence (JPA) with Apache Derby</title><content type='html'>A while back I was playing with JPA/EJB3 persistence and GWT (Google Web Toolkit) but didn't want to use a heavy weight Application Server . The idea behind the application I was looking at was that it should be distributable and always run locally.&lt;br /&gt;
&lt;br /&gt;
I downloaded the hibernate and JPA annotations from the hibernate website and thought it would be a simple case of configuring the persistence.xml file. After a some difficulties getting my application to hit the test Derby database I turned to google and it seems others had problems too.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_4_8wS9HY_bI/TS9x0Uopf9I/AAAAAAAACQc/j-GpiO1fSHE/s1600/Persistence-xml.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_4_8wS9HY_bI/TS9x0Uopf9I/AAAAAAAACQc/j-GpiO1fSHE/s1600/Persistence-xml.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
I was expecting to have to create the persistence.xml file under “war/META-INF/” in my eclipse project. This is just wrong, it seems the persistence.xml file has to be on the classpath when your not using container based persistence.&lt;br /&gt;
&lt;br /&gt;
The next problem I encountered was that I'd not included all the necessary jars from the hibernate distribution. The following combination seemed to work for me in the end.&lt;br /&gt;
&lt;br /&gt;
WEB-INF/lib/&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;hibernate3.jar&lt;/li&gt;
&lt;li&gt;hibernate-jpa-2.0-api.1.0.0.Final.jar&lt;/li&gt;
&lt;li&gt;javassist-3.12.0.GA.jar&lt;/li&gt;
&lt;li&gt;jta-1.1.jar&lt;/li&gt;
&lt;li&gt;slf3j-api-1.6.1.jar&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
My persistence.xml was as follows:&lt;br /&gt;
&lt;pre class="brush: xml; toolbar:true;"&gt;&amp;lt;persistence xmlns=&amp;quot;http://java.sun.com/xml/ns/persistence&amp;quot; 
xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; 
xsi:schemaLocation=&amp;quot;http://java.sun.com/xml/ns/persistence persistence_1_0.xsd&amp;quot; version=&amp;quot;1.0&amp;quot;&amp;gt;
  &amp;lt;persistence-unit name=&amp;quot;default&amp;quot; transaction-type=&amp;quot;RESOURCE_LOCAL&amp;quot;&amp;gt;
   &amp;lt;provider&amp;gt;org.hibernate.ejb.HibernatePersistence&amp;lt;/provider&amp;gt;  
  &amp;lt;properties&amp;gt;  
   &amp;lt;property name=&amp;quot;hibernate.archive.autodetection&amp;quot; value=&amp;quot;class&amp;quot; /&amp;gt;  
   &amp;lt;property name=&amp;quot;hibernate.format_sql&amp;quot; value=&amp;quot;true&amp;quot; /&amp;gt;  
   &amp;lt;property name=&amp;quot;hibernate.show_sql&amp;quot; value=&amp;quot;true&amp;quot; /&amp;gt;  
   &amp;lt;!-- &amp;lt;property name=&amp;quot;hibernate.hbm2ddl.auto&amp;quot; value=&amp;quot;create-drop&amp;quot; /&amp;gt;--&amp;gt;  
   &amp;lt;property name=&amp;quot;hibernate.connection.url&amp;quot; value=&amp;quot;jdbc:derby://localhost:1527/slicr;&amp;quot; /&amp;gt;  
   &amp;lt;property name=&amp;quot;hibernate.connection.driver_class&amp;quot; value=&amp;quot;org.apache.derby.jdbc.ClientDriver&amp;quot; /&amp;gt;  
   &amp;lt;property name=&amp;quot;hibernate.dialect&amp;quot; value=&amp;quot;org.hibernate.dialect.DerbyDialect&amp;quot; /&amp;gt;  
   &amp;lt;!-- &amp;lt;property name=&amp;quot;hibernate.connection.username&amp;quot; value=&amp;quot;user&amp;quot; /&amp;gt;  
   &amp;lt;property name=&amp;quot;hibernate.connection.password&amp;quot; value=&amp;quot;password&amp;quot; /&amp;gt; --&amp;gt;  
  &amp;lt;/properties&amp;gt;    
  &amp;lt;/persistence-unit&amp;gt;
&amp;lt;/persistence&amp;gt;

&lt;/pre&gt;&lt;br /&gt;
I was only knocking up a quick and dirty application as a learning exercise but spent a good couple of hours just trying to hit the database. Hopefully this will help others in the same situation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-8358683391162271622?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/8358683391162271622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=8358683391162271622' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/8358683391162271622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/8358683391162271622'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2011/01/gwt-and-jre-managed-persistence-jpa.html' title='GWT and JRE managed persistence (JPA) with Apache Derby'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_4_8wS9HY_bI/TS9x0Uopf9I/AAAAAAAACQc/j-GpiO1fSHE/s72-c/Persistence-xml.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-5499120750467793381</id><published>2011-01-12T20:47:00.000Z</published><updated>2011-01-12T20:47:42.921Z</updated><title type='text'>I'm back (again)</title><content type='html'>I had intentions of developing my blog back in 2006 and managed to write a few half decent articles. Well its now 2011 and I’ve decided to take up blogging again.&lt;br /&gt;
&lt;br /&gt;
My career has shifted more towards Java and OO Development and I’m no longer working so closely with Application Express but maintain an active interest in the good work the folks at Oracle are doing. My primary interest for blogging is to stop me forgetting some of that important stuff you come across when coding, hopefully someone out there will find this stuff useful too.&lt;br /&gt;
&lt;br /&gt;
I’m currently playing with GWT, JBoss, Groovy, Grails and all things open source with a little Oracle and Weblogic thrown in there for good measure so hopefully they’ll be more to come from me on those technologies.&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-5499120750467793381?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/5499120750467793381/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=5499120750467793381' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/5499120750467793381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/5499120750467793381'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2011/01/im-back-again.html' title='I&apos;m back (again)'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-9131598618998070057</id><published>2007-11-21T10:36:00.001Z</published><updated>2011-01-12T21:03:43.657Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Feisty'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Gutsy'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>I use Ubuntu, But Why?</title><content type='html'>&lt;h3 class="post-title"&gt;&lt;span class="Apple-style-span" style="font-size: small; font-weight: normal;"&gt;Those that know me well, will know that I am a desktop Linux advocate and that I completely moved my home desktop to Ubuntu after considering what I really need my computer to do. The list below is a pretty comprehensive list of what I want to be able to do with my computer:&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Run in a timely manner&lt;/li&gt;
&lt;li&gt;Not crash when something/anything throws a wobbly&lt;/li&gt;
&lt;li&gt;Internet Access (General Web Surfing)&lt;/li&gt;
&lt;li&gt;Internet Chat (MSN, Skype)&lt;/li&gt;
&lt;li&gt;Word Processing, Spreadsheets&lt;/li&gt;
&lt;li&gt;Storing / Editing Photos from my digital camera&lt;/li&gt;
&lt;li&gt;Printing Documents&lt;/li&gt;
&lt;li&gt;Scanning the odd document or photo&lt;/li&gt;
&lt;li&gt;Playing music (MP3s, Internet Radio)&lt;/li&gt;
&lt;li&gt;Playing Videos/DVDs&lt;/li&gt;
&lt;li&gt;Burning CDs/DVDs&lt;/li&gt;
&lt;li&gt;Simple Development &amp;amp; Editing Text Files&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
For me the switch was not about the politics of "free software vs. the almighty evil other company or proprietary software" but the fact I don't need or want a server farm to run the latest version of the software, have a bloated desktop that takes 10 minues to “load my personal settings”, have to upgrade my PC every 6 months or update my virus definitions religiously.&lt;br /&gt;
&lt;br /&gt;
I migrated to Ubuntu just after Vista was released, after hearing and having a few negative experiences with Vista on other people’s hardware. For me, moving to Vista would have meant that I would need some new hardware. My home PC has a fairly modest specification consisting of Athlon XP 2000 (1.67 GHz Processor), 1GB RAM, 64 MB RAM NVIDIA Geforce 2 Graphics card, and 2 x 250gig hard drives. I could have moved to Mac but that would have meant shelling out at least £600 on hardware (something I might still consider when my current hardware starts to feel slow).&lt;br /&gt;
&lt;br /&gt;
I’ve been using Ubuntu on my home servers since the “Badger” but never really felt that it was quite ready for my desktop, until Feisty. I took the plunge after weighing up the pros/cons and trying the live CD with my hardware. Do I regret it? Definitely not. For years I’d run Linux in a VM, now it is the other way round and I am running Windows in a VM for all those legacy applications that must use Windows.&lt;br /&gt;
&lt;br /&gt;
The first thing that hit me was how fast my system goes on such a modest specification. Put simply, every aspect of my computing needs in the list above is covered by Ubuntu. I’ve yet to encounter a task which I can’t accomplish in Ubuntu. For me the benefits include “less” worry about mal-ware, viruses and my general security, performance and the total cost of my home computing experience is much less (More Free-Software/Free-To-Use alternatives and less hardware upgrades).&lt;br /&gt;
&lt;br /&gt;
There are a few minor niggles such as driver compatibility, wireless connectivity and lack of commercial software. However, I am lucky enough to own a scanner (Packard Bell 2400), wireless card (Not sure of model, it just worked) and printers (Samsung ML-1210, Samsung ML-4550) that are ALL supported under Linux. Others might not be so lucky. The fact I am NOT a gamer also helps. The lack of commercial software refers to the unavailability of commercial software like Photoshop and Fireworks. These are pieces of software I’d be happy to pay for if they were available. Though I believe this will change over time as more and more people are starting to use Desktop specific versions of Linux such as Ubuntu. Free-to-use software such as Skype, Opera and RealPlayer are already available and have been for some time.&lt;br /&gt;
&lt;br /&gt;
The simple truth is that if Windows was as performant and secure as my Linux Desktop I would have probably stuck with Windows as it does just work with most hardware.&lt;br /&gt;
&lt;br /&gt;
My advice to anyone looking to buy a new PC would be to try Ubuntu first. You can download the live CD from the Ubuntu website and try it without installing it. Its also the first real distribution that doesn’t require extensive Linux or computing knowledge. You can install it and use it.&lt;br /&gt;
&lt;br /&gt;
Ubuntu Website -&amp;gt; http://www.ubuntulinux.org&lt;br /&gt;
Ubuntu Forums -&amp;gt; http://www.ubuntuforums.org&lt;br /&gt;
Dell computers with Ubuntu -&amp;gt; http://www.dell.com/ubuntu&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-9131598618998070057?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/9131598618998070057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=9131598618998070057' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/9131598618998070057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/9131598618998070057'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2007/11/i-use-ubuntu-but-why-httpwww.html' title='I use Ubuntu, But Why?'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-5600144440141591553</id><published>2007-11-14T11:48:00.001Z</published><updated>2011-01-12T21:05:34.582Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Application Express'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='Apex Tips'/><title type='text'>Clear Page Cache When Using Tabs &amp; Sub-tabs (new solution)</title><content type='html'>&lt;div style="margin-bottom: 0cm;"&gt;Previously I posted a solution for clearing page cache of a target page when a user clicks a sub-tab. While my solution works there is much cleaner way of achieving this involving the use of APEX_UTIL.CLEAR_PAGE_CACHE().&lt;br /&gt;
&lt;br /&gt;
Using the same scenario, consider that we need to clear the page cache of the page that we will be re-directed to, before it loads. The solution is very similar but requires no modification of the target page.&lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;&lt;br /&gt;
Firstly, create a new application page process:&lt;/div&gt;&lt;div style="margin-bottom: 0.5cm;"&gt;Navigate to Applications -&amp;gt; Shared Components -&amp;gt; Application Processes and hit “Create” in the application builder.  Create a process which runs “On Submit: After Page Submission – Before Computations and Validations”.  In Process Source type the following&lt;/div&gt;&lt;pre&gt;IF (:REQUEST = 'T_YOUR_TAB_NAME’) THEN
APEX_UTIL.CLEAR_PAGE_CACHE(your_page_number);
END IF;
&lt;/pre&gt;&lt;br /&gt;
T_YOUR_TAB_NAME can be identified from the developer mode or using firebug in Firefox on the specific tab your interested in.  That's it! Now when a user clicks on a sub-tab the target page's, page cache will be cleared before it loads. To clear the cache for another tab, just add a new block to the application process you have created.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-5600144440141591553?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/5600144440141591553/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=5600144440141591553' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/5600144440141591553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/5600144440141591553'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2007/11/clear-page-cache-when-using-tabs-sub.html' title='Clear Page Cache When Using Tabs &amp;amp; Sub-tabs (new solution)'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-7457192308981703514</id><published>2007-11-14T10:58:00.000Z</published><updated>2007-11-16T09:33:18.987Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Application Express'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='Apex'/><title type='text'></title><content type='html'>&lt;h3 class="post-title"&gt;Apex Gotchas&lt;/h3&gt;
While Apex is an intuitive easy to use development environment it can cause some frustrations and has a number of gotchas that are worth been aware of. The following are a few I've discovered over the last couple of months.    &lt;p style="margin-bottom: 0cm;"&gt;&lt;b&gt;Validations of type PL/SQL Expression without conditions&lt;/b&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm;"&gt;This little beauty caused me an hour and half worth of grief.  &lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;Set up a pl/sql validation of type pl/sql expression, give it a name but leave the condition entry blank.  &lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;When you run the page you will see “Invalid PL/SQL Expression” at the top of page before the header and rest of your page.&lt;/p&gt; &lt;p style="margin-bottom: 0cm; font-weight: bold;"&gt;POP LOV, display description return value returns “undefined”&lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;If you have a page item (Select List), which uses an LOV query, and have enabled null columns (but not specified a null value) you can typically expect the value in the session state to be “%null%” after the page has been submitted.&lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;However it appears that if you have a “Popup LOV, display description, return value” item then the null value actually gets submitted to the session state as “undefined” and not “%null%”. Although this one is easier to spot it more of an annoyance and just appears odd as it actually returns “undefined” to the display area too.&lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;&lt;b&gt;Setting Page Items in Validations, Report Regions and PL/SQL Function Body Conditions&lt;/b&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm;"&gt;Have you ever worked on a bit of functionality where you're effectively hacking it to get it to work with the good intention of re-factoring it later and make it look pretty?Well on one occasion where I had forgot to go back and re-factor a particular page I had worked on I discovered that I had set a page item within a validation.&lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;Logically thinking, I personally would not expect to see a page item set in a validation (your circumstances may be different). Apex allows you to make an assignment to a page item anywhere you can place PL/SQL blocks (E.g. report regions returning SQL Queries,  item/region conditions (I.E. function body returning boolean), LOV Queries. Generally speaking I'd expect such a function to be carried out in process. The old saying , “just because you can doesn't mean you should” comes to mind.&lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;I feel this is a good example demonstrates the need for standards and consistency when developing Apex Applications if not for your own sake then for the poor person who is going to support your application once your gone. More about good practice in a later post.&lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;I did have one more gotcha, concerning dates but can't remember the specifics, if I do I'll add it to the list, likewise if anyone has any more please feel free to add them to the comments section and I'll update the post.&lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;(The gotchas may not apply to versions of Apex greater than 2.2.1 unfortunately the project I was working on was at that particular version)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-7457192308981703514?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/7457192308981703514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=7457192308981703514' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/7457192308981703514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/7457192308981703514'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2007/11/apex-gotchas-while-apex-is-intuitive.html' title=''/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-5685040761108124999</id><published>2007-11-14T10:53:00.000Z</published><updated>2007-11-14T10:57:55.833Z</updated><title type='text'></title><content type='html'>&lt;h3 class="post-title"&gt;Ending the Silence&lt;/h3&gt;  &lt;p style="margin-bottom: 0cm;"&gt;It has been well over 3 months since my last post and I know its lame but “I just have not had the time”. &lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;Since then I’ve been coding and documenting as my long stint at my last client came to an end last week. After a hard day at the office, touching a computer is the last thing I’ve wanted to do. However my blog-topic list has got ever longer where I’ve jotted down idea but not had the time to follow them up and there has been some exciting developments on the Oracle Landscape.
&lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;So if you a regular reader, fear not, I am still alive and there will be more posts coming over the next couple of weeks.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-5685040761108124999?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/5685040761108124999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=5685040761108124999' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/5685040761108124999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/5685040761108124999'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2007/11/ending-silence-it-has-been-well-over-3.html' title=''/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-4621057421814458799</id><published>2007-07-12T10:58:00.000Z</published><updated>2007-07-12T11:40:52.010Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle 11g'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'></title><content type='html'>&lt;h3 class="post-title"&gt;Oracle 11g is here
&lt;/h3&gt;Yesterday saw the launch of Oracle 11g. Eager to get my hands on a copy I popped over to OTN but was disappointed to find that its not yet available for download. However there are a stack of white papers looking at the new features. You can access them here:
&lt;a href="http://www.oracle.com/technology/products/database/oracle11g/index.html"&gt;
http://www.oracle.com/technology/products/database/oracle11g/index.html &lt;/a&gt;

Hopefully it will be made available soon. I'm keen to try out the native binary XML support as well as further improved flash back features.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-4621057421814458799?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/4621057421814458799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=4621057421814458799' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/4621057421814458799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/4621057421814458799'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2007/07/oracle-11g-is-here-yesterday-saw-launch.html' title=''/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-231545727577264647</id><published>2007-07-06T08:26:00.000Z</published><updated>2007-11-14T11:52:46.998Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='PL/SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Application Express'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'></title><content type='html'>&lt;h3 class="post-title"&gt;Clear Page Cache When Using Tabs &amp;amp; Sub-tabs &lt;/h3&gt;Update - 14th Nov 2007 : I have posted a cleaner solution to this at &lt;a href="http://kristianjones.blogspot.com/2007/11/clear-page-cache-when-using-tabs-sub.html"&gt;http://kristianjones.blogspot.com/2007/11/clear-page-cache-when-using-tabs-sub.html&lt;/a&gt;

Most pages you create in Apex have a number of modes that govern when processes, items and regions are displayed, executed or evaluated. Typically this involves setting a hidden page item and testing your condition against that item in the “Conditional Display” pane within the developer mode.

When developing applications with tabs (and sub tabs) you’ll discover that you cant process the request value for your tab as Apex manages the branch conditions for you.

An example scenario may be where you want to clear the page cache only on new requests. One method to get round the problem is to create a hidden item on page 0 and called “P0_PAGE_NEW”

Navigate to Applications -&gt; Shared Components -&gt; Application Processes and hit “create” in the application builder.

Create a process which runs “On Submit: After Page Submission – Before Computations and Validations”.

In Process Source Type the following
&lt;pre&gt;IF (:REQUEST = 'T_YOUR_TAB_NAME’) THEN
:P0_PAGE_NEW := 'Y';
END IF;
&lt;/pre&gt;Now you can create a “On Load – Before Header” session state page process to clear the session that is conditional on :P0_PAGE_NEW being set to ‘Y’. Once you’ve cleared the page cache, just set :P0_PAGE_NEW to ‘N’ in a “On Load – Before Header” pl/sql page process which runs unconditionally with the following source:
&lt;pre&gt;
begin
:P0_PAGE_NEW := 'N';
end ;
&lt;/pre&gt;The cache should now be cleared with every new page visit.

Now imagine, you have one or more tabs which point to the same page. Ideally you would like to have each tab a cause a different action or set of items to be displayed (hypothetically). To do this you can just add to the application process you have created but instead you would set you page mode type item on the page. From there it is a simple matter of conditioning your processes, items and regions to executed or be displayed against that page mode item&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-231545727577264647?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/231545727577264647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=231545727577264647' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/231545727577264647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/231545727577264647'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2007/07/clear-page-cache-when-using-tabs-sub.html' title=''/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-2575134170442098385</id><published>2007-06-19T14:47:00.000Z</published><updated>2007-06-19T15:34:59.252Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'></title><content type='html'>&lt;h3 class="post-title"&gt;Create table as select for LOV generation&lt;/h3&gt;
If your creating Apex applications on a regular basis then sooner or later you will have made use of LOVs. Recently I needed to create an lov using the data contained within USER_TAB_COLS as a starting point.

A feature of Oracle DDL allows you to create and populate a table from a sql query. For example
&lt;pre&gt;create table test_lov_table as
    init_caps(replace(COLUMN_NAME,'_', '  ')) COLUMN_NAME
    ,CHAR_LENGTH
from user_tab_cols
where TABLE_NAME = 'my_table';
&lt;/pre&gt;

The above code only serves as an example but got me thinking whether this technique could be useful anywhere else.  Purely speculating I thought that this could be something to consider if your migrating data from older systems and need to take portions of your data model to create reference data tables for LOVs. Another purely hypothetical situation where this may speed things up is where you need to map one schema's tables, columns to another's tables and columns (through the respective user_tab_cols table) i.e for the purpose of interfacing two data models again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-2575134170442098385?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/2575134170442098385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=2575134170442098385' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/2575134170442098385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/2575134170442098385'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2007/06/create-table-as-select-for-lov.html' title=''/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-3123433246636539</id><published>2007-05-16T14:37:00.002Z</published><updated>2011-01-12T21:11:32.851Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='DB'/><category scheme='http://www.blogger.com/atom/ns#' term='Java Stored Procedures'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='10g'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Call Java Methods from ApEx</title><content type='html'>&lt;div style="margin-bottom: 0cm;"&gt;For those new to ApEx it may not be immediately obvious that it is possible to execute Java Methods from ApEx. Newbies to Oracle database programming may also be surprised to know that you can actually embed Java in the database at all! The fact that this is possible make the Oracle Database Server very powerful making almost everything possible. If you cant code it in PL/SQL then try Java, If you can't use Java then perhaps you are doing something wrong (or need to go back to basics).&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Why would you want to call Java from ApEx applications?&lt;/span&gt;  &lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;PL/SQL is great but there are occasions when you may need to perform complex processing that simply is not possible with PL/SQL, is too complex to implement or requires the use of third party APIs. One such example may be an image conversion process, which converts a GIF to a JPEG programmatically (granted I know this is possible with Oracle Intermedia).  &lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;As regular readers know I’m currently involved in a piece of work which requires various third party Java APIs which can strip out user entered data from a PDF to XML. We then process this relationally using good old pl/sql and relational views over xml. Apologies to those who thought this post might be looking at that topic, I am still writing it up and need to prepare suitable example, which can be downloaded and played with, so please bear with me.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div lang="en-GB" style="color: black; margin-bottom: 0cm;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 100%;"&gt;&lt;b&gt;Pre-requisites&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style="margin-bottom: 0cm;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span lang="en-GB"&gt;Oracle  Database with Java Support ( See &lt;a href="http://www.oracle.com/technology/products/database/oracle10g/pdf/twp_general_10gdb_product_family.pdf"&gt;Product Matrix&lt;/a&gt; )&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span lang="en-GB"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div lang="en-GB" style="margin-bottom: 0cm;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 100%;"&gt;A  DB schema with relevant schema privileges to execute Java.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div lang="en-GB" style="margin-bottom: 0cm;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 100%;"&gt;ApEx  (pretty much any version will do)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt; How do you do it?&lt;/span&gt; &lt;br /&gt;
&lt;div style="margin-bottom: 0cm;"&gt;Calling Java from the Database is a fairly trivial task typically consisting of the following 3 steps.&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div lang="en-GB" style="margin-bottom: 0cm;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 100%;"&gt;Writing  the Java Classes &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div lang="en-GB" style="margin-bottom: 0cm;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 100%;"&gt;Loading  the classes/code into a target database schema &lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div lang="en-GB" style="margin-bottom: 0cm;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 100%;"&gt;Creating  a PL/SQL Wrapper round the Java Method you wish to call.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="margin-bottom: 0cm;"&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;If you need to load pre-compiled java classes into your schema you can use a very useful tool called loadjava. You will need to use this utility if you have existing JAR files and APIs. Hopefully I’ll explore loadjava in a later post, for the moment I would like to concentrate on demonstrating a very simple example of calling a Java method from within Apex. I’m afraid that means it is a “hello world” example as it does not require any pre-compiled classes to be loaded into the database.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;&lt;span style="font-weight: bold;"&gt;Step 1. Create Java Class&lt;/span&gt;&lt;b&gt; &lt;/b&gt; &lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;The following code creates and compiles a java class called HelloWorldExample. Notice that any method you wish to call from pl/sql must be declared as static. You can copy and paste the following code into sqlplus or sqldeveloper.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;pre&gt;CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "HelloWorldExample"
AS
public class HelloWorldExample
{
HelloWorldExample hello;

public HelloWorldExample()
{
hello = new HelloWorldExample();
}
public static void sayHello(String forename, String surname
                      , String outString[])
{
outString[0] = "HELLO WORLD more specifically hello" + forename
          + " " + surname;
}
public static void main(String[] args)
{
//no method
}
};
/
show errors java source "HelloWorldExample";
/&lt;/pre&gt;You should see : &lt;br /&gt;
&lt;pre&gt;AND COMPILE Compiled.
No Errors.&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;div style="margin-bottom: 0cm;"&gt;&lt;b&gt;Step 2: Create a pl/sql call spec/wrapper&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;In order to use your Java method from Apex or PL/SQL you must create a pl/sql call specification wrapper round each Java method you wish to run from PL/SQL.  &lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;&lt;br /&gt;
Again copy and past the following code into sqlplus/sqldeveloper: &lt;/div&gt;&lt;pre&gt;CREATE OR REPLACE PROCEDURE HELLO_WORLD(p1_forename in VARCHAR2
, p2_surname in varchar2, p3_outString out varchar2)
AUTHID CURRENT_USER AS LANGUAGE
JAVA NAME  'HelloWorldExample.sayHello(java.lang.String
, java.lang.String , java.lang.String[])';
/
show err;
/
&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;b&gt;Step 3: Execute to test&lt;/b&gt; &lt;br /&gt;
&lt;div style="margin-bottom: 0cm;"&gt;Executing this Hello World example is as easy as declaring an anonymous block and calling the method from within within. For example: &lt;/div&gt;&lt;pre&gt;declare
p_forename varchar2(4000) := 'KRISTIAN';
p_surname  varchar2(4000) := 'JONES';
p_msg      varchar2(4000) := null;
begin
hello_world(p_forename, p_surname, p_msg);
dbms_output.put_line(p_msg);
end;
&lt;/pre&gt;&lt;br /&gt;
Again if completed correctly you will see : &lt;br /&gt;
&lt;pre&gt;Anonymous block completed
HELLO WORLD more specifically hello KRISTIAN JONES&lt;/pre&gt;Hopefully this has served as a gentle introduction into embedding Java classes in the database. You can call this from procedure from ApEx page as a pl/sql process just substitute in your page items. If anyone has any queries please leave a comment. I'll do my best to reply.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-3123433246636539?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/3123433246636539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=3123433246636539' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/3123433246636539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/3123433246636539'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2007/05/call-java-methods-from-apex-for-those.html' title='Call Java Methods from ApEx'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-1312498420925292911</id><published>2007-05-02T15:53:00.000Z</published><updated>2007-05-02T16:30:40.517Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='BRANCH_TO_PAGE_ACCEPT'/><category scheme='http://www.blogger.com/atom/ns#' term='Application Express'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='Apex'/><title type='text'></title><content type='html'>&lt;h3 class="post-title"&gt;ApEx - BRANCH_TO_PAGE_ACCEPT&lt;/h3&gt;A colleague who also works for Oracle Consulting has recently blogged&lt;a href="http://atulley.wordpress.com/2007/04/30/branch_to_page_accept/"&gt;&lt;/a&gt; about a very useful and not so well known feature of ApEx. BRANCH_TO_PAGE_ACCEPT is a special type of request value which basically allows you to branch to a page, passing in a page item value, skip the page rendering and goes straight to page processing.

Effectively this feature allows you to submit a page with a number of page item values to another page (where the processing functions are located) without the user actually visiting the page through interaction.

The post can be found here: &lt;a href="http://atulley.wordpress.com/2007/04/30/branch_to_page_accept/"&gt;http://atulley.wordpress.com/2007/04/30/branch_to_page_accept/&lt;/a&gt;

Although I can think of a number of potential uses for this I don't want to steal Andy's thunder. So I suggest you check his blog from time to time, he has some excellent stuff on there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-1312498420925292911?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/1312498420925292911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=1312498420925292911' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/1312498420925292911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/1312498420925292911'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2007/05/apex-branchtopageaccept-colleague-who.html' title=''/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-3439167788284738894</id><published>2007-04-27T08:44:00.000Z</published><updated>2007-05-02T13:25:37.838Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle FAQ'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Tips'/><title type='text'></title><content type='html'>&lt;h3 class="post-title"&gt;Oracle FAQs&lt;/h3&gt;
After recently reading a &lt;a href="http://tkyte.blogspot.com/2007/04/how-not-to-ask-20-questions.html"&gt;post&lt;/a&gt; on Tom Kyte's blog I stumbled across an excellent resource which is quoted by another fellow reader of Tom's blog. The &lt;a href="http://www.jlcomp.demon.co.uk/faq/ind_faq.html"&gt;Oracle Co-operative FAQ &lt;/a&gt;was set-up by &lt;a href="http://www.jlcomp.demon.co.uk/index.html"&gt;Jonathan Lewis&lt;/a&gt; and is an excellent resource for anyone who uses the Oracle Database on a daily basis as a developer, tuner or DBA.

I have heard people claim that the Oracle Database is bloated. My standard response is normally, "What you mean to say is that it has features you have not used or don't know how to use". Taking the time to scan the FAQ index may well enlighten you on a few extra features/techniques you can add to your portfolio making you more proficient. It's certainly worth a look.

Enjoy
Kris&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-3439167788284738894?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/3439167788284738894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=3439167788284738894' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/3439167788284738894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/3439167788284738894'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2007/04/oracle-faqs-after-recently-post-on-tom.html' title=''/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-2116558244799260208</id><published>2007-04-26T11:40:00.001Z</published><updated>2007-04-26T11:57:53.421Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='DBMS_UTILITY'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'></title><content type='html'>&lt;h3 class="post-title"&gt;DBMS_UTILITY.FORMAT_ERROR_BACKTRACE&lt;/h3&gt;
&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;I would hate to think of the number of times I have been faced with an "ORA-01403 - No Data Found" or a "ORA-06502: PL/SQL: numeric or value error: character to number conversion" error and not known where its come from.

In Java/C# you can simply make a call to the printStackTrace() method.In comparison I have always found debugging pl/sql a bit of a black art. I've known of DBMS_UTILITY.FORMAT_ERROR_BACKTRACE for some time but forgot of its existence until recently where I was faced with an exception raise in a pl/sql package but couldn't locate where error originated from.

Example usage is as follows:
&lt;pre&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;When Others Then&lt;/span&gt;
          p_msg_id := 0001;
          p_msg_type := 'E';
          p_msg_text :=
              &lt;span style="color: rgb(153, 51, 153);"&gt;To_char&lt;/span&gt; (&lt;span style="color: rgb(153, 51, 153);"&gt;Substr &lt;/span&gt;(&lt;span style="color: rgb(153, 51, 153);"&gt;Sqlcode&lt;/span&gt;, 1, 20)) ||
              ' : ' || &lt;span style="color: rgb(153, 51, 153);"&gt;Substr &lt;/span&gt;(&lt;span style="color: rgb(153, 51, 153);"&gt;Sqlerrm&lt;/span&gt;, 1, 200) ||
              DBMS_UTILITY.FORMAT_ERROR_BACKTRACE;
&lt;/pre&gt;Steven Feuerstein has a very nice article published on OTN and in Oracle Magazine (March/April 05). It can be found at &lt;a href="http://www.oracle.com/technology/oramag/oracle/05-mar/o25plsql.html"&gt;http://www.oracle.com/technology/oramag/oracle/05-mar/o25plsql.html&lt;/a&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-2116558244799260208?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/2116558244799260208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=2116558244799260208' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/2116558244799260208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/2116558244799260208'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2007/04/i-would-hate-to-think-of-number-of.html' title=''/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-638242027709277098</id><published>2007-03-14T15:38:00.001Z</published><updated>2007-05-18T17:26:32.300Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='PDF'/><category scheme='http://www.blogger.com/atom/ns#' term='OC4J'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Xceres'/><category scheme='http://www.blogger.com/atom/ns#' term='10g'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><category scheme='http://www.blogger.com/atom/ns#' term='Xalan'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'></title><content type='html'>&lt;h3 class="post-title"&gt;OC4J or Java Stored Procedures&lt;/h3&gt;Some weeks ago I alluded that I would post a follow up to my Java Dilemma once I was back on site.
&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
During this time I have been studiously working on a solution which allows a user to complete a computerized pdf form and submit it the server where a neat bit of code strips out all the user responses from a pdf form as XML. This in turn is then transformed to make it more useful to the system as a whole and stored in relational tables.

This process is a legacy requirement which compliments a new online, web-based, data input system written entirely in Oracle Apex. Ideally it would be nice to stipulate that all users complete the form via the web-based front-end. Unfortunately not all the users have access to the system but still need to get their information into the system easily, hence the need for an offline form.

The architecture employed is a typical Oracle Stack utilizing DB 10gR2, Apex 2.2, and AS/OC4J 10.1.2 with SSO. Architecturally we decided that it would be best to put all the Java Processing in a container on the web tier and write some custom JSPs to handle form upload, user response extraction and xml insertion into the database. As shown in &lt;a href="http://bp2.blogger.com/_4_8wS9HY_bI/RgOjZroHHTI/AAAAAAAAAAg/ONQrIFhTkOM/s1600-h/Slide2.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;Figure 1&lt;/a&gt;.

&lt;a href="http://bp2.blogger.com/_4_8wS9HY_bI/RgOjZroHHTI/AAAAAAAAAAg/ONQrIFhTkOM/s1600-h/Slide2.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img id="BLOGGER_PHOTO_ID_5045055669188107570" alt="" src="http://bp2.blogger.com/_4_8wS9HY_bI/RgOjZroHHTI/AAAAAAAAAAg/ONQrIFhTkOM/s400/Slide2.JPG" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" border="0" /&gt;Figure 1:&lt;/a&gt;

The solution makes use of the Adobe XML/PDF Access API for Java or &lt;a href="http://www.adobe.com/devnet/livecycle/downloads/xpaaj.html"&gt;XPAAJ&lt;/a&gt; for short. Without the XPAAJ APIs this functionality would not be possible (easily). Unfortunately XPAAJ requires the Apache Xcerses and Xalan XML parser APIs. A suspected bug with Application Server 10.1.2 forces the use of the Oracle XML parsers as default and the Container class-path cannot be changed easily (in a supported manner).

In Application Server 10.1.3 there is a very nice and easy way to accomplish this in a supported manner. This process is outlined on &lt;a href="http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html"&gt;otn&lt;/a&gt;.

AS/OC4J 10.1.3 was not an option for us and it meant we had to go back to the drawing board and use Java Stored Procedures. This approach is shown in &lt;a href="http://bp0.blogger.com/_4_8wS9HY_bI/RgOkzLoHHUI/AAAAAAAAAAo/h_dB4MrI-dE/s1600-h/Slide1.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;Figure 2&lt;/a&gt;. However, this has given a very clear advantage. The Java procedures can be very easily used from within ApEx. This removes the need for writing tedious JSPs to manage the file upload process and instead allows facilitates the use of a simple ApEx file browser page item. With a pl/sql wrapper round the Java, the functionality is exposed seamlessly to the ApEx page just like any other pl/sql procedure. As the rest of the application we are writing is in Apex this keeps things very simple indeed.

&lt;a href="http://bp0.blogger.com/_4_8wS9HY_bI/RgOkzLoHHUI/AAAAAAAAAAo/h_dB4MrI-dE/s1600-h/Slide1.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img id="BLOGGER_PHOTO_ID_5045057206786399554" alt="" src="http://bp0.blogger.com/_4_8wS9HY_bI/RgOkzLoHHUI/AAAAAAAAAAo/h_dB4MrI-dE/s400/Slide1.JPG" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" border="0" /&gt;Figure 2:&lt;/a&gt;

I'll be writing a simple how to which does a complete walk through once I have the time. Otherwise I hope some of the difficulties I've experienced with 10.1.2 will save someone some time.

&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-638242027709277098?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/638242027709277098/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=638242027709277098' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/638242027709277098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/638242027709277098'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2007/03/oc4j-or-java-stored-procedures.html' title=''/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_4_8wS9HY_bI/RgOjZroHHTI/AAAAAAAAAAg/ONQrIFhTkOM/s72-c/Slide2.JPG' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-8439691435852335177</id><published>2007-02-02T15:04:00.001Z</published><updated>2007-03-23T10:24:05.193Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='delete'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='undelete'/><category scheme='http://www.blogger.com/atom/ns#' term='mc'/><category scheme='http://www.blogger.com/atom/ns#' term='ext2'/><category scheme='http://www.blogger.com/atom/ns#' term='gnome'/><category scheme='http://www.blogger.com/atom/ns#' term='ext3'/><title type='text'></title><content type='html'>&lt;h3 class="post-title"&gt;Un-deleting Files on Linux&lt;/h3&gt;
&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Ever deleted a file from a terminal session in linux and wished you hadn't. Yeah, its happened to me too.

Good news, if your using ext2, or ext3 as your file system and you set your system up properly. I.E you created separate partitions for each mount point, e.g. /, /home, /opt etc. You need to just unmount the volume where the file was located e.g. /home and use Midnight Commander (mc) to get your file back. mc comes standard with most distributions but if it doesn't go to &lt;a href='http://www.gnome.org/mc/' set='yes' style='color: brown;'&gt;http://www.gnome.org/mc/&lt;/a&gt; and grab a copy.

First unmount the volume

eg.
&lt;pre class='mission'&gt;umount /dev/sdd1&lt;/pre&gt;&lt;p align='justify'&gt;&lt;span class='mission'&gt;Inside mc, type: &lt;/span&gt;
&lt;/p&gt;&lt;div align='justify'&gt;&lt;pre class='mission'&gt;cd undel:/dev/sdd1&lt;/pre&gt;                                          &lt;span class='mission'&gt;You can't do this anywhere else but mc. Using the "cd" command in mc normally does what it would at a shell prompt; it changes directories. This special syntax instructs mc to display all the undeleted files on that partition instead of the files in a directory. &lt;/span&gt;&lt;/div&gt;
Wait a moment while it searches through that ext2 filesystem for delete inodes (an inode holds the _contents_ of a file, but not the directory name, etc.). In a minute or so, you'll see a list of files with  names like "23434632:2" in that window. The dates and times for the entries are the dates and times when that inode was deleted. I find it most&lt;span class='mission'&gt; useful to sort this window according to time: &lt;/span&gt;
&lt;div align='justify'&gt;&lt;pre class='mission'&gt;[F9], r, s, m, [Enter]&lt;/pre&gt;
&lt;span class='mission'&gt;or &lt;/span&gt;
&lt;pre class='mission'&gt;[F9], l, s, m, [Enter]&lt;/pre&gt;
&lt;/div&gt;You can use the [F3] "View" feature to look at the contents of the inode. Press on top of the files that have times around the time you think you deleted the file(s). This tags them to be undeleted in a moment. 
&lt;span class='mission'&gt; In the other window (use  [tab] to switch windows in mc), make an empty directory under /tmp, such as /tmp/deletedfiles. &lt;/span&gt;
&lt;div align='justify'&gt;&lt;pre class='mission'&gt;mkdir /tmp/deletedfiles
&lt;/pre&gt;&lt;span class='mission'&gt;Now switch back to your undel window and press [F5] to copy those files to your real filesystem. If you're done, you can leave mc with the key - see the legend at the bottom of the screen. &lt;/span&gt;&lt;/div&gt;&lt;p align='justify'&gt;&lt;span class='mission'&gt;This would also be a good time to remount the /home partition with&lt;/span&gt;

&lt;/p&gt;&lt;div align='justify'&gt;&lt;pre class='mission'&gt;mount /home
&lt;/pre&gt;&lt;/div&gt;&lt;span class='mission'&gt;At this point you'll probably want to look at each one and decide what the real name should be. Recovered files should now show in /tmp/deletedfiles. Interact with these as you would any other file. 

Adapted from an article found &lt;a href='http://www.ists.dartmouth.edu/classroom/file-recovery.v0.81.php'&gt;here&lt;/a&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-8439691435852335177?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/8439691435852335177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=8439691435852335177' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/8439691435852335177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/8439691435852335177'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2007/02/undeleting-files-in-linux.html' title=''/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-8544073384742465218</id><published>2007-01-20T16:01:00.000Z</published><updated>2007-05-18T08:27:34.653Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='10.1.2'/><category scheme='http://www.blogger.com/atom/ns#' term='XE'/><category scheme='http://www.blogger.com/atom/ns#' term='10g'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='10.1.3'/><category scheme='http://www.blogger.com/atom/ns#' term='Application Server'/><title type='text'></title><content type='html'>&lt;h3 class="post-title"&gt;Java on top of vs Java inside Oracle&lt;/h3&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;Since finishing my last project I have had some time on the 'bench', giving me the perfect opportunity to get some training in and up to speed for my next project, again with the same client (I must be doing something right). The project is going to predominately involve Database 10g, Apps Server 10g, Java and ApEx.

As I mentioned in a previous post my development environment of choice at the moment is Oracle XE, due to its small memory footprint (comparatively). It provides most the features I've needed for projects I've worked on thus far. Furthermore, the prospect of installing 10g Enterprise is a task that doesn't sit too well, as I've known it to be a bit of a mission in the past.

Unfortunately as I have become more experienced, I've discovered that XE lacks certain features that I would sorely like to make use of in my next Project. One such feature is Java Stored Procedures.

After some digging around and &lt;a href="http://forums.oracle.com/forums/thread.jspa?messageID=1648531"&gt;posts&lt;/a&gt; on the Oracle Forums. Another user pointed me in the direction of this &lt;a href="http://www.oracle.com/technology/products/database/oracle10g/pdf/twp_general_10gdb_product_family.pdf"&gt;matrix&lt;/a&gt; which lists features available between the different versions, from XE to Enterprise.

I need to write some Java which basically manipulates a PDF form which users will fill out and upload to the system we're developing. The Java code will then strip these responses out and store them in the appropriate database fields.

Technically I can see two possible ways of accomplishing this, through:
&lt;ul&gt;&lt;li&gt;Java Stored Procedures

&lt;/li&gt;&lt;li&gt;Use of Java Containers/Extensions outside the DBMS. I.E a java app on the App Server, OC4J etc.
&lt;/li&gt;&lt;/ul&gt;However I am unsure as to which is the best way to proceed. I would like to use Java Stored Procedures, as it is a process I think will re-occur time and time again. The process will also be heavily tied to an ApEx application. This makes calling a Java Stored Procedure fairly trivial. The solution would also appear to integrate better.

I can however see some potential problems if/when the database version is upgraded. For instance will the code be compatible with the Java Environment shipped with 11g (or subsequent database versions)? At present 10g is J2EE 1.4.2 compliant but  I have no idea what version of Java 11g will comply to. At present I don't even know whether this matters.

Either way I think its time to move to a more enterprise like development environment on my laptop for when I'm on site. Without wanting to make a hash of my Windows Installation, I've opted for creating a VM instance running on Oracle Enterprise Linux.

Hopefully I'll remember to post an update on my Java dilemma and let you know which way we opt for.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-8544073384742465218?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/8544073384742465218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=8544073384742465218' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/8544073384742465218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/8544073384742465218'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2007/01/since-finishing-stint-at-mod-i-have-had.html' title=''/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-8428601109621790728</id><published>2007-01-16T13:56:00.001Z</published><updated>2007-01-16T14:02:43.556Z</updated><title type='text'>Extra leave for British workers...</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;If anyone has been watching the news lately, you'll have noticed that some of us will be gaining an extra 8 days on top of our normal holiday allowance. The government has decided that companies can't include bank holidays as part of our holiday allowance. &lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;The BBC have placed an &lt;a href='http://news.bbc.co.uk/1/hi/uk/6253051.stm'&gt;article&lt;/a&gt; on their website if any of you happened to miss the news.&lt;br&gt;&lt;/br&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-8428601109621790728?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/8428601109621790728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=8428601109621790728' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/8428601109621790728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/8428601109621790728'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2007/01/extra-leave-for-british-workers.html' title='Extra leave for British workers...'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-5846502028996543438</id><published>2007-01-15T12:20:00.001Z</published><updated>2007-01-20T16:03:34.692Z</updated><title type='text'>Securing Oracle XE and ApEx Apps</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;As some of you know, I'm fast becoming an ApEx convert and I've started to use it to knock together quick and dirty applications which make my daily work life as a consultant easier. Rather than installing a full Oracle DB instance on my laptop I've opted to install Oracle XE which comes with ApEx 2.1 and is basically a stripped down version of Oracle 10g Database. It suits my purposes and is not as resource hungry as the complete Oracle Instance. &lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;However XE is not without its problems. I knew there would be potential security risks and other considerations when developing in XE rather than a later version of ApEx and a fully patched 10g.&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;I recently discovered a fantastic security &lt;a href='http://www.red-database-security.com/wp/hacking_and_hardening_oracle_XE.pdf'&gt;article &lt;/a&gt;written by &lt;a href='http://www.red-database-security.com'&gt;red-database-security&lt;/a&gt;. The &lt;a href='http://www.red-database-security.com/wp/hacking_and_hardening_oracle_XE.pdf'&gt;article &lt;/a&gt;highlights the flaws with XE and how to overcome them and is well worth a read if your using XE for production systems.&lt;br&gt;&lt;/br&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-5846502028996543438?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/5846502028996543438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=5846502028996543438' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/5846502028996543438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/5846502028996543438'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2007/01/securing-oracle-xe-and-xe-apex-apps.html' title='Securing Oracle XE and ApEx Apps'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-3392102961528396370</id><published>2007-01-09T00:59:00.000Z</published><updated>2007-03-23T10:13:56.571Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Audi'/><category scheme='http://www.blogger.com/atom/ns#' term='TT'/><category scheme='http://www.blogger.com/atom/ns#' term='New'/><title type='text'></title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;I had the pleasure of test driving the new TT on Wednesday I don't think words can describe the fun I had in it. Put simply I'll be ordering mine at the end of the month. I can see why there is a six month waiting list though; The car was just phenomenal in every respect. It's comfortable, not too fuel hungry, turns heads and the acceleration was great. What more could you ask for. Briefly on the Acceleration the car just throws you back in to the seats and goes, and goes and goes. Even in 6th gear it flies.

Vorsprung durch Tecknik indeed!



&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_4_8wS9HY_bI/RaLrmxB70iI/AAAAAAAAAAM/o3AmbkMel4Q/s1600-h/audi_new_tt_coupe_07_06_06.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_4_8wS9HY_bI/RaLrmxB70iI/AAAAAAAAAAM/o3AmbkMel4Q/s320/audi_new_tt_coupe_07_06_06.jpg" alt="" id="BLOGGER_PHOTO_ID_5017831986073162274" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-3392102961528396370?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/3392102961528396370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=3392102961528396370' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/3392102961528396370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/3392102961528396370'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2007/01/new-audi-tt-i-had-pleasure-of-having.html' title=''/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_4_8wS9HY_bI/RaLrmxB70iI/AAAAAAAAAAM/o3AmbkMel4Q/s72-c/audi_new_tt_coupe_07_06_06.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-116643505972710016</id><published>2006-12-18T09:43:00.005Z</published><updated>2011-01-12T21:20:14.820Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='FF2'/><category scheme='http://www.blogger.com/atom/ns#' term='Migrate'/><category scheme='http://www.blogger.com/atom/ns#' term='ODBC'/><category scheme='http://www.blogger.com/atom/ns#' term='FlashFiler'/><category scheme='http://www.blogger.com/atom/ns#' term='NexusDB'/><category scheme='http://www.blogger.com/atom/ns#' term='JDBC'/><category scheme='http://www.blogger.com/atom/ns#' term='Migration'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>FlashFiler (NexusDB) to Oracle Migration</title><content type='html'>The project I'm currently working on has required me to migrate &lt;span style="color: black;"&gt;data&lt;/span&gt; contained within Flash Filer2 database files (*.FF2). Although this is an old and obscure file format, others out there may well need to migrate data stored in such files to a newer, shiner DB, like Oracle.  &lt;br /&gt;
&lt;br /&gt;
&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;div style="margin-bottom: 0cm;"&gt;We were supplied with a CD  that contained a catalogue of data but unfortunately it was in this obscure FF2 file format. There was a front end to the data on the CD but this was pretty much useless as we needed to exploit the data in the application we were developing. After identifying the file format, the question was how to actually get at the data and make use of it in the new application. The client owned the data so copyright etc wasn't an issue, but it may be for you.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;Like most databases, the flash filer database files take the form of binary file. My novel approach was to build a database instance round the files and accessing the data through a DB driver or through ODBC.&lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;This meant there were 2 problems.&lt;/div&gt;&lt;ul&gt;&lt;li&gt; Getting hold of and installing the Database engine cheaply&lt;/li&gt;
&lt;li&gt; Finding an ODBC driver for the database engine&lt;/li&gt;
&lt;/ul&gt;&lt;div style="margin-bottom: 0cm;"&gt;I sniffed failure when I discovered the company who had produced the database engine had ceased trading. After much googling, I found that the Flash Filer DB engine had been kindly placed on source forge at &lt;a href="http://sourceforge.net/projects/tpflashfilera"&gt;http://sourceforge.net/projects/tpflashfiler&lt;/a&gt; and some instructions at &lt;a href="http://www.atari-source.com/docs/turbopower/FlashFilerBasics.pdf"&gt;http://www.atari-source.com/docs/turbopower/FlashFilerBasics.pdf&lt;/a&gt;  on how to get the DB to point to the flat files so they could be accessed. If you don't read the instructions, the answer lies in creating an Alias to the directory containing the FF2 files.  &lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;Unfortunately the ffexplorer.exe supplied with the flashfiler download does not include an export function but does allow you to nicely see the the table structure. This is useful when you come to extract your data.  &lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;Again after some more goggling, I eventually found an ODBC driver at &lt;a href="http://www.nexusdb.com/downloads/FlashFilerODBC213_r001.ZIP"&gt;http://www.nexusdb.com/downloads/FlashFilerODBC213_r001.ZIP&lt;/a&gt; , which be used for free.  Although unsupported, the driver sufficed and did the job nicely (tho not very quickly).&lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;Once installed you need to set up a data source which points to your flash filer database. On NT systems go to the windows control panel (in classic view) then Administrative tools- Sources(ODBC). Click on add and select 'Nexus DB FlashFiler Driver'. Enter your connection details and give you data source a name.  &lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;&lt;a href="http://photos1.blogger.com/x/blogger/3554/4138/1600/70292/flash%20filer%20set%20up.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" src="http://photos1.blogger.com/x/blogger/3554/4138/400/49049/flash%20filer%20set%20up.jpg" style="cursor: pointer; display: block; margin: 0px auto 10px; text-align: center;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;The next problem I encountered was how to actually connect to the database over ODBC and grab the data. Without wanting to installing or write masses of Java, C# or Perl. I found the simplest way was to create some JScript that connected to the database and dumped out flat tab-separated text files. JScript is a Microsoft scripting language that has javascript like syntax. I have uploaded a generic version of the file which is located &lt;a href="http://goo.gl/mVzbX"&gt;here &lt;/a&gt;and can be adapted by yourself. To run, simply type the fully qualified path and filename in a command window.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;To get the data into Oracle you could use sqlldr or externalised tables, both use similar syntax. I used externalised tables and created a new table by doing create table as (select * from external_table).  &lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;When a you use an externalised table, the data is actually read from the text file and  and cannot take advantage of the performance features Oracle uses, hence my reason for creating a table in this way. Granted, I could have bypassed this and used sqlldr or some other scripting language. The only thing to note is that you need to create a data directory mapping in the Database which will map to the location of your csv/tsv file file.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;The files I have supplied may need to be adapted for your own use though. The JScript file was my quick and dirty solution to get a job done quickly and has no error checking. If it fails you'll get a javascript type alert saying so. All code supplied comes without warranty or guarantee.  &lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;Hope this saves someone a cool couple of hours or can find a use for this.&lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-116643505972710016?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/116643505972710016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=116643505972710016' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/116643505972710016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/116643505972710016'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2006/12/migrating-flashfiler-db-files-to.html' title='FlashFiler (NexusDB) to Oracle Migration'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-116601937270017786</id><published>2006-12-13T14:12:00.000Z</published><updated>2007-05-18T08:29:55.070Z</updated><title type='text'></title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p style="margin-bottom: 0cm;"&gt;It's been about a month since my last post and I've been busy, busy, busy. I have just got back from another trip to Prague (more on that in a later post) and my stint in Consulting Customer Services is now over and the work I did for them in APEX was very well received. Since then I've been posted to my first project outside of Oracle.
&lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;It's another project involving APEX and I'm really starting to get to grips with some of the more advanced features the product has to offer. The work I am currently involved in makes the Customer Service system I worked on seem like child's play.&lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;For those of you not familiar with APEX, the product basically sits on top of the Oracle Database  (and Oracle XE) and provides a RAD web-based development environment that allows a developer to build CRUD (Create Report Update Delete) type web applications (and more) very quickly by generating all the look and feel code itself.&lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;APEX is ideal if your primary concern is to exploit your data and concentrate on look and feel later. Custom functionality can be added by through the use of JavaScript and PL/SQL. APEX provides dozens of wizards that provide a developer with the means to create validations, sortable reports, data-entry forms, charts and security right out of the box with very little effort.&lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;When I first started developing in APEX, it seemed to be cumbersome and very difficult to do anything even remotely complex. By this I mean the built in wizards are fantastic but can be difficult to customize to your exact needs. Knowing how and where to change settings or add functionality also proved frustrating.&lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;After using APEX for a couple of months now, I am fast becoming a convert as my proficiency has vastly improved and I have started to combine the out of the box features with both the underlying APEX PL/SQL API's which are not immediately obvious from the development environment.&lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;My top tips would be to experimentation combined with quick scans of the &lt;a href="http://www.oracle.com/technology/products/database/application_express/index.html"&gt;developer documentation&lt;/a&gt; and &lt;a href="http://forums.oracle.com/forums/forum.jspa?forumID=137"&gt;forums&lt;/a&gt; if you start to get stuck. The APEX community is really gathering speed now and has vast amounts of information can be found there. Brushing up on your PL/SQL is the only other advice I can give as this is the quickest way to produce custom functionality.&lt;/p&gt;   &lt;p style="margin-bottom: 0cm;"&gt;As they say in the Czech Republic

Na shledanou!

&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-116601937270017786?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/116601937270017786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=116601937270017786' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/116601937270017786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/116601937270017786'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2006/12/dobr-denits-been-about-month-since-my.html' title=''/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36937276.post-116385886853668472</id><published>2006-11-18T14:07:00.000Z</published><updated>2006-11-18T14:07:48.536Z</updated><title type='text'></title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;Since everyone else is writing blogs these days and because I don’t want to feel like I am being left behind, I have finally taken the plunge and decided to start my very own. &lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;Well partly! I suppose my main motivation comes from wanting to keep in touch with friends and uni people and extending an arm to those people I cant find the time to email.
&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;Since this is the first entry and I originally “intended” to start blogging shortly after finishing Uni, it would only be right that the first entry contain a synopsis of my life over the last couple of months. So here it goes… &lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;After finishing uni I worked as a bar tender in my hometown of Stafford at Après, visited Prague in the Czech Republic, moved down to Reading – the UK’s very own Silicon Valley and started my proper job with Oracle as a Technology Consultant in Applications.
&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;I finished my technical boot-camp around 4 weeks ago and have since been doing my stint in Customer Services. &lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;Over the last couple of days the Customer Service team has sent me all over the country. On Wednesday I found myself at the UKOUG (UK Oracle User Group Conference) in Birmingham, on Thursday I could be found somewhere in South-Wales for a management and leadership conference and on Friday I wound up back in Birmingham for the last day of the UKOUG. Lots of traveling but all good fun nonetheless.&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;Apart from swanning around all over the place, I’ve been working on an internal system developed in Application Express/HTMLDB and will hopefully be finishing this off over the next couple of days. Unfortunately this will have to include some of my weekend as its becoming crunch time. I’ll post an entry regarding my experiences with HTMLDB as I’ve got lots to say on it. Hopefully someone will want to here it.
&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;So long and thanks for all the fish.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36937276-116385886853668472?l=kristianjones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kristianjones.blogspot.com/feeds/116385886853668472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=36937276&amp;postID=116385886853668472' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/116385886853668472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36937276/posts/default/116385886853668472'/><link rel='alternate' type='text/html' href='http://kristianjones.blogspot.com/2006/11/since-everyone-else-is-writing-blogs_18.html' title=''/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
