database-connection

Access remote Oracle database with Powershell

折月煮酒 提交于 2021-02-07 18:27:30
问题 I need to be able to connect to an Windows 7 based Oracle server (32 bit, Oracle XE) which is on my network. The machine I need to connect from is running Windows 7 64 bit, with Powershell installed on both machines. I have installed the Oracle 32 bit client on my 64 bit machine and have SQL Developer installed on both machines. I want to create a script that connects the the Oracle database and runs a simple SELECT query. I can't get it to connect though. I have tried using ODAC (I think I

Connecting to local instance of PostgreSql with JDBC

大憨熊 提交于 2021-02-06 09:47:28
问题 I have a running local instance of PostgreSql on a linux machine. When I use psql command from the shell I success to log in without any problem. I need to connect to the PostgreSql via the JDBC, but I don't know what exactly should I pass as url parameter to DriverManager.getConnection() . It should start with jdbc:postgresql: but what's going next? I was told by the system group that a database with was created like user name. e.g. if my user is jutky a db named jutky was created, but when

Socket Exceptions when trying to connect to MySql database from gitpod IDE (ubuntu server)

旧时模样 提交于 2021-02-05 09:35:17
问题 I'm working with the gitpod online IDE ( vs code in the browser with an ubuntu linux server behind it). I'm struggling with creating a Connection to my mysql database on an other linux (CentOS) server. I've set the Remote MySql hosts on the db server to '%' => 'all allowed'. I'm using the MySql Connector package: https://www.nuget.org/packages/MySqlConnector to connect to it. That's what my code looks like: public async Task<List<User>> GetUsersAsync() { List<User> readUsers = new List<User>(

PHP Sqlsrv connection not working when specify port, instance

半城伤御伤魂 提交于 2021-01-29 13:56:49
问题 PHP version:7.4, SQL Server version:2019, I was going to try to specify port in connection but it didn't work. <?php $serverName = "MYPCNAME, 1433"; $connectionInfo = array( "Database"=>"MyDB", "UID"=>"sa", "PWD"=>'MyPassword'); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn ) { echo "Connection established."; }else{ echo "Connection could not be established.<br />"; die( print_r( sqlsrv_errors(), true)); } ?> Above showed below message. [Microsoft][ODBC Driver 17 for SQL

The specified database user/password combination is rejected: org.hsqldb.HsqlException: unexpected token: NOT

别等时光非礼了梦想. 提交于 2021-01-29 05:04:00
问题 I am using HSQLDB to connect to my database via IDEA. However I am getting the error - username/password rejected, even though I entered correctly: The specified database user/password combination is rejected: org.hsqldb.HsqlException: unexpected token: NOT The database connection was successful before, but after had I modified the SQL code for one of the tables, the error started to occur The code for establishing the connection is below: import java.sql.Connection; import java.sql

jdbc to MYSQL error: “table airportdetails doesn't exist”

你。 提交于 2021-01-29 04:59:22
问题 I am trying to connect to a MySQL database from a jsp page using jdbc in the backend. I have the following code: public static void insertIntoDatabase(String code,String name,String temp,String hum,String del) { Connection con = null; if (del.length() == 0) { del="no data"; } name = name.replaceAll("\\(.+?\\)", ""); name = name.replaceAll(" ", "_"); del = del.replaceAll(" ", "_"); System.out.println("del "+del); String url = "jdbc:mysql://localhost:3306/test"; try { Class.forName("com.mysql

sql open connection in read only mode

折月煮酒 提交于 2021-01-20 21:41:22
问题 This question comes out of curiosity. I searched google for this but didn't get a clue. Suppose a user has full read/write access to MySQL database. I am wondering, is there any way (some parameter in connection string) to connect to database by the same username and password in read-only mode? I want this without changing this user's permissions because the same user might require write permission too at some other time. This would be useful (if possible) to prevent accidental modification

sql open connection in read only mode

江枫思渺然 提交于 2021-01-20 21:39:31
问题 This question comes out of curiosity. I searched google for this but didn't get a clue. Suppose a user has full read/write access to MySQL database. I am wondering, is there any way (some parameter in connection string) to connect to database by the same username and password in read-only mode? I want this without changing this user's permissions because the same user might require write permission too at some other time. This would be useful (if possible) to prevent accidental modification

Persistent DB Connection in Django/WSGI application

耗尽温柔 提交于 2020-12-30 04:50:35
问题 I want to keep a persistent connection open to a third party legacy database in a django powered web application. I want to keep the a connection between the web app and the legacy database open since creating a new connection is very slow for this special DB. It is not like usual connection pooling since I need to store the connection per web user. User "Foo" needs its own connection between web server and legacy DB. Up to now I use Apache and wsgi, but I could change if an other solution

Configure a `DataSource` to connect to a managed Postgres server on Digital Ocean with SSL/TLS encryption

*爱你&永不变心* 提交于 2020-12-15 03:49:29
问题 I am trying the managed database service on DigitalOcean.com, having created a Postgres instance. Digital Ocean defaults to requiring remote connections be made with SSL (actually TLS) encryption. How does one configure a JDBC DataSource implementation for providing connections to such a database server? This Question is similar to Produce a DataSource object for Postgres JDBC, programmatically but adds the specific elements of SSL/TLS encryption and using a managed database remotely. 回答1: