And here it is: Another small tutorial :-) This time we will build a small Java application that simply connects to a MySQL database and prints the conent of one of the database's tables.
Read more about "Connecting to a MySQL DB in Java" ...Archive for [<Tag: java>]
-
Connecting to a MySQL DB in Java
-
RMI Tutorial
RMI Tutorial
Was ist RMI? RMI bedeuted "Remote Method Invokation" und dient dazu, Dienste auf einem Rechner anzubieten, die dann von einem anderen Rechner in Anspruch genommen werden können. Bei diesen Diensten handelt es sich um Java-Objekte die dann am Clientrechner direkt in lokale Variablen eingebunden werden können.
Wenn jedoch eine Methode dieses Objektes ausgeführt werden soll, dann wird diese auf dem "Server" ausgeführt und das Ergebnis dann an den Client übermittelt.
Read more about "RMI Tutorial" ... -
Pellet 2.0rc1 ... and a big surprise
If you've ever had to work with some OWL-ontologies, you have definitely heard the name Pellet. It is perhaps the most wildly use opensource OWL-reasoner/engine out there. Yesterday Evren Sirin announced the release of the first release candidate of the upcoming version 2.0, that (among other things) includes preliminary support for OWL 2.0. But there is also a catch ...
Read more about "Pellet 2.0rc1 ... and a big surprise" ... -
Geoserver with OpenJDK on Ubuntu? I guess not
Or at least not for now. Today I had to install Geoserver on a new Ubuntu 8.04 server within a current Tomcat (6.0.18) for a colleague and was greeted by a nice error message related to casting and the javax.imageio package (or earlier on with a ClassDefNotFound exception related to the same package). The problem here seems to be that the stable Geoserver 1.6.x is not really compatible with OpenJDK yet.
So for now the fastest way to get it working again (that is, if you don't absolutely require OpenJDK) to move back to the old Sun Java 6 package by first installing "sun-java6-jdk" and then by switching to it using
update-alternatives --config java.At first I thought I had to install some external libraries and miserably failed to install the jai_imageio binary package thanks to the package being broken and naturally Sun has to have internal checksums so that you can't easily fix this. But luckily this has become a non-issue with the move back to Java6 for now, but I'm really curious if I just messed up something there or the missing jai_imageio package was really the problem here. I guess, this is a problem for later, now that I have a workaround in place ;-)
-
Java.com redesigned
Seems like Java.com got a nice new redesign :-) The new version of the end user Java page presents itself in a quite colourful and game/mobile oriented way. And only 41 errors on validator.w3.org ;-)
Read more about "Java.com redesigned" ... -
JMF not really so useful...
Is it just me or is JMF yet another example why Java isn't really platform independent? Or actually another example of Sun really making it useful no matter what platform you're on. For example: I now have to write a small program using JMF. I thought: Great, should be no problem using a normal MPEG-1 stream as input source. Yeah, right ... According to the list of supported formats the really platform independent JMF package doesn't support even MPEG-1. This feature is reserved for the platform-dependent binaries. I also tried to register the MP3 plugin and failed there too, so perhaps I understood something the wrong way (but at least I also read about other people having the same problem).
Read more about "JMF not really so useful..." ... -
JMF Format checking: The Evil Edition
Desperate times sometimes require desperate solutions for stupid problems. For example today I have a deadline for a small JMF project. A part of the project is, that an RTSP client should be able to request only for example the audio streams of a certain object on the server so the client should have some kind of flag that specifies what streams should now really be used.
Read more about "JMF Format checking: The Evil Edition" ... -
Default value handling with Json-lib
As part of a project I'm working on I'm currently moving tons of data between servers and clients using JSON. Since all components are written in Java I was looking for a simple yet customizable JSON library and eventually ended up using Json-lib which let's you easily serialize a JavaBean into a JSON-string. While looking through the network traffic yesterday, I noticed a small problem, though: When you convert for instance an Integer property of the bean and this Integer is currently a null-pointer, Json-lib will make a 0 out of it. While in most cases probably a good idea, in my particular case it's simply the wrong way of handling the null-reference since 0 has a different semantic in that particular bean.
Read more about "Default value handling with Json-lib" ... -
TinyTip: Where are my cookies in commons-httpclient?
commons-httpclient is for me perhaps one of the most useful libraries in Java when it comes to doing HTTP requests. It not only abstracts HTTP logically but at the same time keeps you at a low enough level. That said, it still abstracts some stuff perhaps a little bit too far away for some use cases.
Read more about "TinyTip: Where are my cookies in commons-httpclient?" ... -
Ivy: A dependency manager for Java
Primary link: ant.apache.org
In whatever language you are programming you eventually end up in a situation where you are working with so many libraries that you need to manage them somehow. Up until a couple of days ago, I used Maven for this when dealing with Java. But Maven might be a bit more than what you normally want. It not only manages dependencies but also comes with its own project life-cycle management system. You can use Maven for compiling, testing, deploying, generating the documentation, publishing it on a website, and so on. But at least for me, all I normally want is a simple build system. If it has some nice extras, fine, but I don't really like to be forced in some kind of life-cycle management. So basically give me something like Make or Ant and then give me something that manages dependencies. This is more or less how I discovered Ivy.
Read more about "Ivy: A dependency manager for Java" ...