Tag Archive | "accessing"

How to Resolve ‘Error 823′ While Accessing SQL Server Database?


How to Resolve ‘Error 823′ While Accessing SQL Server Database?

Are you getting ‘Error 823′ while accessing an SQL Server database or modifying the database? Are you getting various database inconsistency errors while querying SQL Server database? Well, the problem may take place if your SQL Server database is either inconsistent or damaged. In such critical situations, you must have a complete backup to restore data from it. However, the situations may become worse if there is no current backup in place. At this point of time, you have to opt for SQL recovery tools to get your valuable data recovered.

You may come across the below errors in Windows Application Event Log or MS SQL Server ERRORLOG while performing any operation on MDF (Master Database File) of SQL Server:

“2010-03-06 22:41:19.55 spid58 Error: 823, Severity: 24, State: 2.
2010-03-06 22:41:19.55 spid58 The operating system returned error 38(Reached the end of the file.) to SQL Server during a read at offset 0x000000a72c0000 in file ‘C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\my_db.mdf’. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.”

2009-12-09 04:53:49.170 spid25s Error: 823, Severity: 24, State: 2.
2009-12-09 04:53:49.170 spid25s The operating system returned error 21(The device is not ready.) to SQL Server during a read at offset 0×00000000132000 in file ‘D:\tempdb\tempdb_data.mdf’. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.

Cause:

The Error 823 may occur due to either SQL Server database corruption or I/O errors in the database. The error usually indicates that that there are some inconsistency in file system or the database file is corrupt.

Resolution:

To recover SQL server database, use any of the below methods:

Run Chkdsk to find file system inconsistency issues and resolve it.

Use DBCC CHECKDB utility to try repairing the damaged database.

If the above methods can not perform MS SQL recovery, You need to use third party applications to repair and restore the damaged database. The MDF Repair software performs safe, quick, easy, and absolute recovery in all MDF corruption situations.

Stellar Phoenix SQL Recovery is the most advanced and efficient utility to ensure absolute recovery of damaged database. The software is designed for Microsoft SQL Server 2008, 2005, and 2000. It restores all the objects of MDF file, such as tables, reports, forms, macros, triggers, constraints, and stored procedures.

Posted in DevelopmentComments (1)

The system cannot self repair this error – while accessing SQL database


The system cannot self repair this error – while accessing SQL database

Database Console Commands (DBCC) check the logical and physical consistency of the SQL database and can also resolve few detected error messages. But there are many issues that can not be resolved by using DBCC commands. In such

Posted in DevelopmentComments (1)

Accessing Ms Access Using Java


Accessing Ms Access Using Java

Step by step guide:

1.Create a database in ms access and add a table

2.Add columns to the table.

3.Go to control panel->Administrative Tools

->JDBC-> System DSN

4.In System DSN tab click on add ,choose

Microsoft access driver ,then you will get a

dialog box opened ODBC Microsoft access setup

mention the data source name in it and in

databases click on select button and choose

your .mdb file that is created in step1.

5.Register the driver using

Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”);

6.Connect to the database

Connection con = DriverManager.getConnection

(URL,userid,password);

url=” Jdbc:Odbc:”

userid and password are empty in case of MS access.if it oracle default userid is “scott” password is “tiger”.

Ex: Connection con = DriverManager.getConnection

( “Jdbc:Odbc:msac”, “”,”");

Source Code

import java.sql.*;

import java.io.*;

class JdbcDemo1

{

Connection con;

Statement stmt;

ResultSet rs;

JdbcDemo1(){

try{

Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”);

con = DriverManager.getConnection( “Jdbc:Odbc:msac”, “”,”");

stmt = con.createStatement();

rs = stmt.executeQuery(“SELECT * FROM Table1″);

while (rs.next()) {

String x = rs.getString(“name”);

int s = rs.getInt(“age”);

System.out.println(“x:”+x+”s”+s);

}

}catch(SQLException e){

System.out.println(“Hello World!”+e);

}catch(ClassNotFoundException e){

System.out.println(“purni”+e);

}

}

}

class JdbcDemo

{

public static void main(String args[]){

new JdbcDemo1();

}

}

Related Java Articles

Posted in JavaComments (1)

Java Programming – Accessing Databases Using Jdbc


Java Programming – Accessing Databases Using Jdbc

JAVA PROGRAMMING – ACCESSING DATABASES USING JDBC

You can access databases using JAVA. The special feature available in Java for this purpose is Java Database Connectivity (JDBC).

You have to

Posted in JavaComments (2)