博客
关于我
MySQL8.0.19 JDBC下载与使用
阅读量:374 次
发布时间:2019-03-05

本文共 841 字,大约阅读时间需要 2 分钟。

MySQL JDBC下载链接

选择版本

在这里插入图片描述

在这里插入图片描述

在IDEA中使用

package com.company;import java.sql.*;public class Main {       public static void main(String [] args)    {           String driverName="com.mysql.cj.jdbc.Driver";        String dbURL="jdbc:mysql://localhost:3306/jxgl?serverTimezone=UTC&useSSL=true";        String userName="root";        String userPwd="123456";        try        {               Class.forName(driverName);            System.out.println("加载驱动成功!");        }catch(Exception e){               e.printStackTrace();            System.out.println("加载驱动失败!");        }        try{               Connection dbConn=DriverManager.getConnection(dbURL,userName,userPwd);            System.out.println("连接数据库成功!");        }catch(Exception e)        {               e.printStackTrace();            System.out.print("SQL Server连接失败!");        }    }}

在Eclipse中使用

转载地址:http://ohtg.baihongyu.com/

你可能感兴趣的文章
MySQL
查看>>
MySQL
查看>>
mysql
查看>>
MTK Android 如何获取系统权限
查看>>
MySQL - 4种基本索引、聚簇索引和非聚索引、索引失效情况、SQL 优化
查看>>
MySQL - ERROR 1406
查看>>
mysql - 视图
查看>>
MySQL - 解读MySQL事务与锁机制
查看>>
mysql 1264_关于mysql 出现 1264 Out of range value for column 错误的解决办法
查看>>
mysql 1593_Linux高可用(HA)之MySQL主从复制中出现1593错误码的低级错误
查看>>
mysql ansi nulls_SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON 什么意思
查看>>
MySQL Binlog 日志监听与 Spring 集成实战
查看>>
multi-angle cosine and sines
查看>>
Mysql Can't connect to MySQL server
查看>>
mysql case when 乱码_Mysql CASE WHEN 用法
查看>>
Multicast1
查看>>
MySQL Cluster 7.0.36 发布
查看>>
Multimodal Unsupervised Image-to-Image Translation多通道无监督图像翻译
查看>>
multipart/form-data与application/octet-stream的区别、application/x-www-form-urlencoded
查看>>
mysql cmake 报错,MySQL云服务器应用及cmake报错解决办法
查看>>