def mysql_connect(self):
from java.sql import DriverManager
mysqlLog_server="localhost"
mysqlLog_database="mysql"
mysqlLog_username="root"
mysqlLog_password=""
url = "jdbc:mysql://" \
+ mysqlLog_server + "/" \
+ mysqlLog_database + "?user=" \
+ mysqlLog_username + "&password=" \
+ mysqlLog_password
conn = DriverManager.getConnection(url)
return conn
def mysql_select(conn):
stmt = conn.createStatement()
rs = stmt.executeQuery("SELECT * FROM db")
rs.next();
return rs.getString(4);
conn=mysql_connect("__self__")
rs=mysql_select(conn)
print rs
you can change this code according to your self...
from java.sql import DriverManager
mysqlLog_server="localhost"
mysqlLog_database="mysql"
mysqlLog_username="root"
mysqlLog_password=""
url = "jdbc:mysql://" \
+ mysqlLog_server + "/" \
+ mysqlLog_database + "?user=" \
+ mysqlLog_username + "&password=" \
+ mysqlLog_password
conn = DriverManager.getConnection(url)
return conn
def mysql_select(conn):
stmt = conn.createStatement()
rs = stmt.executeQuery("SELECT * FROM db")
rs.next();
return rs.getString(4);
conn=mysql_connect("__self__")
rs=mysql_select(conn)
print rs
you can change this code according to your self...
Comments
Post a Comment