<?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-33472901</id><updated>2011-11-28T00:49:15.203+01:00</updated><category term='Java applet'/><category term='EJB'/><category term='blogger'/><category term='MySQL'/><category term='antenna'/><category term='javascript'/><category term='Java EE'/><category term='SQL Server'/><category term='MySQL quiz'/><category term='Mac'/><category term='Java ME'/><category term='.net'/><category term='XML'/><category term='gadget'/><category term='MySQL quiz answers'/><category term='Android'/><category term='Java'/><category term='BlackBerry'/><category term='Ajax'/><category term='Google'/><category term='Java Hibernate'/><title type='text'>Erik's Diary</title><subtitle type='html'>Diary for Erik Wetterberg, system developer living in Helsingborg, Sweden.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>72</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-33472901.post-3482242641003537153</id><published>2011-06-12T10:43:00.003+02:00</published><updated>2011-06-12T10:49:56.597+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>First Android app published</title><content type='html'>Yesterday I published my first Android app on Android market, &lt;a href="https://market.android.com/details?id=com.upper88.unsilence"&gt;UnSilence&lt;/a&gt;. The background is that I tend to forget to turn my cellphone back to normal after I've set it to silent during a meeting. I have missed too many calls beacuse of that...&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So UnSilence helps you be allowing you to set your phone to silent (with or without vibaration) for a period of time, and then automatically turn sound back on.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The main design goal was too keep it simple, one click to start the app, and one click to set to silent, that's all. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-3482242641003537153?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/3482242641003537153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=3482242641003537153' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3482242641003537153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3482242641003537153'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2011/06/first-android-app-published.html' title='First Android app published'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-4880219573275305359</id><published>2011-03-18T14:40:00.011+01:00</published><updated>2011-03-18T19:48:50.849+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='Java EE'/><title type='text'>Servlet http proxy</title><content type='html'>For a while I have been working on a project where we are trying to integrate a windows-based service in a Java EE environment. Basically the problem is to host an Ajax application under an application server like IBM Webspehere or Apache Tomcat. We also want to support portlets following the JSR 268 specifikation.&lt;br /&gt;&lt;br /&gt;I googled around a bit and found lots of useful stuff, but nothing that did all that we wanted. The mainly problems was with headers and cookies, since we need to keep a session to the servicein the background we need to make those work. So I ended up writing my own. Not much code, but it might be useful for someone else, as it is pretty general stuff.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The service method&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Since we want to handle all HTTP calls, we override the service method of &lt;a href="http://download.oracle.com/javaee/5/api/javax/servlet/http/HttpServlet.html"&gt;HttpServlet&lt;/a&gt;. If you want only some methods (GET and PUT for example) to work you might just override doGet and doPost for example, but we want it all.. The implementation looks like this:&lt;br /&gt;&lt;blockquote&gt;protected void service(HttpServletRequest req, HttpServletResponse resp)&lt;br /&gt;       throws ServletException, IOException {&lt;br /&gt;   String qry = req.getQueryString();&lt;br /&gt;   URL url = new URL(protocol, host, port, req.getRequestURI()&lt;br /&gt;           + (qry == null ? "" : "?" + qry));&lt;br /&gt;   HttpURLConnection urlConnection = (HttpURLConnection) url&lt;br /&gt;           .openConnection();&lt;br /&gt;   urlConnection.setDoOutput(true);&lt;br /&gt;   urlConnection.setDoInput(true);&lt;br /&gt;   urlConnection.setUseCaches(false);&lt;br /&gt;   urlConnection.setInstanceFollowRedirects(false);&lt;br /&gt;   urlConnection.setRequestMethod(req.getMethod());&lt;br /&gt;   handleRequestHeaders(req, urlConnection);&lt;br /&gt;   handlePostData(req, urlConnection);&lt;br /&gt;   // make the call - get response code&lt;br /&gt;   int responseCode = urlConnection.getResponseCode();&lt;br /&gt;&lt;br /&gt;   resp.setStatus(responseCode);&lt;br /&gt;   if (responseCode != HttpURLConnection.HTTP_OK)&lt;br /&gt;       log.info("HTTP code:" + responseCode + " "&lt;br /&gt;               + urlConnection.getResponseMessage() + " URL["&lt;br /&gt;               + url.toString() + "] " + req.getMethod());&lt;br /&gt;   else&lt;br /&gt;       log.debug("HTTP code:" + responseCode + " URL[" + url.toString()&lt;br /&gt;               + "] " + req.getMethod());&lt;br /&gt;   handleResponseHeaders(resp, urlConnection);&lt;br /&gt;   // send output to client&lt;br /&gt;   handleContent(resp, urlConnection, responseCode);&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;This is pretty straight forward. The protocol (http/https), server and port to use are configurable. We take the URI from the request and add the query string, if there is one. Together with the configure host etc, this forms the new URL, which we open, using the same method as in the call. We set some parameters, request headers and post data if there is any.&lt;br /&gt;&lt;br /&gt;We then call the URL, check the HTTP response code, and take care of the headers and the response, which all are sent to the client.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Handle headers&lt;/span&gt;&lt;br /&gt;The part that we really needed was the headers. This simply transfers the headers between the two connections, with a few exceptions:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;private void handleRequestHeaders(HttpServletRequest req,&lt;br /&gt;          HttpURLConnection urlConnection) {&lt;br /&gt;      // set request headers&lt;br /&gt;      Enumeration e = req.getHeaderNames();&lt;br /&gt;      while (e.hasMoreElements()) {&lt;br /&gt;          String key = (String) e.nextElement();&lt;br /&gt;          if (!"Host".equalsIgnoreCase(key)&lt;br /&gt;                  &amp;amp;&amp;amp; !"Accept-Encoding".equalsIgnoreCase(key)) {&lt;br /&gt;              String value = req.getHeader(key);&lt;br /&gt;              log.debug("Request Header: " + key + ": " + value);&lt;br /&gt;              urlConnection.setRequestProperty((String) key, value);&lt;br /&gt;          }&lt;br /&gt;      }&lt;br /&gt;      //add your own headers here&lt;br /&gt;  }&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;There are two headers that we dont want to transfer from the client's request to our new request:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The Host header, since this will be our proxy server. The new Host header will be added automatically, so we don't need to think about it.&lt;/li&gt;&lt;li&gt;The Accept-Encoding header. This is a fix, the Accept-Encoding header turns gzip on, and since we have not implemented gzip in our proxy we don't want it. Another alternative would be to turn gzipping of requests off in our web server, perhaps this would have been better. If we do transfer th Accept-Encoding header, both servers might zip the content, which will not work.&lt;/li&gt;&lt;/ol&gt;Finally in this method we add our own headers, which is basically the reason why we need the proxy at all.&lt;br /&gt;&lt;br /&gt;When we get the response back from the server we have the corresponding method to handle the response headers:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;private void handleResponseHeaders(HttpServletResponse resp,&lt;br /&gt;            HttpURLConnection urlConnection) {&lt;br /&gt;        // set response headers&lt;br /&gt;        Map&amp;lt;string,&amp;gt;&amp;gt; headers = urlConnection.getHeaderFields();&lt;br /&gt;        Set&amp;lt;map.entry&amp;lt;string,&amp;gt;&amp;gt;&amp;gt; entrySet = headers.entrySet();&lt;br /&gt;        for (Map.Entry&amp;lt;string,&amp;gt;&amp;gt; entry : entrySet) {&lt;br /&gt;            String key = entry.getKey();&lt;br /&gt;            List&amp;lt;string&gt;&amp;gt; headerValues = entry.getValue();&lt;br /&gt;            for (String value : headerValues) {&lt;br /&gt;                if (key != null &amp;amp;&amp;amp; !"Server".equalsIgnoreCase(key)) {&lt;br /&gt;                    log.debug("Response Header: " + key + ": " + value);&lt;br /&gt;                    resp.addHeader(key, value);&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;/blockquote&gt;&lt;br /&gt;This is basically the same as the request headers. In this case we just filter the Server header, where our proxy application server will add its own name.&lt;br /&gt;&lt;br /&gt;Finally to set it up in web.xml we configure the URLs we want the proxy to handle, set the protocol, host and port and we are ready to go.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-4880219573275305359?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/4880219573275305359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=4880219573275305359' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/4880219573275305359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/4880219573275305359'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2011/03/servlet-http-proxy.html' title='Servlet http proxy'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-6207747134240290127</id><published>2010-09-09T14:47:00.002+02:00</published><updated>2010-09-09T14:57:10.174+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='BlackBerry'/><title type='text'>NoClassDefFoundError in BlackBerry</title><content type='html'>I have been struggling a few days with a strange error in BlackBerry. My app works fine in the emulator, but when you start it on BlackBerry Bold (software version 4.5) you get a NoClassDefFoundError. On BlackBerry Storm (software version 4.6) it works fine, but on Bold2 (version 5.0) again you get NoClassDefFoundError.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://www.blackberry.com/developers/docs/4.5.0api/java/lang/NoClassDefFoundError.html"&gt;documentation &lt;/a&gt;says:&lt;br /&gt;&lt;blockquote&gt;Thrown if the Java Virtual Machine tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and no definition of the class could be found.&lt;br /&gt;&lt;br /&gt;The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found. &lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I have gone through all the changes since the last working version and I finally found it. I had added some fields like this:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;fldPortHttp = new TextField("Port:", "", 20, Field.EDITABLE | BasicEditField.FILTER_NUMERIC);&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;This worked well, with no compilation errors and in the emulator, but caused the NoClassDefFoundError at runtime. The solution was simply to change to:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;fldPortHttp = new BasicEditField("Port:", "", 20, Field.EDITABLE | BasicEditField.FILTER_NUMERIC);&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-6207747134240290127?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/6207747134240290127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=6207747134240290127' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6207747134240290127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6207747134240290127'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2010/09/noclassdeffounderror-in-blackberry.html' title='NoClassDefFoundError in BlackBerry'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-5757186003819757715</id><published>2010-09-04T06:55:00.002+02:00</published><updated>2010-09-04T07:05:44.093+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='BlackBerry'/><title type='text'>BlackBerry Java Application development</title><content type='html'>When I first started with BlackBerry development a few years ago it was difficult to find books on BlackBerry development. Since then interest has grown and today it is much easier to find good books on the subject.&lt;br /&gt;&lt;br /&gt;I have just read one of the newer, &lt;a href="http://www.amazon.co.uk/gp/product/1849690200?ie=UTF8&amp;tag=jubicse-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=1849690200"&gt;BlackBerry Java Application Development: Beginner's Guide&lt;/a&gt;&lt;img src="http://www.assoc-amazon.co.uk/e/ir?t=jubicse-21&amp;l=as2&amp;o=2&amp;a=1849690200" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt; by Bill Foust. This is a useful book, even if you, like myself, is not a Beginner. It gives you a good overivew over the BlackBerry UI, which is probably what differs most from Java ME. It also has some material on more advanced subjects, like saving data and communicating over the network, which even though it uses the same classes and calls as standard Java ME is a bit more complicated.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-5757186003819757715?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/5757186003819757715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=5757186003819757715' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/5757186003819757715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/5757186003819757715'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2010/09/blackberry-java-application-development.html' title='BlackBerry Java Application development'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-6405134935319175928</id><published>2010-05-09T16:02:00.003+02:00</published><updated>2010-05-10T19:15:27.173+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><title type='text'>The future for mobile java</title><content type='html'>The last three years or so I have worked mostly with mobile java, starting with Java ME and later moving into BlackBerr and Android. A lot of things has happened, three ears ago Android existed, but ther were hardly any phones available and BlackBerry did exist, but I knew nothing about it.&lt;br /&gt;&lt;br /&gt;Today the future of Java ME is uncertain. Programming in Java is a good option on most mobile platforms (except iPhone), but the strongest alternatives are Android and BlackBerry, not Java ME.&lt;br /&gt;&lt;br /&gt;There are of course different reasons for this. On the technical side, the User Interface options are very limited. LCDUI is very restricted, you very quickly end up with skipping the higher level API, because it is too restricted, and using the Canvas API, where you basically have to paint everything yourself. Doing input in a canvas based interface is difficult, you can react on key down and up, but the standard does not really allow you to tell if the devices even has a keyboard, or if you need to display a virtual keyboard on the screen. &lt;br /&gt;&lt;br /&gt;An even worse problem is the fragmentation of the market. Java implementations differ, and even if it is very probable that your java me code will run on most devices (if it is well written) verifying that it does is not a smal task. And if you want it too look good it is even worse.  Emulators do not help much either, verifing that something runs in the emulator does not guarantee that it will work on the device. And it is not even sure that there is an emultor for your target device.&lt;br /&gt;&lt;br /&gt;And phone manufacturers keep making new models all the time... Apple basically has one platform and offers upgrade for old versions (sometimes free of charge, sometimes at a small charge) but the competition has not learned from this. Instead they have incompatible version on different devices, where you basically have to test on, if not all, several different versions. Just keeping up with the new models from the main manufacturers ( there are only four or five) takes a lot of time. The so called java verification does not guarantee that your application will run on all Java ME implementations with the features you need, instead you have to verify it again and again as there are new devices.&lt;br /&gt;&lt;br /&gt;All in all this leads to that Java ME is not a good alternative for your application development today. The future of java om the mobile is rather in Android or BlackBerry. That is if not one of the major manufacturers take steps to fix this. And frankly I don't see this happening. &lt;br /&gt;&lt;br /&gt;An exception to this is possibly Symbian. Java ME implementation on Symbian is pretty good. But it seems like Nokia is more interested in promoting development in C++, or rather the very restricted C++ available on Symbian.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-6405134935319175928?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/6405134935319175928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=6405134935319175928' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6405134935319175928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6405134935319175928'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2010/05/future-for-mobile-java.html' title='The future for mobile java'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-2351030369865466083</id><published>2010-01-06T21:04:00.002+01:00</published><updated>2010-01-06T21:12:44.484+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Mac'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><category scheme='http://www.blogger.com/atom/ns#' term='antenna'/><title type='text'>New Antenna release</title><content type='html'>Today I released version 1.2.1 of &lt;a href="http://antenna.sourceforge.net/"&gt;Antenna&lt;/a&gt;. The new version includes both bug fixes and new features.&lt;br /&gt;&lt;br /&gt;I made a mistake in the 1.2.0 release, which leads to a Null Pointer Exception if the Wireless Toolkit can not be detected. Antenna can detect a lot of toolkit's, but not all, so this has given users some poblems. A patch has been in the repository for a whil, but now it is in a release also.&lt;br /&gt;&lt;br /&gt;When the 1.2.0 release was made, ther was no Java ME SDK for Mac available, but now there is. Unfortunately the file we used in 1.2.0 to detect Java ME SDK 3.0 is not included in the Mac version, so toolkit detection fails. This is fixed in the 1.2.1 release, which should work with Java ME SDK for Mac ( I haven't tested it myself, since I don't have a mac).&lt;br /&gt;&lt;br /&gt;The realease also includes som contributed patches:&lt;br /&gt;- obfusactor arguments can now be passed to WtkPackage&lt;br /&gt;- Key stor type can be set in WtkSign&lt;br /&gt;- WtkRapc can build libraries&lt;br /&gt;&lt;br /&gt;More info on antenna and the release is available &lt;a href="http://antenna.sourceforge.net/"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-2351030369865466083?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/2351030369865466083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=2351030369865466083' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2351030369865466083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2351030369865466083'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2010/01/new-antenna-release.html' title='New Antenna release'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-8762523828741267968</id><published>2010-01-01T15:28:00.003+01:00</published><updated>2010-01-01T15:43:04.219+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><category scheme='http://www.blogger.com/atom/ns#' term='BlackBerry'/><title type='text'>Supporting BlackBerry touch devices</title><content type='html'>Our BlackBerry application is built using BlackBerry software version 4.5. Unfortunately this means that we can not handle touch events, since they are only supported from version 4.7. Since most of our users have 4.5 or 4.6 this is not an option. Up til now the application has had very limited functionality on touch devices like BlackBerry Storm, running in the so called *compatibility mode' with the virtual keyboard displayed all the time and only about half the screen available for our application.&lt;br /&gt;&lt;br /&gt;But now we have made a few changes:&lt;br /&gt;We upgraded the Storm device software (to version 4.7.0.181). This solved the problem with the virtual keyboard, which now can be displayed only when needed.&lt;br /&gt;&lt;br /&gt;We revised our application. The main problem is our custom object, which did not work well. This seems to be because the &lt;a href="http://www.blackberry.com/developers/docs/4.2.1api/net/rim/device/api/ui/Field.html#navigationMovement%28int,%20int,%20int,%20int%29"&gt;navigationMovement &lt;/a&gt;method is not called on a touch device. Since we had some application  logic in this method in our custom object, it did not work well. The solution was to move the code to the &lt;a href="http://www.blackberry.com/developers/docs/4.2.1api/net/rim/device/api/ui/Field.html#moveFocus%28int,%20int,%20int,%20int%29"&gt;moveFocus&lt;/a&gt; mthod, which is called both on touch and keyborad devices.&lt;br /&gt;&lt;br /&gt;In the long run we probably will have to provide different installations for users with 4.5/4.6 or 4.7 software version. Still we do not support more advanced touch screen usage.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-8762523828741267968?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/8762523828741267968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=8762523828741267968' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/8762523828741267968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/8762523828741267968'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2010/01/supporting-blackberry-touch-devices.html' title='Supporting BlackBerry touch devices'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-1788938985959655995</id><published>2009-09-27T10:25:00.003+02:00</published><updated>2009-09-27T10:30:27.261+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><category scheme='http://www.blogger.com/atom/ns#' term='antenna'/><title type='text'>Antenna 1.2.0 with support for Java ME SDK 3.0 released</title><content type='html'>Yesterday I made the new antenna version with support for Java ME SDK 3.0 available for download. The testers have been positive so far, so it is ready for more general use.&lt;br /&gt;&lt;br /&gt;The changes are documented in &lt;a href="http://antenna.sourceforge.net/setup.php"&gt;here&lt;/a&gt;. You will also find the matrix with toolkits ad optional libraries there, it seems like Blogger don't really like my html table...&lt;br /&gt;&lt;br /&gt;The download is available &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=67420"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-1788938985959655995?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/1788938985959655995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=1788938985959655995' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/1788938985959655995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/1788938985959655995'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2009/09/antenna-120-with-support-for-java-me.html' title='Antenna 1.2.0 with support for Java ME SDK 3.0 released'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-2703430421653671137</id><published>2009-09-23T14:32:00.004+02:00</published><updated>2009-09-24T13:08:11.212+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><category scheme='http://www.blogger.com/atom/ns#' term='antenna'/><title type='text'>Java Me toolkit's and support for optional JSR's</title><content type='html'>As a part of the new Antenna release I have reviewed the toolkits supported and which JSR's they support. The result is the matrix below.&lt;br /&gt;&lt;br /&gt;As you see, many JSR's are widely supported, while others are supported only by a few manufacturers. If you need Bluetooth, PDA, Wireless Messaging, SVG or Mobile Media, they are available in most emulators. But if you need Internationalization, or Open GL your choice is more limited.&lt;br /&gt;&lt;br /&gt;Many manufacturers have their own additional APIs. Most used is Nokia UI, which is actually also supported by Sony Ericsson.&lt;br /&gt;&lt;br /&gt;&lt;table border="1"&gt;&lt;br /&gt;&lt;tbody&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;&lt;b&gt;JSR API Support&lt;/b&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;b&gt;Antenna property&lt;/b&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;b&gt;Sun WTK 2.5&lt;/b&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;b&gt;Java ME SDK 3.0&lt;/b&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;b&gt;MOTODEV Studio for Java ME&lt;/b&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;b&gt;Nokia S60 3rd Edition SDK&lt;/b&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;b&gt;Nokia N97 SDK&lt;/b&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;b&gt;Nokia S40 5&lt;/b&gt;&lt;sup&gt;&lt;b&gt;th&lt;/b&gt;&lt;/sup&gt;&lt;b&gt;ed&lt;/b&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;b&gt;Sony Ericsson SDK 2.5&lt;/b&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;b&gt;Sprint WTK 3.3.2&lt;/b&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;b&gt;LG SDK 1.3 for Java ME&lt;/b&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;CLDC version&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;1.0,1.1&lt;/td&gt;&lt;td&gt;1.0,1.1&lt;/td&gt;&lt;td&gt;1.1&lt;/td&gt;&lt;td&gt;1.1&lt;/td&gt;&lt;td&gt;1.1&lt;/td&gt;&lt;td&gt;1.0, 1.1&lt;/td&gt;&lt;td&gt;1.0, 1.1&lt;/td&gt;&lt;td&gt;1.0, 1.1&lt;/td&gt;&lt;td&gt;1.0, 1.1&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;MIDP version&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;1.0,2.0,2.1&lt;/td&gt;&lt;td&gt;1.0,2.0,2.1&lt;/td&gt;&lt;td&gt;2.1(2.0)&lt;/td&gt;&lt;td&gt;2.0,2.1&lt;/td&gt;&lt;br /&gt;&lt;td&gt;2.0,2.1&lt;/td&gt;&lt;td&gt;1.0,2.0,2.1&lt;/td&gt;&lt;td&gt;1.0,2.0,2.1&lt;/td&gt;&lt;td&gt;1.0,2.0,2.1&lt;/td&gt;&lt;br /&gt;&lt;td&gt;1.0,2.0,2.1&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;JSR 75 PDA&lt;/td&gt;&lt;br /&gt;&lt;td&gt;optionalpda&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;JSR 82 Bluetooth&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Bluetooth&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;JSR 135 Mobile Media 1.2&lt;/td&gt;&lt;br /&gt;&lt;td&gt;mmapi&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;JSR 172 Web Services&lt;/td&gt;&lt;br /&gt;&lt;td&gt;j2mews&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;JSR 177 Security and Trust Services&lt;/td&gt;&lt;br /&gt;&lt;td&gt;satsa&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;JSR 179 Location&lt;/td&gt;&lt;br /&gt;&lt;td&gt;locationservices&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;JSR 180 SIP&lt;/td&gt;&lt;br /&gt;&lt;td&gt;sipapi&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;JSR 184 Mobile 3D Graphics&lt;/td&gt;&lt;br /&gt;&lt;td&gt;java3d&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;JSR 120 WMA 1.0&lt;/td&gt;&lt;br /&gt;&lt;td&gt;wma&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;JSR 205 Wireless Messaging 2.0&lt;/td&gt;&lt;br /&gt;&lt;td&gt;wma2&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;JSR 209 AGUI&lt;/td&gt;&lt;br /&gt;&lt;td&gt;agui&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;JSR 211 Content Handler&lt;/td&gt;&lt;br /&gt;&lt;td&gt;contenthandler&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;JSR 226 Scalable 2D Vector Graphics&lt;/td&gt;&lt;br /&gt;&lt;td&gt;s2dvgapi&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;JSR 229 Payment&lt;/td&gt;&lt;br /&gt;&lt;td&gt;papi&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;JSR 234 Advanced Multimedia Supplements&lt;/td&gt;&lt;br /&gt;&lt;td&gt;ams&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;JSR 238 Mobile Internationalization&lt;/td&gt;&lt;br /&gt;&lt;td&gt;miapi&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;JSR 239 Java Binding for OpenGL ES&lt;/td&gt;&lt;br /&gt;&lt;td&gt;opengl&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;JSR 256 Mobile Sensor&lt;/td&gt;&lt;br /&gt;&lt;td&gt;mobilesensor&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;JSR 257 Contactless Communication&lt;/td&gt;&lt;br /&gt;&lt;td&gt;rfid&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;JSR 280 XML&lt;/td&gt;&lt;br /&gt;&lt;td&gt;xml&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;JSR 300 DRM&lt;/td&gt;&lt;br /&gt;&lt;td&gt;drm&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;G24 MOTO2MOTO&lt;/td&gt;&lt;br /&gt;&lt;td&gt;G24&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;Motorola APIs&lt;/td&gt;&lt;br /&gt;&lt;td&gt;motorola&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;Nokia UI API&lt;/td&gt;&lt;br /&gt;&lt;td&gt;nokiaui&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;td&gt;x&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;eSWT API&lt;/td&gt;&lt;br /&gt;&lt;td&gt;eswt&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr valign="top"&gt;&lt;br /&gt;&lt;td&gt;IAP Info&lt;/td&gt;&lt;br /&gt;&lt;td&gt;iapinfo&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-2703430421653671137?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/2703430421653671137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=2703430421653671137' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2703430421653671137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2703430421653671137'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2009/09/java-me-toolkits-and-support-for.html' title='Java Me toolkit&apos;s and support for optional JSR&apos;s'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-5137777086784551713</id><published>2009-09-19T17:07:00.003+02:00</published><updated>2009-09-19T17:10:50.548+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><category scheme='http://www.blogger.com/atom/ns#' term='antenna'/><title type='text'>Antenna: Support for LG SDK 1.3 for Java ME and Nokia N97 SDK</title><content type='html'>Today I added support for LG SDK 1.3 for Java ME and Nokia N97 SDK to &lt;a href="http://antenna.sourceforge.net/"&gt;antenna&lt;/a&gt;. This is available now in the repository and hopefully soon as a binary download.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-5137777086784551713?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/5137777086784551713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=5137777086784551713' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/5137777086784551713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/5137777086784551713'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2009/09/antenna-support-for-lg-sdk-13-for-java.html' title='Antenna: Support for LG SDK 1.3 for Java ME and Nokia N97 SDK'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-4673422848080053289</id><published>2009-08-26T22:06:00.002+02:00</published><updated>2009-08-26T22:11:14.029+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><category scheme='http://www.blogger.com/atom/ns#' term='antenna'/><title type='text'>Antenna Java ME SDK 3.0 version now available</title><content type='html'>My patch for &lt;a href="http://antenna.sourceforge.net/index.php"&gt;antenna&lt;/a&gt; is now comitted into the repository and is available for download. Still no build available, you have to get the sourcecode yourself and build it, or send me a mail and I will send you a jar file. Hopefully the pre-built version will be available soon. Documentation is also not updated yet, but you will find some in this blog.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-4673422848080053289?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/4673422848080053289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=4673422848080053289' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/4673422848080053289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/4673422848080053289'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2009/08/antenna-java-me-sdk-30-version-now.html' title='Antenna Java ME SDK 3.0 version now available'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-1713903778110945782</id><published>2009-07-08T06:08:00.006+02:00</published><updated>2009-07-08T09:26:53.376+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><category scheme='http://www.blogger.com/atom/ns#' term='antenna'/><title type='text'>Antenna support for Java ME SDK 3.0</title><content type='html'>For building our Java ME application we use &lt;a href="http://antenna.sourceforge.net/"&gt;Antenna&lt;/a&gt;. It is a great tool, that makes automated builds possible and also works well as your regular build tool. But it lacks support for Java ME SDK 3.0 and other newer toolkits. Since we need that, I have made a contribution to the Antenna project, added as a patch yesterday.&lt;br /&gt;If you want to try the modified verions, send me a mail and I will send you the jar.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How it works&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A key property of your Antenna setup is the wtk.home property. It should point to the base directory of your WTK/Java ME SDK installation. Antenna uses this to detect which toolkit you are using. In the older version toolkits are hardcoded into Antenna sourcecode. In the new version textfiles are used to set up available toolkits and their properties.  Antenna goes through a list of toolkits, described in the text file autodetect.txt, and checks if the unique files for that specific toolkit are available. If they are, the right toolkit have been found, and properties are loaded from a properties file.&lt;br /&gt;&lt;br /&gt;This makes it easy to add a new toolkit or new properties for the existing one.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Supported toolkits&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I have tested the new version with the following toolkits:&lt;br /&gt;- SUN Java ME SDK 3.0&lt;br /&gt;- Sun WTK 2.5.2&lt;br /&gt;- MOTODEV SDK for Java ME v2&lt;br /&gt;- Nokia S60_3rd_FP2_SDK_v1.1 (Symbian)&lt;br /&gt;- SPRINT WTK 332&lt;br /&gt;- Samsung_SDK_11 (autodetected as WTK 2.5.2)&lt;br /&gt;- SonyEricsson WTK 2.5.2&lt;br /&gt;- Nokia S40 5th Edition SDK Feature&lt;div id=":54" class="ii gt"&gt;&lt;wbr&gt;Pack 1&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I have also made some tests with Mpowerplayer, but the stub for CLDC 1.1 provided with Mpowerplayer seems not to match the specification. If I replace it with the one from Suns WTK 2.5.2 it seems OK. I have not tested Mpowerplayers preverifier, since it is Mac based and I use a Windows PC.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Antenna setup&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Antenna properties are described &lt;a href="http://antenna.sourceforge.net/index.php#setup"&gt;here&lt;/a&gt;. They work as before, with the new feature that additional libraries can be defined dynamically, in the toolkit properties file, without any need for changes in Antenna source code. If I set up a property for a toolkit like this:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;jsr999=lib/jsr999.jar&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;I can then turn it on in my ant file by setting the property &lt;span style="font-style: italic;"&gt;wtk.jsr199.enabled&lt;/span&gt; to &lt;span style="font-style: italic;"&gt;true&lt;/span&gt;. I can also turn on all defined additional libraries by setting property &lt;span style="font-style: italic;"&gt;wtk.all.enabled&lt;/span&gt; to &lt;span style="font-style: italic;"&gt;true&lt;/span&gt;. During development I used this, since Antenna checks that all jar files are available.&lt;br /&gt;&lt;br /&gt;Adding a new Toolkit&lt;br /&gt;You can add a new toolkit to antenna just by editing a text file and adding another. Do like this:&lt;br /&gt;First you add a new line to the file autodetext.txt (in the res directory). It should look something like this:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#sony ericsson&lt;br /&gt;sonyericwtk2;lib/semc_ext_jp8.jar;lib/cldcapi11.jar&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Lines starting with # are comments. The lines defining toolkits should start with the toolkit property filename and then contain a list of files that are unique to this toolkit. File names should be relative to wtk.home.&lt;br /&gt;&lt;br /&gt;Then you add a properties file, in this case sonyericwtk2.properties. It looks something like this:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;name="Sony Ericsson WTK2"&lt;br /&gt;include=wtk25&lt;br /&gt;nokiaui=lib/nokiaext.jar&lt;br /&gt;semc=lib/semc_ext_jp8.jar&lt;br /&gt;vodafone=lib/vscl21.jar&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The properties you could use are:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;name:                          a descriptive name for the toolkit. Use this always.&lt;/li&gt;&lt;li&gt;preverifyversion:      1 means WTK 1 style, support only CLDC 1.0,  2 means WTK 2 style, include Target parameter in preverify command, 3 means WTK 3 style, only add parameter cldc1.0 if cldc 1.0 is used&lt;/li&gt;&lt;li&gt;emulator:                   exe or jar file for emulator&lt;/li&gt;&lt;li&gt;cldc10,cldc11:            libraries for cldc versions&lt;/li&gt;&lt;li&gt;midp10,midp20,midp21:     libraries for midp versions&lt;/li&gt;&lt;li&gt;include:                      include another toolkit definition. Useful if the toolkit is an add-on to another toolkit, like WTK 2.5 or Java ME SDK 3.0&lt;/li&gt;&lt;/ul&gt;All other properties will be taken for add-on libraries that will be added to classpath if wtk.[propertiy].enabled is true, or if wtk.all.enabled is true.&lt;br /&gt;&lt;br /&gt;Please let me know if you have any problems or improvement suggestions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-1713903778110945782?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/1713903778110945782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=1713903778110945782' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/1713903778110945782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/1713903778110945782'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2009/07/antenna-suport-for-java-me-sdk-30.html' title='Antenna support for Java ME SDK 3.0'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-3464104287228398303</id><published>2009-06-30T09:25:00.002+02:00</published><updated>2009-06-30T09:31:13.083+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><category scheme='http://www.blogger.com/atom/ns#' term='BlackBerry'/><title type='text'>Catch System.out from BlackBerry simulator</title><content type='html'>Just a little trick I just learned. Sometimes I want a quick and easy logging, just to see what's happening in my program. The easiest approach, specially early in the project is simply using System.out. But when you run your program in the emulator you don't see system out anywhere.  To see it you need the command line parameter &lt;span style="font-style: italic;"&gt;/app-param=JvmDebugFile.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Just run the emulator as follows:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;fledge /handheld=9000 "/app-param=JvmDebugFile:bblog.txt"&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;In the bblog.txt you will get a lot of info, and your System.out output.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-3464104287228398303?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/3464104287228398303/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=3464104287228398303' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3464104287228398303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3464104287228398303'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2009/06/catch-systemout-from-blackberry.html' title='Catch System.out from BlackBerry simulator'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-6912545168519243071</id><published>2009-06-17T11:50:00.000+02:00</published><updated>2009-06-17T12:00:25.115+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><category scheme='http://www.blogger.com/atom/ns#' term='antenna'/><title type='text'>Java ME automated build</title><content type='html'>So far I have built my Java ME application using &lt;a href="http://java.sun.com/javame/downloads/sdk30.jsp"&gt;Sun Java ME SDK 3.0&lt;/a&gt; and before the SDK was available with Sun &lt;a href="http://java.sun.com/products/sjwtoolkit/wtk2.5.2/"&gt;Wireless Toolkit&lt;/a&gt;. But now we need to streamline the process and introduce automated build.&lt;br /&gt;&lt;br /&gt;The tool we use for this is ant, with an add-on for Java ME called &lt;a href="http://antenna.sourceforge.net/"&gt;antenna&lt;/a&gt;. Antenna is an open source project, which provides support for operations like obfuscating, updating manifest and JAD files and signing.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Setup&lt;br /&gt;&lt;/span&gt;To use antenna you need to setup the antenna tasks, using taskdef, and define some properties:&lt;br /&gt;&lt;code&gt;&lt;br /&gt; &amp;lt;taskdef resource="antenna.properties"    classpath="${basedir}\tools\antenna.jar" /&amp;gt;&lt;br /&gt;  &amp;lt;property name="wtk.home" location="C:\WTK2.5.2"/&amp;gt;&lt;br /&gt;  &amp;lt;property name="wtk.cldc.version" value="1.1"/&amp;gt;&lt;br /&gt;  &amp;lt;property name="wtk.midp.version" value="2.0"/&amp;gt;&lt;br /&gt;  &amp;lt;property name="wtk.proguard.home" value="${basedir}\tools\proguard4.3"/&amp;gt;&lt;br /&gt;&lt;/code&gt;  &lt;br /&gt;As you can see, we have a directory called tools, where we keep the antenna jar and also a &lt;a href="http://proguard.sourceforge.net/"&gt;proguard&lt;/a&gt; installation, which we need for obfuscation.&lt;br /&gt;Antenna also needs to know where your wireless toolkit is installed and which versions of CLDC and MIDP you use. That's it!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Package&lt;/span&gt;&lt;br /&gt;Antennas main function is packaging your application into jar and jad files, preverified, obfuscated and with correct manifest and jad files. You can do this step-by-step, with different tasks for each step, but you can also use the wtkpackage task to make them all.This is the approach we have taken.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;&lt;/code&gt;target name="package" depends="compile"&lt;code&gt;&amp;gt;&lt;/code&gt;&lt;br /&gt;        &lt;code&gt;&amp;lt;&lt;/code&gt;mkdir dir="${dist.dir}"/&lt;code&gt;&amp;gt;&lt;/code&gt;&lt;br /&gt;        &lt;code&gt;&amp;lt;&lt;/code&gt;copy file="${basedir}/myapp.jad" overwrite="true" failonerror="true" tofile="${dist.dir}/myapp.jad"/&lt;code&gt;&amp;gt;&lt;/code&gt;&lt;br /&gt;    &lt;br /&gt;        &lt;code&gt;&amp;lt;&lt;/code&gt;wtkpackage jarfile="${dist.dir}/myapp.jar"&lt;br /&gt;                            jadfile="${dist.dir}/myapp.jad"&lt;br /&gt;                            obfuscate="true"&lt;br /&gt;                            preverify="true"&lt;code&gt;&amp;gt;&lt;/code&gt;&lt;br /&gt;               &lt;br /&gt;                &lt;code&gt;&amp;lt;&lt;/code&gt;fileset dir="${class.dir}"/&lt;code&gt;&amp;gt;&lt;/code&gt;&lt;br /&gt;                &lt;code&gt;&amp;lt;&lt;/code&gt;fileset dir="${res.dir}"/&lt;code&gt;&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;                &lt;code&gt;&amp;lt;&lt;/code&gt;exclude_from_manifest name="myapp-dir"/&lt;code&gt;&amp;gt;&lt;/code&gt;&lt;br /&gt;                &lt;code&gt;&amp;lt;&lt;/code&gt;exclude_from_manifest name="myapp-host"/&lt;code&gt;&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;        &lt;code&gt;&amp;lt;&lt;/code&gt;/wtkpackage&lt;code&gt;&amp;gt;&lt;/code&gt;&lt;br /&gt;        &lt;code&gt;&amp;lt;&lt;/code&gt;copy file="${dist.dir}/myapp.jad" overwrite="true" failonerror="true" tofile="${dist.dir}/myappu.jad"/&lt;code&gt;&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;        &lt;code&gt;&amp;lt;&lt;/code&gt;/target&lt;code&gt;&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Comments:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;compilation is separate, our package task is made after the compilation&lt;/li&gt;&lt;li&gt;we keep a jad template in the project basedir, which we copy to the dist dir&lt;/li&gt;&lt;li&gt;wtkpackage will create the jar file and update the jad file. We also want it to preverify and obfuscate using proguard&lt;br /&gt;&lt;/li&gt;&lt;li&gt;in ${class.dir} we have all classes that should be included&lt;/li&gt;&lt;li&gt;all used resources are in ${res.dir} &lt;/li&gt;&lt;li&gt;we have two parameters in our JAD template that should be only in the JAD file and not in the Manifest file. This allows for changing them without resigning.&lt;/li&gt;&lt;li&gt;as a last step we copy the jad file. This is to have an unsigned copy for use in emulators and phones that don't support the Verisign certificate we use (Nokia S40..)&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;Signing the application&lt;/span&gt;&lt;br /&gt;Antenna also supports signing using the very straightforward wtksign task:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;target name="sign" depends="package"&gt;&lt;br /&gt;        &amp;lt;wtksign&lt;br /&gt;            keystore="${basedir}/../cert/keystore.ks"&lt;br /&gt;            jarfile="${dist.dir}/myapp.jar"&lt;br /&gt;            jadfile="${dist.dir}/myapp.jad"&lt;br /&gt;            storepass="******"&lt;br /&gt;            certpass="******"&lt;br /&gt;            certalias="myalias"&lt;br /&gt;        /&gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;/target&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This will add signature information to the JAD file using the certificate in the keystore and the JAD and jar files are redy to use.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-6912545168519243071?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/6912545168519243071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=6912545168519243071' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6912545168519243071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6912545168519243071'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2009/06/java-me-automated-build.html' title='Java ME automated build'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-7458867218060262576</id><published>2009-06-03T08:35:00.002+02:00</published><updated>2009-06-03T08:59:27.673+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><category scheme='http://www.blogger.com/atom/ns#' term='BlackBerry'/><title type='text'>Going native on BlackBerry</title><content type='html'>Our application is currently based on Java ME and uses the lcdui to a 100%, even though there are some fixes to make it work better on BlackBerry.  Since BlackBerry is getting more and more popular in the market we have decided to make a version that uses the BlackBerry native UI instead of Java ME standard lcdui.&lt;br /&gt;&lt;br /&gt;BlackBerry does not allow combining its native UI with lcdui, which means we will have to convert everything, including the midlet. The majority of the code is however in our own classes, since 90% of tha application is Canvas-based. It seems quite possible to make them work in both environments.&lt;br /&gt;&lt;br /&gt;Major changes will be:&lt;br /&gt;- our midlet is replaced by a &lt;a href="http://www.blackberry.com/developers/docs/4.7.0api/net/rim/device/api/ui/UiApplication.html"&gt;UIApplication&lt;/a&gt;&lt;br /&gt;- the Canvas will be replaced by a &lt;a href="http://www.blackberry.com/developers/docs/4.7.0api/net/rim/device/api/ui/container/MainScreen.html"&gt;MainScreen&lt;/a&gt;&lt;br /&gt;- instead of the List we use we will have a &lt;a href="http://www.blackberry.com/developers/docs/4.7.0api/net/rim/device/api/ui/component/KeywordFilterField.html"&gt;KeywordFilterField&lt;/a&gt;, which will gives the users better functionality.&lt;br /&gt;&lt;br /&gt;Our components will be placed in the MainScreen (instead of a Java ME Canvas). To make this work we will use an interface for painting with two different implementations, that encapsulate Java ME Graphics and BlackBerry &lt;a href="http://www.blackberry.com/developers/docs/4.7.0api/net/rim/device/api/ui/Graphics.html"&gt;Graphics&lt;/a&gt;. We will also need to handle the different Font classes and lcdui Image versus BlackBerry Bitmap.&lt;br /&gt;&lt;br /&gt;Our immediate gains will be:&lt;br /&gt;- scalable fonts, which is a problem for us now, since the Lcdui fonts on BlackBerry Bold are very large&lt;br /&gt;- some UI improvements, like the KeyWordFilterField instead of the List etc&lt;br /&gt;We will also gain access to possiblities like opening an input field on top of ouyr Canvas, with we really need and have a better looking app.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-7458867218060262576?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/7458867218060262576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=7458867218060262576' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/7458867218060262576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/7458867218060262576'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2009/06/going-native-on-blackberry.html' title='Going native on BlackBerry'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-2251730616020751661</id><published>2009-05-05T13:22:00.003+02:00</published><updated>2009-05-05T13:31:25.120+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Java ME Search Engine</title><content type='html'>Finding information on Java ME issues can be time consuming. A lot of information is available on the Internet, and Google finds lots of it. But most of the time you get Java ME information mixed with a lot of Java SE information.&lt;br /&gt;&lt;br /&gt;To solve this I have collected a lot of Java ME resources and created a Google customized Search Engine. This is a first try, based on some links I had collected. There is certainly a lot more resources available out there. If you know one, don't hesitate to send me a mail.&lt;br /&gt;&lt;br /&gt;Here is the search box:&lt;br /&gt;&lt;br /&gt;&lt;form action="http://www.google.com/cse" id="cse-search-box"&gt;&lt;span style="font-size:130%;"&gt;Java ME Search Engine&lt;/span&gt;&lt;br /&gt; &lt;div&gt;&lt;br /&gt;   &lt;input name="q" size="31" type="text"&gt;&lt;br /&gt;   &lt;input name="sa" value="Search" type="submit"&gt;&lt;br /&gt;&lt;br /&gt; &lt;/div&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;amp;lang=en"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-2251730616020751661?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/2251730616020751661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=2251730616020751661' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2251730616020751661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2251730616020751661'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2009/05/java-me-search-engine.html' title='Java ME Search Engine'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-2374694481693412565</id><published>2009-04-30T08:47:00.008+02:00</published><updated>2009-04-30T10:22:36.162+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><title type='text'>Analyzing Java ME memory heap</title><content type='html'>We have some memory problems with our Java ME application. On some platforms we get out of memory error after working a while. To some extent this is expected, and the error is handled reasonably well, but nether the less we wanted to get a view of how memory is used.&lt;br /&gt;&lt;br /&gt;The Java ME SDK 3.0 includes some tools for this. They are not available in the IDE but has to be started from the command line. So you open two command line windows. In the first you start your midlet:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;cd C:\Java_ME_platform_SDK_3.0\bin&lt;br /&gt;C:\Java_ME_platform_SDK_3.0\bin&gt;emulator.exe -Xdevice:DefaultCldcPhone1 -Xdebug -Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=51307 -Xdescriptor:[jadfile]&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;This should start the emulator with your midlet. I choose the DefaultDldcPhone1 which is configured to have 4 MB of heap. You can change that in the device properties if you want to.&lt;br /&gt;&lt;br /&gt;In your second command window you start the memory profiler:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;cd C:\Java_ME_platform_SDK_3.0\bin&lt;br /&gt;memory-profiler.exe -host 127.0.0.1 -port 51307&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;This should open up the memory profiler window. You then press Connect to cennect to your emulator instance.This will take a while but then you get a window something like this:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_3aT5iYAdRTk/SflSSpOIZAI/AAAAAAAACl8/wVLJzsmIpNM/s1600-h/JavaHeap.jpeg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: center; cursor: pointer; width: 400px; height: 280px;" src="http://2.bp.blogspot.com/_3aT5iYAdRTk/SflSSpOIZAI/AAAAAAAACl8/wVLJzsmIpNM/s400/JavaHeap.jpeg" alt="" id="BLOGGER_PHOTO_ID_5330382114225939458" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Now you press resume and run your application and try to recreate your memory problems. After that you press Pause in the memory tool. This will cause the tool to get a memory dump from your runing application. You will get a memory map at the top and at the bottom left a list of classes and primitives. You can select a class in the list and see what instances exist. It is however quite difficult to find information this way. Better is to use the statistics button. This will get you a window something like this:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_3aT5iYAdRTk/SflWJUdXKZI/AAAAAAAACmE/VqT1F1TyVxA/s1600-h/HeapStat.jpeg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: center; cursor: pointer; width: 400px; height: 236px;" src="http://4.bp.blogspot.com/_3aT5iYAdRTk/SflWJUdXKZI/AAAAAAAACmE/VqT1F1TyVxA/s400/HeapStat.jpeg" alt="" id="BLOGGER_PHOTO_ID_5330386352080365970" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The data is:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;class name or primitive. a [ means 'array of'&lt;/li&gt;&lt;li&gt;object number (or number of objects rather)&lt;/li&gt;&lt;li&gt;size&lt;/li&gt;&lt;li&gt;average size&lt;/li&gt;&lt;li&gt;% of heap&lt;/li&gt;&lt;li&gt;live %&lt;/li&gt;&lt;li&gt;old generation %&lt;/li&gt;&lt;/ul&gt;Since you can not search in this table I copy it al and paste into a spereadsheet, where I can find my classes easier.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-2374694481693412565?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/2374694481693412565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=2374694481693412565' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2374694481693412565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2374694481693412565'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2009/04/analyzing-java-me-memory-heap.html' title='Analyzing Java ME memory heap'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_3aT5iYAdRTk/SflSSpOIZAI/AAAAAAAACl8/wVLJzsmIpNM/s72-c/JavaHeap.jpeg' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-5989281819478021461</id><published>2009-04-28T16:43:00.002+02:00</published><updated>2009-04-28T16:50:44.486+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><title type='text'>Java ME SDK and SSL</title><content type='html'>I have been struggling a few days with getting Https communication to work in Java ME SDK 3.0, but with little success so far. To be able to create a Https connection I need to get the SDK to accept the (self-signed) certificate on my test server. The SDK does not however use the Java SE keystore but has its own (actually it has a lot of keystore's) with its own tool to update it. So far I have not managed to get my certificate into the right keystore. Tried asking on Sun's forum, but they don't seem to be interested in the problem at all.&lt;br /&gt;&lt;br /&gt;So instead I used Nokia's S60 emulator, which gives me the option to accept the server certificate even though it can not be verified. Perhaps I should give up on the SDK for now, specially since the support and documentation is not really good enough.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-5989281819478021461?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/5989281819478021461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=5989281819478021461' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/5989281819478021461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/5989281819478021461'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2009/04/java-me-sdk-and-ssl.html' title='Java ME SDK and SSL'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-3138834666981969302</id><published>2009-03-16T13:54:00.004+01:00</published><updated>2009-04-19T10:09:14.173+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><category scheme='http://www.blogger.com/atom/ns#' term='BlackBerry'/><title type='text'>Programming for BlackBerry with Java ME</title><content type='html'>Research in Motion BlackBerry phones support the Java ME standard, so for a Java ME developer is easy to get started on BlackBerry. But a few things do not work as expected...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Menu&lt;/span&gt;&lt;br /&gt;The BlackBerry has a very consistent user interface, with a menu key and a back key. These keys can not be catched by your Java ME canvas, pressing them will not call the &lt;span style="font-weight:bold;"&gt;keyPressed&lt;/span&gt;() method as you might have expected. Instead the menu key will always open the menu. If you have not added Java ME commands to the Canvas, the BlackBerry will create a menu itself, with 'Close' as the only alternative. The back key will trigger the command with the command type EXIT if there is one and do nothing is there is no such command.&lt;br /&gt;&lt;br /&gt;This basically means that you should always use Java ME Commands in yor BlackBerry application. There is no other way within the Java ME API to get the BB keys to work as expected.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Other keys&lt;/span&gt;&lt;br /&gt;There are no Nokia-style softkeys on a BlackBerry keyboard. But there is a trackball (trackwheel on older models) and a qwerty keyboard.&lt;br /&gt;&lt;br /&gt;The trackwheel sends &lt;span style="font-weight:bold;"&gt;Canvas&lt;/span&gt; UP, DOWN, RIGHT and LEFT codes and trackball press can also be handled and expected. Your application should probably use these keys a lot. Key repeat is however not supported, so if the user scrolls the trackball you will get a series of &lt;span style="font-weight:bold;"&gt;keyPressed&lt;/span&gt; events and no &lt;span style="font-weight:bold;"&gt;keyRepeated&lt;/span&gt;. &lt;br /&gt;&lt;br /&gt;The qwerty keys will call &lt;span style="font-weight:bold;"&gt;keyPressed&lt;/span&gt; with codes as expected, you can use &lt;span style="font-weight:bold;"&gt;getKeyName&lt;/span&gt;. Just remember that some models have a smaller keyboard, with two characters per key. You will always get the first character.&lt;br /&gt;&lt;br /&gt;The return, backspace and space keys will also deliver key events as expected. The shift and alt keys will however not. Instead they affect the keycode delivered to the application. That is ok for the qwerty keys, but also it means that you can not tell if the user is holding down shift and scrolling or pressing the trackball.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Fullscreen mode&lt;/span&gt;&lt;br /&gt;You Java ME Canvas will always cover the full screen. The call to &lt;span style="font-weight:bold;"&gt;setFullScreenMode&lt;/span&gt; has no effect. This also means that the &lt;span style="font-weight:bold;"&gt;sizeChanged&lt;/span&gt; method will never be called. So you should make sure that your application does not depend on it beging called.&lt;br /&gt;&lt;br /&gt;The conclusion is that the BlackBerry Java ME implementation is a good one, and can be very well be used as a base for your implementation on BlackBerry. But if your midlet is based on the Canvas class and developed for Nokia-style phones you will probably need to make some changes, mainly with menues, softkeys etc. You can them detect at runtime if the midlet is on a BlackBerry or not and adjust to that.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-3138834666981969302?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/3138834666981969302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=3138834666981969302' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3138834666981969302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3138834666981969302'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2009/03/programming-for-blackberry-with-java-me.html' title='Programming for BlackBerry with Java ME'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-1655312367215609836</id><published>2009-03-12T09:11:00.000+01:00</published><updated>2009-03-12T09:11:56.536+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><category scheme='http://www.blogger.com/atom/ns#' term='BlackBerry'/><title type='text'>Java ME on BlackBerry</title><content type='html'>One of the platforms you can support with Java ME is BlackBerry. BlackBerry devices are a bit different from your ordinary cellphone. They are very good at email and includes a handful of applications.&lt;br /&gt;&lt;br /&gt;Most of the applications for BlackBerry use the native Java API, but the device also supports Java ME midlet applications. But there are a few points to note...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Create COD files&lt;/span&gt;&lt;br /&gt;BlackBerry supports standard jar/jad files to some extent, and installing your application entering a jad URL in the phones browser might work very well. But my experience is that sometimes it doesn't. Converting the jad/jar files to BlackBerry cod file format on your PC might be a better idea. &lt;br /&gt;&lt;br /&gt;For this you need BalckBerry Java development tools. I use BlackBerry JDE 4.6.0, but there are new versions. You find them &lt;a href="http://na.blackberry.com/eng/developers/javaappdev/javadevenv.jsp"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;From the command line you run something like:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;"C:\Program Files\Research In Motion\BlackBerry JDE Component Package 4.6.0\bin\rapc" import="C:\Program Files\Research In Motion\BlackBerry JDE Component Package 4.6.0\lib\net_rim_api.jar" codename=XXX -midlet jad=yyy.jad yyy.jar &lt;br /&gt;&lt;/code&gt;&lt;br /&gt;This will take your yyy jar and jad files and create XXX.cod. It will also modify your jad file and add a lot of BlackBerry-specific lines to it. This makes the JAD file much larger, so will probably not want to use it for non-BlackBerry devices, even if the original data is still there (some devices have restrictions on jad file size).&lt;br /&gt;&lt;br /&gt;If your midlet is large, it will be split into several cod files. They will all be in the yyy.cod, which might by a zip archive. So you need to check if it is (you can also check the modified jad file to see if there are several cod files in it). If it is you should unpack it and put the individual cod files on your web server together with the modified jad file. Make sure that the cod mimetype is configured on your web server, and your cod file is ready to install.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-1655312367215609836?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/1655312367215609836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=1655312367215609836' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/1655312367215609836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/1655312367215609836'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2009/03/java-me-on-blackberry.html' title='Java ME on BlackBerry'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-9181066302489182409</id><published>2009-03-09T11:58:00.005+01:00</published><updated>2009-03-09T12:19:32.338+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><title type='text'>Portable Java ME development</title><content type='html'>The last six months or so I have been busy with developing a new application in Java ME environment. I have done some work in this envirnment before, but even though the platform has not changed much, my impression is that the quality of the implementations have improved a lot.&lt;br /&gt;&lt;br /&gt;The goal was to support  a wide selection of mobile phones:&lt;br /&gt;- Nokia, both System 40 phones and Symbian System 60&lt;br /&gt;- Research in Motion BlackBerry, at least the latest models like Bold and storm&lt;br /&gt;- Sony Ericsson devices, where we started with Symbian UIQ models and now target mostly Xperia X1, based on windows mobile&lt;br /&gt;- Samsung&lt;br /&gt;- LG&lt;br /&gt;- Motorola&lt;br /&gt;etc...&lt;br /&gt;&lt;br /&gt;Main focus is on more powerful, smartphone segment, but the application works well also on smaller phones.&lt;br /&gt;&lt;br /&gt;Java ME was not the only possible choice. There is always the possibility to use native tools, for Symbian and BlackBerry at least. Our choice was to start developing on Java ME and see if it works and later add Symbian and/or BlackBerry specific code if needed. So far we have not needed it. And what surprises me is that it now works very well and very portable. When we try a new device it almost always works right away. We might need to add some code to make better use of the keyboard or make it look better, but generally it works well.&lt;br /&gt;&lt;br /&gt;It is actually more of a problem to make it work in emulator, which surprises me. A special problem is with hasPointerEvents() method, which is supposed to tell us if the device has a touch screen or not. Since the application changes its user interface slightly depending on if there is a touch screen available or not this is a very important method for us. And on the phones it always works, but in the emulator it does not.&lt;br /&gt;&lt;br /&gt;Another problem with the emulators is to find a good-looking emulator for demonstration purposes. There are a lot of good devices out ther, like Sony Ericsson Xperia X1 and Nokia S60 phones, but I have not managed to find good emulators for them. For the X1 I have so far not found a Java ME emulator at al, and for S60 phones there is one, but it does not look good enough for demonstration puposes. Guess this is because the development of new devices is so fast that manufacturers don't have the time to fix emulators.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-9181066302489182409?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/9181066302489182409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=9181066302489182409' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/9181066302489182409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/9181066302489182409'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2009/03/portable-java-me-development.html' title='Portable Java ME development'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-6331860788951992730</id><published>2008-10-16T09:21:00.006+02:00</published><updated>2009-03-09T12:20:16.704+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><title type='text'>LWUIT first impressions</title><content type='html'>Last week or so I have been working with the &lt;a href="https://lwuit.dev.java.net/"&gt;Leight Weight UI Toolkit&lt;/a&gt; for Java ME. We started with drawing everything by hand using Java ME LCDUI and Canvas class, but we feel that this is not viable in the long run. We want a toolkit that gives us a higher level API and handles differences between different devices.&lt;br /&gt;&lt;br /&gt;Impressions so far are good. It was some work converting our application for Lcdui to Lwuit, but less than expected. Performance is OK, our main problem is network traffic, which has nothing to do with Lwuit, but the toolkit does not seem to slow it down, possible even speeding things up a little (since our old interface repainted the whole screen a bit too often). We haven't really used much of the visual goodies of the toolkit yet, and that is not our main reason for using lwuit, but surely we will use them eventually.&lt;br /&gt;&lt;br /&gt;Lwuit is inspired by Swing. In my opinion they follow Swing a bit too close. I don't really see the need for Layout Managers on these very small devices. Our layout in our main screen is position based and needs a scrollable canvas, which lwuit gives us. So far we use the (undocumented) CoordinateLayout, which seems to work as expected, possibly we will have to implement our own, but since we don't want the LayoutManager to ever move the objects and set the X and Y coordinates ourselves, it shouldn't be too difficult.&lt;br /&gt;&lt;br /&gt;Handy features, like drawing a text centered or making a dotted line, that exist in Lcdui are not available in Lwuit for compatibility with Swing. We used both these features in our interface,  so we had to modify Lwuit so that we can use them, which was not difficult. We don't really see that compatibility with Swing is important, since the interface is designed for mobile devices with small screens and limited keyboards and possibly touch screen.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-6331860788951992730?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/6331860788951992730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=6331860788951992730' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6331860788951992730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6331860788951992730'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2008/10/lwuit-first-impressions.html' title='LWUIT first impressions'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-2438593983095391504</id><published>2008-08-21T15:46:00.002+02:00</published><updated>2009-03-09T12:20:54.349+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><title type='text'>Error preverifying class - java/lang/NoClassDefFoundError: java/lang/Object</title><content type='html'>Is an error you might see when preverifying your midlet. Basically the problem is that the verifier can not find the referenced classes - and if it complains about java.lang.Object it basically can not find anything.&lt;br /&gt;&lt;br /&gt;We had this today, and the reason was that our tool (IntelliJ) generated a not so good ant file, with the classpath for the jre. That is not what the preverifier expects. Rather it should be something like:&lt;br /&gt;-classpath C:\WTK2.5.2\lib\cldcapi11.jar;C:\WC:\WTK2.5.2\lib\midpapi21.jar&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-2438593983095391504?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/2438593983095391504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=2438593983095391504' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2438593983095391504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2438593983095391504'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2008/08/error-preverifying-class.html' title='Error preverifying class - java/lang/NoClassDefFoundError: java/lang/Object'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-8687655794065717405</id><published>2008-08-21T14:35:00.001+02:00</published><updated>2009-03-09T12:21:21.502+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java applet'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><title type='text'>From applet to MIDlet</title><content type='html'>We have started to look into making a mobile client. Our current approach is to make a JME client, partly based on our existing Java client, based on Java SE and Swing and runnable as an applet or a standalone application. The rendering part will need to be rewritten but we hope to be able to reuse communication with the server and some of the internal logic.&lt;br /&gt;&lt;br /&gt;Items we found so far:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;we use both socket and http communication. Both need to be rewritten to use the microedition Connector. So far the changes are small, but we will need to keep different classes for Java ME and SE versions&lt;/li&gt;&lt;li&gt;we use gzip, in the SE version java.util.&lt;span style="line-height: 115%;" lang="SV"&gt;&lt;span style="font-size:100%;"&gt;GZIPInputstream which is not included i Java ME&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="line-height: 115%;" lang="SV"&gt;&lt;span style="font-size:100%;"&gt;enums is a big problem, looks like we will have to convert those used to old-fashioned int and classes with constant definitions.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="line-height: 115%;" lang="SV"&gt;&lt;span style="font-size:100%;"&gt;minor problems like String.split() (no such method in JME, and no StringTokenizer either) needs to be solved.&lt;br /&gt;&lt;/span&gt;&lt;/span&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/33472901-8687655794065717405?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/8687655794065717405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=8687655794065717405' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/8687655794065717405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/8687655794065717405'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2008/08/from-applet-to-midlet.html' title='From applet to MIDlet'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-4479923819059935926</id><published>2008-07-31T08:17:00.005+02:00</published><updated>2009-03-10T11:23:24.032+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java applet'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Multiple applet instances problem solved (?)</title><content type='html'>We have had some problems with our applet getting instanciated several times. Seems like it is not only started twice but there are also several instances created by the browser.  We have spend quite a lot of time on troubleshooting this and trying to find a solution, and now it seems like we have found a solution:&lt;br /&gt;&lt;br /&gt;We changed the APPLET tag in our HTML page to a OBJECT tag. This has to be made specifically for Microsoft Internet Explorer, since it is not supported in other browsers like Firefox and Safari. So in our HTML file we check which browser the user has, and use the OBJECT tag if it is Internet Explorer, the APPLET tag otherwise, something like this:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;var html = "&amp;lt;applet archive='MyJar.jar' code='MyApplet.class' height='700' width='1000'&amp;gt;";&lt;br /&gt;           if (navigator.appName == 'Microsoft Internet Explorer'){&lt;br /&gt;                  // Use object tag for MS Internet Explorer&lt;br /&gt;                  html = "&amp;lt;object classid='clsid:8AD9C840-044E-11D1-B3E9-00805F499D93'" +&lt;br /&gt;                      " width='1000' height='700'&amp;gt;";&lt;br /&gt;                  html += "&amp;lt;param name='code' value='MyApplet.class'/&amp;gt;";     &lt;br /&gt;                  html += "&amp;lt;param name='archive' value='MyJar.jar'/&amp;gt;";     &lt;br /&gt;           }&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;It seems like this helps, but we do need more testing. Possibly we need to change to using the EMBED tag for other browsers but for now we stick to the APPLET tag.&lt;br /&gt;&lt;br /&gt;There is a discussion on this in the Java developer forums &lt;a href="http://forums.sun.com/thread.jspa?forumID=421&amp;amp;threadID=5286988"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-4479923819059935926?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/4479923819059935926/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=4479923819059935926' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/4479923819059935926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/4479923819059935926'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2008/07/multiple-applet-instances-problem.html' title='Multiple applet instances problem solved (?)'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-6234670342372864038</id><published>2008-07-03T15:27:00.005+02:00</published><updated>2009-03-10T11:24:05.960+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java applet'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Formatting java log records</title><content type='html'>While configuring logging levels for different parts of your software is flexible in java logging, formatting log records are not. In terms of what is delivered with the jre you have two alternatives:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;SimpleFormatter&lt;/li&gt;&lt;li&gt;XMLFormatter&lt;/li&gt;&lt;/ol&gt;None of these give you any choice on what to include. SimpleFormatter tells you todays date in every record, but not what thread is printing. XMLFormatter dumps everything, but since the xml file is not valid (at least not on mac) it is not easy to process, you have to edit it to make it valid first. So we decided to write our own formatter, which is not difficult. Here it comes:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;public class ThreadFormatter extends Formatter {&lt;br /&gt;&lt;br /&gt;  public String format(LogRecord record) {&lt;br /&gt;      return "Thread-" +&lt;br /&gt;              record.getThreadID() + " " +&lt;br /&gt;              record.getMillis() % 10000 + " [" +&lt;br /&gt;              record.getSourceClassName() + ":" +&lt;br /&gt;              record.getSourceMethodName() + "] " +&lt;br /&gt;              record.getMessage() + "\n";&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Most important change (besides printing it all on one line in a more compact format) is that the Thread ID is included. The date is actually not very interesting for us, we just display part of the timestamp to give a rough idea of what takes time in the system.&lt;br /&gt;&lt;br /&gt;This works very well, when we run our application standalone or in NetBeans applet viewer. But when we run the application as an applet it will not (for security reasons) load the log formatter class. Feels like the guys at Sun didn't think about logging from applets when the designed java logging. What we would need is a standard log formatter where you can configure the log format, without needing to load your own class. Perhaps we will get that in a later version....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-6234670342372864038?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/6234670342372864038/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=6234670342372864038' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6234670342372864038'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6234670342372864038'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2008/07/foramtting-java-log-records.html' title='Formatting java log records'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-2271903477138829057</id><published>2008-07-02T08:56:00.003+02:00</published><updated>2008-07-31T08:15:38.112+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java applet'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Mac'/><title type='text'>Mac Java logging</title><content type='html'>Continued with the java logging work, specially on the mac. Found the following:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;logging to console is not  possible, since java intercepts all console ouput and writes it to the logg... Creates a loop that fills th console. I have not found any way to turn this off, please drop me a line if you find one..&lt;/li&gt;&lt;li&gt;logging to file with the standard XMLFormatter (the default if you dont change the configuration) produces (almost) an xml file.&lt;/li&gt;&lt;li&gt;The 'XML' file has encoding "MacRoman" , which I have never heard of, but it seems like it is almost standard. Safari (Apple's own browser) does not know it, and complains 'Unsupported encoding MacRoman'. Firefox does not complain about the encoding however.&lt;/li&gt;&lt;li&gt;The 'XML' file has a root tag of &amp;lt;log&amp;gt;. There is no closing tag, so it's an invalid xml. If you want to open the file in Firefox you have to add &amp;lt;/log&amp;gt; by hand.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you print xml strings to your log (which we do) the XMLFormatter tries to escape them, but does not succeed, so you might have to remove them.&lt;/li&gt;&lt;/ol&gt;Seems like there are a few bugs here....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-2271903477138829057?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/2271903477138829057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=2271903477138829057' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2271903477138829057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2271903477138829057'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2008/07/mac-java-logging.html' title='Mac Java logging'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-2609334453281462916</id><published>2008-06-27T08:02:00.002+02:00</published><updated>2008-06-27T08:44:29.894+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java applet'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Java Applet logging</title><content type='html'>The last couple of days I have been working on logging from our applet. Frustrating indeed, but finally it works, almost as planned.&lt;br /&gt;&lt;br /&gt;Our first approach was to do the configuration programatically, something like:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;//get the root logger&lt;span style="font-family: monospace;"&gt;&lt;br /&gt;&lt;/span&gt;Logger logger = Logger.getLogger("");&lt;br /&gt;//create a ConsoleHandler&lt;br /&gt;&lt;span style="font-family: monospace;"&gt;&lt;/span&gt;Handler handler = new ConsoleHandler();&lt;br /&gt;handler.setLevel(Level.FINE);&lt;br /&gt;&lt;span style="font-family: monospace;"&gt;&lt;/span&gt;logger.addHandler(handler);&lt;span style="font-family: monospace;"&gt;&lt;br /&gt;&lt;/span&gt;logger.setLevel(Level.FINE);&lt;span style="font-family: monospace;"&gt;&lt;/span&gt;&lt;span style="font-family: monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;Now, this works very well in the Applet Viewer, but when you run your applet in a browser you'll get an exception, since the applet can not change the Handler configuration.&lt;br /&gt;&lt;br /&gt;Well, there is the &lt;a href="http://java.sun.com/javase/6/docs/api/java/util/logging/Logger.html#getAnonymousLogger%28%29"&gt;getAnonymusLogger()&lt;/a&gt; function, which is designed for use in applets. An anonymous logger would mean that we miss much of the benefits of the flexibel configuration, which is based on named loggers, but I guess it is better than nothing. But while using this method makes it possible to the the level on the Logger, you still can not configure the handler, so you will not get any logging output still.&lt;br /&gt;&lt;br /&gt;So, we had to go for the configuration file. This is actually not so bad. You find the logging.properties file (it is under jre.lib) and configure your logging there. For console logging, you have to change the level of the ConsoleHandler (configured by default, but set to INFO level):&lt;br /&gt;&lt;code&gt;&lt;br /&gt;java.util.logging.ConsoleHandler.level = FINE&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;If you want logging to file, you can add the FileHandler instead:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;And of course, you turn your logging on:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;com.xx.package.level = FINE&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Now on my Windows PC this works both in applet viewer and in browser. But when I try the ConsoleHandler on my Mac, there is another gotcha, &lt;a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6585429"&gt;Bug ID &lt;span &gt;6585429 &lt;/span&gt;&lt;span &gt;LoggerTraceListener causes infinite loop under some circumstances&lt;/span&gt;&lt;/a&gt;. On my mac the console simply loops and writes the same message over and over again. Seems like this is a known bug, and there should be a fix available, but for now we are stuck with logging to file on the Mac.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-2609334453281462916?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/2609334453281462916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=2609334453281462916' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2609334453281462916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2609334453281462916'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2008/06/java-applet-logging.html' title='Java Applet logging'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-6653178414385329824</id><published>2008-06-23T13:32:00.002+02:00</published><updated>2008-06-23T13:37:17.500+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gadget'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Shopping List gadget updated</title><content type='html'>My shopping list gadget was one of my first, and is still my most popular. It was originally written as an inline gadget, and has been inline all the time, up till a few days ago.  But lately I had complaints about problems with it. So this weekend a took a look. It seems like inline gadgets do not work as before anymore. Inline is actually not supported for new gadgets, so this is not a surprise. So I had to rewrite it and change the type. I also removed all the __MODULE_ID__, which are no longer needed, since it is rendered in an IFRAME.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-6653178414385329824?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/6653178414385329824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=6653178414385329824' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6653178414385329824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6653178414385329824'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2008/06/shopping-list-gadget-updated.html' title='Shopping List gadget updated'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-3365260789228118946</id><published>2008-06-21T18:51:00.002+02:00</published><updated>2008-06-21T18:55:47.086+02:00</updated><title type='text'>Web site revised</title><content type='html'>I have spent some hours on revising my private web site &lt;a href="http://jubic.se"&gt;jubic.se&lt;/a&gt;. The new site is based on css positioning instead of the old one, based on html tables. Much esiser to maintain and hopefully a bit more modern look. Some changes to the content too, mainly on the main page, which is re-written. The site contains motsly material on my Google gadgets. I hope to have the time to add some more the following weeks, and possibly also some MySql material later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-3365260789228118946?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/3365260789228118946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=3365260789228118946' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3365260789228118946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3365260789228118946'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2008/06/web-site-revised.html' title='Web site revised'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-3246662376915360857</id><published>2008-06-13T12:51:00.003+02:00</published><updated>2008-06-13T12:56:13.094+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='blogger'/><category scheme='http://www.blogger.com/atom/ns#' term='gadget'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Blogger problem solved!!</title><content type='html'>At last I manged to get my javascript code into blogger. The problem was with &amp;lt; and &amp;gt; which Blogger don't like. So i had to create small strings and use instead:&lt;br /&gt;&lt;br /&gt;var lt = String.fromCharCode(60);&lt;br /&gt;var gt = String.fromCharCode(62);&lt;br /&gt;&lt;br /&gt;And now everything works as it should! Check it out at &lt;a href="http://rockpopfavorites.blogspot.com/"&gt;http://rockpopfavorites.blogspot.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It is behind the YouTube search at the right, which is actually a Google gadget (not yet published) where parameters are set dynamically.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-3246662376915360857?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/3246662376915360857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=3246662376915360857' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3246662376915360857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3246662376915360857'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2008/06/blogger-problem-solved.html' title='Blogger problem solved!!'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-6946043268894673078</id><published>2008-06-13T09:32:00.004+02:00</published><updated>2008-06-13T12:56:40.944+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='blogger'/><title type='text'>Blogger hates me.....</title><content type='html'>I have been trying most of the week to add some HTML and javascript code to a blog. It looks OK in the edit window but every time I save it, Blogger destroys my beautiful javascript code... It tries to format it, moves fragments of code around and destroys it completely. Escpecially special chars (including the not so special " and ' chars and whitespace!!!) seems almost impossible. I have spent several hours of my precious spare time on this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-6946043268894673078?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/6946043268894673078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=6946043268894673078' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6946043268894673078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6946043268894673078'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2008/06/blogger-hates-me.html' title='Blogger hates me.....'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-3670829555085641344</id><published>2008-06-04T20:05:00.003+02:00</published><updated>2008-07-30T15:54:41.025+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java applet'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Applet lifecycle</title><content type='html'>Lately I have been working with applets. This is new to me, since I have been mostly a server and web guy, with J2EE and servlets as my specialities, and some J2ME. And now I have run into a strange problem....&lt;br /&gt;&lt;br /&gt;An applet's life cycle has four methods:&lt;br /&gt;- init() when it is created&lt;br /&gt;- start() when it is shown&lt;br /&gt;- stop() when it is no longer shown&lt;br /&gt;- destroy() for releasing resources&lt;br /&gt;&lt;br /&gt;There is an old exception to this, that som browsers (Internet Explorer, possibly some other too) sometimes i9nvokes init() more than once. We had some problems with our applet which seemed to be caused by this. But when it made a fix for this, it did not help...&lt;br /&gt;&lt;br /&gt;Some more investigation showed that actually Internet Explorer did not only invoke init() twice but also created two instances and invoked both init() and start() on both. This seems to happen the first time an applet is run, but possibly not the second. Very strange indeed....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-3670829555085641344?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/3670829555085641344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=3670829555085641344' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3670829555085641344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3670829555085641344'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2008/06/applet-lifecycle.html' title='Applet lifecycle'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-8208199590049623952</id><published>2008-03-18T11:26:00.005+01:00</published><updated>2009-03-09T12:22:00.614+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><title type='text'>Create thumbnail in J2ME</title><content type='html'>The latest week I have been working on a J2ME project where we need to display thumbnails of piuctures from the mobile camera. I suppose this is a common scenario, but we had some unexpected problems..&lt;br /&gt;&lt;br /&gt;The main reason for the problem is that mobile cameras today are very good. This means that images often will be very big, too big to display, but also to big to handle as an image in the J2ME environment. If you try Image.createImage() you will get an out-of-memory exception. This means that you can not create an Image even to create a thumbnail. In stead you have to create the thumbnail image straight from the stream, without creating a full-size image first.&lt;br /&gt;&lt;br /&gt;There are different ways to do this, but since we work with a target platform that is quite new, and supports &lt;a href="http://jcp.org/en/jsr/detail?id=234"&gt;JSR-234&lt;/a&gt; we chose to use this feature. A small utility function to do the resize could look something like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;public static Image resizeImage(InputStream src, int width, int height)&lt;br /&gt;{&lt;br /&gt; MediaProcessor mp;&lt;br /&gt; try {&lt;br /&gt;    mp = GlobalManager.createMediaProcessor("image/jpeg");&lt;br /&gt;    mp.setInput(src, MediaProcessor.UNKNOWN);&lt;br /&gt;    ByteArrayOutputStream bos = new ByteArrayOutputStream();&lt;br /&gt;    mp.setOutput(bos);&lt;br /&gt;    ImageTransformControl fc = (ImageTransformControl) mp&lt;br /&gt;        .getControl("javax.microedition.amms.control.imageeffect.ImageTransformControl");&lt;br /&gt;    fc.setTargetSize(width, height, 0);&lt;br /&gt;    fc.setEnforced(true);&lt;br /&gt;    fc.setEnabled(true);&lt;br /&gt;&lt;br /&gt;    mp.complete();&lt;br /&gt;    src.close();&lt;br /&gt;    return Image.createImage(bos.toByteArray(), 0, bos.size());&lt;br /&gt;  } catch (MediaException e) {&lt;br /&gt;      System.out.println("MediaException in Utils.resizeImage():" + e.getMessage());&lt;br /&gt;  } catch (IOException e) {&lt;br /&gt;      System.out.println("IOException in Utils.resizeImage():" + e.getMessage());&lt;br /&gt;  }&lt;br /&gt;  return null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-8208199590049623952?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/8208199590049623952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=8208199590049623952' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/8208199590049623952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/8208199590049623952'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2008/03/create-thumbnail-in-j2me.html' title='Create thumbnail in J2ME'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-8284397139005158576</id><published>2008-02-13T08:07:00.001+01:00</published><updated>2008-02-13T08:10:17.746+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>RSS Reader Gadget updated</title><content type='html'>I have made a minor update to the RSS reader gadget. You can now set how old items that should be displayed. Increases usability quite a lot.&lt;br /&gt;Check it out &lt;a href="http://www.google.se/ig/directory?url=jubic.se/google/rssreader.xml"&gt;here.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-8284397139005158576?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/8284397139005158576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=8284397139005158576' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/8284397139005158576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/8284397139005158576'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2008/02/rss-reader-gadget-updated.html' title='RSS Reader Gadget updated'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-4428908043450748133</id><published>2007-12-08T09:38:00.000+01:00</published><updated>2007-12-08T09:51:13.708+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><title type='text'>Web enabling MySQL</title><content type='html'>Mark Atwood has published an interesting &lt;a href="http://fallenpegasus.livejournal.com/661775.html"&gt;post &lt;/a&gt;with his wishlist for MySQL. One of his points is already (partly) covered with the LOAD XML command I made for MySQL 6.0 (or is it 5.2). &lt;br /&gt;&lt;br /&gt;The main problem with it is perhaps that it works (like the LOAD DATA command) only with files, but in a web world you want it to be able to take input from other sources. You also need to be able to send an XML to several tables, with foreign keys coordinated etc.&lt;br /&gt;&lt;br /&gt;Mark also has a wishlist for the opposite, the SELECT OUTFILE command. I have made a couple of stored procedures to help with this, but an extended SELECT OUTFILE would be mucke aesier to use and give much more possibilities. It would be fun to work on this, we'll see if I have the time, now that I am almost ready with my relocation..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-4428908043450748133?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/4428908043450748133/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=4428908043450748133' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/4428908043450748133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/4428908043450748133'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/12/web-enabling-mysql.html' title='Web enabling MySQL'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-7704600084126789596</id><published>2007-11-16T10:03:00.000+01:00</published><updated>2007-11-16T10:16:16.305+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>RSS reader gadget</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_3aT5iYAdRTk/Rz1f0HI6saI/AAAAAAAAAvE/DwWSz95Dwls/s1600-h/rssreaderdump.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://2.bp.blogspot.com/_3aT5iYAdRTk/Rz1f0HI6saI/AAAAAAAAAvE/DwWSz95Dwls/s320/rssreaderdump.png" alt="" id="BLOGGER_PHOTO_ID_5133364499146518946" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;For a while I have been using a small PC program for the feeds I keep a look on. It has lot's of functionality, and with some work I can get it to do just what I want to, which is very simple: just display a list of my feeds, where I can expand a feed and look at the posts.&lt;br /&gt;&lt;br /&gt;But this gave me some problems... Sometimes it crashed, and I loose all my settings. I then have to set up everything again, which is a lot of work. Also I only had it on one of the computers I use (three in all), which meant I could only follow the feeds on that computer.&lt;br /&gt;&lt;br /&gt;So the last time it crashed for me, i deinstalled it and made a Google gadget for feeds instead. So far it is very basic, the main advantage over the ones I have seen is that it handles multiple feeds ( there are excellent gadgets for handling only one feed). Probably I will add more options in the future.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-7704600084126789596?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/7704600084126789596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=7704600084126789596' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/7704600084126789596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/7704600084126789596'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/11/rss-reader-gadget.html' title='RSS reader gadget'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_3aT5iYAdRTk/Rz1f0HI6saI/AAAAAAAAAvE/DwWSz95Dwls/s72-c/rssreaderdump.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-2608087177262454668</id><published>2007-11-01T14:51:00.001+01:00</published><updated>2009-03-09T12:22:24.857+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java ME'/><title type='text'>Back to the J2ME world</title><content type='html'>I have got a new assignment, for a J2ME midlet this time. Primary target is not a small cellphone, but the new &lt;a href="http://www.blackberrycurve.com/"&gt;BlackBerry Curve&lt;/a&gt;. This means we have to think differently, the BlackBerry has a muck better interface, larger screen and a qwerty keyboard. We have to make sure they are used the best way possible. My previous J2ME experience has been with cellphones from Nokia, Sony Ericsson and Motorola, this is something different.&lt;br /&gt;&lt;br /&gt;The BlackBerry environment means that additional preprocessing has to be done. Not a big thing, but yet another point that differs from PC/Windows client, where you just develop form Windows (possible verify on both XP and Vista) and don't care about the hardware. The J2ME platform is still not that mature (will it ever be?), you have to verify on the major phone brands, both that it works and looks OK.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-2608087177262454668?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/2608087177262454668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=2608087177262454668' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2608087177262454668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2608087177262454668'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/11/back-to-j2me-world.html' title='Back to the J2ME world'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-7570478646953590667</id><published>2007-10-24T05:34:00.000+02:00</published><updated>2007-10-24T15:53:40.521+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>Import and Export</title><content type='html'>Recently we have been doing some work with export and import of data from and to MySql databases. Our customer wants to be able to export configuration data from one MySql instance and import it into another.&lt;br /&gt;&lt;br /&gt;The obvious tool to use is mysqldump. But since we need to edit the exported data (just replace some codes) before importing it into the other instance we use the --tab option.  This means that instead of one big file (or actually redirected standard output) we get two files per table, one with the CREATE TABLE command and one with the data.&lt;br /&gt;&lt;br /&gt;In the next step we run some scripts to modify the data. This is quite easy, since data is in text files with one record per row.&lt;br /&gt;&lt;br /&gt;Finally we import the data into the new instance. While the default mode of mysqldump creates a file you can run in the command line client, mysqldump --tab does not. You have to create that yourself, but it is not very complicated. You need the following lines for every table:&lt;br /&gt;&lt;br /&gt;source [tablename].sql                                           &lt;br /&gt;LOCK TABLES  [tablename] WRITE;&lt;br /&gt;ALTER TABLE  [tablename] DISABLE KEYS ;&lt;br /&gt;LOAD DATA INFILE '[path][tablename].txt' INTO TABLE [tablename] ;&lt;br /&gt;ALTER TABLE  [tablename] ENABLE KEYS ;&lt;br /&gt;UNLOCK TABLES;&lt;br /&gt;&lt;br /&gt;The ALTER TABLE and LOCK/UNLOCK commands are not absolutely necessary, but they speed things up. We have not measured the speed of this approach, but the general impression is that it is fast.&lt;br /&gt;&lt;br /&gt;Probably this method is faster than the default mode of mysqldump, because data is not sent through the parser, where there has been some performance problems. LOAD DATA INFILE is in most cases very fast.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-7570478646953590667?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/7570478646953590667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=7570478646953590667' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/7570478646953590667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/7570478646953590667'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/10/import-and-export.html' title='Import and Export'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-1706588222763756798</id><published>2007-10-22T13:37:00.001+02:00</published><updated>2008-07-30T15:55:26.612+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Java Hibernate'/><title type='text'>Out of memory......</title><content type='html'>Last week or so has been busy. We are working on our next release, which seems to work well on a functional level. But we get problems with Out of memory errors...&lt;br /&gt;&lt;br /&gt;There are different causes for this, but the main cause is with Hibernate. The part that causes the most problems is where we read quite a lot of data and generate data for the online part of the system. The data is stored as BLOBs in the database, and Hibernate is used througout. We want to be sure that everything or nothing is processed, so it is all done in one tranmsaction.&lt;br /&gt;&lt;br /&gt;Now it seems that even though we do not read from the table with the BLOBs, only write to it, Hibernate keeps all records in the session cache, filling the memory. To me this seems very strange. We dont need this cache, once the records are written to the database, they should be  removed from the cache. In my experience this is a very common scenario, that you do not read the records created again in the same process. In fact it is good practice to get all data before inserting, so you do not need to read the same record again.&lt;br /&gt;&lt;br /&gt;It is also difficult to understand that Hibernate does not take care of Out of memory conditions. A good cache should not grow without limit, it should purge data when memory usage is too high. This is not something you should have to do in your application.&lt;br /&gt;&lt;br /&gt;The problem seems to be solved for now, but since data volumes in the system will grow, it will probably reappear. We will have to do something more permanent for the future. Probably this will be to bypass Hibernate for the BLOB insert, and do this with JDBC calls.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-1706588222763756798?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/1706588222763756798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=1706588222763756798' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/1706588222763756798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/1706588222763756798'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/10/out-of-memory.html' title='Out of memory......'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-5006920931692336379</id><published>2007-10-11T13:41:00.000+02:00</published><updated>2007-10-11T13:47:57.738+02:00</updated><title type='text'>Moving !!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_3aT5iYAdRTk/Rw4MsvWsgAI/AAAAAAAAAuk/-L2oiaGD808/s1600-h/%C3%96vre+L%C3%A5ngvinkelgatan88.JPG"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://3.bp.blogspot.com/_3aT5iYAdRTk/Rw4MsvWsgAI/AAAAAAAAAuk/-L2oiaGD808/s320/%C3%96vre+L%C3%A5ngvinkelgatan88.JPG" alt="" id="The new house" border="1" /&gt;&lt;/a&gt;&lt;br /&gt;I haven't had much time for this blogging for a while, and probably won't have until perhaps in december. Most of my spare time is spend on moving.&lt;br /&gt;&lt;br /&gt;After 23 years I am leaving Lund. Not going too far though, just some 60 kilometers, to Helsingborg.  From the University town of Lund, where Sony Ericsson is the largest employer, to the harbour town of Helsingborg, with IKEA:s IT department.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-5006920931692336379?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/5006920931692336379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=5006920931692336379' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/5006920931692336379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/5006920931692336379'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/10/moving.html' title='Moving !!'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_3aT5iYAdRTk/Rw4MsvWsgAI/AAAAAAAAAuk/-L2oiaGD808/s72-c/%C3%96vre+L%C3%A5ngvinkelgatan88.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-6891986412022682628</id><published>2007-10-03T13:42:00.000+02:00</published><updated>2007-10-11T13:41:01.547+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><title type='text'>Hibernate proxy classes and reflection</title><content type='html'>I have been struggling the last few days with a small tool to export and import data from a system using Hibernate Object Relational mapping.  To make it fairly general, and avoid having to change it when attributes are added to the data model we based it on Java reflection. Fairly straightforward, create an XML file with classnames as tagnames and fields as attributes.&lt;br /&gt;&lt;br /&gt;The first problem was object relations. My initial plan was to simply follow them, but sinces they are all bi-directional this would mean looping forever. So we had to add a setup where you tell the tool which object relations should be included.&lt;br /&gt;&lt;br /&gt;The next problem was worse. It seems that Hibernate somtimes does not create the right objects when loading objects from the database. Instead so called 'proxy classes' are created. This means that reflection does not work as expected... You cannot use Field to acces the fields, instead you have to use the getter methods. OK, not to complicated, once you know. Unfortunately we had one attribute which did not follow naming standards, so we needed a small hack to make this work. What I would have liked is a way to get the real class and skip the proxy. But i guess you can't get everything.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-6891986412022682628?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/6891986412022682628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=6891986412022682628' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6891986412022682628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6891986412022682628'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/10/hibernate-proxy-classes-and-reflection.html' title='Hibernate proxy classes and reflection'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-3339879997547197322</id><published>2007-09-07T11:30:00.000+02:00</published><updated>2007-09-07T11:30:49.220+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='MySQL quiz answers'/><title type='text'>SQL mode quiz answers</title><content type='html'>My quiz about SQL mode was a bit more difficult than I expected. The question was which ones of the following statements are affected by a change from the default SQL mode to ANSI mode.&lt;br /&gt;&lt;br /&gt;I used the INFORMATION_SCHEMA tables for examples throughout. This is to make it easy to try for yourself, without needing to create tables etc. If you use the Query Browser to try this out you should beware that setting the sql_mode might not work, since the Query Browser by default creates a new database connection for every statement. The easiest way to check this si to use the 'set global sql_mode' command, but you should not do this on a production database, since strange things might happen....&lt;br /&gt;&lt;br /&gt;If you want to read the documentation, you find it &lt;a href="http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Now for the solution...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;a) SELECT concat(table_name,' ',column_name) FROM information_schema.COLUMNS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This was quite an easy one. CONCAT is a MySQL extension to ANSI SQL, but it is not disabled by the ANSI SQL mode. The command will work just as well whatever the SQL mode. But CONCAT is not portable to other databases. Oracle has a CONCAT function, but it takes only two arguments. SQL Server has no CONCAT, and I don't know any other databases that has one.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;b) SELECT TABLE_NAME||' '||COLUMN_NAME FROM information_schema.COLUMNS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That was also an easy one. Double pipes is the ANSI standard way of string concatenation. In MySQL it means OR.&lt;br /&gt;&lt;br /&gt;So, in ANSI mode you will get:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;+-------------------------------------+&lt;br /&gt;&lt;br /&gt;| TABLE_NAME||' '||COLUMN_NAME        |&lt;br /&gt;&lt;br /&gt;+-------------------------------------+&lt;br /&gt;&lt;br /&gt;| CHARACTER_SETS CHARACTER_SET_NAME&lt;br /&gt;&lt;br /&gt;| CHARACTER_SETS DEFAULT_COLLATE_NAME&lt;br /&gt;&lt;br /&gt;| CHARACTER_SETS DESCRIPTION   &lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;etc&lt;br /&gt;&lt;br /&gt;In default mode:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;+------------------------------+&lt;br /&gt;| TABLE_NAME||' '||COLUMN_NAME |&lt;br /&gt;+------------------------------+&lt;br /&gt;|                            0 |&lt;br /&gt;|                            0 |&lt;br /&gt;|                            0 |&lt;br /&gt;|                            0 |&lt;br /&gt;|                            0 |&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;c) SELECT count (*) FROM information_schema.COLUMNS&lt;br /&gt;&lt;/span&gt;This was a tricky one. I guess it was not easy to see, but there is actually a space between count and the left parenthesis. This makes it invalid in MySQL standard mode:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;mysql&gt; SELECT count (*) FROM information_schema.COLUMNS;&lt;br /&gt;ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that&lt;br /&gt;corresponds to your MySQL server version for the right syntax to use near '*) FR&lt;br /&gt;OM information_schema.COLUMNS' at line 1&lt;/blockquote&gt;Change to ANSI mode, and it works:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;mysql&gt; set sql_mode = 'ANSI';&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&gt;  SELECT count (*) FROM information_schema.COLUMNS;&lt;br /&gt;+-----------+&lt;br /&gt;| count (*) |&lt;br /&gt;+-----------+&lt;br /&gt;|       503 |&lt;br /&gt;+-----------+&lt;br /&gt;1 row in set (0.11 sec)&lt;/blockquote&gt;So, this is a statement that works differently....&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;d) SELECT "TABLE_NAME" FROM information_schema.COLUMNS&lt;br /&gt;&lt;/span&gt;This was also quite easy. Double quote is according to ANSI standard used for identifiers like table and column names. You only need them if you have characters that would otherwise be illegal or if you want to have mixed case in your identifiers.&lt;br /&gt;&lt;br /&gt;By default MySQL uses double quotes for strings. This means that the select will give the following result:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;+------------+&lt;br /&gt;| TABLE_NAME |&lt;br /&gt;+------------+&lt;br /&gt;| TABLE_NAME |&lt;br /&gt;| TABLE_NAME |&lt;br /&gt;| TABLE_NAME |&lt;br /&gt;| TABLE_NAME |&lt;/blockquote&gt;&lt;br /&gt;If you change to ANSI, you will get the following result:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;+----------------+&lt;br /&gt;| TABLE_NAME     |&lt;br /&gt;+----------------+&lt;br /&gt;| CHARACTER_SETS |&lt;br /&gt;| CHARACTER_SETS |&lt;br /&gt;| CHARACTER_SETS |&lt;br /&gt;| CHARACTER_SETS |&lt;br /&gt;| COLLATIONS     |&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;e) SELECT `TABLE_NAME` FROM information_schema.COLUMNS&lt;br /&gt;&lt;/span&gt;This is the MySQL alternative to ANSI double quote. It does not follow ANSI standard, but the MySQL ANSI mode will not turn it off.  I do not know another database that allows this syntax, so if you try to convert your system you will have to remove them.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Conclusion&lt;/span&gt;&lt;br /&gt;Statements b, c and d are the ones that will behave differently if you change to ANSI mode. Statements a and e will work the same.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-3339879997547197322?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/3339879997547197322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=3339879997547197322' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3339879997547197322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3339879997547197322'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/09/sql-mode-quiz-answers.html' title='SQL mode quiz answers'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-8273764105970061674</id><published>2007-09-05T21:03:00.002+02:00</published><updated>2007-09-05T22:10:30.796+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='MySQL quiz'/><title type='text'>SQL mode quiz</title><content type='html'>MySQL follows ANSI SQL standard quite close. But there are a few points where it differs. To make MySQL follow the ANSI standard more closely you can use the SQL_MODE system system variable.&lt;br /&gt;&lt;br /&gt;If you set the SQL mode to ANSI, MySQL will interpret you SQL commands differently. Some of your SELECT statements might work differently or not at all. But which ones? Let's see if you know....&lt;br /&gt;&lt;br /&gt;Suppose you change your sql mode setting from none to ANSI. Which of the following statements will be affected:&lt;br /&gt;&lt;br /&gt;a) SELECT concat(table_name,' ',column_name) FROM information_schema.COLUMNS&lt;br /&gt;b) SELECT TABLE_NAME||' '||COLUMN_NAME FROM information_schema.COLUMNS&lt;br /&gt;c) SELECT count (*) FROM information_schema.COLUMNS&lt;br /&gt;d) SELECT "TABLE_NAME" FROM information_schema.COLUMNS &lt;br /&gt;e) SELECT `TABLE_NAME` FROM information_schema.COLUMNS&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-8273764105970061674?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/8273764105970061674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=8273764105970061674' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/8273764105970061674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/8273764105970061674'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/09/sql-mode-quiz.html' title='SQL mode quiz'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-8585710724700845597</id><published>2007-08-29T10:41:00.000+02:00</published><updated>2007-08-29T11:48:27.506+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><title type='text'>Follow up on LOAD XML</title><content type='html'>A few weeks ago (time flies..) i posted a short note about my LOAD XML contribution. It has actually been available for some time, veven if it is not so easy to find. It is included in MySql 5.2.5:&lt;br /&gt;&lt;a href=" ftp://ftp.mysql.com/pub/mysql/download/mysql-5.2.5-alpha/"&gt;download&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dev.mysql.com/doc/refman/5.2/en/load-xml.html"&gt;documentation&lt;/a&gt; - quite good I think!&lt;br /&gt;&lt;br /&gt;It is a bit sad that it is included in 5.2 (still in alfa) and not in 5.1. Since it is a separate command it will not affect existing installations and would not be risky. That faster it gets included the faster we will get feedback on it, which is what I believe is needed right now. Is this something that MySql users need and will use? Or will they use other tools to read XML data into their MySql databases?&lt;br /&gt;&lt;br /&gt;LOAD XML reads data into a MySql table in much the same way as LOAD DATA does and in fact the implementation is based on LOAD DATA. This means that it does not parse the entire XML document ( I belive MySql xml function &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/xml-functions.html"&gt;ExtractValue()&lt;/a&gt; does that) but instead reads one row at a time from the xml file and inserts it into the database. This makes reading of large xml files possible at quite a decent speed, althoug not as fast as LOAD DATA.&lt;br /&gt;&lt;br /&gt;The mapping between XML and the table is based on two assumptions:&lt;br /&gt;- there should be an XML tag that corresponds to a record in the table. You name this tag in the 'ROWS IDENTIFIED BY' clause&lt;br /&gt;- both tags and attributes are matched automatically with column names and values&lt;br /&gt;  inserted into the tables. Tags and attributes that do not match columns are simply ignored&lt;br /&gt;&lt;br /&gt;When I implemented this the scenario it was designed for is an integration scenario, where you receive data in an XML file periodically and dump it into your database.&lt;br /&gt;&lt;br /&gt;There are of course limitations you should be aware of:&lt;br /&gt;- CDATA is not supported and binary fields can not be handled&lt;br /&gt;- it can only load data from a file&lt;br /&gt;- the XML is not verfied, an illegal XML could very well be processed, no validation with xml schema or DTD is made&lt;br /&gt;- there is no namespace support&lt;br /&gt;&lt;br /&gt;All in all I think this could be quite a useful function. Arnold Daniels, who worked with me on this contribution initially, is planning some &lt;a href="http://blog.adaniels.nl/?p=42"&gt;improvements&lt;/a&gt;. Among other things to make this work with XML data that is not read from a file. &lt;br /&gt;&lt;br /&gt;Personally I will perhaps make some minor fixes, but probably start on something entierly different. Don't know what yet, your suggestions are welcome....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-8585710724700845597?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/8585710724700845597/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=8585710724700845597' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/8585710724700845597'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/8585710724700845597'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/08/follow-up-on-load-xml.html' title='Follow up on LOAD XML'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-5946018037027576715</id><published>2007-08-13T20:24:00.001+02:00</published><updated>2007-08-13T22:09:10.948+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><title type='text'>LOAD XML contribution added to MySQL</title><content type='html'>I got news from the MySQL people that my LOAD XML contribution is added to release 5.2. Check the &lt;a href="http://dev.mysql.com/doc/refman/5.2/en/load-xml.html"&gt;manual page&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The aim of the contribution is to simplify reading of XML data into a MySQL database. The LOAD XML command supports three different xml formats:&lt;br /&gt;- field values as attributes&lt;br /&gt;- field values as tags&lt;br /&gt;- the format produced by the mysql -x command, with the field name as an attribute and field value as a tag&lt;br /&gt;&lt;br /&gt;If the LOAD XML command finds a matching field in the target table, the value is inserted, otherwise it is ignored. If you have used the LOAD DATA command (most of us have) you should recognize much of the functionality, LOAD XML works much the same way.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-5946018037027576715?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/5946018037027576715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=5946018037027576715' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/5946018037027576715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/5946018037027576715'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/08/load-xml-contribution-added-to-mysql.html' title='LOAD XML contribution added to MySQL'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-2820215688093487850</id><published>2007-08-06T10:52:00.000+02:00</published><updated>2007-08-06T13:20:33.689+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><title type='text'>More on XML output from MySql</title><content type='html'>In a previous post I described how you could create XML output from SQL using stored functions. But that was a flat structure, with only one table and simple XML structure with a tag for every row in the result set, and column values as attributes or sub tags. Part of the real power of the XML format is that it supports more complicated structures, with hierarchical data. If you need to produce XML for integration with another application you will probably have to produce a XML with data from several tables, and a hierarchical structure. To accomplish this in MySQL we can use the GROUP_CONCAT function, combined with our XML stored functions.&lt;br /&gt;&lt;br /&gt;An example:&lt;br /&gt;We take our select statement from the previous post, that gives us a list of tables in xml format:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;select xml_tag('table',null, concat(xml_attr('name',t.table_name),&lt;br /&gt;xml_attr('engine',t.engine)),null)&lt;br /&gt;from information_schema.tables t&lt;br /&gt;where t.table_schema = 'INFORMATION_SCHEMA'&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;We then add a join with the columns table to get column data:&lt;br /&gt;&lt;blockquote&gt;inner join information_schema.columns c on c.table_name = t.table_name and c.table_schema = t.table_schema&lt;/blockquote&gt;&lt;br /&gt;and replace the last parameter of the xml_tag function call, the one for the subtags with a new xml_tag function call to produce a column tag:&lt;br /&gt;&lt;blockquote&gt;xml_tag('column',c.column_name,null,null)&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;This gives us:&lt;br /&gt;&lt;blockquote&gt;select xml_tag('table',null, concat(xml_attr('name',t.table_name),&lt;br /&gt;xml_attr('engine',t.engine)),xml_tag('column',c.column_name,null,null))&lt;br /&gt;from information_schema.tables t&lt;br /&gt;inner join information_schema.columns c on c.table_name = t.table_name and c.table_schema = t.table_schema&lt;br /&gt;where t.table_schema = 'INFORMATION_SCHEMA'&lt;br /&gt; &lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Running this gives us:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;table name="CHARACTER_SETS" engine="MEMORY" &amp;gt;&lt;br /&gt;&amp;lt;column&amp;gt;CHARACTER_SET_NAME&amp;lt;/column&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;table name="CHARACTER_SETS" engine="MEMORY" &amp;gt;&lt;br /&gt;&amp;lt;column&amp;gt;DEFAULT_COLLATE_NAME&amp;lt;/column&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;table name="CHARACTER_SETS" engine="MEMORY" &amp;gt;&lt;br /&gt;&amp;lt;column&amp;gt;DESCRIPTION&amp;lt;/column&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;table name="CHARACTER_SETS" engine="MEMORY" &amp;gt;&lt;br /&gt;&amp;lt;column&amp;gt;MAXLEN&amp;lt;/column&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;table name="COLLATIONS"  engine="MEMORY" &amp;gt;&lt;br /&gt;&amp;lt;column&amp;gt;COLLATION_NAME&amp;lt;/column&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;etc...&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;OK, this is some kind of structure, column tags inside the table tag. But still we have one table tag for every column, but we want one for every table, with all the column tags inside. To accomplish this we add a group by clause, and use the GROUP_CONCAT function for the column tags. This gives us the following SELECT:&lt;br /&gt;&lt;blockquote&gt;select xml_tag('table',null, concat(xml_attr('name',t.table_name),&lt;br /&gt;xml_attr('engine',t.engine)),GROUP_CONCAT(xml_tag('column',c.column_name,null,null) separator ''))&lt;br /&gt;from information_schema.tables t&lt;br /&gt;inner join information_schema.columns c on c.table_name = t.table_name and c.table_schema = t.table_schema&lt;br /&gt;where t.table_schema = 'INFORMATION_SCHEMA'&lt;br /&gt;group by t.table_name, t.engine&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;And the following result:&lt;br /&gt;&lt;blockquote&gt;&amp;lt;table  name="CHARACTER_SETS"  engine="MEMORY" &amp;gt;&lt;br /&gt;  &amp;lt;column&amp;gt;CHARACTER_SET_NAME&amp;lt;/column&amp;gt;&lt;br /&gt;  &amp;lt;column&amp;gt;DEFAULT_COLLATE_NAME&amp;lt;/column&amp;gt;&lt;br /&gt;  &amp;lt;column&amp;gt;DESCRIPTION&amp;lt;/column&amp;gt;&lt;br /&gt;  &amp;lt;column&amp;gt;MAXLEN&amp;lt;/column&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;table  name="COLLATIONS"  engine="MEMORY" &amp;gt;&lt;br /&gt;  &amp;lt;column&amp;gt;COLLATION_NAME&amp;lt;/column&amp;gt;&lt;br /&gt;  &amp;lt;column&amp;gt;CHARACTER_SET_NAME&amp;lt;/column&amp;gt;&lt;br /&gt;  &amp;lt;column&amp;gt;ID&amp;lt;/column&amp;gt;&lt;br /&gt;  &amp;lt;column&amp;gt;IS_DEFAULT&amp;lt;/column&amp;gt;&lt;br /&gt;  &amp;lt;column&amp;gt;IS_COMPILED&amp;lt;/column&amp;gt;&lt;br /&gt;  &amp;lt;column&amp;gt;SORTLEN&amp;lt;/column&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;etc&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;OK, this is what we wanted! Just one small problem left... When I run this on my laptop I get the error 1260 with the following message: &lt;br /&gt;  %d line(s) were cut by GROUP_CONCAT()&lt;br /&gt;And the result is only 7 rows. This is because the group_concat_max_len has a value that is too small. You can reset it with the command:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;  SET [SESSION | GLOBAL] group_concat_max_len = val&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;I set it with the command:&lt;br /&gt;&lt;blockquote&gt;SET  GLOBAL group_concat_max_len = 2048&lt;/blockquote&gt;&lt;br /&gt;I then rerun the command, and there is no error, and 23 records.&lt;br /&gt;&lt;br /&gt;Code for the stored functions is available at &lt;a href="http://forge.mysql.com/snippets/view.php?id=86"&gt;MySql forge&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-2820215688093487850?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/2820215688093487850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=2820215688093487850' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2820215688093487850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2820215688093487850'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/08/in-previous-post-i-described-how-you.html' title='More on XML output from MySql'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-6352726945826186390</id><published>2007-07-14T17:21:00.000+02:00</published><updated>2007-07-14T17:37:59.098+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><title type='text'>Comments on MySql XML output</title><content type='html'>I have had some comments on my stored functions for XML output from MySql. First of all, publishning the code as a part of a blog post was not a good choice. All xml chars, like &amp;lt; and &amp;gt; must be escaped, and I missed some. I should probably have used the xml_escape function to precess my text...&lt;br /&gt;&lt;br /&gt;That is fixed now, and also I have put the function definitions on the MySql forge,  &lt;a href="http://forge.mysql.com/snippets/view.php?id=86"&gt;here.&lt;/a&gt; Please do not hesitate to tell me if you find any errors, or have suggestions for improvement.&lt;br /&gt;&lt;br /&gt;Another comment was about the xml functionality of 'mysql --xml'. Yes, there is a function for generating xml output from MySql, I do know that. But if you need to output xml from your application there are a number of problems with it:&lt;br /&gt;1) it has to be invoked from the command line, so you need to start a command shell, redirect output somewhere etc. This is not always possible and might not be a good alternative even if it is.&lt;br /&gt;2) you have no control over the xml format, you would probably need to add som XSL processing to get the format you need. This will make it complicated, and XSL knowledge is not that common.&lt;br /&gt;&lt;br /&gt;So, there are a number of situations where the 'mysql --xml' approach is not very suitable, but the stored function might do the job. But certainly you should consider the 'mysql --xml' possibility before choosing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-6352726945826186390?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/6352726945826186390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=6352726945826186390' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6352726945826186390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6352726945826186390'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/07/comments-on-mysql-xml-output.html' title='Comments on MySql XML output'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-2294954972367048132</id><published>2007-07-13T14:08:00.000+02:00</published><updated>2007-07-14T10:02:05.206+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><title type='text'>XML output from MySql</title><content type='html'>Many times you need to produce XML output from your MySql database. MySql has no built-in support for creating XML in it's SQL implementation but you can easily add support using the stored function feature.&lt;br /&gt;&lt;br /&gt;To make xml output easier I have made three small stored SQL functions. They produce xml fragments, which you can easily put together to get a complete xml:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;   xml_escape(value)    replace characters not allowed in xml with the escape sequences&lt;br /&gt;   xml_attr(name, value) create an xml attribute &lt;br /&gt;   xml_tag(tagname, tagvalue, attrs, subtags) create a tag, optionally with &lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Lets see some examples. First a real simple one:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;select xml_tag('table',table_name,null,null)&lt;br /&gt;from information_schema.tables&lt;br /&gt;where table_schema = 'INFORMATION_SCHEMA'&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Gives you something like:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;  &amp;lt;table&amp;gt;CHARACTER_SETS&amp;lt;/table&amp;gt;&lt;br /&gt;  &amp;lt;table&amp;gt;COLLATIONS&amp;lt;/table&amp;gt;&lt;br /&gt;  &amp;lt;table&amp;gt;COLLATION_CHARACTER_SET_APPLICABILITY&amp;lt;/table&amp;gt;&lt;br /&gt;  etc...&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;To make this a valid xml, you need to add an xml header and a root tag, surrounding all the content. Something like this:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;list&amp;gt;&lt;br /&gt;your content...&lt;br /&gt;&amp;lt;/list&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;That will give you a real simple xml, with a list of the tables &lt;br /&gt;in the information schema. But perhaps your specification says &lt;br /&gt;you should present the data as attributes and not as text nodes. &lt;br /&gt;Let's try that:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;select xml_tag('table',null,xml_attr('name',table_name),null)&lt;br /&gt;from information_schema.tables&lt;br /&gt;where table_schema = 'INFORMATION_SCHEMA'&lt;br /&gt;Gives you:&lt;br /&gt;&amp;lt;table  name="CHARACTER_SETS"  /&amp;gt;&lt;br /&gt;&amp;lt;table  name="COLLATIONS"  /&amp;gt;&lt;br /&gt;&amp;lt;table  name="COLLATION_CHARACTER_SET_APPLICABILITY"  /&amp;gt;&lt;br /&gt;etc..&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Since we don't want a text node we let the tagvalue parameter be null. &lt;br /&gt;Instead we use  the xml_attr function to format an xml attribute and &lt;br /&gt;send it in in the attrs parameter.&lt;br /&gt;&lt;br /&gt;But what if we need several attributes? You can not write a stored &lt;br /&gt;function with variable number of arguments, so we use the MySql &lt;br /&gt;standard function concat() for this.&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;select xml_tag('table',null, concat(xml_attr('name',table_name),  &lt;br /&gt;                                    xml_attr('engine',engine)),null)&lt;br /&gt;from information_schema.tables&lt;br /&gt;where table_schema = 'INFORMATION_SCHEMA'&lt;br /&gt;gives you:&lt;br /&gt;&amp;lt;table  name="CHARACTER_SETS"  engine="MEMORY"  /&amp;gt;&lt;br /&gt;&amp;lt;table  name="COLLATIONS"  engine="MEMORY"  /&amp;gt;&lt;br /&gt;&amp;lt;table  name="COLLATION_CHARACTER_SET_APPLICABILITY"  &lt;br /&gt;engine="MEMORY"  /&amp;gt;&lt;br /&gt;&amp;lt;table  name="COLUMNS"  engine="MyISAM"  /&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;And if you want your data as text nodes in sub tags, you do the &lt;br /&gt;same trick with the last parameter in xml_tag, the subtags parameter:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;select xml_tag('table',null,null,&lt;br /&gt;concat(xml_tag('name',table_name,null,null),&lt;br /&gt;xml_tag('engine',engine,null,null)))&lt;br /&gt;from information_schema.tables&lt;br /&gt;where table_schema = 'INFORMATION_SCHEMA'&lt;br /&gt;Results in:&lt;br /&gt;&amp;lt;table&amp;gt;&amp;lt;name&amp;gt;CHARACTER_SETS&amp;lt;/name&amp;gt;&amp;lt;engine&amp;gt;MEMORY&amp;lt;/engine&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;table&amp;gt;&amp;lt;name&amp;gt;COLLATIONS&amp;lt;/name&amp;gt;&amp;lt;engine&amp;gt;MEMORY&amp;lt;/engine&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;table&amp;gt;&amp;lt;name&amp;gt;COLLATION_CHARACTER_SET_APPLICABILITY&amp;lt;/name&amp;gt;&lt;br /&gt;&amp;lt;engine&amp;gt;MEMORY&amp;lt;/engine&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;etc..&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Of course you can combine attributes, subtags and a text node, &lt;br /&gt;but I leave that for yourself to experiment with.&lt;br /&gt;&lt;br /&gt;The stored functions are defined like this:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;DELIMITER $$&lt;br /&gt;&lt;br /&gt;DROP FUNCTION IF EXISTS `xml_escape` $$&lt;br /&gt;CREATE FUNCTION `xml_escape`( tagvalue VARCHAR(2000)) &lt;br /&gt;RETURNS varchar(2000) &lt;br /&gt;BEGIN&lt;br /&gt; IF (tagvalue IS NULL) THEN&lt;br /&gt;     RETURN null;&lt;br /&gt; END IF;&lt;br /&gt; RETURN REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(&lt;br /&gt; tagvalue,'&amp;amp;','&amp;amp;amp;'),&lt;br /&gt;    '&amp;lt;','&amp;amp;lt;'),&lt;br /&gt;    '&amp;gt;','&amp;amp;gt;'),&lt;br /&gt;    '&amp;quot;','&amp;amp;quot;'),&lt;br /&gt;    '\&amp;apos;','&amp;amp;apos;');&lt;br /&gt;END $$&lt;br /&gt;&lt;br /&gt;DROP FUNCTION IF EXISTS `xml_attr` $$&lt;br /&gt;CREATE FUNCTION `xml_attr`(tagname VARCHAR(2000), &lt;br /&gt;tagvalue VARCHAR(2000)) &lt;br /&gt;RETURNS varchar(2000) &lt;br /&gt;BEGIN&lt;br /&gt; IF (tagvalue IS NULL) THEN&lt;br /&gt;     RETURN null;&lt;br /&gt; END IF;&lt;br /&gt; RETURN CONCAT(' ', tagname ,'="',xml_escape(tagvalue),'" ');&lt;br /&gt;END $$&lt;br /&gt;&lt;br /&gt;DROP FUNCTION IF EXISTS `xml_tag` $$&lt;br /&gt;CREATE FUNCTION `xml_tag`(tagname VARCHAR(2000), &lt;br /&gt;                          tagvalue VARCHAR(2000),&lt;br /&gt;                          attrs VARCHAR(2000), &lt;br /&gt;                          subtags VARCHAR(2000)) &lt;br /&gt;RETURNS varchar(2000) &lt;br /&gt;BEGIN&lt;br /&gt; DECLARE result VARCHAR(2000);&lt;br /&gt; SET result = CONCAT('&amp;lt;' , tagname);&lt;br /&gt; IF attrs IS NOT NULL THEN&lt;br /&gt;   SET result = CONCAT(result,' ', attrs);&lt;br /&gt; END IF;&lt;br /&gt; IF (tagvalue IS NULL AND subtags IS NULL) THEN&lt;br /&gt;     RETURN CONCAT(result,' /&amp;gt;');&lt;br /&gt; END IF;&lt;br /&gt; RETURN CONCAT(result ,'&amp;gt;',ifnull(xml_escape(tagvalue),''),&lt;br /&gt;                           ifnull(subtags,''),'&amp;lt;/',tagname, '&amp;gt;');&lt;br /&gt;END $$&lt;br /&gt;&lt;br /&gt;DELIMITER ;&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-2294954972367048132?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/2294954972367048132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=2294954972367048132' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2294954972367048132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2294954972367048132'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/07/xml-output-from-mysql.html' title='XML output from MySql'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-6624947279961825366</id><published>2007-07-06T11:34:00.000+02:00</published><updated>2007-07-06T11:43:33.850+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Wishes &amp; Gifts</title><content type='html'>For a while I have been working on a new Google Gadget. The idea is to keep lists of your wishes and gifts for Christmas or other occasions. I sometimes have problems with coming up with new ideas for gifts both for myself and others, so this should be a help. This is what the gifts tab looks like:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://jubic.googlecode.com/svn/images/wishesandgiftsdump.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px;" src="http://jubic.googlecode.com/svn/images/wishesandgiftsdump.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The wishes tab is simpler, with less functionality, no search etc.&lt;br /&gt;&lt;br /&gt;The gadget was a bit more complicated than I thought, so it tok some time, but finally it was ready yesterday. Here is the link to add it to your Google homepage:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/ig/add?hl=en&amp;moduleurl=http://jubic.se/google/wishesandgifts.xml&amp;source=imag"&gt;Add to Google homepage&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-6624947279961825366?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/6624947279961825366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=6624947279961825366' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6624947279961825366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/6624947279961825366'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/07/wishes-gifts.html' title='Wishes &amp; Gifts'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-4157228588447826788</id><published>2007-06-28T13:14:00.000+02:00</published><updated>2007-06-28T14:40:46.574+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>Top 5 best MySql practices</title><content type='html'>My opinion on MySql best practices, the new new 'chain letter' started by &lt;a href="http://blog.arabx.com.au/?p=752"&gt;Ronald Bradford&lt;/a&gt;. As always, this is a developers point of view.&lt;br /&gt;&lt;br /&gt;0. Make a database design. Databases generated automatically might work very well in development, but when you have large data volumes and lots of concurrent users they do not.&lt;br /&gt;&lt;br /&gt;1. Be consistent in your choice of datatypes. I prefer to use just a subset in a system. Try to stick with SMALLINT UNSIGNED or INTEGER UNSIGNED for keys. Always use the same datatype for the same term in all tables, no joins with datatype conversion! Do not store numbers as CHAR/VARCHAR fields.&lt;br /&gt;&lt;br /&gt;2. Make sure there are indexes supporting all searches that are part of routine system usage. If you have tables that are very small it might be better not to index them, but this should be an active decision.&lt;br /&gt;&lt;br /&gt;3. Verify your database design with real volumes and tests covering the planned usage. A modern computer can quickly scan (without indexes) more data than you will enter by hand, so you will probably need a dump from a production system or generated data. &lt;br /&gt;&lt;br /&gt;4.Use SQL_MODE ANSI and TRADITIONAL for new systems. For old ones, you might have to allow a less strict mode.&lt;br /&gt;&lt;br /&gt;5. Choose your storage engine with care. Use InnoDB (and keep an eye on Falcon!!) if you need transactions, but even if you do, MYISAM migh be a good choice for some tables.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-4157228588447826788?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/4157228588447826788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=4157228588447826788' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/4157228588447826788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/4157228588447826788'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/06/top-5-best-mysql-practices.html' title='Top 5 best MySql practices'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-1229913272415232533</id><published>2007-06-27T09:45:00.000+02:00</published><updated>2007-06-27T10:21:11.160+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><title type='text'>MySql performance in a .NET environment</title><content type='html'>The last two weeks I have been working on a .NET application using MySQL (3.21) for data storage. The application is basically a stand-alone PC application where MySql is used to store a lot of data from test equipment.&lt;br /&gt;&lt;br /&gt;This is a bit different from what I spend most of my time on. No web site with lost of concurrent session, but instead a lot of installations of the software on local PC's. The also means we can not tune parameters on a live system, we have to set them before delivering to customers. Basically this is the main problem, since we don't know how the system will be run.&lt;br /&gt;&lt;br /&gt;Well, if the scenario is different, the most important action was the same. Changing the field order in one of the indexes to match the queries better was our number one action, and the impact was larger than all other actions together. If your indexes are not righ, you should fix it before anything else.&lt;br /&gt;&lt;br /&gt;An upgrade to MySql 5.41 and .net connector 5.0.7 was another obviuos task. I am a bit surprised that it was so easy. The only real problem we had was with merge tables. The initially did not work, but after we made a ALTER TABLE on all underlying tables even the merge tables were OK.&lt;br /&gt;&lt;br /&gt;Performance improvement after upgrading was not large, but when we switched shared memory on, there was a noticeable performance improvement. The application transfers a lot of data between MySql to the applcation, mainly to produce graphs, so this should be important. We also switched both key cache and query cache on, but since we do not know how the application will be used, it is hard to determine the effect of this.&lt;br /&gt;&lt;br /&gt;We had some problems with connections not being closed initially. But turning off connection pooling fixed this. Turning it on from the start was simply a reflex of an old web programmer, I'm afraid. Connecion pooling is not relevant in this scenario.&lt;br /&gt;&lt;br /&gt;All in all a quite successful project. Performance is OK now, and the bottleneck is not the database, so we will look at some other changes, mainy in the graph package.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-1229913272415232533?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/1229913272415232533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=1229913272415232533' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/1229913272415232533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/1229913272415232533'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/06/mysql-performance-in-net-environment.html' title='MySql performance in a .NET environment'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-1474009890528474930</id><published>2007-06-21T14:40:00.000+02:00</published><updated>2007-06-21T15:05:51.796+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>MySql merge table problems</title><content type='html'>While upgrading fom MySql 3 to Myql 5 our only real problem was with merge tables. We have two in the system, both did not work. Createing the merge table did not give an eror, bt when we tried to select from it, we get the error message 1168:&lt;br /&gt; Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist&lt;br /&gt;&lt;br /&gt;This kind of error message gives my the creeps. Or?? Why doesn't it say which one of the cases it is? Surely these are three different cases and it should be easy to separate them. Is it difficult to add error messages to MySql? Or a lazy programmer??&lt;br /&gt;&lt;br /&gt;OK, we try to look at the table definition i MySql's own tool the Query browser. But if you try to do 'Edit Table' in the Query Browser, you get the following error message: &lt;br /&gt;  A MySql eror message was encountered. The eror message is:&lt;br /&gt;  Cannot fetch table information&lt;br /&gt;  The following error occurred:Unable to open underlying table which is differently&lt;br /&gt;  defined or of non-MyISAM type or doesn't exist (1168)&lt;br /&gt;OK, we knew that, but we wanted to take look at the definition to check that it matches the underlying table.&lt;br /&gt;&lt;br /&gt;OK time to check for bugs. We finally find one, saying that of our three possible causes, it is actually a fourth: the table does exist, is of MyISAM type, and definitions match. But it is of an old MyISAM version... Fix is to make an ALTER TABLE on all the underlying tables, this will fix the version also, and everything is OK.&lt;br /&gt;&lt;br /&gt;For the future I think we will look into other solutions. Merge tables are very restrictive and for our purposes a view with UNON ALL would work just as well, since we already make inserts into the underlying tables and have no updates. A quic test also says that the performance is about the same. Or, possibly, we will wait for MySql 5.1 with partitions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-1474009890528474930?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/1474009890528474930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=1474009890528474930' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/1474009890528474930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/1474009890528474930'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/06/mysql-merge-table-problems.html' title='MySql merge table problems'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-4468254183490011536</id><published>2007-06-05T10:35:00.000+02:00</published><updated>2007-06-26T13:36:54.557+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><title type='text'>MySQL performance enhancements</title><content type='html'>I have been working on a new assignment this week, with the goal to improve performance in a .NET application using MySQL (3.21) for data storage. The application handles a lot of data in what is basically a single user system.&lt;br /&gt;&lt;br /&gt;The main rason for the performance problems was heavy searches where indexes did not match. Simply switching the order of columns in the composite key fixed most of it. &lt;br /&gt;&lt;br /&gt;In the old version they copied data to a temporary table, to solve the slow query problem. Once we had the indexes fixed, we could drop this solution and use the ase table in all cases. This also speeded it up a lot.&lt;br /&gt;&lt;br /&gt;The change to MySQL 5.0 made a few other changes possible&lt;br /&gt;- switch to shared memory for communication between database and application&lt;br /&gt;- buffering of indexes&lt;br /&gt;- query caching&lt;br /&gt;which all ment further improved performance&lt;br /&gt;&lt;br /&gt;All in all quite successful so far. Performance is OK now, and the bottleneck is not the database, so we will look at some other changes.&lt;br /&gt;&lt;br /&gt;It has been great fun, .Net is a new environment for me, but it was quite easy to get into it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-4468254183490011536?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/4468254183490011536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=4468254183490011536' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/4468254183490011536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/4468254183490011536'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/06/mysql-performance-enhancements.html' title='MySQL performance enhancements'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-9003589412747726028</id><published>2007-05-30T10:29:00.000+02:00</published><updated>2007-05-30T10:44:40.179+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>More gadgeteering....</title><content type='html'>I am a great music fan, and from time to time can't stop myself from singing a song or two, mostly rock classics. Although I know a lot of lyrics, often I can't recall them all.&lt;br /&gt;&lt;br /&gt;Now they are all out there on the net, but sometimes difficult to find. So I made a small Google custom search engine, and a gadget to go with it, like this: &lt;br /&gt;&lt;script src="http://gmodules.com/ig/ifr?url=http://jubic.se/google/lyricsearch.xml&amp;amp;up_color=blue&amp;amp;synd=open&amp;amp;w=320&amp;amp;h=80&amp;amp;title=Lyric%20Search%20Gadget&amp;amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;amp;output=js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Surprisingly what you can do with so little, the power of the web is amazing!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-9003589412747726028?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/9003589412747726028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=9003589412747726028' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/9003589412747726028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/9003589412747726028'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/05/more-gadgeteering.html' title='More gadgeteering....'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-1362991836349831506</id><published>2007-05-16T17:52:00.000+02:00</published><updated>2007-05-16T18:00:59.880+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Pricerunner Google Gadget</title><content type='html'>Made another Google gadget the other day, this time doing a search in Pricerunner, to compare prices and products. I believe Pricerunner is a very good service, and widely used in Sweden.&lt;br /&gt;&lt;br /&gt;The gadget looks like this:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://jubic.se/google/pricerunnerdump.png"&gt;&lt;img style="float:center; margin:10 10px 10px 0;cursor:pointer; cursor:hand;width: 320px;" src="http://jubic.se/google/pricerunnerdump.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Today it supports Pricerunner in the UK, Germany, Sweden and Denmark. Hopefully I will be able to add US and France soon.&lt;br /&gt;&lt;br /&gt;You could also try it &lt;a href="http://jubic.se/prgadget.php"&gt;here.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/ig/add?moduleurl=http://jubic.se/google/pricerunner.xml"&gt;Add Pricerunner to your Google homepage.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-1362991836349831506?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/1362991836349831506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=1362991836349831506' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/1362991836349831506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/1362991836349831506'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/05/pricerunner-google-gadget.html' title='Pricerunner Google Gadget'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-2732706191617106539</id><published>2007-05-10T13:09:00.000+02:00</published><updated>2007-05-10T13:22:52.964+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>Turning the result around</title><content type='html'>In many cases you don't want your the result from your SQL statement in just a plain listing, but organized in columns, or whith data grouped on status, period or whatever. This can often be accomplished with a combination of the IF function and SUM or another group function.&lt;br /&gt;&lt;br /&gt;For example get your sales per customer grouped by period:&lt;br /&gt;SELECT customer_no AS CUSTNO, cust_name AS CUSTNAME,&lt;br /&gt;      sum(if(period = '200701',amount,0) as Jan_Amount,&lt;br /&gt;      sum(if(period = '200702',amount,0) as Jan_Amount&lt;br /&gt;FROM otd.salestrans_hist s &lt;br /&gt;WHERE period IN ('200701','200702')&lt;br /&gt;GROUP BY customer_no, cust_name&lt;br /&gt;&lt;br /&gt;Or number of open and closed records in each class:&lt;br /&gt;SELECT class, sum(if(status='Open',1,0)) as open,&lt;br /&gt;                sum(if(status='Closed',1,0)) as closed&lt;br /&gt;FROM table_name&lt;br /&gt;GROUP BY class&lt;br /&gt;&lt;br /&gt;In the examples I have used the MySQL IF function. You could also use CASE,  which is SQL standard.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-2732706191617106539?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/2732706191617106539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=2732706191617106539' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2732706191617106539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/2732706191617106539'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/05/turning-result-around.html' title='Turning the result around'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-3899434637893151462</id><published>2007-04-25T11:39:00.000+02:00</published><updated>2007-05-10T15:09:05.545+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='EJB'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Indexing, indexing and indexing....</title><content type='html'>&lt;span style="font-size:85%;"&gt;Saw this table definition in a system I was working on:&lt;br /&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;CREATE TABLE session_role (&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    Session_sessionId        bigint(20)   NOT NULL,&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    activeRoles_roleId   varchar(255) NOT NULL,&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;PRIMARY KEY(Session_sessionId,activeRoles_roleId),&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;UNIQUE KEY activeAccounts_actorId (activeRoles_roleId),&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;KEY `FK38CC06CCF5B03D50` (Session_sessionId),&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;KEY `FK38CC06CC4085AE4` (activeRoles_roleId),&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;CONSTRAINT `FK38CC06CC4085AE4` FOREIGN KEY (activeRoles_roleId)&lt;br /&gt;     REFERENCES role(roleId),&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;CONSTRAINT `FK38CC06CCF5B03D50` FOREIGN KEY (Session_sessionId)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;     REFERENCES session (sessionId)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;) ENGINE=InnoDB DEFAULT CHARSET=utf8;&lt;br /&gt;&lt;br /&gt;This is four indexes for a two-column table! Of course nobody has actually written this, this is generated by JBoss/Hibernate, with a MySQL database used for storing data. Be very careful with code generators....&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-3899434637893151462?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/3899434637893151462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=3899434637893151462' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3899434637893151462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3899434637893151462'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/04/indexing-indexing-and-indexing.html' title='Indexing, indexing and indexing....'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-238561101392117695</id><published>2007-04-11T12:53:00.000+02:00</published><updated>2007-05-16T18:02:06.649+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Google gadget</title><content type='html'>I have spent some time on a Google gadget, Shopping List, and now it is released. &lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://jubic.se/google/shoppinglistdump.png"&gt;&lt;img style="margin: 10pt 10px 10px 0pt; float: center; cursor: pointer; width: 340px;" src="http://jubic.se/google/shoppinglistdump.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Helps you remeber what to buy. It can also be printed and sent via mail, Gmail or other.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Click the link below to add to your Google homepage.&lt;br /&gt;&lt;br /&gt;It is amazing what you can do with a little javascript and html. The small format also makes it necessary to think about your design.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/ig/add?moduleurl=http://jubic.se/google/shoplist.xml&amp;amp;source=imag" target="_blank"&gt;Add "Shopping List" to your Google homepage&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-238561101392117695?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/238561101392117695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=238561101392117695' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/238561101392117695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/238561101392117695'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/04/google-gadget.html' title='Google gadget'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-1710585215835537362</id><published>2007-03-22T09:59:00.000+01:00</published><updated>2007-03-22T14:20:03.091+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EJB'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>More EJB questions</title><content type='html'>Our EJB project is moving forward.. My sceptisism is growing... Some questionable points:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Session beans&lt;/strong&gt; is where most, if not all our business logic goes. But session beans are nut pure java classes. They are based on some arcitectural ideas, which are not obviuosly good:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Communication with RMI and serialized java objects. This is probably a bad idea in most cases, a solution that is not only java specific but also has problems with different java versions. Basically it is based on that both sides have the same java classes. And then there is&lt;/li&gt;&lt;li&gt;Putting your logic in separate threads. A good idea if your session beans work with a large number of java clients, but probably a bad idea if your clients are servlets or message driven beans. In that case it will give you more thread handling overhead and little gain.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;Entity beans&lt;/strong&gt; have disappeared, instead we have got the new EntityManager. This of course means much faster development, but what is the cost? In my opinion the Data Access Object pattern is a good one, since it means that you have all your database access for one object in one place. With the EnityManager you can easily end up with SQL statements scattered all over your application. Where did the object orientation go?&lt;/p&gt;&lt;p&gt;Another point is constructions like this:&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;customer.getOrders().add(new Order(.....))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span &gt;this would mean that to add a new order, you first fetch all existing orders from a customer before adding a new one. A framework that encourages this kind of solutions is not a good one.&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/33472901-1710585215835537362?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/1710585215835537362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=1710585215835537362' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/1710585215835537362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/1710585215835537362'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/03/more-ejb-questions.html' title='More EJB questions'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-345181316901530294</id><published>2007-03-08T08:53:00.000+01:00</published><updated>2007-03-08T09:00:02.006+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EJB'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Started with EJB3</title><content type='html'>I have just started on a new project, where we will use EJB 3.0. I am very sceptical to the EJB concept, because some of the worst systems I have seen use EJB. Complicated to write, very hard to maintain and with very bad performance, mostly because they generate a lot of database traffic.&lt;br /&gt;&lt;br /&gt;Version 3.0 is a big improvement, that's for sure. But is it better than the old POJO way, with Database Access Objects and SQL/JDBC? That remains to see. Development is so far fast, but will performance be OK? If everything goes OK, we will roll out the system in thousands of installations. We can not make performance tuning when the systems are up and running, which according to my experience is necessary on EJB systems. The performance has to be ok from day one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-345181316901530294?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/345181316901530294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=345181316901530294' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/345181316901530294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/345181316901530294'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2007/03/started-with-ejb3.html' title='Started with EJB3'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-3889799662806673562</id><published>2006-12-12T10:42:00.000+01:00</published><updated>2006-12-12T10:52:04.716+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><title type='text'>LOAD XML submitted</title><content type='html'>I have been working on an addition to MySQL the latest month's or so, adding XML import to MySQL. This weekend I decided that the version was good enough to submit to MySQL. You can find it at http://lists.mysql.com/internals/34169. Good enough to submit yes, probably not good enough for production, but feedback would be good.&lt;br /&gt;&lt;br /&gt;But all in all I am quite satisfied with it.&lt;br /&gt;- focus is on easy-of-use, with automatic matching of tags and attributes to field names&lt;br /&gt;- support for three different xml formats: using tags for field values, using attributes or the  format used by oth MySQL tools (not a good format, but anyway..)&lt;br /&gt;- works very much like th CSV file load that has been a feature of MySQL for very long&lt;br /&gt;&lt;br /&gt;I can think of some additions, like support for binary fields (probably does not work today), better handling of character encoding etc, improved handling of the SET clause etc. But then, there are always improvements that could be made, and probably there are others that I have not thought of that are more important.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-3889799662806673562?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/3889799662806673562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=3889799662806673562' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3889799662806673562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/3889799662806673562'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2006/12/load-xml-submitted.html' title='LOAD XML submitted'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-116281783459977826</id><published>2006-11-06T13:53:00.000+01:00</published><updated>2006-12-12T10:52:54.416+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Tsql2mysql update</title><content type='html'>Released a new version of the procedure converter from SQL Server to MySQL. The changes are driven by user requests.&lt;br /&gt;&lt;br /&gt;I have added support for temporary table creation: in SQL server you create a temporary table by adding INTO #temptable to your select. This is converted to MySQL CREATE TEMPORARY  TABLE and the # is dropped.&lt;br /&gt;&lt;br /&gt;Also some minor changes, like support for very large SQL statements, better pretty-printing and improved support for CASE statements.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-116281783459977826?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/116281783459977826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=116281783459977826' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/116281783459977826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/116281783459977826'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2006/11/tsql2mysql-update.html' title='Tsql2mysql update'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-116013466631277976</id><published>2006-10-06T13:34:00.000+02:00</published><updated>2006-12-12T10:53:25.708+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>MySQL Developer Certification</title><content type='html'>Received the final papers about my MySQL 5.0 Developers certification. Seems we are only two certified in Sweden so far, feels strange to be one of the few. But probably most people working with MySQL don't bother about certifying.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-116013466631277976?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.mysql.com/training/certification/candidates.php?exam=dev' title='MySQL Developer Certification'/><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/116013466631277976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=116013466631277976' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/116013466631277976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/116013466631277976'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2006/10/mysql-developer-certification.html' title='MySQL Developer Certification'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-116012909901534848</id><published>2006-10-06T12:01:00.000+02:00</published><updated>2007-03-13T15:36:33.898+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>Supporting the procedure converter</title><content type='html'>Had a support question on the T-SQL to MySQL procedure converter. Seems like the first (current) version crashes when SQL statements are very long. Made a fix, and also improved the printing of long lines. Don't know if I am going to release it as is, or add more pretty-rpinting perheps. Also noticed that my support case uses + for string concatenation, which is not converted by the current version.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-116012909901534848?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/116012909901534848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=116012909901534848' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/116012909901534848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/116012909901534848'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2006/10/supporting-procedure-converter.html' title='Supporting the procedure converter'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-115882715153519265</id><published>2006-09-21T10:04:00.000+02:00</published><updated>2007-03-13T15:37:09.757+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>Some comments on the procedure converter</title><content type='html'>The T-SQL to MySQL procedure converter is of course developed based on what I needed when I made it. I have made it as a window's executable because we run the system on windows (guess that is common with SQL Server installations...). There is no fancy user interface (in fact no user interface at all) because I didn't need it etc.&lt;br /&gt;&lt;br /&gt;T-SQL constructs not handled:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="FONT-WEIGHT: bold"&gt;String concatenation&lt;/span&gt;: since + is used in T-SQL both for concatenation strings and for addition you need to know the datatype of the arguments to know if it should be converted. The tool does no attempt to do this, even if some cases (text constants, declared variables or parameters) would be quite easy.&lt;/li&gt;&lt;li&gt;&lt;span style="FONT-WEIGHT: bold"&gt;GOTO's and labels&lt;/span&gt;: The code I converted contains a lot of GOTO's. A very common construction is: &lt;blockquote&gt;SELECT /UPDATE/DELETE/INSERT&lt;br /&gt;....&lt;br /&gt;SELECT @p_err_num = @@ERROR&lt;br /&gt;IF (@p_err_num &lt;&gt; 0) GOTO OnError&lt;br /&gt;COMMIT TRANSACTION&lt;br /&gt;GOTO Done&lt;br /&gt;OnError:&lt;br /&gt;ROLLBACK TRANSACTION&lt;br /&gt;Done:&lt;br /&gt;RETURN( @p_err_num )&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;I don't want to convert this! The MySQL/ANSI error handler is so much better, and there is no GOTO. So, the goto's and lables will be commented out and you will have to convert it by hand.&lt;/li&gt;&lt;li&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Dateadd:&lt;/span&gt; &lt;span style="FONT-WEIGHT: normal"&gt;MySql has the same functionality in the date_add function, but parameter order is different. Since function calls can be nested, the tool would need to parse the code more than it does to be able to fix this. This is on my list, but not yet implemented.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="FONT-WEIGHT: normal"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Select TOP&lt;/span&gt;: This corresponds to the MySQL LIMIT clause. But since T-SQL allows parameters perhaps using the SET SQL_SELECT_LIMIT would be better. On the other hand this would be complicated in cursors.. Since we have only very few procedures where this is used, we do it by hand so far. Perhaps in a coming release...&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="FONT-WEIGHT: normal"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Dynamic SQL: &lt;/span&gt;T-SQL execute could be&lt;span style="FONT-WEIGHT: bold"&gt; &lt;/span&gt;replaced by MySQL PREPARE/ EXCUTE/ DROP PREPARE but the command would be a text string, and the tool does not, and should not, convert text strings. Probably you should check why you are using dynamic SQL in your code, and consider using another approach, or convert the text strings to MySQL by hand. Dynamic SQL is advanced and should only be used if you really need it.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="FONT-WEIGHT: normal"&gt;&lt;br /&gt;&lt;br /&gt;Erik&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-115882715153519265?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/115882715153519265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=115882715153519265' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/115882715153519265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/115882715153519265'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2006/09/some-comments-on-procedure-converter.html' title='Some comments on the procedure converter'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-115857118425648861</id><published>2006-09-18T11:10:00.000+02:00</published><updated>2007-03-22T15:21:43.684+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>T-SQL to MySQL procedure converter released</title><content type='html'>Yesterday evening I finally released the procedure converter at Sourceforge.net. I am quite satisfied with the result, it covers quite a lot. But the user interface is virtuallt non-existant, and the parsing needs some improvement. The problem is that for more complex conversion tasks (like shifting order for function parameters) I would need better parsing of the source code.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Features:&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;converts CREATE PROCEDURE/FUNCTION syntax&lt;/li&gt;&lt;li&gt;adds semi-colon at the end of statements&lt;/li&gt;&lt;li&gt;converts IF and WHILE statements to MySQL syntax&lt;/li&gt;&lt;li&gt;sorts the code in the correct order, with declarations at the top and instructions&lt;/li&gt;&lt;li&gt;after that &lt;/li&gt;&lt;li&gt;removes @, [ and ] from identifiers&lt;/li&gt;&lt;li&gt;converts comments to MySQL syntax (a space in the 3&lt;sup&gt;rd&lt;/sup&gt; position for -- comments)&lt;/li&gt;&lt;li&gt;adds a CONTINUE HANDLER FOR NOT FOUND if the procedure contains cursors&lt;/li&gt;&lt;li&gt;comments out GOTO and labels (you will have to restructure this yourself, since there is no GOTO in MySQL stored procedures)&lt;/li&gt;&lt;li&gt;converts some data types (nvarchar, identity, smalldatetime, money, smallmoney)&lt;/li&gt;&lt;li&gt;Converts function with a direct MySQL correspondence (getdate, getutcdate, len, replicate)&lt;/li&gt;&lt;/ol&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Limitations&lt;br /&gt;&lt;/span&gt;&lt;ol&gt;&lt;li&gt;No conversion of GOTO:s and labels&lt;/li&gt;&lt;li&gt;no MySQL error handling added&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-115857118425648861?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://sourceforge.net/projects/tsql2mysql' title='T-SQL to MySQL procedure converter released'/><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/115857118425648861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=115857118425648861' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/115857118425648861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/115857118425648861'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2006/09/t-sql-to-mysql-procedure-converter.html' title='T-SQL to MySQL procedure converter released'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-115756388045212864</id><published>2006-09-06T19:25:00.000+02:00</published><updated>2007-03-22T15:22:34.782+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>More Conversion tool problems</title><content type='html'>My conversion tool is getting better, soon time to release.&lt;br /&gt;&lt;br /&gt;What makes it possible is really that T-SQL is such a poor language, not much to take care of. But that is also the problem, since som features are far from perfect, T-SQL code contains a lot of complicated constructs, like error handling with goto's, and checking @@error efter every SQL statement. Converting that to MySQL would make horrible code, in a system where much better error handling is available. But there is currently no GOTO in MySQL...&lt;br /&gt;&lt;br /&gt;So that will be unsolved, GOTO's and labels etc. Also references to SQL Server specific system tables, views, procedures and varibles will be largely unconverted.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-115756388045212864?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/115756388045212864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=115756388045212864' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/115756388045212864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/115756388045212864'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2006/09/more-conversion-tool-problems.html' title='More Conversion tool problems'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-115735078980088210</id><published>2006-09-04T08:16:00.000+02:00</published><updated>2007-03-22T15:22:59.677+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>Conversion of Microsoft T-SQL to MySQL</title><content type='html'>Spent some time on a tool for converting T-SQL stored procedures to MySQL during the weekend. It is looking quite good, but new problems keep popping up all the time. Like the differences in WHILE statement syntax, different naming of database objects etc.&lt;br /&gt;&lt;br /&gt;Guess at some time I will have to be satisfied with a tool that leaves som problems unsolved, but not quite yet... I'll spend some more time on it before I release it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-115735078980088210?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/115735078980088210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=115735078980088210' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/115735078980088210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/115735078980088210'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2006/09/conversion-of-microsoft-t-sql-to-mysql.html' title='Conversion of Microsoft T-SQL to MySQL'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-115684336184835374</id><published>2006-08-29T11:21:00.000+02:00</published><updated>2006-11-06T13:52:23.369+01:00</updated><title type='text'>Should databases always be normalized?</title><content type='html'>I posted a comment on this subject today. My point is not that normalization is not good as a rule, but rather that there are times that you could optimized your design by deviating from the model. &lt;br /&gt;&lt;br /&gt;The example seems to be such a case, where you avoid having a table with very many records by storing the data in a list (violates &lt;a href="http://en.wikipedia.org/wiki/1NF"&gt;first normal form&lt;/a&gt;). More about this later...&lt;br /&gt;&lt;br /&gt;You could also take a look at &lt;a href="http://en.wikipedia.org/wiki/Denormalization"&gt;Denormalization&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-115684336184835374?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://datacharmer.blogspot.com/2006/07/ugly-query-should-be-warning-bell.html#115684249563242538' title='Should databases always be normalized?'/><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/115684336184835374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=115684336184835374' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/115684336184835374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/115684336184835374'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2006/08/should-databases-always-be-normalized.html' title='Should databases always be normalized?'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-115676853244481568</id><published>2006-08-28T14:26:00.000+02:00</published><updated>2007-03-22T15:22:59.677+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>Moving from MS SQL Server to MySQL</title><content type='html'>This spring I have added some new modules to our system. The old ones are all based on Microsoft SQL Server, but for the new ones we decided to go with MySQL as a part of a strategy of moving to MySQL with the whole system.  We decided to use InnoBase as a storage engine and Hibernate for accessing the database from our Java application. No strange decisions, I believe.&lt;br /&gt;&lt;br /&gt;The development phase is now over, with no major problems, and the system is up and running. During this autumn we will see how it works, but I'm nit very worried, it seems stable.&lt;br /&gt;&lt;br /&gt;Unfortunately the customers strategy is today unclear, so we're stuck in a situation with two databases. Personally, I feel that using MS SQL Server in a Java environment is a questionable approach, since Microsoft is positioning the product as a part of the .net platform. And the 2000 version, which we are currently running, is getting old...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-115676853244481568?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eriksdiary.blogspot.com/feeds/115676853244481568/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33472901&amp;postID=115676853244481568' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/115676853244481568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/115676853244481568'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2006/08/moving-from-ms-sql-server-to-mysql.html' title='Moving from MS SQL Server to MySQL'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33472901.post-115676465352579231</id><published>2006-08-28T13:24:00.000+02:00</published><updated>2006-11-06T13:52:23.186+01:00</updated><title type='text'>Enter the blog universe</title><content type='html'>OK, finally  registered for a blog, as I have been thinking about for quite a while. Let's see where this leads to, will I have the energy to keep it up?&lt;br /&gt;&lt;br /&gt;And in english (more or less...) too! Why would a swede write in english? Well, mainly because the content will be mostly computer related, where english seems like the natural language. Might be a few more personal entries too, but that is really not the purpose.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33472901-115676465352579231?l=eriksdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/115676465352579231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33472901/posts/default/115676465352579231'/><link rel='alternate' type='text/html' href='http://eriksdiary.blogspot.com/2006/08/enter-blog-universe.html' title='Enter the blog universe'/><author><name>Erik</name><uri>http://www.blogger.com/profile/07865795210715993795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/blogger/7496/3675/1600/Eriksylarna.jpg'/></author></entry></feed>
