473,412 Members | 2,054 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Database Connection

I have a problem database connection. I try to connect to MS Acces via ODBC.
I made data source in ODBc but I didn't run it. JDBC-ODBC driver must be in my pc because I loaded JDk 1.4.2. I don't know what I will do.
Nov 30 '06 #1
9 6666
r035198x
13,262 8TB
I have a problem database connection. I try to connect to MS Acces via ODBC.
I made data source in ODBc but I didn't run it. JDBC-ODBC driver must be in my pc because I loaded JDk 1.4.2. I don't know what I will do.
Describe your problem. Are you getting an error message?
Nov 30 '06 #2
This is my code:
<%
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newI nstance();
java.sql.Connection baglanti = java.sql.DriverManager.getConnection("jdbc:odbc:pe rsonel","asd","asd");
java.sql.Statement sorgulama = baglanti.createStatement();
java.sql.ResultSet sonucVeriler = sorgulama.executeQuery("SELECT * FROM Elemanlar");

}


catch(ClassNotFoundException cnfe)
{
System.err.println("Database Driver'a ulaşılamıyor");
System.err.println("Detay: "+cnfe);
System.exit(0);
}
%>

This is error:type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: General error
org.apache.jasper.runtime.PageContextImpl.doHandle PageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePa geException(PageContextImpl.java:758)
org.apache.jsp.renkli_005fgoster_jsp._jspService(r enkli_005fgoster_jsp.java:132)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)


root cause

java.sql.SQLException: General error
sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc .java:6987)
sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java :7115)
sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.j ava:3074)
sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOd bcConnection.java:323)
sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDrive r.java:174)
java.sql.DriverManager.getConnection(DriverManager .java:512)
java.sql.DriverManager.getConnection(DriverManager .java:171)
org.apache.jsp.renkli_005fgoster_jsp._jspService(r enkli_005fgoster_jsp.java:101)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
Nov 30 '06 #3
r035198x
13,262 8TB
This is my code:
<%
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newI nstance();
java.sql.Connection baglanti = java.sql.DriverManager.getConnection("jdbc:odbc:pe rsonel","asd","asd");
java.sql.Statement sorgulama = baglanti.createStatement();
java.sql.ResultSet sonucVeriler = sorgulama.executeQuery("SELECT * FROM Elemanlar");

}


catch(ClassNotFoundException cnfe)
{
System.err.println("Database Driver'a ulaşılamıyor");
System.err.println("Detay: "+cnfe);
System.exit(0);
}
%>

This is error:type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: General error
org.apache.jasper.runtime.PageContextImpl.doHandle PageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePa geException(PageContextImpl.java:758)
org.apache.jsp.renkli_005fgoster_jsp._jspService(r enkli_005fgoster_jsp.java:132)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)


root cause

java.sql.SQLException: General error
sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc .java:6987)
sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java :7115)
sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.j ava:3074)
sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOd bcConnection.java:323)
sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDrive r.java:174)
java.sql.DriverManager.getConnection(DriverManager .java:512)
java.sql.DriverManager.getConnection(DriverManager .java:171)
org.apache.jsp.renkli_005fgoster_jsp._jspService(r enkli_005fgoster_jsp.java:101)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
Did you try

using

Expand|Select|Wrap|Line Numbers
  1. String url = "jdbc:odbc:myDb";
  2. Connection con = DriverManager.getConnection(url);
Nov 30 '06 #4
Hi,
I tried your respond but I don't solve my problem.
Nov 30 '06 #5
r035198x
13,262 8TB
Hi,
I tried your respond but I don't solve my problem.
Did you get the same error as before?
Nov 30 '06 #6
Did you get the same error as before?
Error is same.
Dec 1 '06 #7
The "java.sql.SQLException: General error" means that there is an error accesing the database, not in you java code. You must look for any log in the database or maybe in the ODBC source. Check that the ODBC source link correctly with the database file, or that the database is not corrupted. In SQLServer you can find the source of the error in logs file, but i am not sure MS Access has them. Good luck.

Andrew.
Dec 29 '06 #8
Shanaj
51
This is my code:
<%
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newI nstance();
java.sql.Connection baglanti = java.sql.DriverManager.getConnection("jdbc:odbc:pe rsonel","asd","asd");
java.sql.Statement sorgulama = baglanti.createStatement();
java.sql.ResultSet sonucVeriler = sorgulama.executeQuery("SELECT * FROM Elemanlar");

}


catch(ClassNotFoundException cnfe)
{
System.err.println("Database Driver'a ulaşılamıyor");
System.err.println("Detay: "+cnfe);
System.exit(0);
}
%>

This is error:type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: General error
org.apache.jasper.runtime.PageContextImpl.doHandle PageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePa geException(PageContextImpl.java:758)
org.apache.jsp.renkli_005fgoster_jsp._jspService(r enkli_005fgoster_jsp.java:132)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)


root cause

java.sql.SQLException: General error
sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc .java:6987)
sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java :7115)
sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.j ava:3074)
sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOd bcConnection.java:323)
sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDrive r.java:174)
java.sql.DriverManager.getConnection(DriverManager .java:512)
java.sql.DriverManager.getConnection(DriverManager .java:171)
org.apache.jsp.renkli_005fgoster_jsp._jspService(r enkli_005fgoster_jsp.java:101)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)





hello


try this

create dsn by selecting "system dsn" tab
Jan 2 '07 #9
hello


try this

create dsn by selecting "system dsn" tab

hey wat u wanna do is ..
i think u using msacces right if s
go to the control pannel select administrative tools- datasources (odbc) - select system dsn by using tab key.
then press add
select ms access driver press finish
give the data source name that u specified in ur program
and pres select to select the database .and select ur database and click ok and stop the server and restart the run
then it will work very fine.
bye
reply me if its notworking
prakash.nmsp@gmail.com
bye
Jan 3 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Mudge | last post by:
Hi, My hosting provider only allows me to use 50 connections to my MySQL database that my Web site will use. I don't know what this 50 connections means exactly. Does this mean that only 50...
11
by: pradeep_TP | last post by:
Hi all, I have a few questions that I have been wanting to ask for long. These are all related to ADO.net and specifically to conenction to database. 1) If I have opened a connection to a...
3
by: R Reyes | last post by:
Hi, I'm trying to modularize my database connections a little better and get more out of my project with less code. First check out this common dbOpen() function inside class clsDatabase. I...
14
by: Nick Gilbert | last post by:
Hi, I have an asp.net application which runs from a CD-ROM using Cassini. As such, it is single user only. The application connects to an Access database when it is loaded, and keeps the same...
7
by: Lau Lei Cheong | last post by:
Hello, Actually I think I should have had asked it long before, but somehow I haven't. Here's the scenerio: Say we have a few pages in an ASP.NET project, each of them needs to connect to...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
35
by: Terry Jolly | last post by:
Web Solution Goal: Have a global database connection Why: (There will be 30+ tables, represented by 30+ classes) I only want to reference the database connection once. I put the connection...
6
by: Arsalan Ahmad | last post by:
Hi all, I am creating a website in which in an Item detail page there are a number of web controls (7 or 8) and what is happening that inside each of control's Page_Load() function I am creating...
22
Frinavale
by: Frinavale | last post by:
How To Use A Database In Your Program Many .NET solutions are database driven and so many of us often wonder how to access the database. To help you understand the answer to this question I've...
1
Curtis Rutland
by: Curtis Rutland | last post by:
How To Use A Database In Your Program Part II This article is intended to extend Frinny’s excellent article: How to Use a Database in Your Program. Frinny’s article defines the basic concepts...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.