老师我这个失败,怎么弄啊,是哪里出问题了吗?
这个路径为啥找不到应该怎么写?????????????
怎么能让光标放在这有文档注释效果啊?????????????
回车键一直换行咋解决???????????????????
杜老师,下面问题怎么解决?我查了一下资料,说进入mysql bin目录下执行 mysql_upgrade -u root -p --force,然后在输入密码,但是如何在mysql的bin目录下面输入这段话呢?麻烦您帮忙看看
package JDBC; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import java.util.ResourceBundle; public class JdbcUtil { private static String driver; private static String jdbcUrl; private static String user; private static String password; static { //读取Properties文件 ResourceBundle bundle = ResourceBundle.getBundle("src/JDBC/jdbc"); driver = bundle.getString("driver"); jdbcUrl = bundle.getString("jdbcUrl"); user = bundle.getString("user"); password = bundle.getString("password"); try { //链接数据库 Class.forName(driver); } catch (ClassNotFoundException e) { e.printStackTrace(); } } /** * 获取Connection对象 * @return */ public static Connection getConnection(){ Connection connection = null; try { connection = DriverManager.getConnection(jdbcUrl,user,password); } catch (SQLException e) { e.printStackTrace(); } return connection; } /** * 关闭Statement * @param statement */ public static void closeStatement(Statement statement){ if(statement!=null){ try { statement.close(); } catch (SQLException e) { e.printStackTrace(); } } } /** * 关闭Connection * @param connection */ public static void closeConnection(Connection connection){ if(connection!=null){ try { connection.close(); } catch (SQLException e) { e.printStackTrace(); } } } /** * 关闭所有资源 * @param statement * @param connection */ public static void closeAll(Statement statement,Connection connection){ if(statement!=null){ try { statement.close(); } catch (SQLException e) { e.printStackTrace(); } } if(connection!=null){ try { connection.close(); } catch (SQLException e) { e.printStackTrace(); } } } }
package JDBC; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import static JDBC.JdbcUtil.closeAll; import static JDBC.JdbcUtil.getConnection; public class jdbcTest02 { public static void main(String[] args) { jdbcTest02 jdbcT = new jdbcTest02(); jdbcT.insertDepartments("教学部",19,19); } public void insertDepartments(String department_name,int department_id,int location_id){ Connection connection = null; Statement statement = null; try { connection = JdbcUtil.getConnection(); statement = connection.createStatement(); String sql = "insert into departments value("+department_id+",'"+department_name+"',"+location_id+")"; System.out.println(sql); statement.executeUpdate(sql); } catch (Exception e) { e.printStackTrace(); }finally { closeAll(statement, connection); } } }
老师能帮忙看一下哪里的问题嘛
老师,IDEA可以操作JDBC吗?有些步骤IDEA找不到
1:老师我这个是什么问题呀,检查代码看着没错呀。
老师,我想问一下,oracle数据库安装完成之后,安装文件所在的文件夹是不是不能删除?我把安装文件夹删除了,sqlplus就无法打开了。还有我想问一下oracle19c怎么卸载?
老师单行函数遇到空值返回什么?不用通用函数
老师外连接必须是用on作为连接条件,不能使用where,那为什么SQL99的内连接,可以使用where
这个错误是个什么意思,需不需要哪里设置一下?
plsql developer怎么哪里修改和查看sys和system的密码
老师,打开编辑表时提示这个信息是什么意思?
老师,我写根据题目。写SQL语句,简单的还好,遇到有点桡的,和稍微复杂的,就很容理解错误,我之前学Oracle的时候,也就这样,当时老师每天给大量的题目练习,但是现在复习时,还是老样子,怎么解决
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637