我正在尝试从我的 Java 应用程序调用 mySQL 存储过程。当我从 mySQL 工作台调用存储过程时,它可以工作,并且根据我发送的参数获得正确的行数。当我尝试从 Java 调用它时,问题就出现了,我没有得到任何结果,我也找不到原因。我一直在关注oracle文档。
存储过程:
CREATE DEFINER=`root`@`localhost` PROCEDURE `comprobarUsuario`(
IN usu varchar(20),
IN pass varchar(20),
OUT idusuarios int)
BEGIN
SELECT idusuarios
FROM usuarios
WHERE usuarios.nombreUsuario = usu and usuarios.contraseña = pass;
END
Run Code Online (Sandbox Code Playgroud)
我试图调用存储过程的 Java 类:
public class ConectorSQL {
public static final String URL = "jdbc:mysql://localhost:3306/ProyectoBD?autoReconnect=true&useSSL=false";
public static final String USERNAME = "root";
public static final String PASSWORD = "1627Admin";
public static Connection getConnection() {
Connection con = null;
try {
Class.forName("com.mysql.jdbc.Driver");
con = (Connection) …Run Code Online (Sandbox Code Playgroud) 我一直在进行一个项目,该项目需要使用JavaFX的Pane圈显示节点。
这是一所大学的工作,因此我不能将外部库用作JFxtras。
做一些研究后,我在stackoverflow中发现了该类。
public class CircularPane extends Pane {
private long degreese = 0;
private long increment;
@Override
protected void layoutChildren() {
final int radius = 250;
final double increment = 360 / getChildren().size();
double degreese = 0;
for (Node node : getChildren()) {
double x = radius * Math.cos(Math.toRadians(degreese)) + getWidth() / 2;
double y = radius * Math.sin(Math.toRadians(degreese)) + getHeight() / 2;
layoutInArea(node, x - node.getBoundsInLocal().getWidth() / 2, y - node.getBoundsInLocal().getHeight() / 2, getWidth(), getHeight(), 0.0, HPos.LEFT, VPos.TOP); …Run Code Online (Sandbox Code Playgroud)