radhakrishna.p 29 Posting Whiz in Training

hai stultuske

when we print the sql statement at console before executing

i thought it prints like as follows (what he has given in his first)

output might be:

INSERT INTO GoodCustomer(Product ID, Type, Watt, Volts) VALUES(+obj.getProductId()+,'type_value_here','ge####t_value_here','volts_value_here')

but +obj.getProductId()+ remains the same

thats the reason i left that value as a expression evaluated value as JamesCherrill said

please have a clean look once in changed sql statement in my post

i haven't placed any single quotes which declares obj.getProductId() as a string literal in my post

thats it

my apologies to all of you if i mislead the response

any comments are appreciated

radhakrishna.p 29 Posting Whiz in Training

hai slygoth,

try to change the statement formating from this

String query = "INSERT INTO GoodCustomer(Product ID, Type, Watt, Volts) VALUES(+obj.getProductId()+,'"+obj.getType()+"','"+obj.ge####t()+"','"+obj.getVolts()+"')");

to this

String query = "INSERT INTO GoodCustomer(Product ID, Type, Watt, Volts) VALUES("+obj.getProductId()+",'"+obj.getType()+"','"+obj.ge####t()+"','"+obj.getVolts()+"')");

i think you missed to give " " quotation marks at the start and end of +obj.getProductId()+

let me know the status

happy coding

radhakrishna.p 29 Posting Whiz in Training
radhakrishna.p 29 Posting Whiz in Training

hai iciaguevara,

yeah i got your problem.

you haven't set the bounadries properly for quantity textfeild because its overlapping with the above feilds whatever you declared in the code.

i tested your code at my side

please set the boudaries for the two fields(quantity label and qantity text filed) as shown bellow

for label of quantity try to set boundaries

lblQty.setBounds(70,220,70,30);

and for textfield of quantity

txtQty.setBounds(150,220,70,30);

i think these 2 might the problem for not displaying the textfield in your code

let me know status as well as if you have any doubts in my clarification

happy coding

radhakrishna.p 29 Posting Whiz in Training

hai iciaguevara,

Could you explain me breifly about what the problem is?

so that we can try to give a way for the solution.

let me know

radhakrishna.p 29 Posting Whiz in Training

(suggestion only:) why dont you try like this

Actually java script can access any of html input elements whereever you placed with in the page

if you try to place your string array values in any of the html elements like

input fields,divs,spans,and so on (based on our requiement we can hide these html elements also for not showing anything to user)

you can access your values diffinately from your java script.

lets take an example:

instead of sting array values make your string array as follows

<%

String my_str_values = "value1,value2,value3" // instead of string array you better to take string of values seperated by commas

%>

store this 'my_str_values' value in hidden type html input elements as shown bellow

<input type="hidden" name="my_val" id="my_val" value="<%= my_str_vaues%>"/>

so that this html input element is accessble to javascript

there you can use split() method to get your array back

you can do whatever you want.

try like this it may helpful

let me know if you have any doubts in my clarification

happy coding

radhakrishna.p 29 Posting Whiz in Training

could you just post the picurl column values of your table here?

just i need that column data only

let me check once if you don't have any problem

radhakrishna.p 29 Posting Whiz in Training

the error is about whatever you provided name 'XE' in the database_url is incorrect to say directly

so i think you need to change the value of 'service_name_or_SID_here' in the given bellow connection URL

String database_url ="jdbc:oracle:thin:@<host_name>:1521:<service_name_or_SID_here>";

you have given XE for that, but you need to check once what is the sid of your database?

execute the following command at sql_prompt of your oracle 11g database inorder to get the SID of the database

SELECT * FROM global_name;

it gives the sid of your database replace with that name in the above database_url as follows

String database_url ="jdbc:oracle:thin:@<host_name>:1521:NEW_SID_NAME_HERE";

and then check it once and remaining things are as it is

let me know the status

radhakrishna.p 29 Posting Whiz in Training

i think the following will be the connection string for connecting oracle 11g in java

String database_url ="jdbc:oracle:thin:@<host_name>:1521:<service_name>";

for example : (in coding) 

String database_url = "jdbc:oracle:thin:@localhost:1521:XE";

// getting conection object here 

DrverManager.getConnection(database_url,"user_name","password");

the following url expalins all the details of connecting to oracle 11g database along with driver details :

http://www.quickprogrammingtips.com/java/connecting-to-oracle-database-in-java.html

please check it once

let me know the status

radhakrishna.p 29 Posting Whiz in Training

hai kamil.metkowski,

i used the url what you shown in the above post as shown bellow

<html>
<head>
<title>this is my first html page </title>
</head>
<body>
<img src="http://metkowski.net/KlempBikes/images/bmx1.jpg" alt="no img found"/>
</body>
</html>

its worked for me but you are saying that gives an error

do you have internet connection to your pc/laptop while running the page?(to display the resouce which is availble in the internet)

i feel this is also one reason for not displaying the image also

check it one more time

any comments are appreciated

radhakrishna.p 29 Posting Whiz in Training

ojdbc6.jar or ojdbc5.jar files needed to connect oracle 11g databse

what is the driver and url for oracle 11g

what does URl means in this context? (i mean you are asking connection url to this database to connect with your application)

let me know clearly once

radhakrishna.p 29 Posting Whiz in Training

i couldn't understand what you are going to do in the given bellow statement

whether you assigning value to some varable or comparing values of 2 variables

if($total += $pamount=$resproduct_fetch['price_status'] * $deposit=$resproduct_fetch['price_status'])

please be more brefly about your requirement

could you explain what you are going to do with that?

radhakrishna.p 29 Posting Whiz in Training

could you post what kind of error it is?

it would be helpful for us to give a solution if you post the error message here

happy coding

radhakrishna.p 29 Posting Whiz in Training

I needed another eye

what does it means.could you expalin?

let me know

happy coding

radhakrishna.p 29 Posting Whiz in Training

nothing happens when clicking the submit button.

could you explain me breifly somemore what the requirement is?

radhakrishna.p 29 Posting Whiz in Training

suggestion only:

i am not sure this works fine or not

place this header declaration at line no :65 in download.php before echoing your pdf file data

header("Content-Type: application/pdf")

just check it once

let me know the status

Note: i am not good at coding side

radhakrishna.p 29 Posting Whiz in Training

hai klaragold

you may better to use ajax concept in javascript/jquery for this requirement

why because you are in contact.html page you need to send the details of this page to contact.php

if you want to use jquery following URL heps you a lot how to use jquery ajax

http://phpcodeforbeginner.blogspot.in/2013/01/jquery-ajax-tutorial-and-example-of.html

and then display status information as follows (in the above example he displays the outout by using)

$("#msg").html("some message there ");

replace that statement with the following statement

$("#thanks").html(result);  
// thanks is the id of your div in contact.html  and result is the what you echoed in contact.php 

thats it

i hope you get clearly

let me know if you have any doubts

Note: my apologies to members over here because i feel better by giving references to the solution than giving explanation in this requirement so i did this way

radhakrishna.p 29 Posting Whiz in Training

you mean you want to display the <div> like lightbox or popupbox ...etc when your page is open

could you clarify once how it would be>

radhakrishna.p 29 Posting Whiz in Training

hai singularity~,

i think if you echo your $sql variable before executing,it display's as follows

UPDATE book_store SETtitle = '$_POST[title]', isbn = '$_POST[isbn]', price = '$_POST[price]', quantity = '$_POST[quantity]' WHERE ID = '$_POST[id]'

there is no space between 'SET' keyword and 'title'

so please provide space between 'SET' keyword and title

that might be the one giving the error i think

please check it once i guess right or not

let me know the status

radhakrishna.p 29 Posting Whiz in Training

hai pxmur76,

as softswing said, you need to add/register KeyListner to your textfield so that only you can listen key events generated by the textfield.

this is the way you can handle the "enter" key event with in the text feild.please do as follows

steps:

  1. add Keylistner to your textfield

  2. i think you know KeyListner has the following methods & its signatures like (i am providing exact method signatures).

    public void keyPressed(java.awt.event.KeyEvent evt){}
    public void keyReleased(java.awt.event.KeyEvent evt){}
    public void keyTyped(java.awt.event.KeyEvent evt){}

based on your requirement implement your code in any one of the above 3 methods and provide empty implementation for the remaining methods you may want.

3.then by using getKeyCode() method of Event class you can handle the enter key as follows

      // w.r.t above method signatures

          if(evt.getKeyCode() == 10){
                   // here do whatever you want when the enter key is pressed in the text feild
          }else{
                  // your remaining code 
          }

i think you got my point.

let me know if you have any doubts in my clarification

radhakrishna.p 29 Posting Whiz in Training

hai scippi,

mostly this kind of situation will occur by entering/providing wrong input values (the exception name itself saying to us clearly you entered input value is other than what you expecting from the code .......)

i think you have entered the value other than the integer value so it thrown the following exception to you other than that no issues at all in the code.

java.util.InputMismatch exception: null (in java.util.Scanner)

go through the url it explains the exception details

http://docs.oracle.com/javase/1.5.0/docs/api/java/util/InputMismatchException.html

radhakrishna.p 29 Posting Whiz in Training

hai klaragold
please clarify the following things little bit more

1. where do you want to display the status message?(what i mean is you want to display with in the contact.php page or you want to display that in seperate page)

is it possible to only allow sending the message by validation? The issue is that i can send it without an email adress..

2. what do you mean by validation in the above statement? (i mean you wnat to check whether it is valid mail address or not or something than that)

please explain it clearly so that we are ready to help you

radhakrishna.p 29 Posting Whiz in Training

hai foxwizzy,

you done for in your code for editing the entries (see at line 94).

so why dont you follow same procedure for deleting the entry (just suggestion only)? like as follows (at line no 113)

<a href="delete.php?entry_id=<? echo r['current_entry_id']?>">Delete</a>

use the same thing here for deleting entries by passing its entry id value to the appropriate page(i mean 'delete.php' if it is existed).

i think you got my point and its work fine for this kind of requirement

let me know if you feel any doubt in my answer (if you dont want like that kind of answer)

happy coding

radhakrishna.p 29 Posting Whiz in Training

in addition to that please remove '%n' and replace it with '\n'

note : i dont know exactly if you are using %n for any special reason (leave it as it is if there is no special reason)

System.out.printf("%d. %s?%n", number, quizBank[number].question);

let me know the status

radhakrishna.p 29 Posting Whiz in Training

hai darylglenng

i got the answer for your problem (if my assumption is right) and what you just need to do is

add 1 more question to your existing questions list with the same index 0 as follows (try to copy and paste it to your code as it is)

quizBank[0] = new Wow();
quizBank[0].question = "my adddtional question";
quizBank[0].answer = "adtinal question answer here";

please check it once

let me know the status

happy coding

radhakrishna.p 29 Posting Whiz in Training

hai to all,

by look at your code the following these 2 things might be the one reason for the above problem i thought

at line no 44 and 45 of HangmanFrame class

you declared the 2 class variable references as a instance variavbles as follows

private HangmanGame game;
private WordGenerator myWord;

but those 2 references are declared but not instanciated at all thats the reason you got the NullPointerException

but inside the constructor you created those 2 objects but those references scopes are limited to inside the constructor only right.

i think you got my point

so replace these 2 line of inside the constructor

WordGenerator myWord = new WordGenerator();
HangmanGame game = new HangmanGame(myWord.getWord()); 

as follows

this.myWord = new WordGenerator();
this.game = new HangmanGame(myWord.getWord());

please try to do like that it may gives a solution i think

let me know the status after modifying the code

happy coding

Note: any comments are appreciated

radhakrishna.p 29 Posting Whiz in Training

find the <url_pattern> tag value of your servlet in the web.xml and provide that value/path in the href='your_servlet' tag as shown bellow

<a href="url_pattern_of_your_servlet"><strong>Vehicle</strong></a>

let me know status as well as if you have any doubt in my clarification

happy coding

radhakrishna.p 29 Posting Whiz in Training

hai f_atencia

i dont have great knowledge at coding side but i want to give a way to solution to your requirement.

please start as follows

steps:

  1. first replace '%'charecter with empty charecter in the given number string by using replace('%','');

  2. then find '.' symbol in the given number string by using split(".") or using indexOf('.') javascript functions
    (note: you didn't mention what we have to do for the number 45.67% having this kind of format in the above post)

if you are ready to use split(delimiter_charecter) funtion

then display the first part after the split(delimiter_charecter) function is applied to the string what we got in the first step

this is not the exact solution for your requirement but it gives the output for your requirement

try to start coding as described above

if you have any doubts in my clarification

let me know

any comments are appreciated

happy coding

radhakrishna.p 29 Posting Whiz in Training

my apologies for the above post i couldnt read the code properly that was my mistake

please go thru this

as bguild said,

move line 10 out side of the main() method. if do that then those are available to all the methods by changing variable usage like as follows

1.instead of using 'base' variable in the base() method

base = input.nextFloat();

replace as follows

this.base = input.nextFloat();  // this line says current class instance method using current class instace variable(if you are doing the assignments inside methods)

otherwise if you want to assign values to those varibles using class object reference do as folloes

class_ref_name.base = input.nextFloat(); // like as for other variables 

like this you do for the remaining variable

i think the following code would be better one (after modifying your class)

 class Area3
    {
      public Scanner input =null;
      public float base, height, area;
    public static void main(String args[]){

    // your remaining code
      input = new Scanner(System.in);
      Area3 tri = new Area3();
      // call those methods        
      // your remaining code 

    }// end of main

    public void base(){
            System.out.println("enter value for base");
           this.base = input.nextFloat(); 
    }

    public void height(){
           System.out.println("enter value for height");
           this.height = input.nextFloat(); 
    }

    public void area(){
          this.area=this.height*this.base/2;
        // your code 
    }
    }// end of class

then check it once remaining is as you wish

let me know the status

radhakrishna.p 29 Posting Whiz in Training

as bguild said,

move line 10 out side of the main() method. if do that then those are available to all the methods by changing variable usage like as follows

1.instead of using 'base' variable in the base() method

base = input.nextFloat();

replace as follows

this.base = input.nextFloat();  // this line says current class instance method using current class instace variable

like this you do for the remaining 2 variables

then check it once remaining is as you wish

let me know the status

radhakrishna.p 29 Posting Whiz in Training

hai Farhad.idrees,

i think you haven't passed any value to validate(some_value) . i dont know exactly whether that 'value' varible may takes default value for comparing .

as JorgeM said , the above reason might be the one .so make that if..else statements properly

one more thing
at line 7 and 8:

var minimum = document.getElementById('min').innerText

there is no innerText propety for an html element in javascript. you may use innerHTML for accessing data from label,div,span elements only

check those once

letme know the status

happy coding

radhakrishna.p 29 Posting Whiz in Training

hai adikimicky

please do as JamesCherrill said he is right

in order to send and receive data properly between sockets (client and server) we have to use same kind of data flow related classes in java

you used streams for receiving data at Client side but you are sending data to client which is irrelavent data type than at receiving side

replace the following code at your server side code from line no 22 to 24

OutputStream s1out=s1.getOutputStream();
DataOutputStream dos = new DataOutputStream(s1out);
dos.writeUTF("hello");
dos.flush(); // dont forget to call this method 
dos.close();

so that you will get the output as you want

let me know the status

happy coding
suggestion:

dos.flush(); // dont forget to call this method because which confirms that all the data has been sent
radhakrishna.p 29 Posting Whiz in Training

there is an event called onkeypress() for the textfeild input element of html. you can call the required function on that moment like as follows

<input type="text" name="you_text_feild_name" id="you_text_feild_id" onkeypress="your_function_name()"/>

please try to call your java script function as described above

so that you will get the output as you want

let me know the status

happy coding

radhakrishna.p 29 Posting Whiz in Training

we can achieve your functionality by using isNaN(value_of_your text feild) function of java script

the following URL gives better idea on your requirement and how to use the isNaN() function for your script code

http://javascriptexample.blogspot.in/2008/07/isnan-function.html

let me know if you have any doubts in my clarification

happy coding

radhakrishna.p 29 Posting Whiz in Training

suggetion :

place 'break' statement at the end of each 'case' statement in switch() statement

otherwise all three cases will execute for each time when the control comes in the switch() statement

happy coding

tux4life commented: Good catch! ;) +13
radhakrishna.p 29 Posting Whiz in Training

hai smurfy

i think you need to pass user details for getting Connection object for accessing Underlying database

but i couldn't find the user details in your connection string url code

what i mean is while creating connection object we need to pass the user details of the database for access (in otherwords need access permisions)

so your connection string should be like as follows

String dbURL = "jdbc:derby://host_name:port_number/database_name;create=true;user=me;password=mine";

then pass that connection string url to the getConnection(dbURL) method (as you done previously)

thats it

i think that might be the problem in your code

please go through the following URL it gives brief idea on how to connect Derby Database clearly

http://db.apache.org/derby/integrate/plugin_help/derby_app.html

if you have any doubts in my clarification

let me know the status

happy coding

radhakrishna.p 29 Posting Whiz in Training

hai Edwinner,

can you explain what you are going to do with the following query

$query = ("UPDATE customers SET firstname = '$firstname' OR lastname = '$lastname' OR phone = '$phone' OR address = '$address' OR city = '$city' OR state = '$state' OR zip = '$zip' WHERE customernumber = '$id'");

Note: dont need of paranthesis at thw begining '(' and end ')'of the above statement

radhakrishna.p 29 Posting Whiz in Training

i think you have to use jquery live() function to effect the chages immediately

i am giving a sample example to apply css dynamically using live() function

here is the code i think it may helps you a lot

<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script>
$(document).ready(function(){

  var style_status = 1;

  $("button").live("click",function(){
  if(style_status == 1){
      $("#my_id").removeClass("mystyle");
      $("#my_id").addClass("mystyle2");
      style_status = 0; 
  }else{
      $("#my_id").addClass("mystyle");
      $("#my_id").removeClass("mystyle2");
      style_status = 1; 
  }

  });
});
</script>
</head>
<style type="text/css">
.mystyle{
    color:green;
    font-size: 100px;
}

.mystyle2{
    color:red;
    font-size: 50px;
}

</style>
<body>

<p>This is a paragraph.</p>
<div id="my_id">asdfasdfdas fasdfas d fasd fasdfasd f </div>
<button>Click me!</button>

</body>
</html>

use live function appropriately as your need then its work fine

let me know the status

happy coding

radhakrishna.p 29 Posting Whiz in Training

at line 12-14 i think you need to change the argument type what i mean is

your

printString(chr *string)

method expects address of the variable/ pointer varible instead of passsing value of the variable while calling the method

but you called this method by passing the value directly so that is the reason you got skipping over the function call

please check by placing the bellow format of calling code from line 12-14

printString(&a);

instead of

printString(a);

modify remaining code accordingly

its works fine

let me know the status after the modifications

happy coding

radhakrishna.p 29 Posting Whiz in Training

try like this:(whenever you want to change the class name )

for adding class propery to a element (i.e div,table,....etc)

$("id-or-name-or-referenceof-ele").addClass("your-class-name-here");

for removing class property of a element

$("id-or-name-or-referenceof-ele").removeClass("your-class-name-here");

it may helpful to you. in case if you have any doubt on my clarification

let me know the status

happy coding

radhakrishna.p 29 Posting Whiz in Training

suggestions:

before storing a random number into the given array we have to consider 2 things

  1. whether array contains desired number of random numbers or not (to print the final array elements)

  2. whether the generated random number is existed in the array previously or not

if we achieve those 2 things then we will get the result as you expected

the following code does 2 things which i have explained above

import java.util.Random;

public class RandomizedArrayExample
{
    public static int[] myNumbers = null;    
    public static void main(String[] args)
    {
      try
      {
          myNumbers = new int[6];
          System.out.println(" my initial values ");
          for (int i = 0; i < myNumbers.length; i++) {
               System.out.println(myNumbers[i]);
          }

          Random r = new Random();
          int total_elements_cnt = 0;
          boolean loop_status = true;

          while(loop_status)
          {
              int next_num = r.nextInt(42)+1;          
              if(!isCompleted()){
                  if(!isDuplicate(next_num)){
                      myNumbers[total_elements_cnt] = next_num;
                      total_elements_cnt++;
                  }else{
                      continue;
                  }
              }else{
                  loop_status = false;
              }
          }
          System.out.println("-------- my final values -------------");
          for (int i = 0; i < myNumbers.length; i++) {
               System.out.println(myNumbers[i]);
          }
      } catch (Exception e) {
          e.printStackTrace();
      }
  }

  public static boolean isCompleted(){
      boolean status = true;
      for (int i = 0; i < myNumbers.length; i++){
          if(myNumbers[i]==0){
              status = false;
              break;
          }
      }
      return  status;
  }

  public static boolean isDuplicate(int num){
      boolean status = false;
      for (int i = 0; i < myNumbers.length; i++){
          if(myNumbers[i]== num){
              status = true;
              break;
          }
      }
      return  status;
  }
}

check it once and let me know the status

happy coding

radhakrishna.p 29 Posting Whiz in Training

we can achieve this by using AttributedString class which is available in java.text.*; package

the following url's may help you for this

http://www.java2s.com/Code/JavaAPI/java.text/TextAttributeSUPERSCRIPT.htm

http://www.daniweb.com/software-development/java/threads/186751/printing-powers-in-java

please check it once

radhakrishna.p 29 Posting Whiz in Training

hai pssingh1001,

have you gone through the URL which i have posted initially?( see top most one)

thats help you a lot for this kind of requirement

please check its one and let me know the status

happy coding

radhakrishna.p 29 Posting Whiz in Training

please also check the value of $result by echoing it
because for loop execution is based on this value

if the vaue of the $result variable is '0' then there is nothing to display

so please check & echo the value of $result variable also

happy coding

radhakrishna.p 29 Posting Whiz in Training

hai adikimicky,

suggestions (for better programing):

make your connect method signature as follows

public void connect(String user_name,String pass){
//  your code here
}

at line 59 pass username and password values to connect() method.so that line will be as follows

connect(userName,passWord);

then finally chage the query as follows

String str = "insert into Table1 values('"+user_name+"','"+pass+"')";

thats it

happy coding

radhakrishna.p 29 Posting Whiz in Training

.js is the extension of java script file (if you want to place the script code in a seperate file) and

bellow is the place where you want to place your script code with in a web page

<script type="text/javascript">

     // your script code 

    </script>
    (or)

    <script type="text/javascript" src="path_to_external_javascript_file.js">

     // your script code 

    </script>

this section of code will load automaticaly into browser based on the place where you put (what i mean is you can place this section at header part of the page or at body part ... etc)

please go thrugh the followlink which gives brief description about java script and its usage as well as examples

Click Here

[Click Here](http://www.tutorialspoint.com)

radhakrishna.p 29 Posting Whiz in Training

hai pssingh1001,

please be more informative in your requirement (i.e what do you want and what do you have so far)

explain briefly so that we will help you

radhakrishna.p 29 Posting Whiz in Training

can you please explain the requirement clearly?
so that we are here to help you

radhakrishna.p 29 Posting Whiz in Training

hai noorjan ,

follow the bellow link if your project type is swing based application

http://www.daniweb.com/software-development/java/threads/447192/trying-to-show-image-from-mysql-to-jtable

radhakrishna.p 29 Posting Whiz in Training

you misssed sigle quotation mark where i showed BOLD letters in your code (at + sign before input tag started at the end)

$('#left_bar .cart-info').append('<div>'+localStorage["myid"] = document.getElementById("myid").value =parseInt(localStorage["myid"] || "0", 10) + 1;'+'<input id="myid" type="text" name="itemquantity[]" value="1"/></div>');

let me know the status after updating the code