Hey I'm trying to connect to a DB2 database, by using Servlets(Using NetBeans right now) but I just can't find a useful example on the web, could someone help me?
Thank you so much for your time.
It's no different to connecting to a DB2 database without using a Servlet :)
A quick Google search came up with some documentation on using JDBC with DB2. That page has some code examples that should get you started.
Essentially it's a matter of obtaining a Connection object using either the DriverManager or DataSource interfaces. Once you have that you can obtain Statements or PreparedStatements are you're good to go.
DataSource rather than DriverManager. DataSource is a better design and makes it much easier to transparently include things like connection pooling.