database-connection

.NET Core 2 - Connection string with instance name and port number

三世轮回 提交于 2020-06-28 08:15:33
问题 In my application I have a connection string in the config. This application created using .NET core 2.11 and SQL Server. This is the connection string: Data Source=servername\instancename, portnumber;Initial Catalog=dbname;Persist Security Info=True;User ID=username;Password=password; This string causes an error as shown here: This error happens if I use instance name and port number in the string. If I remove either one, it is working. So, how do I make it work to used both instance name

Best practices / most practical ways to implement mysqli connections

不羁岁月 提交于 2020-06-07 07:21:43
问题 I'm working on streamlining a bit our db helpers and utilities and I see that each of our functions such as for example findAllUsers(){....} or findCustomerById($id) {...} have their own connection details for example : function findAllUsers() { $srv = 'xx.xx.xx.xx'; $usr = 'username'; $pwd = 'password'; $db = 'database'; $port = 3306; $con = new mysqli($srv, $usr, $pwd, $db, $port); if ($con->connect_error) { die("Connection to DB failed: " . $con->connect_error); } else { sql = "SELECT *

Best practices / most practical ways to implement mysqli connections

做~自己de王妃 提交于 2020-06-07 07:21:05
问题 I'm working on streamlining a bit our db helpers and utilities and I see that each of our functions such as for example findAllUsers(){....} or findCustomerById($id) {...} have their own connection details for example : function findAllUsers() { $srv = 'xx.xx.xx.xx'; $usr = 'username'; $pwd = 'password'; $db = 'database'; $port = 3306; $con = new mysqli($srv, $usr, $pwd, $db, $port); if ($con->connect_error) { die("Connection to DB failed: " . $con->connect_error); } else { sql = "SELECT *

SQL syntax error : correspond to your MariaDB server for the right syntax

纵饮孤独 提交于 2020-06-01 05:49:06
问题 When I click on the Create button to add a supplier record in to my database, I receive the above error message. Can someone help me where did I went wrong: is there something wrong with the insert statement. private void jbtnCreateActionPerformed(java.awt.event.ActionEvent evt) { try { String sql = "INSERT INTO supplier" +"(Full Name, Address Line 1, Address Line 2, Post Code, Email Address, Phone Number)" +"VALUES (?,?,?,?,?,?)"; connection = DriverManager.getConnection("jdbc:mysql:/

Database Connection in Web Application

依然范特西╮ 提交于 2020-05-10 06:29:23
问题 The following are the different techniques we can use for database connection in a web application envrioment. Application Context Database Connection: only one database connection shared among all requests. Database Pooling: open a fixed number of database connection and share the connection among all requests. New Database Connection per request: Open a connection for each request. What are the advantage and disadvantage of these techniques? Which one should a developer use? 回答1: Option 1.

Database Connection in Web Application

别等时光非礼了梦想. 提交于 2020-05-10 06:26:26
问题 The following are the different techniques we can use for database connection in a web application envrioment. Application Context Database Connection: only one database connection shared among all requests. Database Pooling: open a fixed number of database connection and share the connection among all requests. New Database Connection per request: Open a connection for each request. What are the advantage and disadvantage of these techniques? Which one should a developer use? 回答1: Option 1.

Azure Function Database Connection

血红的双手。 提交于 2020-04-18 05:42:12
问题 I have a Python package that I am able to run successfully on an Azure Data Science Virtual Machine. However, when I push it to Azure as a Function, I cannot successfully make a database connection. I was getting an error that the ODBC Driver 13 for SQL Server was not supported, so I changed the driver to ODBC Driver 17 for SQL Server and now I am NOT getting an error, but no data is being returned for a query that I know should return data. Is there any other reason that data would not be

SQLSTATE[HY000] [1045] Access denied for user 'username'@'localhost' (using password: YES)

拥有回忆 提交于 2020-04-06 21:49:09
问题 In my Ubuntu VM, I kept getting SQLSTATE[HY000] [1045] Access denied for user 'username'@'localhost' (using password: YES) update I have configured my database like this in my .env file DB_HOST=45.55.88.57 DB_DATABASE=b-prod DB_USERNAME=root DB_PASSWORD=********* UNIX_SOCKET=/var/run/mysqld/mysqld.sock It works perfectly. But when I use DB_HOST=45.55.88.57 DB_DATABASE=b-prod DB_USERNAME=b <---------------------------------------------- DB_PASSWORD=********* UNIX_SOCKET=/var/run/mysqld/mysqld

EXCEPTION: Unsupported operation: RawSocket constructor (Dart with sqljocky5: ^2.2.1)

牧云@^-^@ 提交于 2020-03-24 03:20:12
问题 I am trying to connect dart with a MySQL database. I installed the MySQL workbench and created a simple DB, have modified the pubspec.yaml and added any other dependencies I needed for MySQL. But I keep pulling up an exception in the browser. EXCEPTION: Unsupported operation: RawSocket constructor STACKTRACE: dart:sdk_internal connect package:sqljocky5/comm/buffered_socket.dart 60:7 defaultSocketFactory package:sqljocky5/comm/buffered_socket.dart 72:20 connect dart:sdk_internal async package

Database connection expensive to create?

﹥>﹥吖頭↗ 提交于 2020-03-21 16:23:59
问题 Why is database connection expensive to create ? Like what finite resource (bandwidth/network round trip/cpu) exactly is it consuming ? Typically expensive to create means it is consuming some resource like cpu/disk/io, but in case of connection i can only think of the time it takes for Sync/Ack etc. 回答1: You didn't say what database you are asking about, so this answer is pretty generic. Database connections are much more than just a TCP/IP socket. Each connection consumes memory that