Golang database/sql.DB.Ping function example
package database/sql
Ping verifies a connection to the database is still alive, establishing a connection if necessary.
Golang database/sql.DB.Ping function usage example
...
db, err := Open(driverName, dataSourceName)
if err != nil {
return db, err
}
err = db.Ping() // try to ping database server
return db, err
...
Reference :
Advertisement
Something interesting
Tutorials
+5.4k Python : Delay with time.sleep() function example
+10.1k Golang : Test a slice of integers for odd and even numbers
+17.6k Golang : Parse date string and convert to dd-mm-yyyy format
+8.6k Golang : Another camera capture GUI application with GTK and OpenCV
+5.2k Golang : Issue HTTP commands to server and port example
+51.4k Golang : Check if item is in slice/array
+5.8k Golang : Launching your executable inside a console under Linux
+9.2k Golang : Write multiple lines or divide string into multiple lines
+9.2k Golang : Generate Codabar
+5.6k Python : Print unicode escape characters and string
+11.5k Golang : Generate DSA private, public key and PEM files example