basic package Create
This commit is contained in:
35
db.gradle
Normal file
35
db.gradle
Normal file
@@ -0,0 +1,35 @@
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
configurations {
|
||||
db
|
||||
}
|
||||
dependencies {
|
||||
db 'org.mariadb.jdbc:mariadb-java-client:3.3.2'
|
||||
}
|
||||
task getColumns {
|
||||
doLast {
|
||||
def cl = new URLClassLoader(configurations.db.collect { it.toURI().toURL() } as URL[], this.class.classLoader)
|
||||
def driver = cl.loadClass('org.mariadb.jdbc.Driver').newInstance()
|
||||
def props = new Properties()
|
||||
props.put("user", "madeu")
|
||||
props.put("password", "apdlemdb12#$")
|
||||
def conn = driver.connect("jdbc:mariadb://183.98.184.84:3306/madeu", props)
|
||||
|
||||
println "--- medical_divi_list ---"
|
||||
def rs = conn.createStatement().executeQuery("SHOW COLUMNS FROM medical_divi_list")
|
||||
while (rs.next()) {
|
||||
println rs.getString(1) + " : " + rs.getString(2)
|
||||
}
|
||||
rs.close()
|
||||
|
||||
println "--- crm_cust_list ---"
|
||||
rs = conn.createStatement().executeQuery("SHOW COLUMNS FROM crm_cust_list")
|
||||
while (rs.next()) {
|
||||
println rs.getString(1) + " : " + rs.getString(2)
|
||||
}
|
||||
rs.close()
|
||||
|
||||
conn.close()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user