Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
K

khurram_shahzad

@khurram_shahzad
About
Posts
25
Topics
14
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • html tags formatted email not working in windows server outlook
    K khurram_shahzad

    Hi, I've a simple java code to send email to from my application, but issue is with formatting of emails, previously i had written plain text mail and used \t and \n to format email and format was correct on my laptop outlook using windows7 but when i openned this in outlook on windows server 2003 then the format was not correct. then I used html tag to format the email body and that was again fine on outlook2007 on my laptop using windows7, outlook-6 on another pc using windows-XP, but again on outlook-6 on windows server 2003 the format was not correct even its like that on windows server it removed all html like un-formatted plain text mail. so please any idea to format the email so that it works on almost all known OS's I've used

    MimeMessage msg = new MimeMessage(mailSession);

    object to send email with for html msg type used is "text/html"

    msg.setContent(message, "text/html");

    THANKS I advance.

    Java java html sysadmin windows-admin help

  • MySQL tables crashed
    K khurram_shahzad

    Yes thanks .. I'm also thinking the same.

    Database help database mysql question career

  • MySQL tables crashed
    K khurram_shahzad

    Hi everyone, I'm a software developer and just started my professional career life, question here i want to ask is ... that few days ago i was at client site to resolve some issue in application deployed by a company that uses MySQL for database, what i was found that there are four MySQL tables were crashed due to low harddisk space issue (I've searched on net that this is a usual problem with MySQL) that then i repaired by using myisamchk command. Error shown by MySQL when these were accessing is [table name] marked as crashed and should be repaired. ok so this was the background scenario, now what i want to know/ask here is ... as described in above details that these 4 four tables were not accessible becuase they are crashed but I took a backup of this database and restore it to MySQL at another machine then i can access these table easily with no issue/error by MySQL, SO WHY THIS HAPPENS THAT AT ONE SIDE THESE ARE AS CRASHED AND ON ANOTHER THE BACKUP OF SAME DATABASE THAT WAS TAKEN WHEN THESE TABLES ARE CRASHED ARE THEN WORKING FINE. I really will appreciate any kind of help on this topic Im just asking this for knowlegde and second thing is my boss also asked me the same question ;P

    Database help database mysql question career

  • what is the basic purpose of static class/methode
    K khurram_shahzad

    Thanks for your help .... Thanks a lot

    Java performance question

  • what is the basic purpose of static class/methode
    K khurram_shahzad

    Thanks for your help .... Thanks a lot

    Java performance question

  • How to compare two classes instances
    K khurram_shahzad

    Yes here im comparing to diffrent instace of same class ..... Thanks A LLLot .... Thanks for your great help .... :-D

    Java tutorial question

  • How to compare two classes instances
    K khurram_shahzad

    Thanks A LLLot .... Thanks for your great help ....

    Java tutorial question

  • what is the basic purpose of static class/methode
    K khurram_shahzad

    Please tell me some details about static class/methode, i search for it on internet in forms etc but i didn't yet setisfied and still unable to explain it in confident and clear way :( the most common questions about static class/methode in my mind are, - why use static class My Knowledge >> They provide access to class static methode directly without creating its instance. they have same instance in memory .. means every use/access to this methode can have changes effect for every one. ANY OTHER BENEFIT AND PURPOSE !! Also please tell me clearly the basic purpose of static class/method ... in interviews they always as to me about it and i always failed to answer clearly to him :sigh:

    Java performance question

  • How to compare two classes instances
    K khurram_shahzad

    but can you please give some guide line to do this ... such that one way in my mind is like this that i put an Interger property in class that are then use to identify different instanceof class .. such that 1 for 1st instance/node then 2 for 2nd and so on and then compare some thing like this NodeA.IntegerIdentifier == NodeB.IntegerIdentifier but i doesn't satisfy with this idea as it is not apply in real senario as because in programming we should try to make solution in some thing like general awy. So is there any idea aur suggestion for me that how i achieve this equality problem/isue what ever :)

    Java tutorial question

  • How to compare two classes instances
    K khurram_shahzad

    How i campare two objects, such that if i have class(given below) and i want to compare there two different instances then how ??

    class MyNode {
    MyNode left;
    MyNode right;
    }

    Is there any possiblity to do that --->

    public boolean MyFunction(MyNode toSearch, MyNode parentNode) {
    MyNode currentNode = parentNode;
    while(currentNode != toSearch) {
    return true;
    }
    else {
    currentNode = currentNode.left;
    }
    }
    return false;

    Java tutorial question

  • Java MySQL Driver issue
    K khurram_shahzad

    Ok Thanks you ver much ....... Problem solved by adding MySQL.jar to Library. THanks a lot ...

    Java database help java mysql com

  • Java MySQL Driver issue
    K khurram_shahzad

    Hi, i am trying to connect to MySQL database mysql using JAVA .. using code given below,

    import java.sql.*;

    public class dbExample{
    public static void main(String[] args) {
    System.out.println("Listing all table name in Database!");
    Connection con = null;
    String url = "jdbc:mysql://localhost:3306/";
    String db = "mydb";
    String driver = "com.mysql.jdbc.Driver";
    String user = "root";
    String pass = "root";
    try{
    Class.forName(driver);
    con = DriverManager.getConnection(url+db, user, pass);
    }
    catch (Exception e){
    e.printStackTrace();
    }
    }
    }

    I've picked this example from internet .. and there lot more example i tried using this same driver String driver = "com.mysql.jdbc.Driver"; But this code all other i tried gives me error Driver Class not found ... at this statment Class.forName(driver); ..... and similarly on trying this driver sun.jdbc.odbc.JdbcOdbcDriver the above mentioned statment Class.fonName ... executes but then it gives error on statment con = DriverManager.getConnection(url+db, user, pass); error is No suitable drive found for jdbc:mysql://localhost:3306/mydb I'm very much confused and tried it toooooo many time in diffrents ways that i could but still unable to create successfull database connection. I've tried this using notepad / Netbeans both and both on WINDOWS7 and XP ... and both give same error to me .... :( :( :( :( Please Please PLease give me any solution .... I shell be very very Thanksfull to you.

    Java database help java mysql com

  • where are stored procedures stored.
    K khurram_shahzad

    Where are Stored Procedure stores in MySQL or any other database e.g. SQL Server etc ..... Further explanation of my question, Such that if i created a database then i know all my data is in this created database ..... but if i talk about creating/using stored procedures then were are they stored. I.ve searched some example and tutorials for stored procedure ... but i didn't found aobut it. THANKS

    Database database mysql sql-server sysadmin tutorial

  • Processing JSP-Form using Servlet using AJAX Post method
    K khurram_shahzad

    I am trying to process data by servlet sended by jsp form using AJAX..... with 'GET' method its working okey ... but using 'POST' method to do this creating problem that onreadystatechage condition not exectue at (xmlhttp.readyState==4 && xmlhttp.status==200)

    xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4 || xmlhttp.status==200) {
    alert("state=4 OR 200"); //for testing...
    //document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
    document.getElementById("TextChatHistory").value = xmlhttp.responseText;
    }
    }

    i tryed to solve this too much .... but i cant .... Any one plz help me ..... THANK ... COMPLETE PROGRAM CODE IS GIVEN BELOW, JSP_CODE

    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <%--@page import="java.util.Timer.*, java.util.TimerTask.*"
    Timer timer;
    --%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>

        <script type="text/javascript" >
            function AjaxFunction() {
                xmlhttp = null;
                if(window.XMLHttpRequest) {
                    xmlhttp = new XMLHttpRequest();
                    //alert("alert\_Browser");
                } else {
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                    //alert("alert\_ActiveX");
                }
                xmlhttp.onreadystatechange=function() {
                    if (xmlhttp.readyState==4 || xmlhttp.status==200) {
                        alert("state=4 OR 200"); //for testing...
                        //document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
                        document.getElementById("TextChatHistory").value = xmlhttp.responseText;
                    }
    	}
                xmlhttp.open("POST", "TextChat", true);
                var Parameter\_MsgSType = "msgText=" + document.getElementById("msgText").value;
                alert(Parameter\_MsgSType);  //for testing...
                xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
                xmlhttp.setRequestHeader("Content-lenght", Parameter\_MsgSType.lenght);
                xmlhttp.setRe
    
    Java java help javascript html testing

  • Error in developing my first AJAX example. . . .
    K khurram_shahzad

    hi ... i m trying to make this me first simple AJAX example using PHP that shows message from PHP on clicking Button in HTML page .... but this case some prolem ... that is when click on button to show message then nothing is happen .... is also check WAMP ... so any idea or suggestion !!!! HTML CODE IS,

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>MyFirstAJAXProram</title>

    </head>
    <body>
    <script type="text/javascript">
    function JavaFunction() {
    var xmlhttp;
    if(window.XMLHttpRequest) {
    xmlhttp = new XMLHttpRequest();
    } else {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function() {
    if(xmlhttp.readystate == 4) {
    document.timerForm.time.value = xmlhttp.responseText;
    }
    }
    xmlhttp.open("GET", "phpfile.php", true);
    xmlhttp.send(null);
    }
    </script>
    <form name="timerForm">
    <input type="button" onclick="JavaFunction()"; />
    Time: <input type="text" id="timer" name="time" value="00:00:00" readonly="readonly" />
    </form>
    </body>
    </html>

    PHP CODE;

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    <?
    echo("KHURRAM SHAHZAD");
    ?>
    </body>
    </html>

    I found one another problem is that php file also not run when i try to run it directly..... :(

    JavaScript help javascript php html tools

  • Problem in learning AJAX with PHP
    K khurram_shahzad

    Oh i c ...... :-)

    Java javascript php html tools help

  • Problem in learning AJAX with PHP
    K khurram_shahzad

    hi ... i m trying to make this me first simple AJAX example using PHP that shows message from PHP on clicking Button in HTML page .... but this case some prolem ... that is when click on button to show message then nothing is happen .... is also check WAMP ... so any idea or suggestion !!!! HTML CODE IS,

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>MyFirstAJAXProram</title>

    </head>

    <body>
    <script type="text/javascript">

    function JavaFunction() {
    var xmlhttp;
    <!--Getting XMLHttpRequest OR Active depends on browser support...-->
    if(window.XMLHttpRequest) {
    xmlhttp = new XMLHttpRequest();
    } else {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }

    xmlhttp.onreadystatechange=function() {
    	if(xmlhttp.readystate == 4) {
    		document.timerForm.time.value = xmlhttp.responseText;
    	}
    }
    xmlhttp.open("GET", "phpfile.php", true);
    xmlhttp.send(null);
    

    }
    </script>
    <form name="timerForm">
    <input type="button" onclick="JavaFunction()"; />
    Time: <input type="text" id="timer" name="time" value="00:00:00" readonly="readonly" />
    </form>
    </body>
    </html>

    HERE's PHP CODE,

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    <?
    echo("KHURRAM SHAHZAD");
    ?>
    </body>
    </html>

    Java javascript php html tools help

  • calling servlet in background from jsp
    K khurram_shahzad

    when we call servlet from a JSP page .. explorer/program moves to servlet page .... Such in my scenareo i have JSP form that on submiting call servlet to retrieve data from XML .. But problem is that . i like that on submitin form servlet runs in background without changing page to servlet page ... like thread in background .... SO PLZ ANY IDEA OR SUGGESTION !!!! THANKS T ALL HELPERS ...

    Java java xml help

  • MySQL connection URL issue [modified]
    K khurram_shahzad

    Thanks .. But thing still creates problem to me. In this program they uses database test which is already exist ... where i dont know ..... but in case i create my own database then where i keep it and how to give database path in statment con = DriverManager.getConnection("jdbc:mysql:///test", "root", "secret");

    package com.stardeveloper.example;

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;

    public class JdbcExample2 {

    public static void main(String args[]) {
    Connection con = null;

    try {
      Class.forName("com.mysql.jdbc.Driver").newInstance();
      con = DriverManager.getConnection("jdbc:mysql:///test",
        "root", "secret");
    
      if(!con.isClosed())
        System.out.println("Successfully connected to " +
          "MySQL server using TCP/IP...");
    
    } catch(Exception e) {
      System.err.println("Exception: " + e.getMessage());
    } finally {
      try {
        if(con != null)
          con.close();
      } catch(SQLException e) {}
    }
    

    }
    }

    Web Development database help java mysql question

  • MySQL connection URL issue [modified]
    K khurram_shahzad

    Connection con = DriverManager.getConnection("jdbc:odbc:employee");

    please tell me that the methode of defining this "jdbc:odbc:employee" string. As mentioned in getConnnection detail in netbeans the first part jdbc is fix and the second and the third is subProtocol and subName ... so tell me please what are these three things? I'm accessing MySQL database employee.sql using java servlet ... but i dont know this above mentioned statment mechanism so i m still failed to complete. I've also read some bloges/etc but cant ound detail that clear my queation. So plz me. Also plz tell me that in most of the examples and also in above given statment they defines database in two forms, "jdbc:mysql:employee" or "jdbc:odbc://localhost/employee" so what are these location on computer or on my local mechine so shere i keep database(employee.sql) to refer them like these two ways. THANKS TO ALL HELPERS ...

    modified on Wednesday, July 14, 2010 12:23 AM

    Web Development database help java mysql question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups