Re: problem with query from database

Martin Klang <[email protected]> Fri, 27 Aug 2004 12:44:09 +0100
Newsgroups gmane.text.xml.o-xml
Message-ID <[email protected]>
Right, the JDBC connectors and drivers are not part of the executable  
jar.

Firstly you need the ObjectBox db extension classes which are part of  
obox.jar, which you can download from here:
http://download.pingdynasty.com/o-xml/ObjectBox/ObjectBox-1.0.2/

Next you need the JDBC drivers for your database, though I think the  
JDBC-ODBC bridge is already included with the SDK?
Otherwise you can probably find one here:
http://servlet.java.sun.com/products/jdbc/drivers

The easiest is probably to include objectbox.jar in your classpath too,  
it has other support libraries required that are not in obox.jar.

Then run the program with something like:

java -cp obox.jar:objectbox.jar -e  
org.oXML.extras.db.DatabaseExtensions program.oml


hth,

/m

ps I missed to cc the last response to the list, apologies.

On 27 Aug 2004, at 12:13, mark.venbrux_3-//[email protected] wrote:

>
> Hi Martin,
>
> Thanks for the quick response!
>
> The result is now a "NoClassDefFoundError":
>
> H:\experiments\oxml_db_query>java -jar objectbox-1.0.2.jar -e  
> org.oXML.extras.db.DatabaseExtensions program.oml
> Fri Aug 27 13:04:10 CEST 2004   info: Begin.
> Exception in thread "main" java.lang.NoClassDefFoundError:  
> org.oXML.extras.db.JdbcConnector
>         at  
> org.oXML.extras.db.ConnectionTemplate.class$(ConnectionTemplate.java: 
> 65)
>         at  
> org.oXML.extras.db.ConnectionTemplate.process(ConnectionTemplate.java: 
> 64)
>         at  
> org.oXML.engine.template.CompoundTemplate.process(CompoundTemplate.java 
> :20)
>         at  
> org.oXML.engine.template.ProgramTemplate.process(ProgramTemplate.java: 
> 87)
>         at  
> org.oXML.engine.template.DocumentTemplate.process(DocumentTemplate.java 
> :71)
>         at  
> org.oXML.engine.InterpretedProgram.run(InterpretedProgram.java:189)
>         at org.oXML.type.Program.run(Program.java:124)
>         at org.oXML.engine.ObjectBox.run(ObjectBox.java:158)
>         at org.oXML.engine.ObjectBox.run(ObjectBox.java:122)
>         at org.oXML.engine.ObjectBox.main(ObjectBox.java:196)With kind  
> regards,
>           Mark
>
>
> There is no "JdbcConnector" class in the objectbox jarfile. Am I on  
> the right path to set up a connection to Microsoft Access?
>
>  ++++++++++++++++++++++++++++++++++++++++
>  Ir. Mark Venbrux
>  Multimedia Systems Software Group
>  Philips Digital Systems Laboratory - Eindhoven
>  Building SFJ 458 - B2, tel: +31 40 27 38378
>
>
>
>
>
> Martin Klang <[email protected]>
>
> 2004-08-27 12:52 PM
>
>        
>         To:        Mark Venbrux_3/EHV/PDSL/PHILIPS@PHILIPS
>         cc:        
>         Subject:        Re: [o:XML] problem with query from database
>
>         Classification:        
>
>
>
> Hi Mark,
>
>  Seems the db declarations are treated as literal XML.
>  Looking at the namespace declaration I think you're missing a slash,  
> it
>  should be:
>  xmlns:db="http://www.o-xml.com/db/"
>
>  let me know if that doesn't work!
>
>  /m
>
>  On 27 Aug 2004, at 11:23, mark.venbrux_3-//[email protected] wrote:
>
>  >
>  > Hi,
>  >
>  > I was experimenting with the program listed below.
>  > I try to run a query from a M$ Access datasource.
>  > I don't get error messages, nor a result.
>  > Any clue what to do?
>  >
>  > <o:program xmlns:o="http://www.o-xml.org/lang/"
>  > xmlns:io="http://www.o-xml.org/lib/io/"
>  > xmlns:db="http://www.o-xml.com/db">
>  >     <o:log msg="Begin."/>
>  >     <db:connection>
>  >         <db:url>jdbc:odbc:my_db_data_source</db:url>
>  >         <db:driver>sun.jdbc.odbc.JdbcOdbcDriver</db:driver>
>  >         <db:username>my_db</db:username>
>  >         <db:password>my_db</db:password>
>  >     </db:connection>
>  >     <db:query name="getProducts">
>  >         <db:sql>select Name  from Products</db:sql>
>  >         <db:result>
>  >             <product>
>  >                 <name>[name]</name>
>  >             </product>
>  >         </db:result>
>  >     </db:query>
>  >     <db:call query="getProducts"/>
>  >     <o:log msg="End."/>
>  > </o:program>
>  >
>
>
>  ______________________________________________________________________
>  This email has been scanned by the MessageLabs Email Security System.
>  For more information please visit http://www.messagelabs.com/email
>  ______________________________________________________________________
>
>


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________