Informationen aus mehreren Reihen trotz “GROUP BY”

Folgendes Szenario:

Ich habe eine Datenbanktabelle, in der zu einem Benutzer in mehreren Reihen eine Information steht.

user_id, date, information_about_user_on_date
1, 2011-11-01, information_1
1, 2011-11-02, information_2
1, 2011-11-03, information_3

Diese Informationen möchte ich in einer Reihe anzeigen, ohne mir alle Zeilen einzeln holen zu müssen. In SQL gibt es zwar die schöne Funktion “GROUP BY”, hier würde ich aber nur noch eine der Informationen erhalten. Continue reading

Print Friendly

Information from several rows in spite of “GROUP BY”

Following scenario:

I have a database table, where information about an user is stored in several rows.

user_id, date, information_about_user_on_date
1, 2011-11-01, information_1
1, 2011-11-02, information_2
1, 2011-11-03, information_3

This information I want to show in one single line without getting this information row by row. SQL has the nice functionality “GROUP BY” but by using this normally I’m only getting one information. Continue reading

Print Friendly

Wie mache ich meine Webseiten schöner?

Jeder, der schon einemal eine Webseite erstellt hat, kennt folgendes Problem:

Du entwickelts dein Webprojekt lokal auf deiner Maschine. Alles sieht gut aus, genau, wie du es dir vorgestellt hast. Dann lädst du diese Seite auf den Webserver und testest, ob es immer noch so aussieht, wie es soll. Ja, alles ist wunderbar!

Dann ruft dich ein Freund an und fragt: Was hast du denn da gemacht? Sieht ja furchtbar aus! Die Texte sehen ganz furchtbar aus und die Abschnitte sprengen dein Seitendesign!

Wie kann das Sein?! Der Grund ist, dass auf deinem System die Schiftarten, die du verwendet hast, existieren uns somit von Browser geladen werden können. Auf anderen Systemen existieren diese vielleicht nicht. Nur Verdana, Arial und eine handvoll anderer Schriftarten sind Standard auf jedem System und somit verfügbar. Du möchtest aber spezielle Schiftarten verwenden, die besser in dein entwickeltes Design passen. Continue reading

Print Friendly

How to make your Website texts nicer

Everybody knows that problem:

You develop your Website on your local system. Everything looks nice and good. Then you upload your code on your Webserver, test, if everything looks like it should and you are happy.

Then a friend calls you and you got to here: What have you done? It looks horrible! The Texts are looking bad and the Paragraphs are breaking the page design!

How can that be? The Reason is, that on your System the Fonts, you are using are existing and can be loaded by the browser. On other Systems maybe that fonts are not existing. Only Arial and Verdana and a hend full of other fonts are installed on every system. But you want to use special fonts for your website that are fitting better in your design.
Continue reading

Print Friendly

Textdateien mit Spring Batch erzeugen

Wir wollen eine Datei über Spring batch erzeugen. Hierfür benötigen wir einen Marshaller mir “Reader” und “Writer”.

Der Reader:

<bean id="fileReader">
  <property name="dataSource" ref="dataSource" />
  <property name="sql" value="SELECT * FROM table" />
  <property name="rowMapper">
    <bean class="de.package.rowmapper.FileRowMapper" />
  </property>
</bean>

Continue reading

Print Friendly

Send Email by Spring batch with variable attachments

It is very simple to send an Email with attachments by Spring batch framework.

Firstly you need 3 beans for handling the email:
- The first bean initializes JavaMail and sets all needed properties

<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
    <property name="host" value="smtp.yourEmailDomain.de"/>
    <property name="port" value="25"/>
    <property name="username" value="yourUserName"/>
    <property name="password" value="yourPassword"/>
    <property name="javaMailProperties">
        <props>
            <prop key="mail.smtp.auth">true</prop>
        </props>
    </property>
</bean>
Continue reading

Print Friendly