1,首先从mysql的官网上下载mysql-connector-java-5.1.44.zip

2,选择downloads下的community

3,在Community下选择MySql Connectors

4,下面是MySQL Connectors的版本,我们选择Connector/J

5,选择zip的文件包,进行下载。

6,将下载好的文件包进行解压,找到其中mysql-connector-java-5.1.44-bin

7,创建一个项目,项目进行右击,选择Add External Archives

8,配置成功后的结果,如下图所示

9,输入如下所示程序代码,以进行测试,实验表明:连接成功。

java project如何连接数据库的更多相关文章

  1. 我的第7个java程序--把java web项目改为java project项目--mybatis

    连接数据库需要 程序,连接字符串,查询语句 主程序->读取连接字符串->读取查询语句->把查询到的值赋值给映射对象->打印对象属性 java project的好处,不用做那么多 ...

  2. java compiler level does not match the version of the installed java project facet 解决方案

    项目出现 java compiler level does not match the version of the installed java project facet 错误,一般是项目移植出现 ...

  3. java compiler level does not match the version of the installed java project facet

    Java compiler level does not match the version of the installed java project facet错误的解决 因工作的关系,Eclip ...

  4. export a java project to runable jar

    When a java project needs to be transfered to another machine, e.g. vps, we need to export it to a r ...

  5. Using Maven to generate a Java Project or Web project

    I often to generate a Java project or Web project with Eclipse tool. Well, I have no idea when I wan ...

  6. Java compiler level does not match the version of the installed Java project facet.(转)

    Java compiler level does not match解决方法 从别的地方导入一个项目的时候,经常会遇到eclipse/Myeclipse报Description  Resource P ...

  7. maven项目 Java compiler level does not match the version of the installed Java project facet

    因工作的关系,Eclipse开发的Java项目拷来拷去,有时候会报一个很奇怪的错误.明明源码一模一样,为什么项目复制到另一台机器上,就会报“java compiler level does not m ...

  8. Java compiler level does not match the version of the installed Java project facet.问题

    从同事那里拷贝过来的web项目,导入到eclipse中,出现Java compiler level does not match the version of the installed Java p ...

  9. Java compiler level does not match the version of the installed Java project facet. springmvc1 和 Target runtime Apache Tomcat v7.0 is not defined.

    Java compiler level does not match the version of the installed Java project facet.springmvc1 : Targ ...

随机推荐

  1. java核心技术-IO

    一 .IO 1.1 流的简单介绍和分类 Java流操作的相关的类和接口: Java流类图结构: 四个抽象基类分别为:InputStream .OutputStream .Reader .Writer: ...

  2. .NET Core是什么

    对于开发人员,把C#语言和.NET描述为最重要的新技术一点都不夸张.NET提供了一种环境.在这种环境中,可以开发在Windows上运行的几乎所有应用程序.如:编写Web页面.WPF应用程序.REST ...

  3. javascript判断浏览器支持CSS3属性

    function getsupportedprop(proparray){ var root=document.documentElement; //reference root element of ...

  4. 手写堆优化dijkstra

    \(dijkstra\) 算法的堆优化,时间复杂度为\(O(n+m)\log n\) 添加数组\(id[]\)记录某节点在堆中的位置,可以避免重复入堆从而减小常数 而这一方法需要依托手写堆 #incl ...

  5. luogu P3065 first——trie树相关

    题目描述 Bessie has been playing with strings again. She found that by changing the order of the alphabe ...

  6. BZOJ P1212 [HNOI2004] L语言

    标点符号的出现晚于文字的出现,所以以前的语言都是没有标点的.现在你要处理的就是一段没有标点的文章. 一段文章T是由若干小写字母构成.一个单词W也是由若干小写字母构成.一个字典D是若干个单词的集合. 我 ...

  7. git忽略相应文件夹,不上传

    1.在项目根目录里  右键选择Git Bash 进入命令行 2. touch .gitignore ,生成“.gitignore”文件. 3.  .gitignore文件里输入以下内容.DS_Stor ...

  8. Conda常用命令整理

    主要参考Anaconda官方指南Using Conda:https://conda.io/docs/using/index.html 环境:Win10 64bit with conda 4.3.14  ...

  9. ElasticSearch初体验之使用

    好久没写博文了, 最近项目中使用到了ElaticSearch相关的一些内容, 刚好自己也来做个总结.现在自己也只能算得上入门, 总结下自己在工作中使用Java操作ES的一些小经验吧. 本文总共分为三个 ...

  10. IDEA创建maven项目时,maven太慢-archetypeCatalog=internal

    创建项目时候加上archetypeCatalog=internal 参数, archetypeCatalog表示插件使用的archetype元数 据,不加这个参数时默认为remote,local,即中 ...