stephen84s 550 Nearly a Posting Virtuoso Featured Poster

606

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Looking at the exception it seems that Netbeans can't find the Persistence provider for your EntityManager.
In simple language *I think* it means that there is no JDBC driver for SQLite on your system or in the classpath. I cant guess any more possibilities since you have not provided any more information.

You can check this out if you are looking for a jdbc driver for SQLite.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

<EDIT> Ignore stultuske beat me to it

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

This sounds more like a Javascript question as opposed to a PHP question.
Well all you have to do is on the radio button you have to define an "onclick" (or onchange but it doesn't work with IE) event on the two radio buttons like below :-

<form>
  <input type="radio" id="radio1" name="radio2" onclick="document.getElementById('txt1').disabled=true"/>Beta <br />
  <input type="radio" id="radio1" name="radio2" onclick="document.getElementById('txt1').disabled=false"/>Gamma<br />
  <input type="text" name="txt1" id="txt1" /><br />
</form>

Note onclick has been assigned the Javascript code that we wish to execute when someone clicks on the radio button.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Grrrr.............Why no FF ?

Water or Beer ?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

tan

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

602

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Hardly at all, I still have to discover myself.

Do you know the forbidden words on this thread ?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

598

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

India here.

~s.o.s~ commented: Better late than never, eh? ;-) +25
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Definitely I can,

But can I pass the same question to the next guy/gal ?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

586

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

This code and problom is here ,Anyone Who wish to contribute his knowlege then he can reply to this problom, otherwise for all those people who are roud then i am in advance asking them, please dont disturb me with your roud advoices,
many thanks

You wanted to send a file via SSH and I gave you the link to it, Unfortunately you still couldn't figure it out so I gave you the exact link to the page where the example was mentioned, Now do you want me to do the coding also for you. Also the code you have pasted here is for FTP connectivity not SSH, so definitely it shouldn't work.
Have you even gone through the examples mentioned in my previous link ??? Here I will paste the code for you:-

<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');

ssh2_scp_send($connection, '/local/filename', '/remote/filename', 0644);
?>

Also the same page contains an example for sftp :-

<?php
$srcFile = '/var/tmp/dir1/file_to_send.txt';
$dstFile = '/var/tmp/dir2/file_received.txt';

// Create connection the the remote host
$conn = ssh2_connect('my.server.com', 22);

// Create SFTP session
$sftp = ssh2_sftp($conn);

$sftpStream = @fopen('ssh2.sftp://'.$sftp.$dstFile, 'w');

try {

    if (!$sftpStream) {
        throw new Exception("Could not open remote file: $dstFile");
    }
   
    $data_to_send = @file_get_contents($srcFile);
   
    if ($data_to_send === false) {
        throw new Exception("Could not open local file: $srcFile.");
    }
   
    if (@fwrite($sftpStream, $data_to_send) === false) {
        throw new Exception("Could not send data from file: $srcFile.");
    }
   
    fclose($sftpStream);
                   
} catch (Exception $e) {
    error_log('Exception: ' . $e->getMessage());
    fclose($sftpStream);
}
?>

I bet …

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Yep, saw her there now.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

586

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Add some functionality, Compile it and run it and see if it behaves as you want.
Why do want our stamp of approval on it, its not like the world would come to an end if you get a compile error or a wrong output while trying out different combinations for a solution, you might end up discovering a lot more of the Java language that way.

BTW yes that is correct.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Dint know it existed, am in now. . . strange dani is not on daniweb's facebook group :P

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

582

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

578

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

FACEBOOK

Agree on that Facebook for me too

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

578 :P

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

574

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

570

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Can you tell me the architecture of the system ??

And how do you plan to validate users ??? Do you have a central database server or is it small school / college assignment where your database will be MS Access / etc and it will reside on the machine where the applet is running ??

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

566

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

562

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

CEO my foot, am pretty sure you are just lone programmer cum administrator cum janitor there.
And hope your so called firm goes bankrupt and rots in HELL.

Salem commented: Good post +23
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

558

anupam_smart commented: nice signature +3
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

If you want to use the HTTP API the it is pretty straight forward, you will need to use the java.net.URL and java.net.URLConnection classes in Java.

Here is a Java tutorial on how to work with URLs.
http://java.sun.com/docs/books/tutorial/networking/urls/index.html

Also following is an example illustrating how to perform HTTP POST in Java.
http://www.exampledepot.com/egs/java.net/Post.html

For SMPP however there is no in built support in Java, so you will need to find one of third party libraries. OpenSMPP is one such library. You will need to download the source code and build it using ant. Once you buid it using "ant", you will get the "smpp.jar" in the dist folder, the smpp.jar needs to be present in the classpath while you are compiling any projects which will be using OpenSMPP . Also the javadocs for it will be generated in the "doc" folder, the javadocs contain a few examples on how to connect to an SMPP service provider to send messages / receive messages.

Ezzaral commented: Good info. +15
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

i searched but i didnt find any thing suitable..i need to write that code in myapplication.. i haven't find any smaple code which will help a bit..

Thats because you did not spend enough time looking.
You just searched for 6 minutes and expect to discover everything. Why do you want people to spoon feed you their code, their effort ?? While you do not even care to take the time to search through the forums.

BTW what API does your SMS Provider support HTTP, SMPP, CMG ???? You haven't even cared to mention that.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Have you even bothered searching through the forums, I bet not because I myself have answered the same question nearly two or three times and just in case you are in too much of a hurry to even type the search query here you go ;-
http://www.daniweb.com/search/search.php?q=send+sms+via+java

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Firefox+NoScript+AdBlockPlus=solved problems

Yep thats what is working for me too.

But I have one observation, on my Windows machine I do not have any such problem, both in IE 8 beta as well as Firefox.

I encountered this problem only in my Firefox + OpenSuse combination (with Adblock Plus disabled of course). But then I also have the same problem with facebook too while playing the flash games, the menu tends to go behind the flash.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

First point I suggest is read the Read-Me thread which is the first thread in the JSP forum, You are performing database operations from directly withing your JSP page which is considered a bad practice, the above thread will guide you on how to go about organizing your code nicely so that when you get on real world projects in JSP you will be thorough with the right practice.

Now let us check how your coding is going on. First thing I see is you are failing to consider all the circumstances and you have just not traced mentally how your if and else if statements will be executed.

for ex consider this :-

if(user == null || user.equals("")) 
{
  response.sendRedirect("register.jsp?err = please fill the username");
}
else if (user != null)
{
  query = "select username from msUser where username like '%"+user+"%'";
}

In the "if" condition you are already checking wheteher user == null or blank user.equals("") so why do you need to check again in the else if (user != null) , the code in that else if block could been easily put in the else block.

Now just take a look at your query:-

select username 
from msUser 
where username like '%"+user+"%'

This would list all the users to you which contain the current user's username.
For example if the current user wants to register the user name as "dracula" and if a user called "dracula1" already exists then the …

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

BirthDay Cake - Icing

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

554

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Although I have never tried it, I have read the manual pages of both resolv.conf and resolver, and I found the following line which would interest you :-
This is from the resolv.conf manual page.

The resolver is a set of routines in the C library that provide access to the Internet Domain Name System (DNS). The resolver configuration file contains information that is read by the resolver routines the first time they are invoked by a process.

And this is from the resolver manual page:-

The res_init() function reads the configuration files (see resolv.conf(5)) to get the default domain name, search order and name server address(es). If no server is given, the local host is tried. If no domain is given, that associated with the local host is used. It can be overridden with the environment variable LOCALDOMAIN. res_init() is normally executed by the first call to one of the other functions.

So I guess you can read the resolv.conf file using resolver but I could not find any method that would actually write back to it.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Try Ctrl + Alt + F1 this should give you the command line, then try Ctrl + Alt + F7 and check if the desktop appears.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Hi,
Hi All,
Can anyone tell me about a library that helps me to read contents from /etc/resolv.conf file and also update the same file with new entries. Does this possible with Resolver library routines? Any useful links or sample programs regarding this? Thanks in advance.
Renjith

resolv.conf stores the DNS Servers your system should use, in plain text. Why would you want a special library to read it ???

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Then it is bad because i need to backup all my files and database when i am in ubuntu and use them in xp again. If i can't do this i think i should install ubuntu without vistual pc and make dual boot.
Is it logical?

Also forgot to mention, if you are going to take such a drastic step then instead of Virtual PC you could try VirtualBox, guest additions for virtual box are available for almost all major OSes.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I am not going to spoon feed you the exact steps and I do not prefer anyone bugging me for help via PM,
See the following, page it was already present in my earlier link, if you had cared yo take the time to read it, you would have found it out yourself.
http://in.php.net/manual/en/function.ssh2-scp-send.php

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well I this is a workaround I had done while using VirtualBox which had Ubuntu (the OS in my Virtual Machine), on my Windows XP laptop.

The folders in Windows XP on which network sharing is enabled, are accessible in Ubuntu.
All you have to do in your Ubuntu box is:-
Go to "Connect to Server", In the first drop down select "Windows Share (smb)", put the IP Address of your Host OS that is IP Address configured for your LAN card in XP, enter the "share name" which should be the name of your shared folder in Windows XP and click on Connect.

So you shouldn't need to take the pains to install and configure the samba server. Also if the architecture of VirtualPC is anywhere near VirtualBox I do not think you will be able to directly access the shares of the Ubuntu machine from Windows

Note: -
Ubuntu 8.04 has a bug which will not allow you to connect to a Windows share unless and until you specify a share name. in Ubuntu 7.10 this bug was fixed, so if you would not enter the share name in the Connect To Server dialog, it would show you all the available shared folders on the given machine. I do not know if it has been fixed in 8.10 .

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

That should be simple :-

SELECT * 
FROM customers
WHERE customers_id NOT IN (
  SELECT customers_id
  FROM orders
)
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

546

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Following is another site which gives you javadocs with examples.

http://www.kickjava.com

>>Performance<<
Programming in Java over the years, I have encountered quite a few myths (ex. making your variables and methods final), although the following article by Brian Goetz is nearly three years old, I still encounter these "myths" about Java quite a few times mostly from newbie programmers and sometimes even experienced developers.
http://www-128.ibm.com/developerworks/java/library/j-jtp09275.html?ca=dgr-jw22JavaUrbanLegends

Then theres the question of performance of Java both speed and memory management.
The following article again from Brian Goetz should put to rest anyone's doubts in the performance of Java in those sections:-
http://www-128.ibm.com/developerworks/java/library/j-jtp09275.html?ca=dgr-jw22JavaUrbanLegends

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

First thing you could do to help us is get rid of that SMS or Instant Messaging language to let us understand your problem better and get rid of the ".."s we are not playing fill in the blanks here, and finally use a spell check.

Next do not do database connectivity directly inside a JSP. And also paste the code of the JSP you are talking about, cause honestly what you are saying defies logic to me.

Also note when JSP is converted to a servlet, it is not executed. So no data will be fetched at the this time, Its just like when you write a normal Java application, during compile time the code is converted into a class file (it is not executed) and only when you specify "java <main-class-name>" it is executed and thats when the data fetching happens.

Please a sincere suggestion to you is first concentrate on the basics of the language before jumping in to advanced topics. What I have mentioned here would have been covered in any book on JSPs in the first or second chapter itself. The greatest towers in the world stand because they have a strong foundation underneath. Similarly you should never leave out the basics and just jump to advanced topics just to save time, in fact you will end up spending more coming back to the basics each and every time you run into any sort of trouble.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

This should help you understand how Javadoc comments should be written.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Ok. In the properties of www directory, it permites only root and it is not enabled. Also, there is not other option to let me add my user. How do i do it?

you need to run the chmod command or the chown as root, or using sudo whichever is more viable option for you. Also needless to say, it has to be done in the terminal and cannot be modified via the GUI. (Unless your distribution permits the root user to login via the GUI)

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Now consider your code:-

if (nummer[i] < 0 && nummer[i] > 9){

Now according to me since this is a char array, you numbers will be stored as chars and hence you will need to check for their ASCII equivalent values, or better you could just use the isdigit() function, to figure out if the current character is a valid digit or not.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

For that you will PHP bindings for libssh2.
You can check out one of them here or here.

Note both the links refer to the same extension.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

When you say "But this would be a security hazard since anyone and everyone will then be allowed to write to that folder.
", do you mean anyone on the Internet because, i am using this at home and only access to the Internet.

Also when i do

Chmod 757 /var/www/

it generates an error which says "bash : Chmod command not found". i am in terminal.

Well all you had to do was just copy paste the command from my post. But I still suggest rather than changing the permission to 757, you change the owner of the folder "www" to the one you are using.
If you are just using it at home then I guess it wouldn't be too much of a problem (as long as you do not have a static IP address), but according to me its always best to follow the safer practice everywhere especially if it doesn't take too much effort from your side.