03.11.2010 23:45, John Goodleaf kirjoitti:
Setting CLASSPATH should work (I do the same thing), but you should also be able to specify it as an arg to jython when it's called. So jython -J-classpath C:/jythonjunk/mysql-connector-java.jar:some/other/path <script> should work as well.
Just remember, the classpath separator is ; on Windows, not : (due to C: etc.)
J

2010/11/3 Alex Grönholm <alex.gronholm@nextday.fi>
03.11.2010 23:32, Michael March kirjoitti:
No dice.

C:\jythonjunk>jython dbtest.py
['C:\\jythonjunk', 'C:\\jython2.5.2rc2\\Lib', '__classpath__', '__pyclasspath__/
', 'C:\\jython2.5.2rc2\\Lib\\site-packages', 'C:\\jythonjunk\\mysql-connector-ja
va-5.0.8-bin.jar']
Traceback (most recent call last):
  File "dbtest.py", line 6, in <module>
    connection2 = zxJDBC.connect('jdbc:mysql://127.0.0.1/auditrepository?stringt
ype=unspecified', 'root', 'FOO', 'com.mysql.jdbc.Driver')
zxJDBC.DatabaseError: driver [com.mysql.jdbc.Driver] not found

Did you try setting a CLASSPATH like I suggested before?

On Wed, Nov 3, 2010 at 2:11 PM, Sharon Lucas <lucass@us.ibm.com> wrote:
You didn't specify the fully-qualified path to your mysql jar file.   If
your mysql jar file is in a directory called C:\MySql for example, trying
specifying:

sys.path.append("C:\\MySql\\mysql-connector-java-5.0.8-bin.jar")

instead of:

sys.path.append("mysql-connector-java-5.0.8-bin.jar")

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   lucass@us.ibm.com
(512) 286-7313 or Tieline 363-7313




From:   Michael March <mmarch@gmail.com>
To:     jython users <jython-users@lists.sourceforge.net>
Date:   11/03/2010 03:58 PM
Subject:        [Jython-users] I can not connect to MySQL from Jython to save
           my  life..



Using Jython 2.5.0 or 2.5.2RC2 and JDK 1.6.0_16 (WINDOWS 2008)

import sys
sys.path.append("mysql-connector-java-5.0.8-bin.jar")
print sys.path
from com.ziclix.python.sql import zxJDBC

connection2 = zxJDBC.connect('jdbc:mysql://
127.0.0.1/auditrepository?stringtype=unspecified', 'root', 'FOO',
'com.mysql.jdbc.Driver')

Yields this output:

C:\jythonjunk>jython dbtest.py
['C:\\jythonjunk', 'C:\\jython2.5.2rc2\\Lib', '__classpath__',
'__pyclasspath__/
', 'C:\\jython2.5.2rc2\\Lib\\site-packages',
'mysql-connector-java-5.0.8-bin.jar
']
Traceback (most recent call last):
 File "dbtest.py", line 6, in <module>
   connection2 = zxJDBC.connect('jdbc:mysql://
127.0.0.1/auditrepository?stringt
ype=unspecified', 'root', 'FOO', 'com.mysql.jdbc.Driver')
zxJDBC.DatabaseError: driver [com.mysql.jdbc.Driver] not found

I've read use the '--verify' option but that doesn't seem to work.

thanks!
------------------------------------------------------------------------------

Achieve Improved Network Security with IP and DNS Reputation.
Defend against bad network traffic, including botnets, malware,
phishing sites, and compromised hosts - saving your company time,
money, and embarrassment.   Learn More!
http://p.sf.net/sfu/hpdev2dev-nov
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users





--
<admiral>

Michael F. March ----- mmarch@gmail.com
Ph: (415) 894-9269 ---- Fax: (602)296-0400
P.O. Box 2254 ---- Phoenix, AZ 85002-2254
          "Seriously" - HSR

------------------------------------------------------------------------------ The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now! http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________ Jython-users mailing list Jython-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jython-users


------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users


------------------------------------------------------------------------------ The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now! http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________ Jython-users mailing list Jython-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jython-users