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.7k Golang : Frobnicate or tweaking a string example
+13.5k Facebook PHP getUser() returns 0
+32.4k Golang : Math pow(the power of x^y) example
+5.4k Golang *File points to a file or directory ?
+15.4k Golang : invalid character ',' looking for beginning of value
+11.6k Android Studio : Create custom icons for your application example
+7.5k Golang : Create zip/ePub file without compression(use Store algorithm)
+6k Fontello : How to load and use fonts?
+5.8k Javascript : How to replace HTML inside <div>?
+12.3k Golang : 2 dimensional array example
+9.6k Golang : Quadratic example
+6.2k Golang & Javascript : How to save cropped image to file on server