If by 'mainframe' you mean MVS or OS/390 then the first question is, do you have the client attachment feature. Unlike the other platforms, if you want to connect MQ clients to the mainframe you need to buy (yes, really!) and enable CAF.
Assuming you have this then clients should be able to connect just like any other platform. Mind you, this also assumes you have TCP/IP available on your mainframe as JMS doesn't work over SNA.
If you don't have CAF then you'll need to connect (either directly or as an MQ client) to a non-mainframe QMgr which *is* connected to the mainframe QMgr. Then you can send and receive messages via this 'proxy' QMgr.
Finally, if you're asking about how to specify a client connection in JMS rather than a local one, you need to call these methods on your destination:
setHostName(myhost)
setPort(nnnn)
setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP)
the default is local, i.e. JMSC.MQJMS_TP_BINDINGS_MQ
Of course to maintain compatibility with the JMS standard you would set these in your JNDI entry and then do a lookup from your program to retrieve them. Does anyone actually do this?
Hope this helps,
Paul