I'm trying to learn java and how to use it for web applications . I'm already familiar with PHP so i'm trying to learn how to use JSP since it seems to be the closest thing to PHP in Java. My school provides us with a fre MySQL v5.1 databases so I'm using that as my db. When connecting to a database in PHP I use mysqli and do
$mysqli = new mysqli("oniddb.cws.oregonstate.edu", "username, "pword", "username");
if ($mysqli->connect_errno) {
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
For Java and JDBC I'm having a hard time finding the equivalent to this. Everything I've found implies my database is local and not over the web. How can I do this in JSP?
Thanks in advance