I create a web application on Spring MVC + Hipernate + MySQL.

Uploading reports will be. There is a base, but in the form of a SERVER and the name of the database. That is, in the internet everywhere examples of this type

jdbc.databaseurl=jdbc:mysql://localhost:3306/babobka 

I have no host and port. How can I use the server name and database name? have tried

 jdbc.databaseurl=jdbc:mysql:СЕРВЕР/БД. 

Not connected.

I was given the following data: Microsoft SQL Server Instance: SRV-SQL-SERVER \ SEVREPORT Database: srv-sev-report

  • do you know on which host your server is located? where do you get the server name and database name? - Mikhail Vaysman
  • Yes, I punched the host through the ping, but I don’t know the port - Vladislav

1 answer 1

This line

 jdbc.databaseurl=jdbc:mysql://localhost:3306/babobka 

means that

  • localhost is the host name
  • 3306 is the port number. 3306 is the port on which the MySql server listens by default
  • babobka - the name of the base

Since you do not have MySql, but MS Sql, the line should look like this

 jdbc.databaseurl=jdbc:sqlserver://SRV-SQL-SERVER:SEVREPORT;databaseName=srv-sev-report 
  • I was given the following data: Microsoft SQL Server Instance: SRV-SQL-SERVER \ SEVREPORT Database: srv-sev-report - Vladislav
  • The error now is this: ERROR: org.hibernate.util.JDBCExceptionReporter - Communications link? WARN: org.hibernate.cfg.SettingsFactory - Could not obtain a connection metadata com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure - Vladislav
  • I didn’t even notice that these are different things, it turns out that other dependencies will already be there and the jdbc setting with drivers - Vladislav
  • if you correctly used the framework, then the changes will be minimal - Mikhail Vaysman
  • sort of right. now the error Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load the JDBC driver class [com.microsoft.sqlserver.jdbc.SQLServerDriver]. I will continue to drip, thanks :) - Vladislav