我连mysql的已有存储过程,可是报错:Callable Statements not supported
谢谢高手帮帮我
大家看看代码:
import java.sql.*; public class jdbcTest {
public static void main(String[] args) {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
}
catch (Exception e) {
System.out.println("Can't load JDBC Driver. " +
"Make sure classpath is correct");
}
Connection connection;
ResultSet rs;
CallableStatement cStmt;
Statement stmt;
String url = "jdbc:mysql://localhost:3306/test";
String username = "root";
String password = "woaini";
try {
connection = DriverManager.getConnection(url, username, password);
cStmt = connection.prepareCall("{call showAll()}");
rs = cStmt.executeQuery();
}
catch (SQLException e) {
System.out.println("Connect problem: " + e.getMessage());
}
}
}
谢谢高手帮帮我
大家看看代码:
import java.sql.*; public class jdbcTest {
public static void main(String[] args) {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
}
catch (Exception e) {
System.out.println("Can't load JDBC Driver. " +
"Make sure classpath is correct");
}
Connection connection;
ResultSet rs;
CallableStatement cStmt;
Statement stmt;
String url = "jdbc:mysql://localhost:3306/test";
String username = "root";
String password = "woaini";
try {
connection = DriverManager.getConnection(url, username, password);
cStmt = connection.prepareCall("{call showAll()}");
rs = cStmt.executeQuery();
}
catch (SQLException e) {
System.out.println("Connect problem: " + e.getMessage());
}
}
}
解决方案 »
- 请教:有人知道Audio Scrobbler API吗?怎么使用和编程?
- j2se向access插入中文数据时如何防止乱码
- 一点迷惑
- java 做打印能指定哪台打印机打印哪个文件吗?
- commons.net.ftp包在Linux上使用的问题
- Java 串口发送数据监听
- JAVA递归遍历题
- 关于static的初始化问题,这段代码谁知道结果为什么是这样的?
- 请教怎么用正则表达式提取以下的信息啊
- 很奇怪的问题,我得OS是XP,JDK是1.5,注册RMI服务总是有问题
- 我不知道怎么读数组里数,然后再逆序输出!
- $$$两个小组独立地测试同一个程序,第一组发现25个错误,第二组发现30个错误,错误总数是多少个?
mysql能用存储过程么?
没有吧?