Solved the problem:
1st by adding a sun-web.xml that links the resource reference from the web.xml to an actual jndi-name (the one I setup on Glassfish). Normally, that shouldn't be necessary (says Oracle) but I did it anyways [Edit: as it turns out, it is really not necessary! ]
2nd I left out the "jdbc". In the servlet, the web.xml and the sun-web.xml it is now just called "osclassDB" (my resource name) instead of "jdbc/osclassDB"
now it looks like this:
web.xml
<resource-ref>
<res-ref-name>osclassDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
sun-web.xml
<resource-ref>
<res-ref-name>osclassDB</res-ref-name>
<jndi-name>osclassDB</jndi-name>
</resource-ref>
in the servlet
Context dbContext = (Context) initialContext.lookup("java:comp/env");
DataSource dataSource = (DataSource) dbContext.lookup("osclassDB");
connection = dataSource.getConnection();
[Edit:] the sun-web.xml is really not necessary