Bassam_Basamad
asked on
Connect To Database From Within Java Applet
Dear Experts,
Can I do connect to database (i.e. SQL Server,Oracle or SQL CE 4.0) from within Java Applet,?
if not, is there any ways to do communcation between applet and any database?
Thank you,
Can I do connect to database (i.e. SQL Server,Oracle or SQL CE 4.0) from within Java Applet,?
if not, is there any ways to do communcation between applet and any database?
Thank you,
Yes you can connect to the databse from Applet if the instance is running on the
same host as web server
same host as web server
Applet, even unsigned, allows network connections to the server from which it was loaded,
therefore if your database instance is running on the same server as the web server
from which you loaded applet, then you can connect to database - I did this way may times.
Signed applet can connect to other servers, but signing is rather painful operation,
and installing web server is usually rather simple, so you can isntall and setup web server
on the same server where you have database and in this way be able to access it from applet.
therefore if your database instance is running on the same server as the web server
from which you loaded applet, then you can connect to database - I did this way may times.
Signed applet can connect to other servers, but signing is rather painful operation,
and installing web server is usually rather simple, so you can isntall and setup web server
on the same server where you have database and in this way be able to access it from applet.
ASKER
Normally the applet can be accessed from client browser so in the client browser there is no Oracle or SQL Server running, is it possiple to run this code inside the applet within client browser not on the server or web server.
Thank you
Thank you
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No, of course you don't have database on the client machine, you can have web server (not to be mixed up with web browser) on the same machine
as Oracle database - your client will only have browser and applet will run in his browser, but it can
communicate wityh your server, where you have databse, and from which it could have been loaded if it also had web server.
as Oracle database - your client will only have browser and applet will run in his browser, but it can
communicate wityh your server, where you have databse, and from which it could have been loaded if it also had web server.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Could you please, post any working example to connect to SQL Server, SQL CE (Recommended) or Oralce from within Applet,
Thank you,
Thank you,
I posted the code above how to connect to Oracle - this code
is indpendent whether you need to connect from Java application or applet - all
connection details will be the same
is indpendent whether you need to connect from Java application or applet - all
connection details will be the same
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The only thing that you'll have to have jdbc driver - and these drivers - they are pure java - jar files
will be different for Oracle and for SQL server - you want to decide which one you will be using
and then download them eiither from Oracle or from Microsoft
will be different for Oracle and for SQL server - you want to decide which one you will be using
and then download them eiither from Oracle or from Microsoft
ASKER
Thank you for helpful answers, actually what I need to do is connecting my applet to SQL CE database, to read some settings before it launch,That's why I have used the Web service to call from wihin applet, and that web service can connect to this SQL CE,and return XML data as settings but I have faced a problem when I browse the page from remote pc not in the same local pc.
Can you help me, in this issue please,
I have post this question in another post, can you look at it,please?
https://www.experts-exchange.com/questions/26838137/Applet-And-NET-web-Service-Calling.html
Thank you
Can you help me, in this issue please,
I have post this question in another post, can you look at it,please?
https://www.experts-exchange.com/questions/26838137/Applet-And-NET-web-Service-Calling.html
Thank you
ASKER
Doesnot provide a way to SQL CE in java.
Open in new window