Tutorial by Examples: connect

Create custom class for calling multipart/form-data HttpURLConnection request MultipartUtility.java public class MultipartUtility { private final String boundary; private static final String LINE_FEED = "\r\n"; private HttpURLConnection httpConn; priva...
Enable USB Debugging on your device and from command line type adb devices. If everything is OK, the response should be: List of devices attached 1234567890 device Where 1234567890 is the device's id. If multiple devices are connected, you should see all of them: List of devices at...
UCanAccess is a pure Java JDBC driver that allows us to read from and write to Access databases without using ODBC. It uses two other packages, Jackcess and HSQLDB, to perform these tasks. Once it has been set up*, we can work with data in .accdb and .mdb files using code like this: import java.sq...
This example connects to a Wi-Fi access point with WEP encryption, given an SSID and the password. public boolean ConnectToNetworkWEP(String networkSSID, String password) { try { WifiConfiguration conf = new WifiConfiguration(); conf.SSID = "\"" + networkSSID ...
This example connects to a Wi-Fi access point with WPA2 encryption. public boolean ConnectToNetworkWPA(String networkSSID, String password) { try { WifiConfiguration conf = new WifiConfiguration(); conf.SSID = "\"" + networkSSID + "\""; // Please note th...
Managing AWS resources that scale up and down runs into the limits of the static inventory host file, that's why we need something dynamic. And that's what the dynamic inventories are for. Let's start: Download these ec2.ini and ec2.py files to the your project folder: cd my_ansible_project wget...
Another use of RODBC is in connecting with SQL Server Management Database. We need to specify the 'Driver' i.e. SQL Server here, the database name "Atilla" and then use the sqlQuery to extract either the full table or a fraction of it. library(RODBC) cn <- odbcDriverConnect(connect...
First, install Mongoose with: npm install mongoose Then, add it to server.js as dependencies: var mongoose = require('mongoose'); var Schema = mongoose.Schema; Next, create the database schema and the name of the collection: var schemaName = new Schema({ request: String, time: Nu...
The first step in accessing a data source via ADO is creating an ADO Connection object. This is typically done using a connection string to specify the data source parameters, although it is also possible to open a DSN connection by passing the DSN, user ID, and password to the .Open method. Note t...
Driver: 12c R1 11g R2 (Note: the driver is not included in Maven Central!) Driver class initialization: Class.forName("oracle.jdbc.driver.OracleDriver"); Connection URL Older format, with SID "jdbc:oracle:thin:@<hostname>:<port>:<SID>" Newer...
The --url flag can be tricky to use. There is a 60 second window to authenticate, and then the username/password randomly resets. So be sure to have robomongo open and ready to configure a new connection when you run the command. # get the MONGO_URL string for your app meteor mongo --url $METEOR...
Did you know about the --url flag? Very handy. meteor mongo --url YOURSITE.meteor.com
library(RODBC) con <- odbcDriverConnect("driver={Sql Server};server=servername;trusted connection=true") dat <- sqlQuery(con, "select * from table"); close(con) This will connect to a SQL Server instance. For more information on what your connection string should loo...
Add the required network permissions to the application manifest file: <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android....
To check that the connection to the server is valid: sqoop list-tables --connect "jdbc:sqlserver://<server_ip>:1433;database=<database_name>" --username <user_name> --password <password> Before doing this it is recommended ...
Express is based on Connect, which is what provides the middleware functionality of Express. To understand what connect is, you can see that it provides the basic app structure that you use when you use express const connect = require('connect') const app = connect() app.listen(3000) This wi...
DatabaseTransactions trait allows databases to rollback all the change during the tests. If you want to rollback multiple databases , you need to set $connectionsToTransact properties use Illuminate\Foundation\Testing\DatabaseMigrations; class ExampleTest extends TestCase { use Databas...
Quite often it's necessary to send/upload a file to a remote server, for example, an image, video, audio or a backup of the application database to a remote private server. Assuming the server is expecting a POST request with the content, here's a simple example of how to complete this task in Andro...
Create a MongoDB connection, that later you can query: $manager = new \MongoDB\Driver\Manager('mongodb://localhost:27017'); In the next example, you will learn how to query the connection object. This extension close the connection automatically, it's not necessary to close manually.
If you want to connect to an HBase server, first you need to make sure that the IP of the server is in your /etc/hosts file for example add the line 255.255.255.255 hbase Then you can use the Java API to connect to zookeeper, you only have to specify the client port and the zookeeper address ...

Page 3 of 10