unknown database in jdbc

前端 未结 7 1624
有刺的猬
有刺的猬 2021-01-26 00:59

I am using JDBC and new to it. but I keep getting this runtime exception:

   connecting to psysical database...
   com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErr         


        
相关标签:
7条回答
  • 2021-01-26 01:38

    This error occurs when server is not able to find the database. This can be due to a wrong port given in the database URL, for example

    String DB_URL = "jdbc:mysql://localhost:3307/database_name"
    

    So check this port number (3307 in the above case) with the port mentioned in the Xampp controler (go to Xampp controller and then configuration of MySql).

    0 讨论(0)
提交回复
热议问题