Name:MyDS, Time:1, Success:True, Type:Statement, Batch:False, QuerySize:1, BatchSize:0, Query:["CREATE TABLE users (id INT, name VARCHAR(20))"], Params:[]
Name:MyDS, Time:0, Success:True, Type:Prepared, Batch:True, QuerySize:1, BatchSize:2, Query:["INSERT INTO users (id, name) VALUES (?, ?)"], Params:[(1=1,2=foo),(1=2,2=bar)]
Name:MyDS, Time:1, Success:True, Type:Prepared, Batch:True, QuerySize:1, BatchSize:2, Query:["INSERT INTO users (id, name) VALUES (?, ?)"], Params:[(1=3,2=FOO),(1=4,2=BAR)]
Name:MyDS, Time:3, Success:True, Type:Statement, Batch:False, QuerySize:1, BatchSize:0, Query:["SELECT COUNT(*) FROM users"], Params:[]
DataSource db = ProxyDataSourceBuilder
.create(actualDataSource)
.logQueryByCommons(INFO) // or logQueryBySlf4j(INFO)
.build();
Random random = new Random();
int result = random.nextInt(1000); // Генерация случайного числа от 0 до 1000
System.out.println(result);
result = 9 + random.nextInt(9) // Генерация случайного 9 значного числа, где каждая цифра можешь иметь значение от 0 до 9
System.out.println(result);
JLabel tooltipLabel = new JLabel("Username");
tooltipLabel.setToolTipText("Enter your username");
JTextField tooltipTextfield = new JTextField(10);
tooltipTextfield.setToolTipText("Enter your username over here, that other thing is a label.");
PasswordField pf = new PasswordField();
Tooltip tooltip = new Tooltip();
tooltip.setText(
"Your text");
pf.setTooltip(tooltip);
public class SimpleServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
RequestDispatcher view = req.getRequestDispatcher("/path/to/file.html");
view.forward(req, resp);
}
}
On.get("/main").html((Req req) -> {
Resp resp = req.response();
resp.contentType(MediaType.HTML_UTF_8);
resp.result('Main.html');
return resp;
});
@RequestMapping(value = "/main", method = RequestMethod.GET)
public ModelAndView getMain()
ModelAndView modelAndview = new ModelAndView("success.jsp");
return modelAndView;
}
getList(): Promise<Data[]> {
return this.http.get(Ваш url + '/getData')
.toPromise()
.then(response =>
response.json().data as Data[]);
}
@RequestMapping(name = "/getData")
public List<Data> getListData(){
List<Data> list = new ArrayList<>();
list.add( new Data());
list.add( new Data());
list.add( new Data());
list.add( new Data());
return list;
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ru.test</groupId>
<artifactId>test.a</artifactId>
<packaging>war</packaging>
<version>1</version>
<name>name-project</name>
</project>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<dependency>
<groupId>com.github.User</groupId>
<artifactId>Repo name</artifactId>
<version>Release tag</version>
</dependency>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ru.test</groupId>
<artifactId>test.a</artifactId>
<packaging>war</packaging>
<version>1</version>
<name>name-project</name>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.User</groupId>
<artifactId>Repo name</artifactId>
<version>Release tag</version>
</dependency>
</dependencies>
</project>
try {
// Execute command
String command = "cmd /c start cmd.exe";
Process child = Runtime.getRuntime().exec(command);
// Get output stream to write from it
OutputStream out = child.getOutputStream();
out.write("cd C:/ /r/n".getBytes());
out.flush();
out.write("dir /r/n".getBytes());
out.close();
} catch (IOException e) {
}
private void changeMyIPAdress(String IP)
{
this.IP = rand.nextInt(200)+"."+rand.nextInt(200)+"."+rand.nextInt(200)+rand.nextInt(200);
Client.setIP(IP); // Client.set(this.IP);
}
java ClassName > a.txt
System.setOut(new PrintStream(new FileOutputStream(fileName)));
public class Solution
{
public static void main(String[] args)
{
String localString = "I live in Russia";
System.out.println(data(localString));
}
public static int data(String s)
{
return s.length();
}
}
<groupId>Example</groupId>
<artifactId>Example</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<mainClass>тут пишем путь до вашего главного класса </mainClass>
</configuration>
</plugin>
</plugins>
</build>