The Artima Developer Community
Sponsored Link

Python Buzz Forum
Jython MySQL Sample using JDBC

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ed Taekema

Posts: 310
Nickname: edtaekema
Registered: Mar, 2006

Ed Taekema is Professional Consultant
Jython MySQL Sample using JDBC Posted: Jun 15, 2007 5:23 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Ed Taekema.
Original Post: Jython MySQL Sample using JDBC
Feed Title: Ed Taekema - Road Warrior Collaboration
Feed URL: http://www.fishandcross.com/blog/?feed=rss2
Feed Description: A blog looking at business communication, knowledge management, scripting tools and more.
Latest Python Buzz Posts
Latest Python Buzz Posts by Ed Taekema
Latest Posts From Ed Taekema - Road Warrior Collaboration

Advertisement
Here is a quick sample jython script to query a MySQL database using the mysql jdbc driver. Make sure that the jdbc driver is in your classpath and available to jython.   from java.lang import * from java.sql import * driverName=”com.mysql.jdbc.Driver” Class.forName(driverName) url = “jdbc:mysql://localhost/mydatabase?user=myuser&password=mypassword” con = DriverManager.getConnection(url) stmt = con.createStatement() sql = “select column from table where (column2=’%s’)” % ‘columnvalue‘ rs = stmt.executeQuery(sql) list = [...]

Read: Jython MySQL Sample using JDBC

Topic: Wake on LAN Previous Topic   Next Topic Topic: Moving along with Solaris

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use