From 8234ba1612f151bf18c61f7f2daac7582f6f61ff Mon Sep 17 00:00:00 2001 From: mrAsacura Date: Mon, 18 Apr 2022 14:41:29 +0300 Subject: [PATCH] curr --- src/main/java/ru/egspt/moodle/Access.java | 29 ++++++++++++++++++-- target/classes/ru/egspt/moodle/Access.class | Bin 738 -> 1489 bytes 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/main/java/ru/egspt/moodle/Access.java b/src/main/java/ru/egspt/moodle/Access.java index df912ce..a06be08 100644 --- a/src/main/java/ru/egspt/moodle/Access.java +++ b/src/main/java/ru/egspt/moodle/Access.java @@ -1,19 +1,44 @@ package ru.egspt.moodle; +import javax.swing.JOptionPane; + public class Access { - private static String userName = "esoe"; - private static String password = "psalm6912"; + private static String userName; + private static String password; private static String url = "jdbc:MySQL://45.128.206.87:3306/moodle"; //если значение userName отсутствует, запросить его у пользователя public static String getUserName(){ + setUserName(); return userName; } public static String getPassword(){ + setPassword(); return password; } public static String getURL(){ + setUrl(); return url; } + /** + * @param userName the userName to set + */ + public static void setUserName() { + Access.userName = JOptionPane.showInputDialog("Укажите имя пользователя базы данных:"); + } + /** + * @param password the password to set + */ + public static void setPassword() { + Access.password = JOptionPane.showInputDialog("Укажите пароль пользователя базы данных:"); + } + /** + * @param url the url to set + */ + public static void setUrl() { + String u = JOptionPane.showInputDialog("Укажите url базы данных:"); + Access.url = "jdbc:MySQL://" + u + ":3306/moodle"; + } + } diff --git a/target/classes/ru/egspt/moodle/Access.class b/target/classes/ru/egspt/moodle/Access.class index ba2ed464ffd2d42b06d5c2fba545f7d6e7c2f584..7daaee8ada01c25718d1a22858b98240288bda4e 100644 GIT binary patch literal 1489 zcmb7ETT|0e5dIFAHVpx>aut+cmiM$&;2N4XfU&~nzAysylxmt zU6m&i3DvUvs9>mFQ{F4GuB21){K}e|uo;A`rJ8ffy2=oYUmP#lrj|~P(RoI(tPR6V zGL&acoebj%T}x~BV={yz%M2A$Mp6|}&Ct1)TuH=UeOy|M$7FeMDB9OQ8tv~Lj*gDR z1_pYEJw^dAT$3QcM{8V5t8>})71eyBtmrNaBcbTaimCCvXY`G`DMgf{PC^hOrL|Wz zi=ioAx?ZAQl~V1u=hfAPBUkGaiONk0Ej(bAb>Yq_-jYzsDe^E2UK6-~NJ9IW|Cycp z-;v zs}iD+slnE&vGF3E$=cJJq8lk96)xyQUIt?&S|gy3VYZm;DKYz$XZpXC1q?7miUN|P z{!yVHLtb%t!R8e?nbq{9Y6=)(sJYh@r1r55Cc1*xi2B}cYJm{o^DKyb&*hb!+fn^!QB_nGl)ESM-x+*`0QGQ#b9~vH- z*>Z?nWAr9+?YJwA1+4--0kRU1cAd2HpD!rwqGp@k%23Pqu3f-&*8G>qV`3vMtog)&eLE?-gjT3+*U| zwiC3Y07}E`K^KV+?`~VLpP;ix7#)C=x+}bm#(UY0HCjd4`FIo#0|>( R??W@D-7BY019_BT<}VQxWpw}m delta 401 zcmcb}{fL$8)W2Q(7#J8#7*r>6HE6S>7U!pOGB7gm^DwY7uyHU5GBR)$6es57npqke zfh2@^7}!A)q7yrG8O0}Vvt*IsVUU{m*;Aa6fjd35Bp|W4xIDiog^_^`$O{efnLM4@ zuAY^FgMpKQ3#gwPXqg3&1_1#fp3Mw=LIRr^goH#kGl*>jiZL-r07*UuW+2G|bOS3; z7aM~lScUQ7{t)E2*9;4GAM%`paKBbQz$$D