Answer the question
In order to leave comments, you need to log in
Connecting and not connecting to the database from different pages, but with the same code?
Question to know. I have a standard database connection from two different jsp pages, different IDEA projects:
try
{
Class.forName("com.mysql.jdbc.Driver");
System.out.println("Driver Loaded");
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/testDB","root","");
//Database Name - testDB, Username - "root", Password - ""
System.out.println("Connected...");
}
catch(Exception e)
{
e.printStackTrace();
}
Test Connection Successfuland in the view (panel on the right) the base is visible.
Answer the question
In order to leave comments, you need to log in
Different settings for Data Sources for projects.
Check out the settings here .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question