SQL Database is corrupted....... plz help.

Respected Sir,
unfortunately hard disk of my system is damaged, now i recovered my database. but it cannot be attached again to SQL management
studio 2005.
the error is myfile.mdf is not a primary database file. (SQL server , error 5171)
plz sir help me...

Corruption in SQL server database can happen due to any uncertain like virus attack, power
failure, hardware issue, OS malfunction, sudden system shutdown, so on. When a SQL server data file (.mdf) is corrupt then DBAs can try several methods to repair and recover data from it. 
Run DBCC CHECKDB: It checks & reports all the error message
in errorlog, if there is any problem with the database. Try to analyze & understand the error message logged in the errorlog. Re-run DBCC CHECKDB with the recommended minimum repair option to repair the file. 
Detailed information about DBCC CHECKDB is available here: http://www.techrepublic.com/forums/discussions/sql-database-recovery-from-corrupt-database-file/
Restore from backup: If above command fails to fix the error
message the try to restore the database from clean backup. 
3rd party tool: Try 3rd party
Recovery Toolbox for SQL Server to recover data from corrupt mdf file. Most of the software have demo version that shows the preview of corrupt SQL server data file. 
http://www.sql.recoverytoolbox.com/

Similar Messages

  • SQL Database is corrupted

     unfortunately hard disk of my system is damaged, now i recovered my database. but it cannot be attached again to SQL management studio 2005.
      the error is
     myfile.mdf is not a primary database file. (SQL server , error 5171)

    not a primary database file. (Microsoft SQL Server, Error: 5171) ? 
    The aforementioned error message conveys that the database is corrupt and is, therefore, not accessible. 
    Cause: 
    The root cause of this error message is that the database file is corrupt. It may be possible because of various reasons such as power surges, human errors,
    virus infections, etc. 
    Resolution: 
    To address this issue, there are few things that you can perform. First of all, take a backup of this corrupted database lest it is further damaged. Then,
    you should try to check the database consistency using the DBCC CHECKDB utility. For this, you should run the utility without any clause. The command is executed and the reason for corruption is provided. Then, run the utility using the mentioned clause. However,
    if you are still not able to repair sql, then you should use a third-party ms sql repair tool for mdf repair. Such tools recover corrupted SQL database components after all kinds of logical crash scenarios. 
    SQL Recovery software is a robust tool that is used to recover corrupt databases created in MS SQL Server 2000, 2005, and 2008. It is able to repair sql
    components such as tables, defaults, stored procedures, triggers, views and rules. It can also repair database constraints such as primary key, foreign key, unique key, check, etc. It is a highly interactive tool that does not overwrite the original database
    while scanning it. It is compatible with Window 7, Vista, 2003 Server, XP, 2000, and NT.

  • Trigger, catproc.sql : ICD Vector problem, plz help

    oracle 817, win2000
    I accidently excuted this script
    HOME\rdbms\admin\catproc.sql
    while connected as system, not as sys.
    Afterwards i executed it on sys (still not without errors, but alot less)
    Now, the manager account is behaving rather weird. im getting alot of errors like this one trying to load some java stored procedures to the DB:
    initialization complete
    loading : MyRep
    Error while loading MyRep
    ORA-06509: PL/SQL: ICD-vector is missing for this package
    ORA-06512: at "SYSTEM.DBMS_LOB", line 492
    ORA-06512: at line 1
    Obviously i've messed with something i shouldnt mess with.. how can i resolve it short of a reinst of 817 ?
    Thx in advance.
    null

    Bruce,
    I think what happened is that you should have logged in as
    sys instead of system when you run the catproc.sql. So, now you
    have a package created for sys and system. What I suggest to you
    is that you go into DBA Studio and remove the package(s)
    (duplicate ones) and then you should be alright. I hope this
    will solve your problem.
    Steve Siew

  • Hi, plz help me. i wanna store photos to sql database. so how to insert file field into insert record in dreamweaver cs3?

    I dont know how to insert file field into insert record in DW. i also want to know, insert dynamic table with image field. Plz help me anyone. Ty..

    ohh kk thank you bro. But How to store photos to server file. I wanna upload and display the photos in webpage. Can you send me the php code for this?

  • Plz help using ms access as database,i want to create a login page in java

    hye frnz... plz help me m new to java
    m using ms access as database and try to create a login page where user type username and pw
    i had enter valid user entries in database i checked connectivity is working i want as user login the main window must open after checking username and pw field to database but
    now there is an error class not found exception sun:jdbc...... error
    plz help me i had stuck frm 4 days */
    import java.sql.DriverManager;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Login extends JFrame
    //Component Declarations
    JLabel jlb1,jlb2;
         JTextField jtf1;
         JPasswordField jpf1;
         JButton jb1,jb2;
         //Constructor
         Login()
         //frame settings
              setTitle("Login Dialog");
              setLayout(new GridBagLayout());
              GridBagConstraints gbc = new GridBagConstraints();
              setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              Dimension d= Toolkit.getDefaultToolkit().getScreenSize();
              setBounds(d.width/2-175,d.height/2-100,350,200);
              gbc.insets=new Insets(7,7,7,7);
         //adding components
              jlb1=new JLabel("User ID");
              gbc.gridx=0;
              gbc.gridy=0;
              add(jlb1,gbc);
              jlb2=new JLabel("Password");
              gbc.gridx=0;
              gbc.gridy=1;
              add(jlb2,gbc);
              jtf1=new JTextField(10);
              gbc.gridx=1;
              gbc.gridy=0;
              add(jtf1,gbc);
              jpf1=new JPasswordField(10);
              gbc.gridx=1;
              gbc.gridy=1;
              add(jpf1,gbc);
              jb1=new JButton("Login");
              gbc.gridx=0;
              gbc.gridy=2;
              add(jb1,gbc);
              jb1.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                   Connection conn=null;
                        Statement stmt=null;
                        boolean found=false;
                   try
                             Class.forName("sun.jdbc.driver.JdbcOdbcDriver");
                             String dataSourceName = "Inventory";
                             String dbURL = "jdbc:odbc:" + dataSourceName;
                             conn=DriverManager.getConnection(dbURL, "","");
                             stmt=conn.createStatement();
                             ResultSet rst=stmt.executeQuery("Select * from User");
                             System.out.println(jtf1.getText()+"/t"+jpf1.getPassword());
                             while(rst.next())
                                  System.out.println( rst.getString(1) +"/t"+ rst.getString(2));
              if(jtf1.getText().equals(rst.getString(1).trim()) && new String(jpf1.getPassword()).equals(rst.getString(2).trim()))
                                       found=true;
                                       rst.close();
                                       dispose();
                                       MainWindow mw= new MainWindow();     /*created min window object created to be opend after login but not working*/     
                                       break;
                             rst.close();
                             stmt.close();
                             conn.close();                    
                        catch(ClassNotFoundException e){System.out.print(e);}
                        catch(Exception e){System.out.print(e);}
                        if(found==false) /*this portion is executing and dialog box appears invalid name and pw with class not found exception sun:jdbc.......on console */
                             JOptionPane.showMessageDialog(null,"Invalid username or password",
                                  "Error Message",JOptionPane.ERROR_MESSAGE);
              jb2=new JButton("Clear");
              gbc.gridx=1;
              gbc.gridy=2;
              add(jb2,gbc);
              jb2.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                        jtf1.setText("");
                        jpf1.setText("");
                        jtf1.requestFocus();
              setSize(350,200);
              setVisible(true);
              jtf1.requestFocus();
         public static void main(String args[])
    Login l=new Login();
    Edited by: 795772 on Sep 19, 2010 4:44 AM

    795772 wrote:
    hye frnz... plz help me m new to java
    m using ms access as database and try to create a login page where user type username and pw
    i had enter valid user entries in database i checked connectivity is working i want as user login the main window must open after checking username and pw field to database but
    now there is an error class not found exception sun:jdbc...... error
    plz help me i had stuck frm 4 days */
    <snip>The subject of this forum is Oracle databases. How does your problem relate to that subject?
    Two bits of advice:
    1) Make sure you ask questions in a forum related to your problem.
    2) If you want to be taken seriously as a professional, drop the MS IM Speak and use the language of the forum. In this forum it is English, which is successfully used by many people for whom English is far from their native language.

  • Need Help/Advice with Photo Web Gallery coming from SQL Database

    This is my first attempt at a database driven website. I assume what I am trying to accomplish should be fairly easy for more experienced but I am stuck at this point.
    First, let me explain what I am trying to accomplish.
    I want to create a thumbnail photo gallery displayed in columns and rows. I want to be able to hover over or click on the thumbnail image and have a lightbox script display the image over the thumb page. I am developing locally right now with intent to upload to the hosting site upon completion.
    I am developing with ASP vbScript pages. I have an SQL database where the paths to the image thumbnails and pictures are stored in a table. On the gallery page, I have created a div tag to hold my image recordset. Within this div, I have inserted 3 absolute positioned divs to hold the pictureID, the pictureName and the image inserted as a datasource. I then inserted the information from the bindings panel of my recordset. Last, I used a horizontal looper extension from Tom Muck to get the thumbnails to display in columns and rows. Everything works up to this point just fine.
    Now, I want to be able to hover or click on a thumnail image and have it displayed in a lightbox. I downloaded and used a javascript called Lightbox 2 which contains 3 javascript files and a css stylesheet. I inserted the files into the head tag like instructed to but could not get things to work properly. Here is where I need help. Currently, I am clicking on the thumbImage binding within the image Div and creating a link holder. I am then binding the larger pictureImage to it with the a.href selected in the bind to. I am then adding the command to call the lightbox javascript. Now, when I test my page, my thumbnail images do not show up (my alt text does in its place) but the links are in place and you can click on the alt text and it will return the correct larger image, but not in the lightbox, just in a new window with no styles.
    Am I going about this correctly? Can you use lightbox scripts with data-driven galleries? Does anybody have any suggestions of what I may be doing wrong or missing? Are there better ways to go about accomplishing this?
    Any help would be appreciated as this dynamic data thing has my head spinning. Although I know a database is needed to simplify the update and maintenance of the photos while allowing them to be searchable by keywords and tags also set up in the database.
    Thanks

    As I explained, I am developing locally a the moment. I will see about getting the databased moved up to the hosting server and then provide a link for an example.
    In the mean time, can you or anyone else explain a way that you would go about displaying an image thumbnail photo gallery laid out in rows / columns, with any lighbox script that would overlay the larger image over the existing page instead of opening a new browser window?
    I don't have to use the method I tried to describe.
    In all of the lightbox examples I have looked at thus far, they give instructions on how to append that javascript to a single static image or a group of static images, not images from a datasource. That is where I am getting confused.
    Don't know if this will help or not but please see code below:
    Javascript and CSS positioned in head tag
    <!--beginning of lightbox script with css -->
    <link href="CSS/lightbox.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/protype.js" type="text/javascript"></script>
    <script src="Scripts/scriptaculous.js?load=effects,builder" type="text/javascript"></script>
    <script src="Scripts/lightbox.js" type="text/javascript"></script>
    <!--end of lightbox script with css -->
    Calling for javascript in the galleryimage div when hovering over thumbnail image
        <!--beginning of gallery div -->
        <div id="gallery">
          <p>
            <!--beginning of galleryImage div -->
          </p>
          <table width="400" border="0" align="center" id="galleryNav2">
            <tr>
              <td width="100" align="center"><% If MM_offset <> 0 Then %>
                  <a href="<%=MM_moveFirst%>">First</a>
              <% End If ' end MM_offset <> 0 %></td>
              <td width="100" align="center"><% If MM_offset <> 0 Then %>
                <a href="<%=MM_movePrev%>">Previous</a>
              <% End If ' end MM_offset <> 0 %></td>
              <td width="100" align="center"><% If Not MM_atTotal Then %>
                <a href="<%=MM_moveNext%>">Next</a>
              <% End If ' end Not MM_atTotal %></td>
              <td width="100" align="center"><% If Not MM_atTotal Then %>
                <a href="<%=MM_moveLast%>">Last</a>
              <% End If ' end Not MM_atTotal %></td>
            </tr>
          </table>
          <p> </p>
          <table align="center" id="HorzLooper">
            <%
    startrw = 0
    endrw = HLooper1__index
    numberColumns = 5
    numrows = 5
    while((numrows <> 0) AND (Not rs_ssfGallery.EOF))
    startrw = endrw + 1
    endrw = endrw + numberColumns
    %>
            <tr align="center" valign="top">
              <%
    While ((startrw <= endrw) AND (Not rs_ssfGallery.EOF))
    %>
              <td><div id="galleryImage">
                <div id="galleryThumb"><a href="images/pic/<%=(rs_ssfGallery.Fields.Item("picture_url").Value)%>"rel="lightbox"><img src="images/thumb/<%=(rs_ssfGallery.Fields.Item("thumb_url").Value)%>" alt="<%=(rs_ssfGallery.Fields.Item("alt_url").Value)%>" /></a></div>
                <div id="galleryImageID"><%=(rs_ssfGallery.Fields.Item("picture_ID").Value)%></div>
                <div id="galleryImageFamily"><%=(rs_ssfGallery.Fields.Item("family").Value)%></div>
              </div></td>
              <%
    startrw = startrw + 1
    rs_ssfGallery.MoveNext()
    Wend
    %>
            </tr>
            <%
    numrows=numrows-1
    Wend
    %>
          </table>
          <p> </p>
          <table width="400" border="0" align="center" id="galleryNav">
            <tr>
              <td width="100" align="center"><% If MM_offset <> 0 Then %>
                  <a href="<%=MM_moveFirst%>">First</a>
              <% End If ' end MM_offset <> 0 %></td>
              <td width="100" align="center"><% If MM_offset <> 0 Then %>
                  <a href="<%=MM_movePrev%>">Previous</a>
              <% End If ' end MM_offset <> 0 %></td>
              <td width="100" align="center"><% If Not MM_atTotal Then %>
                  <a href="<%=MM_moveNext%>">Next</a>
              <% End If ' end Not MM_atTotal %></td>
              <td width="100" align="center"><% If Not MM_atTotal Then %>
                  <a href="<%=MM_moveLast%>">Last</a>
              <% End If ' end Not MM_atTotal %></td>
            </tr>
          </table>
    <!--end of galleryImage div -->
        </div>
        <!--end of gallery div -->
    Thanks for any help or suggestions.

  • Help Needed!! Working with SQL Databases

    Hi All,
    I'm currently working on an application that interfaces with an SQL database, and I seem to have ran into a roadblock.
    I have a multicolumn list box on my front panel which is filled in with data extracted from the database. On selecting any of the rows in the list box, another one is opened displaying another set of data extracted by a generated SQL query. At the moment I am only selecting one row at a time to view it's related data, but I want to expand such that I can select mutiple rows from the list box at a time and see all of their corresponding data.
    With only a single selection, I can pass the index value of the selection to an Index Array Function with the database as the other input and build my SQL statement.
    But with multiple selections, I imagine I would have to build an array on index values and use those as a reference to build the SQL statment. And I am not sure how exactly to go about doing that.
    Here is the code that I currently have working for a single selection from the list box.
    Any help is appreciated. Cheers.
    Solved!
    Go to Solution.

    tdog wrote:
    Hi All,
    I'm currently working on an application that interfaces with an SQL database, and I seem to have ran into a roadblock.
    I have a multicolumn list box on my front panel which is filled in with data extracted from the database. On selecting any of the rows in the list box, another one is opened displaying another set of data extracted by a generated SQL query. At the moment I am only selecting one row at a time to view it's related data, but I want to expand such that I can select mutiple rows from the list box at a time and see all of their corresponding data.
    With only a single selection, I can pass the index value of the selection to an Index Array Function with the database as the other input and build my SQL statement.
    But with multiple selections, I imagine I would have to build an array on index values and use those as a reference to build the SQL statment. And I am not sure how exactly to go about doing that.
    Here is the code that I currently have working for a single selection from the list box.
    Any help is appreciated. Cheers.
    Regarding building the array:
    I can see hat you multicolumn listbox has not multiselection enabled, and is limited to one or zero selected item at once. To enable multiselction; simply rightclick your multicolumn listbox and change your selection mode to support multiple selected items. The NewVal at the event structure should change from a single index number to a 1D array of indexed numbers. No coding needed. Then just retrive out all the items (since you know the indexes) and create the quiry. The quiry part I dont really know (long time no see SQL), but it looks like a for loop to create the string should do the trick?

  • I need help re-installing CS4 production premium. Error code says "Installation database is corrupt" but if I try to delete the caps.db file I can't even find one. Furthermore, I tried Adobe Cleaner and it made no difference. HELP!

    I need help re-installing CS4 production premium (for PC). Error code says "Installation database is corrupt" but if I try to delete the caps.db file I can't even find one. Furthermore, I tried Adobe Cleaner and it made no difference. HELP!

    I need help re-installing CS4 production premium (for PC). Error code says "Installation database is corrupt" but if I try to delete the caps.db file I can't even find one. Furthermore, I tried Adobe Cleaner and it made no difference. HELP!

  • Plz help to to transfer excel or acess data to Oracle 10g database

    Plz help me to transfer excel or acess data to Oracle 10g database.
    I have excel and acess sheet data here i wanna transfer it to oracle database. Plz guide me how to this
    Message was edited by:
    user582212

    There are several ways, such as ODBC or migration workbench, which is also mentioned in the current article on sqldeveloper on OTN, here's the link. If you use this forum's search function, you should find several threads regarding this topic.
    C.
    Message was edited by:
    cd

  • Plz help to optimize my sql

    I was recently assigned a task to maintain an old system,which is related to telecom domain. In the process i need to optimize a SELECT sql which is as this:
    SELECT *
    FROM (SELECT T1.ID AS ID,
    T3.FULL_NAME AS PORT_FULL_NAME,
    T1.CODE AS CODE,
    T4.FULL_NAME AS FULL_NAME,
    T2.LCODE AS LCODE,
    T1.RATE AS RATE,
    T1.DEVICE_ID AS DEVICE_ID
    FROM TN_MULT_UNIT T1,
    TD_DEVICE T2,
    TD_PORT T3,
    TG_RES_NAMING T4,
    TN_MULT_UNIT T5
    WHERE T1.DEVICE_ID = T2.ID(+)
    AND T2.ID = T4.RES_ID
    AND T1.STATUS = 'Free'
    AND T1.Parent_Id = T5.id
    AND T1.UNIT_TYPE = 'ExTime'
    AND T1.RATE = '2M'
    AND T1.SUBPART_ID = T3.ID
    AND T3.SPECIAL = 'Exchange'
    AND T3.PORT_TYPE = 'SwitchRelay'
    UNION
    SELECT T1.ID AS ID,
    T3.FULL_NAME AS PORT_FULL_NAME,
    T1.CODE AS CODE,
    T4.FULL_NAME AS FULL_NAME,
    T2.LCODE AS LCODE,
    T1.RATE AS RATE,
    T1.DEVICE_ID AS DEVICE_ID
    FROM TN_MULT_UNIT T1, TD_DEVICE T2, TD_PORT T3, TG_RES_NAMING T4
    WHERE T1.DEVICE_ID = T2.ID(+)
    AND T2.ID = T4.RES_ID
    AND T1.STATUS = 'Free'
    AND T1.UNIT_TYPE = 'LogicPort'
    AND T1.RATE IN ('2M', '155M', '34M')
    AND T1.SUBPART_ID = T3.ID
    AND T3.SPECIAL = 'Exchange'
    AND T3.PORT_TYPE = 'SwitchRelay') T
    the sql statement above is to retrieve all Ports where its UNIT_TYPE is 'LogicPort' or 'ExTime'(exchange timeslot), with these two kind of port i need use additional different conditions respectively.so i choose to use UNION statement. but this sql is seem to be too slow to run.plz help me to find a more efficient way.
    Thanks in advance!

    Tuning is a really big question. There is a reason why the documentation devotes an entire volume to the topic. Not to mention all the people that make a fine living by consulting and writing books.
    The point is, it is really hard for us to solve your problem without knowing a whole lot of information about your situation. We can't just look at your query and say "aha!". Ideally you should read the Tuning Guide from start to finish, but you aren't going to do that. What you must do is read Rob Van Wijk's excellent primer When your query takes too long ....
    Feel free to come back with any specific questions. Remember to give us all the information we need.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Help me on CVP class to query a SQL database

    Dear friends,
    I try to create a class extends to Action element. But when I do deploy, it return no result.
    I want this class receive Calling Number and do the query to database (SQL as I test, later if it works I will do for another database). After query I will get Name, Address, Email of this Customer based on Calling Number (ANI).
    Please help to take a look on my program and help me to fix it.
    Thank you very much.
    import com.audium.server.AudiumException;
    import com.audium.server.voiceElement.ActionElementBase;
    import com.audium.server.session.ActionElementData;
    import java.sql.*;
    * This class is called when a standard action has been configured to use a
    * Java class. Since this is a standard action element, it applies to a
    * specific application and does not have a configuration. As a result, the
    * only method needed in this class is the doAction method.
    public class DBLookupStandardAction extends ActionElementBase
    class WhatIGot
    String ANI = null;
    String Name = null;
    String Address = null;
    String Email = null;
    public void doAction(String name, ActionElementData data) throws AudiumException
    Connection conn = null;
    String Name = null;
    String Address = null;
    conn = connectToDatabase();
    String ani = data.getAni();
    WhatIGot whatigot = new WhatIGot();
    whatigot = QueryDatabase(conn, ani);
    Name = whatigot.Name;
    Address = whatigot.Address;
    data.setSessionData("Name",Name);
    data.setSessionData("Address",Address);
    // PUT YOUR CODE HERE.
    private Connection connectToDatabase()
    Connection conn = null;
    try
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    conn = DriverManager.getConnection("jdbc:sqlserver://172.16.3.5:1433;DatabaseName=hcmpt","sa","");
    catch (ClassNotFoundException e)
    e.printStackTrace();
    System.exit(1);
    catch (SQLException e)
    e.printStackTrace();
    System.exit(2);
    return conn;
    /*Query*/
    private WhatIGot QueryDatabase(Connection conn, String ANI)
    WhatIGot WhatIGot = new WhatIGot();
    try
    Statement st = conn.createStatement();
    ResultSet rs = st.executeQuery("SELECT prefixnos, Name, Address, Email FROM customer_info where prefixnos = ANI");
    WhatIGot.ANI = rs.getString ("prefixnos");
    WhatIGot.Name = rs.getString ("Name");
    WhatIGot.Address = rs.getString ("Address");
    WhatIGot.Email = rs.getString ("Email");
    rs.close();
    st.close();
    catch (SQLException se) {
    System.err.println("Threw a SQLException creating the list of blogs.");
    System.err.println(se.getMessage());
    return WhatIGot;

    Thank you Geoff,
    I have made some changes and now it's working fine with SQL database.
    I go forward to Oracle database. But can you show me how can I copy a new library (ojdbc14.jar) to the CVP server:
    - which folder?
    - and how apply it for all other application can use the same lib here?
    waiting for you answer...
    Thank you,
    This code I have tested, it can connect and query and I try to put to screen. It is working. But when I apply to CVP xml server, it not work. And the CVP VXML server got "stop" (maybe on the fail state)
    package com.dts.db;
    * @author Doan Khanh Tan Thanh
    // These classes are used by standard action elements.
    import com.audium.server.AudiumException;
    import com.audium.server.voiceElement.ActionElementBase;
    import com.audium.server.session.ActionElementData;
    import java.sql.*;
    * This class is called when a standard action has been configured to use a
    * Java class. Since this is a standard action element, it applies to a
    * specific application and does not have a configuration. As a result, the
    * only method needed in this class is the doAction method.
    public class OracleDBLookupAction extends ActionElementBase
    class WhatIGot
    String Name = null;
    String Address = null;
    String Email = null;
    public void doAction(String name, ActionElementData data) throws AudiumException
    String NameWhatIGot = null;
    Connection conn = null;
    String AddressWhatIGot = null;
    //String EmailWhatIGot = null;
    String ani = null;
    conn = connectToDatabase();
    ani = (String)data.getSessionData("ANI");
    WhatIGot whatigot = new WhatIGot();
    whatigot = QueryDatabase(conn, ani);
    NameWhatIGot = whatigot.Name;
    AddressWhatIGot = whatigot.Address;
    //EmailWhatIGot = whatigot.Email;
    data.setSessionData("Name",NameWhatIGot);
    data.setSessionData("Address",AddressWhatIGot);
    // PUT YOUR CODE HERE.
    private Connection connectToDatabase()
    Connection conn = null;
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    conn = DriverManager.getConnection("jdbc:oracle:thin:@172.16.5.134:1521:dbkttt","CUOC1080","123456");
    catch (ClassNotFoundException e)
    e.printStackTrace();
    System.exit(1);
    catch (SQLException e)
    e.printStackTrace();
    System.exit(2);
    return conn;
    /*Query*/
    private WhatIGot QueryDatabase(Connection conn, String ANI)
    WhatIGot WhatIGot = new WhatIGot();
    try
    Statement st = conn.createStatement();
    ResultSet rs = st.executeQuery("SELECT * FROM CUSTOMER_INFO where ANI = '838232822'");
    while ( rs.next() )
    WhatIGot.Name = rs.getString ("NAME");
    WhatIGot.Address = rs.getString ("ADDRESS");
    WhatIGot.Email = rs.getString ("EMAIL");
    rs.close();
    st.close();
    catch (SQLException se) {
    System.err.println("Threw a SQLException creating the list of blogs.");
    System.err.println(se.getMessage());
    return WhatIGot;

  • MySQL  database? Plz help.

    Hi all
              I am doing a project in p2p video conferencing.So to maintain all the user details can I use MySQL database. Is there any other appropriate databases?
                Plz help me with any tutorials if any one knows.
    Advance thanx

    Yes,
    You can use any database and backend. All you need for video chatting is to exchange identities using a webservice that spits out xml.
    Download the sample application
    http://labs.adobe.com/technologies/stratus/samples/#resources
    In it you will find a python cgi script. The script is self explanatory on how to configure a web service. It uses SQLite but you can use mysql or any other database.

  • HT201210 every time i want to update my phone,  i see an alart message saying that the firmware file is corrupted...what do i do now....i am using 5.1.1 and it is jailbroked.......i face the same problem while restoring......plz help.....TOUFIQ

    every time i want to update my phone,  i see an alart message saying that the firmware file is corrupted...what do i do now....i am using 5.1.1 and it is jailbroked.......i face the same problem while restoring......plz help.....TOUFIQ

    Jailbroken phoned are not supported here. Anything could be wrong with it - it is jailbroken.

  • Storing emails offline in database problem plz help me

    hello friends all .
    i wana store all the emails which i get from INBOX folder in database i am using Microsoft Access 2000 for it the below code get all the mails from INBOX and are stored in Array now plz some one help and send a code to store each field of message in data base..
    my database table name is mails
    Fields name -------------------Data Type
    mailid ----------------------- Autonumber
    from -------------------------- Text max length 255 chars (avaliable)
    to ---------------------------- Text max length 255 chars (avaliable)
    bcc --------------------------- Text max length 255 chars (avaliable)
    cc ---------------------------- Text max length 255 chars (avaliable)
    subject ------------------------ Text max length 255 chars (avaliable)
    attachments -------------------- Text max length 255 chars (avaliable)
    now what i want is to store the path of attachments store in directory
    Properties props = new Properties();
    String host = pop3.getText ();
    String provider = "pop3";
    try {
    Session session = Session.getDefaultInstance (props,
    new MailAuthenticator());
    Store store = session.getStore (provider);
    store.connect (host,null,null);
    Folder inbox = store.getFolder ("INBOX");
    if (inbox== null){
    System.out.println ("no inbox");
    inbox.open (Folder.READ_ONLY);
    Message[] messages= inbox.getMessages ();
    for (int i =0 ; i<messages.length;i++){
    messages.writeTo(System.out)
    // what should i do here to store each message in database plz help me
    inbox.close (false);
    store.close ();
    catch(Exception ep){
    ep.printStackTrace();
    i'll be very thankfull plz help i try my best but didnt get success plz plz ! send a working code which i can learn and implement or send any file which do this work so that i can get help .
    thank you

    Unfortunately what you are trying to do is a little more complicated than just posting some code.
    To get the message content and any attachments you need to "parse" the MIME message you get from the store. An email will (should) be a multipart mime construct. You need to get all the "Parts" out of the message and put them into your relevant database fields.
    The "header" elements can be obtained just using the methods of the Message objects you are getting back. Have a look at the javadoc for the javax.mail.Message abstract class.
    As for example code, here's some old code I had lying around which parses a multipart message to get the various parts.
    There is a sample "main" method which should explain how it works:
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    import java.io.*;
    * <p>Title: </p>
    * <p>Description: Parses a mime message to get the relevant parts.<BR>
    * <p>Copyright: Copyright (c) 2002</p>
    * @author Jason Polites
    * @version 1.0
    public class MimeMessageParser {
       * Gets the parts from the MimeMessage
       * Use null contentType to ignore
       * Use null disposition to ignore
      public static void getParts(List parts, Part p, String contentType, String disposition)
          throws MessagingException, IOException
        Object content = p.getContent();
        String currentDisposition = p.getDisposition();
        String currentContentType = p.getContentType();
        // now we need to check if the part was a multipart...
        if(content instanceof Multipart)
          Multipart mp = (Multipart)content;
          // Now we need to delve into the parts
          for(int i=0;i<mp.getCount();i++)
            getParts(parts, mp.getBodyPart(i), contentType, disposition);
        // check to the contentType
        if(contentType == null) {
          // we don't need to check
          if(disposition == null) {
            // no need to check
            // add the part
            parts.add(p);
            //index++;
          else if(currentDisposition != null && currentDisposition.startsWith(disposition))
            // add the part
            parts.add(p);
        else if(p.isMimeType(contentType)) {
          // Check the disposition
          if(disposition == null) {
            // no need to check
            // add the part
            parts.add(p);
          else if(currentDisposition != null && currentDisposition.startsWith(disposition))
            // add the part
            parts.add(p);
       * Gets the parts which match any of the dispositions
       * @param parts
       * @param contentTypes
       * @param disposition
       * @return
      public static List getMultiplePartsFromList(List parts, String contentType, String[] dispositions)
          throws IOException, MessagingException
        List matchedParts = null;
        for(int i = 0; i < dispositions.length; i++) {
          if(matchedParts == null) {
            matchedParts = getPartsFromList(parts, contentType, dispositions);
    else
    matchedParts.addAll(getPartsFromList(parts, contentType, dispositions[i]));
    return matchedParts;
    public static List getPartsFromList(List parts, String contentType, String disposition)
    throws MessagingException, IOException
    LinkedList matchedParts = new LinkedList();
    Part p = null;
    Object content = null;
    String currentDisposition = null;
    String currentContentType = null;
    for(int i = 0; i < parts.size(); i++) {
    p = (Part)parts.get(i);
    content = p.getContent();
    currentDisposition = p.getDisposition();
    currentContentType = p.getContentType();
    if(contentType == null) {
    // we don't need to check
    if(disposition == null) {
    // no need to check
    matchedParts.add(p);
    else if(currentDisposition != null && currentDisposition.startsWith(disposition))
    matchedParts.add(p);
    else if(p.isMimeType(contentType)) {
    // Check the disposition
    if(disposition == null) {
    // no need to check
    matchedParts.add(p);
    else if(currentDisposition != null && currentDisposition.startsWith(disposition))
    matchedParts.add(p);
    return matchedParts;
    public static void main(String[] args) {
    try {
    File email = new File("C:\\test.eml");
    InputStream source = null;
    MimeMessage message = null;
    MimeMessageParser parser = null;
    parser = new MimeMessageParser();
    // First, construct an inputstream for the message file
    source = new FileInputStream(email);
    String host = "localhost";
    boolean sessionDebug = false;
    // Create some properties and get the default Session.
    Properties props = System.getProperties();
    props.put("mail.host", host);
    props.put("mail.transport.protocol", "smtp");
    Session mailSession = Session.getDefaultInstance(props, null);
    // Set debug on the Session so we can see what is going on
    // Passing false will not echo debug info, and passing true
    // will.
    mailSession.setDebug(sessionDebug);
    message = new MimeMessage(mailSession, source);
    // parse the message...
    LinkedList parts = new LinkedList();
    MimeMessageParser.getParts(parts, message, null, null);
    Part p;
    Attachment a;
    String[] dispositions = new String[2];
    dispositions[0] = MimeMessage.INLINE;
    dispositions[1] = MimeMessage.ATTACHMENT;
    List attachments = MimeMessageParser.getMultiplePartsFromList(parts, null, dispositions);
    //Just for testing.. print out the parts...
    for(int i = 0; i < attachments.size(); i++) {
    System.out.println("Part " + i + " content type: " + ((Part)attachments.get(i)).getContentType());
    catch (Exception ex) {
    ex.printStackTrace();

  • What do corrupted sql database viewer ?

    There MS SQL 2005 server and a database that you want to connect to the server.
    There mdf ldf and files. The problem is that, most likely, the base was incorrectly disabled, and now when you try to connect the message:
    File activation failure. The physical file name "C: \ Program Files \ Microsoft SQL Server \ MSSQL.1 \ MSSQL \ Data \ GB_main_log2.ldf" may be incorrect.
    The log can not be rebuilt because the database was not cleanly shut down. (Microsoft SQL Server, Error: 5120)
    What do corrupted sql database viewer ?

    Hi VectoriaKoalak,
    As other post, the best bet is to restore the database from a good backup.
    However, if you have no backups or have damaged backups.  To fix the database, you can set the database in Emergency Mode and run DBCC CHECKDB with the REPAIR_ALLOW_DATA_LOSS option to fix up corruptions. For more detailed steps, please review
    the following blog.
    EMERGENCY-mode repair: the very, very last resort
    http://www.sqlskills.com/blogs/paul/checkdb-from-every-angle-emergency-mode-repair-the-very-very-last-resort/
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

Maybe you are looking for

  • ITunes sharing no longer works

    When I try to connect to my shared library I only get a dialog box mentioning "iTunes not accepting connections at this time, try again later." Supposedly this message only occurs when 5 other users have connected to your library in a single day. I'v

  • How to hide a variable in the query?

    Hello everyone,       I don't know if my framing would be correct but i would like to explain my problem first. I have a query with a variable in the result but with defaulted values. I don't want this variable to pop up when i am running a report. I

  • I was charged 4 times for the same order at $31.06 each. No one will help!

    I can't believe it. I was charged $31.06 4 times for one order (multiple items) at the iTunes store. This took my account negative. I found out buying groceries (which I was only able to get a little of with what cash I had to my name). I have been e

  • My first 9.02 "Out of Memory!"   ????

    So, I finally installed Logic 9.02 on my mac pro with 12 gigs of ram. Started a simple project yesterday, with NO VI's, and a few plugins. I was testing drum mic setups, so I recorded an 8 track drum take. Then I wanted to see how the new 'drum repla

  • Help with Tomcat 5 and MS Access

    Hi I have a Tomcat 5 running and I want to query to a MS Access. Must I configure the server.xml to allow the connection? I'm doing the connection in a class, not in JSP: import java.sql.*; public class BaseDatos { String url="jdbc:odbc:sms"; String