Color and texture coordinates using VBOs

I have been following ThinMatrix’ tutorials on how to use LWJGL and OpenGL.
When loading data into a model they get stored in VBOs, which are stored in a VAO. My problem is that I don’t know how to specify in which VAO attribute list position which data is.
Currently, it’s like this and it works: 0 Vertex Positions | 1 Texture Coordinates | 2 Colors (and indices stored in an element array buffer).
I want to switch Colors and Texture Coordinates. By simply doing that my rendering doesn’t work correctly anymore. So how do I specify which attribute list position contains which data, when rendering a model?
Here’s my rendering code (working with color-data in 2 and uvCoords in 1):

	GL30.glBindVertexArray( entity.getTexturedModel( ).getModel( ).getVaoId( ) );
	GL20.glEnableVertexAttribArray( 0 );
	GL20.glEnableVertexAttribArray( 1 );
	GL20.glEnableVertexAttribArray( 2 );
	Matrix4f transformationMatrix = MathUtil.createTransformationMatrix( entity.getPosition( ),entity.getRotation( ),entity.getScale( ) );
	shader.loadTransfromationMatrix( transformationMatrix );
	GL13.glActiveTexture( GL13.GL_TEXTURE0 );
	GL11.glBindTexture( GL11.GL_TEXTURE_2D,entity.getTexturedModel( ).getTexture( ).getTextureId( ) );
	GL11.glDrawElements( GL11.GL_TRIANGLES,entity.getTexturedModel( ).getModel( ).getVertexCouunt( ),GL11.GL_UNSIGNED_INT,0 );
	GL20.glDisableVertexAttribArray( 0 );
	GL20.glDisableVertexAttribArray( 1 );
	GL20.glDisableVertexAttribArray( 2 );
	GL30.glBindVertexArray( 0 );

The vertex array index is either specified in the vertex shader using the [icode]layout(location = N)[/icode] interface layout qualifier on the in/attribute declaration (i.e. using [icode]layout(location=2) in vec2 texCoords;[/icode]); or using [icode]GL20.glBindAttribLocation(program, 2, “texCoords”)[/icode] before calling [icode]GL20.glLinkProgram()[/icode].
The reason why it works for you currently without probably doing neither of those two things, is that the GLSL linker allocates attribute indices automatically probably in declaration order in the vertex shader, which you can also query after successful program linkage via [icode]GL20.glGetAttribLocation(program, “texCoords”)[/icode] to setup your VAO vertex attributes accordingly, if you rather would like to do it this way.

Hint: You also do not have to glEnable/DisableVertexAttribArray() all the time. The vertex array enable state is part of the VAO state. It suffices when you call glEnableVertexAttribArray() once when creating and initializing the VAO.

Thank you! I totally forgot that there was something in the shader class!
I just always copied them from my last projects.