Advance Java Database Connection Simple and Easy in Jsp Page
Localhost database connection in jsp pages
include this line <%@include file="dbConnection.jsp" %> in every pages where database connection required-
<%
String connectionURL = "jdbc:mysql://127.0.0.1:3306/Database_name?autoReconnect=true&useSSL=false";
Connection cnn = null;
Class.forName("com.mysql.cj.jdbc.Driver").newInstance();
cnn = DriverManager.getConnection(connectionURL, "username", "password");
%>
Now Enjoy and keep in touch for latest updates-
Thanking You
Localhost database connection in jsp pages
include this line <%@include file="dbConnection.jsp" %> in every pages where database connection required-
<%
String connectionURL = "jdbc:mysql://127.0.0.1:3306/Database_name?autoReconnect=true&useSSL=false";
Connection cnn = null;
Class.forName("com.mysql.cj.jdbc.Driver").newInstance();
cnn = DriverManager.getConnection(connectionURL, "username", "password");
%>
Now Enjoy and keep in touch for latest updates-
Thanking You
Report