I am trying to connect to my hostinger database but it does not work:
<property name = "javax.persistence.jdbc.url" value = "jdbc:mysql://mysql.hostinger.fr/myDBName"/>
I have the following error:
java.net.UnknownHostException: mysql.hostinger.fr: nodename nor servname provided, or not known
Hostinger does not allow you to connect remotely on your database with a basic free account. You need to deploy your application to test the connection.
Related
I have configured my spring boot application to run from a remote sql server database deployed to one of our environments with ip and port configuration below. And it works with no issue.
datasource.common.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
datasource.common.platform=mssql
datasource.common.username=${dbUsurname}
datasource.common.password=${dbPassword}
datasource.common.url=jdbc:sqlserver://10.223.124.566:31567;databaseName=acc
But when I replace my connection to another database instance that is deployed for another environment , even if I supply correct username , password and ip combination I get error.
datasource.common.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
datasource.common.platform=mssql
datasource.common.username=${dbUsurname}
datasource.common.password=${dbPassword}
datasource.common.url=jdbc:sqlserver://10.223.124.211:31567;databaseName=int
I get the following trace.
Cannot open database "int" requested by the login. The login failed.
ClientConnectionId:0dd4761b-8969-4848-96f8-c7ca41c48bf
I can connect to database with which I got error in spring application from mssql management studio with the given configuration and had no issue connecting it. Is there any setting for a database instance that prevents applications from connecting it other than username and password ?
This is the first time I try to deploy my application using wildfly to a remote server, it seems that I succeeded, but now I cannot connect the created database. wildfly says that
Connection URL = jdbc:postgresql:/var/run/postgresql:5432,
I use this string to connect
<property name="connection.url">jdbc:postgresql:/var/run/postgresql:5432?currentSchema=myshema&user=user&password=pass</property>
For this I get
Connection error: : org.postgresql.util.PSQLException: FATAL: database "/var/run/postgresql:5432" does not exist
in logs. What am I doing wrong?
I have a database created in SQL Server with the following configuration:
Also, I am trying to connect to the database named EDS.
For that I created the following details:
Should i have domain in the string or should it be in the username?
When i go to the database properties i see the owner has.
Also, is the url correct on the instance part according to the image? it looks like it is not able to go to that particular instance.
Also, this is the configuration for the connection (using Windows Authenticaton)
When I put in the username I am getting the following error log:
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user '. ClientConnectionId:e812971f-b03c-4210-9dbd-de0791bcc304
When specifying the location of the SQL Server instance, one normally provides serverName\instanceName or serverName:portNumber, not both. That is, either
jdbc:sqlserver://INNOWAVE-99\SQLEXPRESS01;databaseName=EDS
or
jdbc:sqlserver://localhost:1433;databaseName=EDS
(assuming that the SQLEXPRESS01 instance has been explicitly configured to listen on port 1433, which is not usually the case for a SQL Express instance).
As mentioned in the documentation for Building the Connection URL
If both a portNumber and instanceName are used, the portNumber will take precedence and the instanceName will be ignored.
There is no domain= property defined for the connection URL for Microsoft's JDBC driver for SQL Server. Logging in to the SQL Server instance with Windows domain credentials is done implicitly using the integratedSecurity=true connection property (and not explicitly providing a username and password); details here.
I'm also having the same problem. Working for me too without port number.
Don't forget to give semicolon at the end of the connection.
Connect to the default database on the local computer by using integrated authentication:
jdbc:sqlserver://localhost;integratedSecurity=true;
Connect to a named database on a remote server:
jdbc:sqlserver://localhost;databaseName=AdventureWorks;integratedSecurity=true;
Connect on the default port to the remote server:
jdbc:sqlserver://localhost:1433;databaseName=AdventureWorks;integratedSecurity=true;
Connect by specifying a customized application name:
jdbc:sqlserver://localhost;databaseName=AdventureWorks;integratedSecurity=true;applicationName=MyApp;
Reference Link : mssql document
I would like to ask someone who already tried to connect to SQL database from soapUI opensource version.
I have a test step JDBC request where I try to test and connect to my sql database. I use opensource version of soapUI. I read how it should be set up but still experience some problems.
This is what I do:
I installed java 8 and jdbc driver version 4.1. Added jdbc jar file to SoapUi/jre/bin folder as it is said in documentation for soapUI. This version of driver should work with Java 8.
Then in Driver field I write
com.microsoft.sqlserver.jdbc.SQLServerDriver
In connection string:
jdbc:sqlserver://Sservername:portnumber;databaseName=Consumption;username=alyona.kovalyova;password=mypassword
I get error saying
Can't get the Connection for specified properties; com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'alyona.kovalyova'. ClientConnectionId...
I use my domain account because in our company the policy does not allow us to use database user. Because of this I tried to add integratedSecurity parameter to the string which should allow to login with windows account like this:
jdbc:sqlserver://S23-AS:1433;databaseName=Consumption;integratedSecurity=true
I also get error:
Can't get the Connection for specified properties; com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId..
Does anyone encountered the same issue before? Could you give some recommendation?
For integrated authentication to work you'll need sqljdbc_auth.dll matching your environment (32bit / 64bit) in your library path (putting it in bin as well might help already)
We are using in our project a websphere application server and want to connect to a sql server. In our websphere we have configured a datasource and the testing of the connection in the websphere works. In our deployed application the connection does not work. We get this exception:
Caused by: com.ibm.websphere.ce.cm.StaleConnectionException: Single-Sign-On is only supported on Windows. Please specify a user name.DSRA0010E: SQL State = 08001, Error Code = 0
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:56)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:39)
at java.lang.reflect.Constructor.newInstance(Constructor.java:515)
at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapExceptionHelper(GenericDataStoreHelper.java:608)
at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapException(GenericDataStoreHelper.java:670)
at com.ibm.ws.rsadapter.AdapterUtil.mapException(AdapterUtil.java:2111)
at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getPooledConnection(WSRdbDataSource.java:2320)
at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.createManagedConnection(WSManagedConnectionFactoryImpl.java:1600)
at com.ibm.ejs.j2c.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:2036)
at com.ibm.ejs.j2c.FreePool.createOrWaitForConnection(FreePool.java:1713)
at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2496)
at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:1063)
at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:700)
at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:668)
at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:635)
at de.volkswagen.dps.server.core.database.ConnectionFactory.createDatasourceConnection(ConnectionFactory.java:45)
... 40 more
We use this driver: jtds-1.2.4.jar which we got from here
Have anybody an idea how to solve the problem?
Looks like a security issue.
With Test Connection a SSO (Single sign on) can be used, but not in the deployed app.
you need to make sure you setup a JAAS authentication alias and configure your Datasource to use it, that alias comtains the username and password to be used for authentication.
Open the Datasource in the admin console and there is a link on the right to create the JAAS alias and tHere are combo boxes to tell the datasource to use it.