connection

How to connect java to Ms access Database [duplicate]

匆匆过客 提交于 2019-12-03 03:55:21
This question already has an answer here: Manipulating an Access database from Java without ODBC 1 answer i'm trying to connect the java to ms access database but it didn't work really well and i got an error message like this sun.jdbc.odbc.JdbcOdbcDriver this is my code : import java.sql.*; public class main{ public static void main(String[] args) { try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver(*.accdb)};DBQ=D:\\Andries\\testdatabase.accdb"); Statement st = con.createStatement(); }catch(Exception ex)

Android Bluetooth Connection Secure Insecure

夙愿已清 提交于 2019-12-03 03:53:17
I have been playing around with the bluetooth API for Android 2.2 (API level 8, HTC Desire) and had an app connecting to an embedded Bluetooth device using: device.createRfcommSocketToServiceRecord(DEV_UUID); This generated a pairing request as expected, however to streamline the connection process I wanted to avoid the user interaction when pairing so moved to API level 10 (HTC Desire with CyanogenMod 7) so I could use: device.createInsecureRfcommSocketToServiceRecord(DEV_UUID); When testing this also works as expected (connecting without prompting the user to pair), however when I try to

Phantomjs loads pages slowly

被刻印的时光 ゝ 提交于 2019-12-03 03:49:23
问题 I'm new into phantomjs, trying it on a standard centOS server (with httpd etc installed, but no modified settings apart from nameservers set to 8.8.8.8 and 8.8.4.4). I'm using the default loadspeed.js file (be it renamed). However, page speeds appear to be extremely slow. Here's an example: $ phantomjs phantomjs.js http://www.google.com/ starting Loading time 90928 msec $ phantomjs phantomjs.js http://173.194.67.138/ #(one of google's public ips) starting Loading time 30204 msec When I load

What are some best practices for debugging Qt signals and slots?

心已入冬 提交于 2019-12-03 03:47:32
Debugging signals and slots can be hard, because the debugger does not jump to the slots of a signal when it is emitted. What are some best practices for debugging Qt signals and slots? In particular How do I make sure connections are set up successfully? When should I use signals and slots, when should I avoid them? What are the most efficient debugging techniques from your experience? jdi There was a blog post written a while back called 20 ways to debug Qt signals and slots It addresses I think #1 and #3 of your questions. For #2, I don't think there is really a hard and fast reason to use

What max_connection should I set for MySQL?

北慕城南 提交于 2019-12-03 03:39:18
I am using MySQL 5.1.35 database on Linux Centos . The Linux server has 2GB RAM with 14GB of disk space . I have created webservices using Restlet framework in Java which has thousand user access. I want to set max_connection for maximum concurrent connections. So please suggest me that what max_connection should I set? Thanks in advance. You need to calculate the memory required by your MySQL engine. See manual here If you are using MYISAM tables then you can calculate memory requirement using following formula: key_buffer_size + (read_buffer_size + sort_buffer_size) * max_connections = K

Inno Setup: add GUI to connect to SQL

混江龙づ霸主 提交于 2019-12-03 03:25:06
Complete Inno Setup and Pascal newbie here. I want to package a single .sql file inside a setup.exe . The setup will be available for download so I can't embed any connection strings within the setup project. The setup basically installs an .NET CLR assembly (dll as hex stream) into the supplied SQL server database by running a simple .sql script I've seen the other posts on here about connecting to an SQL server but none address my issue of a hardcoded connection string or replicating/implementing the generic Data Connection Dialog that pops up in all MS apps for making a DB connection

S3 Java client fails a lot with “Premature end of Content-Length delimited message body” or “java.net.SocketException Socket closed”

纵饮孤独 提交于 2019-12-03 03:19:31
I have an application that does a lot work on S3, mostly downloading files from it. I am seeing a lot of these kind of errors and I'd like to know if this is something on my code or if the service is really unreliable like this. The code I'm using to read from the S3 object stream is as follows: public static final void write(InputStream stream, OutputStream output) { byte[] buffer = new byte[1024]; int read = -1; try { while ((read = stream.read(buffer)) != -1) { output.write(buffer, 0, read); } stream.close(); output.flush(); output.close(); } catch (IOException e) { throw new

Why does PDO print my password when the connection fails?

南笙酒味 提交于 2019-12-03 02:57:13
问题 I have a simple website where I establish a connection to a Mysql server using PDO. $dbh = new PDO('mysql:host=localhost;dbname=DB;port=3306', 'USER', 'SECRET',array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")); I had some traffic on my site and the servers connection limit was reached, and the website throws this error, with my PLAIN password in it! Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[08004] [1040] Too many connections' in /home/domain/html/index.php

Determining when an EDGE connection comes back after a dropout on an iPhone

删除回忆录丶 提交于 2019-12-03 02:52:08
问题 I've incorporated Apple's Reachability sample into my own project so I know whether or not I have a network connection - if I don't have a network connection, I don't bother sending out and requests. I decided to go with the status notification implementation because it seemed easier to have the reachablity updated in the background and have the current results available immediately as opposed to kicking off a synchronous request whenever I want to make a network connection. My problem is

Using POSIX message queues instead of TCP sockets - how to establish “connection”?

扶醉桌前 提交于 2019-12-03 02:08:40
I have client and server programs which now communicate via TCP. I'm trying out using POSIX message queues instead (in cases where the client and server are on the same machine, of course). My hope is that it will improve performance (specifically via reduced latency). I've worked out most of it, but am not sure about one thing: how to establish the "connection." The server accepts connections from multiple clients concurrently, so I'm tempted to emulate the TCP connection establish process like so: Server opens a queue with a well-known name and reads from it continuously (it can use select(2