BVB Source Codes

The Android source client + server register online booking system Show DaoUtil.java Source code

Return Download The Android source client + server register online booking system: download DaoUtil.java Source code - Download The Android source client + server register online booking system Source code - Type:.java
  1. package com.hospital.util;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5. import java.sql.PreparedStatement;
  6. import java.sql.ResultSet;
  7. import java.sql.SQLException;
  8. import java.sql.Statement;
  9.  
  10. public class DaoUtil {
  11.         // 获取数据库连接
  12.         static String driver = "com.mysql.jdbc.Driver";
  13.         static String dbUrl = "jdbc:mysql://localhost:3306/hospital";
  14.         static String dbUser = "root";
  15.         static String dbPassword = "tiger";
  16.  
  17.         public static Connection getConnection(){
  18.                 Connection conn = null;
  19.                 try {
  20.                         Class.forName(driver);
  21.                         conn = DriverManager.getConnection(dbUrl, dbUser, dbPassword);
  22.                 } catch (Exception e) {
  23.                         e.printStackTrace();
  24.                 }
  25.                 return conn;
  26.         }
  27.         // 获取数据库操作
  28.         public static Statement getStatement(Connection conn){
  29.                 try {
  30.                         return conn.createStatement();
  31.                 } catch (SQLException e) {
  32.                         e.printStackTrace();
  33.                         return null;
  34.                 }
  35.         }
  36. }
  37.  
  38.  
downloadDaoUtil.java Source code - Download The Android source client + server register online booking system Source code
Related Source Codes/Software:
CoordinatorTabLayout cool components - CoordinatorTabLayout is combination of a custom co... 2017-02-26
grace - Graceful restart & zero downtime deploy for Go... 2017-02-26
tpm - Tmux Plugin Manager 2017-02-26
Win32-OpenSSH - Win32 port of OpenSSH 2017-02-26
goconvey - Go testing in the browser. Integrates with `go tes... 2017-02-26
The Android source gorgeous sunny weather weather forecast program source code - This item is a weather forecast program source cod... 2017-02-26
The Android source of guangdong ocean university library Android client program source code - This project is a guangdong ocean university libra... 2017-02-26
The Android source code imitation sing part layout interface project - This project is a modeled after sing the UI projec... 2017-02-27
The Android source CSDN information client try simple project - This item is a CSDN practice version information o... 2017-02-27
Android jingdong financial front page head effect - Principle is very simple, is through listening Scr... 2017-02-27
flakes - Flakes is an Admin Template Framework. A combinati... 2017-04-15
capstone - Capstone disassembly/disassembler framework: Core ... 2017-04-15
nginx-resources - A collection of resources covering Nginx, Nginx + ... 2017-04-15
utron - A lightweight MVC framework for Go(Golang) 2017-04-15
cfssl - CFSSL: Cloudflare's PKI and TLS toolkit ... 2017-04-15
HandBrake - HandBrake's main development repository ... 2017-04-15
Awesome-Networking - A curated list of awesome networking libraries, re... 2017-04-15
react-sortable-hoc - A set of higher-order components to turn any list ... 2017-04-15
jugglingdb - Multi-database ORM for nodejs: redis, mongodb, mys... 2017-04-15
waybackpack - Download the entire Wayback Machine archive for a ... 2017-04-15

 Back to top