cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Per Kreipke" <...@onclave.com>
Subject RE: MS access and esql
Date Thu, 19 Oct 2000 14:49:11 GMT
I don't see any difference between your code and one that works for me, but
here it is, maybe it will help:

<?xml version="1.0"?>

<?cocoon-format type="text/xml"?>
<?cocoon-process type="xsp"?>
<?xml-logicsheet
href="resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl"?>

<xsp:page
  language="java"
  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
  xmlns:esql="http://apache.org/cocoon/SQL/v2"
>
  <page>Testing
   	<esql:execute-query>
		<esql:driver>sun.jdbc.odbc.JdbcOdbcDriver</esql:driver>
		<esql:dburl>jdbc:odbc:ProjectPlan2</esql:dburl>
		<!--
		<esql:username>test</esql:username>
		<esql:password>test</esql:password>
		-->
		<esql:max-rows>20</esql:max-rows>
		<esql:query>select * from simple</esql:query>
		<esql:results>
		 <name><esql:get-string column="Name"/></name>
		</esql:results>
	</esql:execute-query>
  </page>
</xsp:page>

Note: I don't know enough spanish to understand the details in the error
message, sorry. Also, your data source is a File DSN in ODBC that points to
your Access Database, no?

Per.

> Hi,
> This is a question to users who used to run a database connection with
> MSAccess:
> If I try an direct access with a java class, it runs perfectly, but when
> I translate that in my esql tags I've always the same error:
> [Microsoft][Administrador de controladores ODBC] No se encuentra el
> nombre del origen de datos y no se especific&oacute; ning&uacute;n
> controlador predeterminado
>                                 </message><stacktrace>
>                                         java.sql.SQLException:
> [Microsoft][Administrador de controladores ODBC] No se encuentra el
> nombre del origen de datos y no se especific&oacute; ning&uacute;n
> controlador predeterminado
>         at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6031)
>
>         at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6188)
>         at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:2458)
>         at
> sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:320)
>
>         at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:163)
>
>         at java.sql.DriverManager.getConnection(DriverManager.java:517)
>
> It seems that it cannot "see" my database (but it runs with my java
> class).
> My xml file is:
> <?xml version="1.0" encoding="UTF-8"?>
> <?cocoon-process type="xsp"?>
> <?xml-logicsheet
> href="resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl"?>
>
> <xsp:page language="java" create-session="true"
> xmlns:xsp="http://www.apache.org/1999/XSP/Core"
> xmlns:esql="http://apache.org/cocoon/SQL/v2">
>
>   <page title="SQL Search Results">
>
>  <esql:execute-query>
>    <esql:driver>sun.jdbc.odbc.JdbcOdbcDriver</esql:driver>
>    <esql:dburl>jdbc:odbc:columbia_xml</esql:dburl> ???????? <Here it's
> the pb, I know..> ????????
>    <esql:username>user</esql:username>
>    <esql:password>pass</esql:password>
>    <esql:query>SELECT * FROM movie WHERE id_movie='1'</esql:query>
>    <esql:results>
>     <movie>
>      <title><esql:get-string column="title_es"/></title>
>     </movie>
>    </esql:results>
> ...........
>   </esql:execute-query>
>  </page>
> </xsp:page>
>
> Thank you for your help
> Fred


Mime
View raw message