database-connection

SAS connection to Teradata Database using Teradata ODBC

南楼画角 提交于 2019-12-30 11:08:24
问题 I'm trying to connect to Teradata in SAS. I set up an teradata ODBC on the machine. The assumption currently for me is that using ODBC is the only way for me to access the database. And here is the syntax of my connection command: Libname Teradata ODBC dsn = 'dsnname' uid = 'uid' pwd = 'pwd'; results: Error: The ODBC engine cannot be found. Error: Error in the LIBNAME statement. It keeps saying that the ODBC engine cannot be found. I'm really confused now. Is there anything wrong with the

How to connect python application with online database

醉酒当歌 提交于 2019-12-30 10:51:09
问题 I'm trying to connect Python Application with online database. It's working properly on localhost database but when I try to connect with online it showing error. Error errno=2003, values=(self.get_address(), _strioerror(err))) mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on '69.162.107.34:3306' (10060 A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host

PHP/PDO: How to get the current connection status

纵然是瞬间 提交于 2019-12-30 08:13:54
问题 What is the PDO equivalent of: mysqli_stat($dbConn); P.S. I use it to (get a message to) make sure I am connected 回答1: I cannot get credit for this answer. Someone posted the answer, but he/she latter deleted the entry. Here's the (saved archived) answer to your question: $status = $conn->getAttribute(PDO::ATTR_CONNECTION_STATUS); 回答2: $pdo->getAttribute(PDO::ATTR_CONNECTION_STATUS) always return "127.0.0.1 via TCP/IP" even if i stop mysqld, to use: if ($pdo->getAttribute(PDO::ATTR_SERVER

Produce a `DataSource` object for Postgres JDBC, programmatically

徘徊边缘 提交于 2019-12-30 06:31:11
问题 The JDBC Tutorial recommends using a DataSource object to obtain database connections rather than using the DriverManager class. To quote the Connecting with DataSource Objects page: DataSource objects … the preferred means of getting a connection to a data source. How do I get such an object for a JDBC connection to Postgres? I have a JDBC driver in place. Right now, I do not want to fiddle around with JNDI like this or this. Can I instantiate a DataSource programmatically within my Java app

Cannot create JDBC driver of class '' for connect URL 'null' : Tomcat & SQL Server JDBC driver

最后都变了- 提交于 2019-12-30 06:25:20
问题 I've tried just about everything I can find out there, if someone is able to help me out, I will be eternally grateful (and a lot more free in my time). Basically, I have an error in Tomcat 7.0 (both when running within Eclipse and via startup.bat) that says this once data begins to be accessed by my dynamic web application: Cannot create JDBC driver of class '' for connect URL 'null' java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507) at sun

Connection.open for hangs indefinitely, no exception is thrown

萝らか妹 提交于 2019-12-30 06:01:08
问题 When I try to do the following code, the program hangs indefinitely. I don't know why and there seems to be other unanswered topics on the matter. Although, if the IP\website cannot be reached, then it works as intended. private void DoStuff() { string connectionString = "Data Source=www.google.com;Connection Timeout=5"; using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); //Hangs here indefinitely Console.WriteLine("Test"); } } For example, if I set the

PHP Database connection practice

好久不见. 提交于 2019-12-30 00:41:12
问题 I have a script that connects to multiple databases (Oracle, MySQL and MSSQL), each database connection might not be used each time the script runs but all could be used in a single script execution. My question is, "Is it better to connect to all the databases once in the beginning of the script even though all the connections might not be used. Or is it better to connect to them as needed, the only catch is that I would need to have the connection call in a loop (so the database connection

Connection Pooling with Apache DBCP

烂漫一生 提交于 2019-12-29 14:15:10
问题 I want to use Apache Commons DBCP to enable connection pooling in a Java Application (no container-provided DataSource in this). In many sites of the web -including Apache site- the usage of the library is based in this snippet: BasicDataSource ds = new BasicDataSource(); ds.setDriverClassName("oracle.jdbc.driver.OracleDriver"); ds.setUsername("scott"); ds.setPassword("tiger"); ds.setUrl(connectURI); Then you get your DB connections through the getConnection() method. But on other sites -and

Connection Pooling with Apache DBCP

天涯浪子 提交于 2019-12-29 14:13:22
问题 I want to use Apache Commons DBCP to enable connection pooling in a Java Application (no container-provided DataSource in this). In many sites of the web -including Apache site- the usage of the library is based in this snippet: BasicDataSource ds = new BasicDataSource(); ds.setDriverClassName("oracle.jdbc.driver.OracleDriver"); ds.setUsername("scott"); ds.setPassword("tiger"); ds.setUrl(connectURI); Then you get your DB connections through the getConnection() method. But on other sites -and

PostgreSQL: could not connect to server - Connection refused error

橙三吉。 提交于 2019-12-29 09:19:42
问题 I've failed to set up postgreSQL to work with my Ruby-on-Rails project for the past week. I've tried to uninstall and reinstall, postgreSQL , twice now. But when I try to launch postgreSQL I keep getting the error below: could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (127