---
title: "web工程连接数据库报错"
author: "sgp420"
date: "2016-01-19T10:35:26Z"
tags: []
categories: ["数据库"]
slug: "web"
draft: false
lastmod: "2016-01-19T10:35:26Z"
id: 2271944
url: "https://sgp420.iteye.com/blog/2271944"
---

数据库使用的是oracle 9i，服务器tomcat 7.0;

1、当程序执行到 Class.forName(driver); 报ava.lang.ClassNotFoundException，程序中已添加对应的包；

2、在程序中单独运行连数据库成功；

2、解决方式：将classes12.jar 丢到D:\\tomcat7\\lib，最终成功了；