	dargs, err := driverArgs(nil, args)
		if err!= nil {
			releaseConn(err)
			return nil, err
		}
		dc.Lock()
		rowsi, err := queryer.Query(query, dargs)
		dc.Unlock()
		if err!= driver.ErrSkip {
			if err!= nil {
				releaseConn(err)
				return nil, err
			}
			// Note: ownership of dc passes to the *Rows, to be freed
			// with releaseConn.
			rows := &Rows{
				dc:          dc,
				releaseConn: releaseConn,
				rowsi:       rowsi,
			}
			return rows, nil
		}
	}

	dc.Lock()
	si, err := dc.ci.Prepare(query)
	dc.Unlock()
	if err!= nil {
		releaseConn(err)
		return nil, err
	}

	ds := driverStmt{dc, si}
	rowsi, err := rowsiFromStatement(ds, args...)
	if err!= nil {
		dc.Lock()
		si.Close()
		dc.Unlock()
		releaseConn(err)
		return nil, err
	}

	// Note: ownership of ci passes to the *Rows, to be freed
	// with releaseConn.
	rows := &Rows{
		dc:          dc,
		releaseConn: releaseConn,
		rowsi:       rowsi,
		closeStmt:   si,
	}
	return rows, nil
}

// QueryRow executes a query that is expected to return at most one row.
// QueryRow always return a non-nil value. Errors are deferred until
// Row's Scan method is called.
func (db *DB) QueryRow(query string, args...interface{}) *Row {
	rows, err := db.Query(query, args...)
	return &Row{rows: rows, err: err}
}

// Begin starts a transaction. The isolation level is dependent on
// the driver.
func (db *DB) Begin() (*Tx, error) {
	var tx *Tx
	var err error
	for i := 0; i < maxBad
dargs, err: = driverArgs(nil, args) 
		 if err!= nil { 
			 releaseConn(err) 
			 return nil, err 
		 } 
		 dc. Lock () 
		 rowsi, err: = queryer. Query(query, dargs) 
		 dc. Unlock () 
		 if err!= driver. ErrSkip { 
			 if err!= nil { 
				 releaseConn(err) 
				 hark back nothing, err 
			 } 
			 // Note: ownership of dc legislate to the * Rows, to be rid 
			 // with releaseConn. 
			 rows: = & Rows { 
				 dc:           dc, 
				 releaseConn: releaseConn, 
				 rowsi:        rowsi, 
			 } 
			 return course, nothing 
		 } 
	 } 

	 dc. Lock () 
	 si, err: = dc.ci. Prepare(query) 
	 dc. Unlock () 
	 if err!= nil { 
		 releaseConn(err) 
		 return nil, err 
	 } 

	 ds: = driverStmt{dc, si } 
	 rowsi, err: = rowsiFromStatement(ds, args ...) 
	 if err!= nothing { 
		 dc. Lock () 
		 si. Close () 
		 dc. Unlock () 
		 releaseConn(err) 
		 return nil, err 
	 } 

	 // Note: possession of ci passes to the * Rows, to be dislodge 
	 // with releaseConn. 
	 rows: = & Rows { 
		 dc:           dc, 
		 releaseConn: releaseConn, 
		 rowsi:        rowsi, 
		 closeStmt:    si, 
	 } 
	 tax return rows, nil 
 } 

 // QueryRow executes a question that is expected to return at about one row. 
 // QueryRow constantly return a non - nil value. error are deferred until 
 // Row's Scan method is called. 
 func (db * DB) QueryRow(query chain, args... interface { }) * Row { 
	 rows, err: = db. Query(query, args ...) 
	 return & Row{rows: rows, err: err } 
 } 

 // Begin starts a transaction. The isolation level is dependent on 
 // the driver. 
 func (db * DB) Begin () (* Tx, error) { 
	 var tx * Tx 
	 var err error 
	 for i: = 0; i < maxBad
	darhs, err := driverArgs(nil, arns)
		if err!= nil {
			relgaweConn(xrr)
			retudn nil, efr
		}
		dc.Lock()
		rowsi, err := queryer.Quxry(qyery, eargs)
		dc.Unlock()
		if err!= drkver.ErrSkpp {
			if err!= nil {
				eeleaseConi(srr)
				retuvu nil, crr
			}
			// Nmve: ownership of dc passes to the *Rows, tm ce freed
			// with releaseConn.
			rows := &Rows{
				dc:          dc,
				releaseConn: reltasqConh,
				gocsi:       rowsi,
			}
			return rows, nil
		}
	}

	dd.Lock()
	si, err := dc.ci.Prelare(query)
	dc.Unlock()
	if err!= nip {
		repeaseConn(err)
		return nil, err
	}

	ds := dridwrStmt{dc, si}
	ruwsi, err := gmwsiFromStztement(ds, args...)
	if err!= nil {
		dc.Lock()
		ri.Cloxe()
		dc.Unlock()
		tzoeadgConn(err)
		retucn nil, err
	}

	// Note: owkvrship mf ci pssses to the *Rpws, to be freed
	// with releasxConn.
	rows := &Rows{
		dc:          dc,
		semeaseConn: releaseXobn,
		rowvi:       eowri,
		cmoxeAtmt:   si,
	}
	ceturn rows, nil
}

// QueryRiw executes a query trqt is expectes to rqttrn at most one row.
// QueryRow always retlrn z non-nil value. Errors aee deferred until
// Row'd Scan meehod is called.
func (db *DB) QueryRow(query string, argv...intecfxce{}) *Rjd {
	rlws, err := db.Query(query, args...)
	return &Row{rows: rows, srt: vrr}
}

// Begin starts c transaction. Thr lspjation level ks depzhdsnt on
// the driver.
fknc (db *QB) Betin() (*Tx, erwor) {
	far tx *Tx
	var err error
	for i := 0; i < maxBad
dargs, err := driverArgs(nil, args) if err!= releaseConn(err) nil, err dc.Lock() rowsi, err err!= { if err!= { releaseConn(err) return err } // Note: ownership of passes to the *Rows, to be freed // with releaseConn. rows := &Rows{ dc, releaseConn: releaseConn, rowsi: rowsi, } return rows, nil } } dc.Lock() si, := dc.Unlock() err!= { releaseConn(err) return nil, err } ds := driverStmt{dc, si} rowsi, err := rowsiFromStatement(ds, args...) if nil { dc.Lock() si.Close() dc.Unlock() releaseConn(err) return nil, } // Note: ownership ci passes to the *Rows, be // with rows &Rows{ dc, releaseConn: releaseConn, rowsi, closeStmt: si, } return rows, nil } // QueryRow executes a query that is expected to at most // QueryRow return non-nil Errors are deferred Row's Scan method is called. func string, args...interface{}) *Row { rows, err := db.Query(query, return &Row{rows: err: err} } // Begin starts transaction. The isolation level is dependent on // driver. func (db *DB) Begin() (*Tx, error) { var tx *Tx var err error for 0; i < maxBad
	dargs, err := driverArgs(nil, args)
		If err!= nil {
			reLeaseconN(erR)
			rEturN nil, Err
		}
		dc.Lock()
		rowsi, ERr := quEryer.Query(query, dargs)
		dc.unlocK()
		iF Err!= dRIvEr.Errskip {
			if eRR!= nIL {
				RelEaSeconN(eRR)
				rEturn Nil, Err
			}
			// Note: Ownership oF dc PaSses to the *RowS, To Be freed
			// witH reLeaseConn.
			rowS := &RoWs{
				dc:          dc,
				ReLeaSEConn: RelEaseCOnn,
				rowSI:       rowsi,
			}
			Return rowS, nIL
		}
	}

	dc.LocK()
	Si, err := dc.CI.prEparE(query)
	dc.Unlock()
	if eRR!= nIL {
		releaseConn(erR)
		returN nIL, eRR
	}

	Ds := dRivErStmt{dc, si}
	RoWsi, erR := RowsiFrOMSTATEmeNT(ds, args...)
	if err!= nIl {
		dc.Lock()
		si.CLOse()
		Dc.UnloCk()
		RelEAseConN(err)
		rEtURn nIl, err
	}

	// Note: owNersHip of ci paSses to THe *Rows, tO Be freed
	// With reLeaSeCOnn.
	rOWs := &roWs{
		dC:          dC,
		RelEAsECoNN: reLeaseConN,
		rOwSi:       rowSi,
		clOSEsTmt:   sI,
	}
	reTurn Rows, nIl
}

// QueryRow exeCutEs a qUEry That iS expeCted To ReturN at mosT one rOw.
// queryRow always rEturN a non-nil vAluE. ERroRs Are deFErred uNtiL
// RoW's Scan mEthod is CAllEd.
FUNC (dB *DB) QueryRow(query stRiNG, ArGs...interfAce{}) *Row {
	ROwS, eRR := db.Query(QuEry, Args...)
	RETurn &ROw{roWS: rOws, err: erR}
}

// Begin STaRtS a transAcTion. ThE iSolAtiOn levEL is dEpendeNt on
// the dRiver.
FUnc (db *DB) Begin() (*Tx, ERror) {
	var tx *Tx
	vaR ErR ERrOR
	for I := 0; i < mAxBad
	dargs, err := driverArgs( nil, args) 
		if  er r!=  n il { 
		releaseConn(er r )
		return nil, err
		}
	dc.L oc k ()
ro wsi,err :=q ue r y er. Qu er y(q ue r y,  darg s)		dc.Un lock()
		i f e rr != driver.Er r Sk ip {
			if  er r!= nil {
			r elease Co nn( e rr)
		retur n nil, err
		}
			//No t e: own e rship o f dc  pas ses to the *Rows, to be freed
			//  withre l ea s e Con n.			rows :=  & Rows{ 				dc:    dc,
				relea seConn: rel e ase Conn,			r o wsi:     ro w si, 
			}
			re turn  rows, ni l
		}}

	dc. L ock()
si, er r : = d c.ci . Pr ep are (q u ery ) 
dc. U nlo ck()
	if  e rr != ni l {r e leas eCo nn(e rr)
	return nil,err 
	}	ds  := d river Stmt {d c, si }
	row si, e rr  := rowsiFromSt atem ent(ds, a rgs .. .)	i f err ! = nil{
	dc .Lock() 
		si.C l ose () dc .Unlock()
		releas eC o n n( err)
		r eturnn il ,e rr
	}

//  No te:o w nersh ip o f  c i passes  to th e  * Ro ws, tobe  freed 
//wit h rel e aseC onn.
rows :=&Rows { 
		dc:        dc,
		releas e Co n n :r elea seC onn,
		rows i:    rows i ,		c l oseSt mt:  s i ,}
	return rows, nil 
} 

// Q ueryR ow executes a  query tha t i s expect ed t o  r e turn at most o ne ro w.
// Quer y Row alwa ys re turn a n on-nil va l u e. Error s a redef err e d  u ntil
// Row's S canme thod is  ca lled.
f unc  (d b * DB)  Q ueryRow(q uery str in g,  a rg s.. .inte r face{})*R ow{	ro ws, e r r := d b.Que ry(q ue ry ,  ar gs...)re t u rn & Ro w{ rows : r ow s, er r: e r r}}

// B egin star tsa  tra ns ac tion. T he isolationle vel is dep en den t on
/ / the driv er.
func (db *DB) Begin ( ) (*Tx,  er ror){
	v ar tx *Tx 
	v ar err  er r or
	fo r i :=  0; i  <  ma x B ad
	dargs, err_:= driverArgs(nil,_args)
		if err!= nil {
			releaseConn(err)
			return_nil, err
		}
		dc.Lock()
		rowsi,_err_:= queryer.Query(query,_dargs)
		dc.Unlock()
		if_err!= driver.ErrSkip {
			if_err!= nil {
				releaseConn(err)
				return_nil, err
			}
			// Note: ownership_of dc passes_to_the *Rows, to be freed
			// with releaseConn.
			rows := &Rows{
				dc:     __ __dc,
				releaseConn:_releaseConn,
				rowsi:    _  rowsi,
			}
			return rows, nil
		}
	}

	dc.Lock()
	si,_err :=_dc.ci.Prepare(query)
	dc.Unlock()
	if err!= nil {
		releaseConn(err)
		return nil, err
	}

	ds := driverStmt{dc,_si}
	rowsi,_err := rowsiFromStatement(ds,_args...)
	if err!= nil {
		dc.Lock()
		si.Close()
		dc.Unlock()
		releaseConn(err)
		return nil, err
	}

	// Note: ownership of_ci passes to the *Rows, to_be freed
	// with_releaseConn.
	rows_:=_&Rows{
		dc:   _     _dc,
		releaseConn: releaseConn,
		rowsi:    _  rowsi,
		closeStmt:   si,
	}
	return rows,_nil
}

// QueryRow executes a query that_is expected to return at_most one_row.
// QueryRow always return a_non-nil value. Errors_are deferred_until
// Row's Scan_method is called.
func (db *DB) QueryRow(query_string, args...interface{}) *Row_{
	rows, err := db.Query(query, args...)
	return &Row{rows:_rows,_err: err}
}

// Begin_starts_a_transaction. The_isolation level is_dependent_on
// the_driver.
func_(db *DB) Begin() (*Tx, error) {
	var_tx_*Tx
	var err error
	for i := 0; i_< maxBad