Permalink
Browse files

add driver/README

  • Loading branch information...
1 parent 8975373 commit 1500aa56bd1817a5a7df58bf8a65be6b0666e355 @weigj committed Feb 20, 2012
Showing with 32 additions and 0 deletions.
  1. +32 −0 driver/README.txt
View
@@ -0,0 +1,32 @@
+Driver for database/sql
+
+Install:
+ go install
+
+Example:
+
+package main
+
+import (
+ "database/sql"
+ _ "odbc/driver"
+ "fmt"
+)
+
+func main() {
+ db, err := sql.Open("odbc", "DSN=test;")
+ defer db.Close()
+
+ stmt, err := db.Prepare("select name from table")
+ defer stmt.Close()
+
+ rows, err := stmt.Query()
+ defer rows.Close()
+
+ for rows.Next() {
+ var name string
+
+ _ = rows.Scan(&name)
+ fmt.Println(name)
+ }
+}

0 comments on commit 1500aa5

Please sign in to comment.