I want to connect to ExaSol database using Scala. I'm able to connect to the database in Python using pyodbc but I'm receiving the following error on attempting to connect using JDBC driver in Scala :
scala> :require /Users/some/path/mssql-jdbc-7.4.0.jre8.jar
scala> Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver")
scala> import java.sql.{Connection, DriverManager, ResultSet}
scala> val conn = DriverManager.getConnection("jdbc:sqlserver://11.11.11.11:8563;databaseName=some-db;user=user_name;password=pass_word;useUnicode=true;characterEncoding=UTF-8")
Sep 11, 2019 1:38:55 PM com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin
WARNING: ConnectionID:2 ClientConnectionId: a03dede8-7f9c-495d-83d5-4986b859e1e9 Prelogin error: host 11.11.11.11 port 8563 Unexpected end of prelogin response after 0 bytes read
Sep 11, 2019 1:38:55 PM com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin
WARNING: ConnectionID:2 ClientConnectionId: ea705538-c0c9-4bc3-ba66-9630e7850b58 Prelogin error: host 11.11.11.11 port 8563 Unexpected end of prelogin response after 0 bytes read
Sep 11, 2019 1:39:09 PM com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin
WARNING: ConnectionID:2 ClientConnectionId: 5238ac7c-55cc-4ec2-a070-d7f454c6c43b Prelogin error: host 11.11.11.11 port 8563 Unexpected end of prelogin response after 0 bytes read
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 11.11.11.11, port 8563 has failed. Error: "The driver received an unexpected pre-login response. Verify the connection properties and check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. This driver can be used only with SQL Server 2005 or later.". ClientConnectionId:5238ac7c-55cc-4ec2-a070-d7f454c6c43b
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:2924)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:2913)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.Prelogin(SQLServerConnection.java:2655)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:2480)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:2142)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1993)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1164)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:760)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:270)
... 28 elided
Please try to use the "com.exasol.jdbc.EXADriver" driver.
The documentation is in the below url:
https://docs.exasol.com/connect_exasol/drivers/jdbc.htm
Related
[root#localhost bin]# ./pemworker --register-agent --pem-server 192.168.254.199 --pem-port 5432 --pem-user postgres --display-name MasterAgent --allow_server_restart true --allow-batch-probes true --enable-smtp true
Wed Jun 1 23:21:55 2022 WARNING: ConnectToPEM: unable to connect to PEM database: connection to server at "192.168.254.199", port 5432 failed: No route to host
Is the server running on that host and accepting TCP/IP connections?
Wed Jun 1 23:21:55 2022 ERROR: Unable to connect to Postgres Enterprise Manager Server
I am learning Symfony,
I create my project with : symfony new myproject --full
directly after this I run symfony serve
in the console I am getting thoses errors :
Tailing Web Server log file (/Users/ben/.symfony/log/cd52af540b09d661e4ffb4f5029da4bbaf3586a9.log)
Tailing PHP-FPM log file (/Users/ben/.symfony/log/cd52af540b09d661e4ffb4f5029da4bbaf3586a9/53fb8ec204547646acb3461995e4da5a54cc7575.log)
[OK] Web server listening
The Web server is using PHP FPM 7.3.11
https://127.0.0.1:8000
[Web Server ] Jun 3 23:38:48 |DEBUG | PHP Reloading PHP versions
[Web Server ] Jun 3 23:38:48 |DEBUG | PHP Using PHP version 7.3.11 (from default version in $PATH)
[Application] Jun 3 21:29:59 |CRITICA| REQUES Uncaught PHP Exception Doctrine\DBAL\Exception\ConnectionException: "An exception occurred in driver: SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?" at /Users/ben/Desktop/symfonytuto/demo/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php line 96
[Application] Jun 3 21:29:59 |CRITICA| REQUES Exception thrown when handling an exception (Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432? at /Users/ben/Desktop/symfonytuto/demo/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php line 96)
[Application] Jun 3 21:29:59 |CRITICA| PHP Uncaught Exception: An exception occurred in driver: SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?
[Application] Jun 3 21:37:59 |ERROR | REQUES Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET https://127.0.0.1:8000/"" at /Users/ben/Desktop/symfonytuto/demo/vendor/symfony/http-kernel/EventListener/RouterListener.php line 136
[Application] Jun 3 21:38:00 |ERROR | REQUES Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET https://127.0.0.1:8000/favicon.ico" (from "https://127.0.0.1:8000/")" at /Users/ben/Desktop/symfonytuto/demo/vendor/symfony/http-kernel/EventListener/RouterListener.php line 136
[Application] Jun 3 21:38:00 |CRITICA| REQUES Exception thrown when handling an exception (Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432? at /Users/ben/Desktop/symfonytuto/demo/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php line 96)
[Application] Jun 3 21:38:00 |CRITICA| PHP Uncaught Exception: An exception occurred in driver: SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?
[Application] Jun 3 21:38:00 |CRITICA| REQUES Uncaught PHP Exception Doctrine\DBAL\Exception\ConnectionException: "An exception occurred in driver: SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?" at /Users/ben/Desktop/symfonytuto/demo/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php line 96
[Application] Jun 3 21:38:00 |CRITICA| REQUES Exception thrown when handling an exception (Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432? at /Users/ben/Desktop/symfonytuto/demo/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php line 96)
[Application] Jun 3 21:38:00 |CRITICA| PHP Uncaught Exception: An exception occurred in driver: SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?
[Web Server ] Jun 3 23:38:48 |INFO | PHP listening path="/usr/sbin/php-fpm" php="7.3.11" port=50170
[PHP-FPM ] Jun 3 23:38:48 |NOTICE | FPM fpm is running, pid 1240
[PHP-FPM ] Jun 3 23:38:48 |NOTICE | FPM ready to handle connections
After this the Symfony's default page is loading correctly but when I add a route to the url for example : https://127.0.0.1:8000/testtt
I'm getting this error :
An exception occurred in driver: SQLSTATE[08006] [7] could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
(it should be something like 'this route doesnt exist' no ?)
Please tell me how I can give you more info about my problem !
Thanks a lot !
This question pops up often enough that I think an answer is appropriate until the issue is resolved.
Assume you just created a new Symfony website-skeleton app, added a new controller and started the development server. You navigate to your new route and exceptions are tossed. Either get a 'driver not found' or a 'could connect to server'. Which of course is a bit unexpected since you have not yet done anything with the database.
The problem is that the Doctrine migrations bundle provides a data collector for Symfony's profiler bar that shows up at the bottom of the browser page when running in development mode. The data collector needs to connect to the database in order to collect migrations data. It does not care about the fact that there is no database. It just tries to connect and ends up tossing an exception.
I opened an issue on this. I am still not entirely sure if this is a feature or bug. Feel free to comment on the issue if you like.
This is a fairly recent problem though I have not tracked exactly when it first popped up. Hence many existing tutorials and step by step guides do not mention it. Consider it to be part of your development experience. Learning how to read exceptions is quite important.
There are several solutions. If you plan on using a database then go ahead and create yourself a database and adjust the DATABASE_URL to point to it. The database can be empty. The migration data collector just needs to be able to connect to it. On my local development machine I actually created a database called db_name just to avoid this error message.
A second solution is to just remove the migrations bundle with
composer remove doctrine/doctrine-migrations-bundle
And the problem goes away. If later on you need migrations then just use composer require to re-install it.
I have another solution that solves the problem without having to remove the package with composer remove ....
comment out Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], in /config/bundles.php
Then move /config/packages/doctrine_migrations.yaml up one directory so it's not longer trying to be included.
This may be a little less intimidating for new developers.
If the issue appears when you want to access the localhost.../lucky/number, go to .env file under the your "folder name" and uncomment this line:
DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
And the rest of them with mySQl and Postgres, comment them.
Hope it works for you. :)
Trying to start mongo node with command
mongos --configdb 192.168.6.3:27019 --port 27018
In results having output:
Tue Mar 15 16:08:21.062 [mongosMain] warning: couldn't check dbhash on config server 192.168.6.3:27019 :: caused by :: 11002 socket exception [CONNECT_ERROR] server [192.168.6.3:27019] mongos connectionpool error: couldn't connect to server 192.168.6.3:27019
Tue Mar 15 16:08:21.064 [mongosMain] ERROR: error upgrading config database to v4 :: caused by :: could not load config version for upgrade :: caused by :: 11002 socket exception [CONNECT_ERROR] server [192.168.6.3:27019] mongos connectionpool error: couldn't connect to server 192.168.6.3:27019
Tue Mar 15 16:08:21.064 warning: couldn't check dbhash on config server 192.168.6.3:27019 :: caused by :: 11002 socket exception [CONNECT_ERROR] server [192.168.6.3:27019] mongos connectionpool error: couldn't connect to server 192.168.6.3:27019
Could you help me, what I'm doing wrong?
I would summarize solution from the comments to close the question.
First, read the mongo server logs.
If you see DNS-related errors there then check if you use correct DNS names which your system can resolve. To exclude DNS errors try to run server using direct IP addresses in configurtaion.
If you still see network-related errors (such as could not connect to server) then check:
the server instance you are trying to connect to is running
you use correct IP address and port
your network links are up
firewalls both on peer and your side are not blocking connection
I am trying to execute a Java script file in MongoDB at port 5930. Mongo can listen to the Database on that port:
./mongo localhost:5930
connecting to: localhost:5930/test
Server has startup warnings:
Wed Dec 18 13:15:58.906 [initandlisten]
Wed Dec 18 13:15:58.906 [initandlisten] ** WARNING: /proc/sys/vm/overcommit_memory is 2
Wed Dec 18 13:15:58.906 [initandlisten] ** Journaling works best with it set to 0 or 1
Now when I execute test.js at port 5930 but I get the following error:
./mongo test.js
connecting to: test
Wed Dec 18 13:22:56.011 JavaScript execution failed: Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:L112
exception: connect failed
The test.js has the following line:
conn = new Mongo("localhost:5930);
How can I run the script at port 5930? and Why did the script always try to execute from the default port (27017)?
Thanks
Mongo tries to connect itself to the local database automatically, before it looks at your script.
Connect to a local Mongo database running on an alternate port with this mongo command line:
mongo --nodb test.js
And have your code open the connection (which you already do).
when connection using mongo db driver with replica set it is giving warning that connecting to localhost as below mentioned. any idea why ?
Dec 21, 2013 2:47:49 PM com.mongodb.ConnectionStatus$UpdatableNode update
WARNING: Server seen down: localhost/127.0.0.1:10001 - java.io.IOException - message: couldn't connect to [localhost/127.0.0.1:10001] bc:java.net.ConnectException: Connection refused: connect
Dec 21, 2013 2:47:50 PM com.mongodb.ConnectionStatus$UpdatableNode update
WARNING: Server seen down: localhost/127.0.0.1:10003 - java.io.IOException - message: couldn't connect to [localhost/127.0.0.1:10003] bc:java.net.ConnectException: Connection refused: connect
Dec 21, 2013 2:47:52 PM com.mongodb.ConnectionStatus$UpdatableNode update
WARNING: Server seen down: localhost/127.0.0.1:10001 - java.io.IOException - message: couldn't connect to [localhost/127.0.0.1:10001] bc:java.net.ConnectException: Connection refused: connect
Dec 21, 2013 2:47:53 PM com.mongodb.ConnectionStatus$UpdatableNode update
WARNING: Server seen down: localhost/127.0.0.1:10003 - java.io.IOException - message: couldn't connect to [localhost/127.0.0.1:10003] bc:java.net.ConnectException: Connection refused: connect
Dec 21, 2013 2:47:54 PM com.mongodb.ConnectionStatus$UpdatableNode update
WARNING: Server seen down: localhost/127.0.0.1:10002 - java.io.IOException - message: couldn't connect to [localhost/127.0.0.1:10002] bc:java.net.ConnectException: Connection refused: connect
Exception in thread "main" com.mongodb.MongoException: can't find a master
at com.mongodb.DBTCPConnector.checkMaster(DBTCPConnector.java:514)
at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:174)
at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:155)
at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:249)
at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:205)
at com.mongodb.DBCollection.insert(DBCollection.java:57)
at com.mongodb.DBCollection.insert(DBCollection.java:100)
at mongo.Test.main(Test.java:33)