In your shader, using your own uniform is correct, don't use gl_*. Use #version 400 core and they should give compiler errors as they're removed from the language.
Anyway your problem seems to be this:glDetachShader(programId, vertexShaderId); glDetachShader(programId, fragmentShaderId);
Remove that code.
Ok, I figured it out. The problem was that I didn't use the variables so they were compiled out. Maybe that is what Geometrian meant. The detaching of the shader after linking should be okay: http://stackoverflow.com/questions/9113154/proper-way-to-delete-glsl-shader
But thanks for the #version 400 core tip. Now I only have to solve the texture problem.