java.net.UnknownHostException

java.net.UnknownHostException
MESSAGE: locahost

STACKTRACE:

java.net.UnknownHostException: locahost
at java.net.InetAddress.getAllByName0(InetAddress.java:1157)
at java.net.InetAddress.getAllByName(InetAddress.java:1083)
at java.net.InetAddress.getAllByName(InetAddress.java:1019)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:246)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2771)
at com.mysql.jdbc.Connection.<init>(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at BBS.DBWrapper.getConnection(DBWrapper.java:106)
at BBS.DBWrapper.executeQuery(DBWrapper.java:154)
at BBS.MainClassTopic2$2.run(MainClassTopic2.java:64)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)


** END NESTED EXCEPTION **


出现这种错误主要原因是把ip地址写错了

你可能感兴趣的:(java.net.UnknownHostException)