Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- driver = com.mysql.jdbc.Driver
- url = jdbc:mysql://localhost:3306/TestingSystem
- user = root
- password = admin
- charset = utf8
- private void connect(){
- String urlDB = properties.getProperty("url");
- connectionInfo.put("user", properties.getProperty("user"));
- connectionInfo.put("password", properties.getProperty("password"));
- connectionInfo.put("charSet", properties.getProperty("charset"));
- try {
- Class.forName(properties.getProperty("driver"));
- } catch (ClassNotFoundException e) {
- log.error("Not found driver for data base");
- }
- try {
- connection = DriverManager.getConnection(urlDB, connectionInfo);
- if(connection == null) {
- log.error("Connection with data base isn't open.");
- } else {
- log.info("Connection with data base is open.");
- }
- } catch (SQLException e) {
- log.error("Error connection with data base");
- }
- }
- UPDATE basic_data SET data = 'Пример'
- WHERE name = 'Пример'
- INSERT INTO test_data_questions(input_data, output_data, id_question)
- VALUES('Пример', 'Пример', (SELECT q.id FROM questions q WHERE q.title = 'Пример'))
Add Comment
Please, Sign In to add comment