tried to use the
[goDBhammer.git] / src / webconnector.go
1 // im a web connector
2
3 package main
4
5
6 import (
7         "http";
8         "io";
9         "./dbibridge";
10 )
11
12 // hello world, the web server
13 func HelloServer(c *http.Conn, req *http.Request) {
14         io.WriteString(c, "<html><form method=post><input type=\"input\"><input type=\"submit\" name=\"go\" value=\"go\"></html>\n");
15 }
16
17 func main() {
18
19         var Dbconn *dbibridge.DBConnection;
20         
21         Dbconn = dbibridge.DBICreate();
22         
23         dbibridge.DBIConnect(Dbconn, "mysql", "localhost", "root", "password", "zm");
24         dbibridge.ExecSQL(Dbconn, "create table asdf (asdf int)");
25         dbibridge.DBIDisconnect(Dbconn);
26         //http.Handle("/hello", http.HandlerFunc(HelloServer));
27         //err := http.ListenAndServe(":12345", nil);
28         //if err != nil {
29                 ////panic("ListenAndServe: ", err.String())
30         //}
31
32 }