Java Oracle localhost connection error (ORA-12505)
I am trying to currently connect to a database on my current computer. import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class Main { public static void main(String[] argv) throws Exception { Connection connection = null; try { // Load the JDBC driver String driverName = "oracle.jdbc.driver.OracleDriver"; Class.forName(driverName); // Create a connection to the database String serverName = "localhost"; String portNumber = "1521"; String sid = "xe"; String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid; String username =