Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Cannot find tables using JDBC to MySQL database

Posted on 2002-07-24
8
Medium Priority
?
315 Views
Last Modified: 2010-04-01
I have set up:

- a JSP connection to a MySQL database using Tomcat
- on my Windows 2000 machine
- I have also downloaded the "MySQL driver mm.mysql-2.0.4-src.jar" and placed it in tomcat/lib.

I have set up a table called "article" and added several columns. I have also set up test.jsp which connects to the database and reads the columns.

My problem is that when I run "test.jsp" I get the following error...

Internal Servlet Error:

javax.servlet.ServletException: General error: Table 'icore.article' doesn't exist

Root cause:
java.sql.SQLException: General error: Table 'icore.article' doesn't exist

My table does exsist and I have checked it using the same SQL statement as in my JSP code.

Any ideas if this is a code error, or config error or something else?
0
Comment
Question by:jruit718
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 6

Expert Comment

by:kotan
ID: 7176116
can you provide the code (test.jsp) ?
0
 

Author Comment

by:jruit718
ID: 7177539
This is the code I'm using.....

<%@ page import="java.sql.*" %>
<%
String connectionURL="jdbc:mysql://localhost/icore?user=icore&password=thepass";
Connection connection = null;
java.sql.Statement statement = null;
ResultSet rs = null;
%>

<html><body>

<%
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
connection = DriverManager.getConnection(connectionURL, "", "");
statement = connection.createStatement();
rs = statement.executeQuery("SELECT * FROM ARTICLE;");

while (rs.next()) {
out.println(rs.getString("title")+"<br>");
}



rs.close();
%>

</body></html>
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 7178963
are you sure table article exists and your user has permission to view/access it?

Maybe you have to qualify the database.. like test.Article or whatever.

Just ideas.

CJ
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 6

Expert Comment

by:kotan
ID: 7179004
The table and field name in mysql are case sensitive. Please double check.
0
 

Author Comment

by:jruit718
ID: 7180398
Never Mind... I found the problem... Seems that there was 2 databases of similar names "icore" and "icore;" one was empty and one was not. I must have created it by mistake.

Thanks for your help.
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 7180458
ok.

Please as Community Support to delete this question.

CJ
0
 

Accepted Solution

by:
ComTech earned 0 total points
ID: 7181100
This question will be placed in PAQ, and points refunded.

Regards,

ComTech
Community Support Administrator  
Experts-Exchange  
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question