avatar

Andres Jaimes

Create a connection to MySQL in Java

This time we are going to create a basic connection to MySQL in Java and pull some data from it. // Compile it: // javac Mysql.java // // Try it: // java -classpath mysql-connector-java-5.1.27-bin.jar:. MySQL import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Properties; public class MySQL { public Connection getConnection() throws SQLException { Connection conn = null; Properties p = new Properties(); p.put("user", "username"); p.put("password", "superpassword"); String cs = "jdbc:mysql://localhost/demo"; conn = DriverManager.

Installing Lucene/Solr on CentOS 6

This time we are going to install Solr, the super text search platform on CentOS. The installation process requires a couple extra libraries in order to work: Apache Commons Logging and SLF4J. Installing Java yum install java java -version You must have at least version 1.6 in order to run Solr. If you got Java 1.5, I recommend you to follow this tutorial to get version 1.6. Installing Tomcat yum -y install tomcat6 tomcat6-webapps tomcat6-admin-webapps chkconfig tomcat6 on service tomcat6 start Use a web browser to check it is working correctly.

Installing Java 1.6 on CentOS 6

Java 1.5 is the default Java version you get when you ask yum to install it on CentOS. However, several applications need 1.6 in order to run. Just follow the next steps to install it. Remove Java 1.5 yum remove java-1.5-* Install the rpmforge repository cd rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt Check if you have a 32 or 64 CentOS version uname -a For 32 versions (i686) download and install the following repository

Download YouTube videos using Java

From time to time we all have needed to show a YouTube video where no Internet connection is available. This program will allow you to download a video from YouTube for later playback. It is important to say that YouTube constantly changes its video URL, so someday it may need some rework. The following code was tested on Aug 12, 2012 and it works. Have a good day.  /** * YouTubeDownloader * * Modified by Andres Jaimes https://andres.

How to install Papyrus on Eclipse Indigo

Papyrus is a UML designer plugin for the eclipse development environment. Installing it on the Indigo version is very easy: Go to Help > Install New Software… Under Work with, select All Available Sites and look for Modeling on the tree view. Under Modeling, look for MDT Papyrus – SDK and press the Next button Press Next again Accept the Licence and press Finish You will be asked to restart Eclipse, so go ahead… Next time you create a project, you will see the Papyrus project listed.

Java, brigther than ever

Java, the programming language for many of us, is shinning more than ever! Just see how Android (Google’s operating system) uses it for its applications: http://en.wikipedia.org/wiki/Android_%28operating_system%29

Some words on Java, C# and C++

I have always considered myself a C++ guy. That was one of the first languages I learned. But, life has taken me through many different paths, and I have needed to learn others. It was seven years ago, when I tried my first cup of Java and I realized objects were a must: Why did I need to create an additional class to return a compound value? another file?, I could do a “one-liner” in C++.