3 from com
.sun
.star
.sdb
.CommandType
import COMMAND
7 connectionString
= "socket,host=localhost,port=2002"
9 url
= "uno:"+connectionString
+ ";urp;StarOffice.ComponentContext"
11 localCtx
= uno
.getComponentContext()
12 localSmgr
= localCtx
.ServiceManager
13 resolver
= localSmgr
.createInstanceWithContext(
14 "com.sun.star.bridge.UnoUrlResolver", localCtx
)
15 ctx
= resolver
.resolve( url
)
16 smgr
= ctx
.ServiceManager
18 rowset
=smgr
.createInstanceWithContext( "com.sun.star.sdb.RowSet", ctx
)
19 rowset
.DataSourceName
= "Bibliography"
20 rowset
.CommandType
= COMMAND
21 rowset
.Command
= "SELECT IDENTIFIER, AUTHOR FROM biblio"
25 print "Identifier\tAuthor"
27 id = rowset
.findColumn( "IDENTIFIER" )
28 author
= rowset
.findColumn( "AUTHOR" )
30 print rowset
.getString( id ) + "\t" + repr( rowset
.getString( author
) )