Streaming a python game through a jsp
The way I see it you have two options:

If network connection is intermittent (not so frequent), you can use javascript (AJAX specifically) to make HTTP calls to the server whenever you need to access your database.
If you are expecting frequent (continuous) requests (i.e. multiplayer games), you would need to keep a connection alive using either

Persistent HTTP request
TCP Socket
Websocket : You probably want to use this if you want cross-browser support.


Let me know if you have any other questions regarding the options above.
So im creating this game using pygame, and i have to put it up on a website, but it has to run server-side since the game is gonna be using a database locally, and the client will be able to enter a web page and click on a button and the game is gonna run, i cant make the game run completely client side because then the game wont be able to connect to my local database 
Any ideas?