How to use JDBC to connect to oracle7.3.4 on remote host
I have written a small applet which runs fine on one host(Solaris
box)using appletviewer. In this program I am trying to connect
to oracle on another host and the program is working fine. The
same applet is not working from a web page.
can anyone help me out?
giving error like netscape.security.AppletSecurity.exception
and lot more exception
null
You are restricted by the Java security sandbox from connecting
directly to another machine through the applet. You have to use
a JDBC driver located on the web server machine. Please make
sure you have installed this properly, as in appended a valid
JDBC .jar archive to your CLASSPATH.
Openlink Software has robust JDBC drivers that enable scrollable
(rowset driven) cursors. You may be interested in checking out
http://www.openlinksw.com for further info.
Our latest JDBC drivers are found at
ftp://ftp.openlinksw.com/pre-3.2/index.html
(scroll down to the very bottom - Windows section - don't worry,
they're platform independent!)
Best regards
BVReddy (guest) wrote:
: I have written a small applet which runs fine on one host
(Solaris
: box)using appletviewer. In this program I am trying to
connect
: to oracle on another host and the program is working fine.
The
: same applet is not working from a web page.
: can anyone help me out?
: giving error like netscape.security.AppletSecurity.exception
: and lot more exception
null
Similar Messages
-
How to use JDBC database connection in Solaris
Hi all,
I am new to Solaris and i want to create an application using JDBC database connection.
I want a small piece of code, probably a login page code that verifies the username from a OpenOffice database (.odb) file. I am particular to know the driver name, etc. If possible give the code using JNDI loopkup.
Thanks in advance,
Parasou.Sure no problem.
Please stand by while I do your work for you. -
How to use jdbc to connect oracle
I want use jdbc direct to connect oracle database,and I
want to use sun Company or oracle Company driver. how can I get driver and how do I write connection string?
Deeply to wait your reply,thank you!The correct format would be jdbc:oracle:thin@server:port:sidTry "jdbc:oracle:thin:@192.168.84.20:1521:ORDB","ysys","fareast"and see what happens.
Note that you two formats for the DriverManager.getConnection() method; if DriverManager.getConnection(db_url, username, password) doesn't work, try the other call with a fully-qualified database url:DriverManager.getConnection("jdbc:oracle:thin:ysys/[email protected]:1521:ORDB")The SID is the server ID that was given to the instance when the database was installed; default is ORCL, but may have been changed. Port default is 1521, but again, this may be different for your system. -
How to use JDBC to connect Oracle databse
Hi
I try to connect the oracle databse by using JDBC. But I not sure whether is it correct or not because I learnt from the documentation provided by WWW.JAVA.SUN.
I have create a ODBC DSN file call TKS username/password : tem/manager
then I download the source code and enhance a bit as following :
import java.sql.*;
public class CreateCoffees
public static void main(String args[])
String url = "jdbc:oracle:thin:tem/manager@(
description=(address_list=(
address=(protocol=tcp)
(host=192.9.200.8)(port=1521)))(source_route=yes)
(connect_data=(sid=tks)))";
Connection con;
String createString;
createString = "create table COFFEES " +
"(COF_NAME VARCHAR(32), " +
"SUP_ID INTEGER, " +
"PRICE FLOAT, " +
"SALES INTEGER, " +
"TOTAL INTEGER)";
Statement stmt;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
catch(java.lang.ClassNotFoundException e)
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
try {
con = DriverManager.getConnection(url, "tem", "manager");
stmt = con.createStatement();
stmt.executeUpdate(createString);
stmt.close();
con.close();
catch(SQLException ex)
{ System.err.println("SQLException: " + ex.getMessage());
After that I saved the file as CreateCoffees.java and compiled it
D:\KLTAY\JAVA>javac CreateCoffees.java
CreateCoffees.java:6: unclosed string literal
String url = "jdbc:oracle:thin:tem/manager@(
^
CreateCoffees.java:10: unclosed string literal
(connect_data=(sid=tks)))";
^
CreateCoffees.java:30: cannot resolve symbol
symbol : variable con
location: class CreateCoffees
con = DriverManager.getConnection(url, "tem", "manager");
^
CreateCoffees.java:31: cannot resolve symbol
symbol : variable con
location: class CreateCoffees
stmt = con.createStatement();
^
CreateCoffees.java:34: cannot resolve symbol
symbol : variable con
location: class CreateCoffees
con.close();
^
5 errors
Please give some advise.Thanks
best regards,
TayString url = "jdbc:oracle:thin:tem/manager@(
description=(address_list=(
address=(protocol=tcp)
(host=192.9.200.8)(port=1521)))(source_route=yes)
(connect_data=(sid=tks)))";
After that I saved the file as CreateCoffees.java and
compiled it
D:\KLTAY\JAVA>javac CreateCoffees.java
CreateCoffees.java:6: unclosed string literal
String url = "jdbc:oracle:thin:tem/manager@(
^
CreateCoffees.java:10: unclosed string literal
(connect_data=(sid=tks)))";
^I would suggest putting all code between the quotesj(") on one line and then attempting to recompile. -
-How to use JDBC to connect the SQLServer and Oracle.
Hi,
I create a table in the WIP DB, I want to modify this table when use "PRE-START" activity in POD.
SAPME version: 5.2.3.4 SDK:2.0 DB:SQL2005 and Oracle 10.2g
SourceCode like below:
public void execute(StartHookDTO dto) throws Exception {
initServices();
try{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=SAPMEWIP", "sa" ,"sap12345");
conn.close();
}catch(Exception e){
e.printStackTrace();
Besides, I already setup the JDBC ClassPath in ConfigTool, but it gets somes error when executing.
the error code like below:
java.sql.SQLException: No suitable driver
Please give me some support or a example, thank you so much!
Br,
AlexYou probably want to use the WIP Datasource defined in JNDI.
-
How to use JDBC to connect informix database
Dear all,
I want my client application to connect informix database by using JDBC. The JDBC driver has been installed successfully in the client computer (Win2000). The informix 5.0 resides the a Unix server named "dbserver". The following is my java program.
========================
import java.sql.*;
import java.awt.event.*;
public class Application1 {
public static void main(String[] args) {
Connection conn;
try
Class.forName("com.informix.jdbc.IfxDriver");
catch (Exception e)
System.out.println("Error "+e.getmessage());
e.printStackTrace();
return;
System.out.println("It is ok");
try
conn = DriverManager.getConnection("jdbc:informix-sqli://dbserver:1526:INFORMIXSERVER=dbserver;username=test;password=******");
catch (SQLException e)
System.out.println("ERROR ."+e.getMessage());
e.printStackTrace();
return;
System.out.println("All is fine");
===========================
However, the error appears mentioning "Attempt to connect to database server (dbserver) failed." I don't know what the problem is because my informix database server is exactly "dbserver".
Kindly need help from you guys. Thanks in advance.
KevinHi,
Plz try this (instead of 'username' use 'user') ...
DriverManager.getConnection("jdbc:informix-sqli://dbserer:1526:INFORMIXSERVER=dbserver;user=test;password=*****");
or this (pass the username and password as params)....
DriverManager.getConnection( "jdbc:informix-sqli://dbserer:1526:INFORMIXSERVER=dbserver" , "test" , "*****" );
Hope this helps
ssa.
>
I want my client application to connect informix
database by using JDBC. The JDBC driver has been
installed successfully in the client computer
(Win2000). The informix 5.0 resides the a Unix server
named "dbserver". The following is my java program.
========================
import java.sql.*;
import java.awt.event.*;
public class Application1 {
public static void main(String[] args) {
Connection conn;
try
Class.forName("com.informix.jdbc.IfxDriver");
catch (Exception e)
System.out.println("Error "+e.getmessage());
e.printStackTrace();
return;
System.out.println("It is ok");
try
conn =
onn =
DriverManager.getConnection("jdbc:informix-sqli://dbser
er:1526:INFORMIXSERVER=dbserver;username=test;password=
catch (SQLException e)
System.out.println("ERROR ."+e.getMessage());
e.printStackTrace();
return;
System.out.println("All is fine");
===========================
However, the error appears mentioning "Attempt to
connect to database server (dbserver) failed." I don't
know what the problem is because my informix database
server is exactly "dbserver".
Kindly need help from you guys. Thanks in advance.
Kevin -
How to use JDBC to connect Tomcat with database server?(Urgent!)
I try to deploy the tomcat and make it connect with databaser server.
I am using mysql connector J 3.0. I added the CLASSPATH of mysql-connector-java-3.0.7-stable-bin.jar in the tomcat.sh .
I also add the web application in server.xml.
When I start tomcat, I can see using Classpath including mysql-connector-java-3.0.7-stable-bin.jar .
But when i browse my jsp including the jdbc, wait for a while, I get a message as following: Timeout on server localhost. My web server and database server is same computer.
Could you tell me what's wrong?Did you check to see that the MySQL database was indeed up and running, and accepting connections when you started Tomcat? Did you make sure that your firewall permits connections to the database?
Timeout errors generally occur when you send a request to a server and the server does nothing with it - i.e., it doesn't respond to it in any way. Most firewalls are configured this way. If I telnet to your machine and I get "connection refused", I know your machine exists and I can try hacking into it. If I telnet and get nothing at all, then I will either assume either there's no actual machine at that address or it's unresponsive. -
How to use JDBC Connection Pools in a standalone application?
Hi, there,
I have a question about how to use JDBC Connection Pools in an application. I know well about connection pool itself, but I am not quite sure how to keep the pool management object alive all the time to avoid being destroyed by garbage collection.
for example, at the website: http://www.developer.com/java/other/article.php/626291, there is a simple connection pool implementation. there are three classes:JDBCConnection, the application's gateway to the database; JDBCConnectionImpl, the real class/object to provide connection; and JDBCPool, the management class to manage connection pool composed by JDBCConnectionImpl. JDBCPool is designed by Singleton pattern to make sure only one instance. supposing there is only one client to use connection for many times, I guess it's ok because this client first needs instantiate JDBCPool and JDBCConnectionImpl and then will hold the reference to JDBCPool all the time. but how about many clients want to use this JDBCPool? supposing client1 finishes using JDBCPool and quits, then JDBCPool will be destroyed by garbage collection since there is no reference to it, also all the connections of JDBCConnectionImpl in this pool will be destroyed too. that means the next client needs recreate pool and connections! so my question is that if there is a way to keep pool management instance alive all the time to provide connection to any client at any time. I guess maybe I can set the pool management class as daemon thread to solve this problem, but I am not quite sure. besides, there is some other problems about daemon thread, for example, how to make sure there is only one daemon instance? how to quit it gracefully? because once the whole application quits, the daemon thread also quits by force. in that case, all the connections in the pool won't get chance to close.
I know there is another solution by JNDI if we develop servlet application. Tomcat provides an easy way to setup JNDI database pooling source that is available to JSP and Servlet. but how about a standalone application? I mean there is no JNDI service provider. it seems a good solution to combine Commons DBCP with JNID or Apache's Naming (http://jakarta.apache.org/commons/dbcp/index.html). but still, I don't know how to keep pool management instance alive all the time. once we create a JNDI enviroment or naming, if it will save in the memory automatically all the time? or we must implement it as a daemon thread?
any hint will be great apprieciated!
SamTo my knoledge the pool management instance stays alive as long as the pool is alive. What you have to figure out is how to keep a reference to it if you need to later access it.
-
How to use JDBC Lookup in PI 7.1 ?
Hi,
Please advise how to use JDBC lookup in message mapping PI 7.1 ? any reference link / document ?
I have followed this step below :
1. Create the external definition for the database table.
2. Use the external definition (table) in message mapping JDBC Lookup.
But the target still "Yellow colour" meanint the mapping hasnot completed yet ? why ? and when i double click the JDBC lookup
there some error message
"No suitable parameter found; define new parameter of type 'Channel' first"
Please advise.
Thank You and Best Regards
FernandHi Fernand,
JDBC Lookup can be done in PI 7.1 using below mentioned steps :
1) Create a communication channel between PI and the database to connect to database.
2) Import the table data as External Definition.
3) In message mapping where this lookup is to be used select JDBC Lookup under Conversions and map
4) Double Click on JDBC Lookup
5) Select parameter and a database table (imported as the external definition). All the elements of the table will appear in the middle column. Select and move the input parameters to the left side column and the output parameters to the right side column. Click OK.
6) Under message mapping go to signature tab and define the parameter as channel and category as JDBC Adapter Type.
7) Under Operation mapping define the parameter & associate it with parameter defined in Message Mapping.
Thanks
Amit -
Is there any documentation on how to use JDBC in ALBPM?
I'm trying to connect to a DB using DriverManager class.
1) I've defined an externalResource of type SQL Database.
2) When I execute the following code:
//externalResourceURL is the URL of the SQL Database external resource created in 1), same for user and password
con as java.sql.Connection = DriverManager.getConnection(arg1=externalResourceURL, arg2=user, arg3=password)
3) I get the following error: This driver is locked for use with embedded applications.
Is there any tutorial or documentation on how to use JDBC in ALBPM?
Thanks in advanceI don't know of any documentation off hand... but what are you trying to do? I haven't needed to to make a connection using the DriverClass....
If you aren't using dynamicSQL... you can just catalog the database, and make direct sql calls (not recommended)... but if you catalog it, then just an INSERT command works... or UPDATE... etc
logMessage "Starting insert."
INSERT INTO MYTABLE(id, name) VALUES ("2", "kevin");
logMessage "Finished insert."Check out the studio help under SQL Keywords for more info on that...
HTH
-Kevin -
I want to use jdbc to connect MS SQL SERVER
hi,
I want to use jdbc to connect MS SQL SERVER,not the jdbc-odbc bridge.
I download the driver from MS,deploy it,but when I connect the database such as:
<%Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");%>
<%String sConnStr="jdbc:microsoft:sqlserver://computer2000:1433";%>
<%Connection conn=DriverManager.getConnection(sConnStr,"sa","123");%>
<%Statement stmt=conn.createStatement();%>
but it said
javax.servlet.ServletException: com.microsoft.jdbc.sqlserver.SQLServerDriver
java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
how can i work out this problem
maybe my configure is wrong,please give me a successful sample configuration
thanks a lotHi,
I am not sure where you have got the following code from
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
What happens here, is Java Runtime will search for the Class named:
com.microsoft.jdbc.sqlserver.SQLServerDriver
If this Class is not in the Runtime Classpath, it will throw the Error that you have got. Kindly get the proper driver as well as ensure that the Class is available in the Runtime Classpath.
Thanks and regards,
Pazhanikanthan. P -
Junit : how to create JDBC URL connection
hi folks,
I am implementing JUnit in my application , for that I have seen srdemo application every thing is fine but i havent get how to configure JDBC URL connection 'SRServiceLocalTesting' ? can any body tell me how to do it.
Thanks in advance
Regards
PravinHi,
Have a look,
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_xml-to-table/odi_project_xml-to-table.htm
Thanks,
Guru -
How to used the internet connection adsl on my com...
how to used the internet connection adsl on my computer by nokia n73 me
i whant used the adsl connection in nokia n73 me by Bluetooth or cable
and thank youHi Theo,
There are several ways to implement this using simple timing features of LabVIEW. Two fairly simple methods are comparing system time stamps or using the Wait VI provided in the Timing palette. The time stamp comparison requires a little bit more programming, but can be included in your main program loop. To use the Wait function, you will probably need to construct a new loop parallel to your main loop. I have attached screenshots of these two implementations. Please let me know if you have any more questions.
Donovan
Attachments:
WaitDelay[1].Png 5 KB
TimeStampFalse.Png 11 KB
TimeStampTrue.Png 11 KB -
HT201205 how to use bluetooth to connect iphone to ipad???
how to use bluetooth to connect iphone to ipad???
what you do you expect them to be able to do with eachother ?
you can transfer files or data between them unless you find some 3th party program which does that
this is what ios devices support in terms of bluetooth profiles
http://support.apple.com/kb/ht3647
this is the full list of all bluetooth profiles (even your computer only support a fragtion of the list)
http://en.wikipedia.org/wiki/Bluetooth -
How to use the same services-config for the local and remote servers.
My flex project works fine using the below but when I upload my flash file to the server I doesn't work, all the relative paths and files are the same execpt the remote one is a linux server.
<?xml version="1.0" encoding="UTF-8"?>
<services-config>
<services>
<service id="amfphp-flashremoting-service"
class="flex.messaging.services.RemotingService"
messageTypes="flex.messaging.messages.RemotingMessage">
<destination id="amfphp">
<channels>
<channel ref="my-amfphp"/>
</channels>
<properties>
<source>*</source>
</properties>
</destination>
</service>
</services>
<channels>
<channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
<endpoint uri="http://localhost/domainn.org/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>
</channels>
</services-config>
I think the problem is the line
<endpoint uri="http://localhost/domainn.org/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
but I'm not sure how to use the same services-config for the local and remote servers.paul.williams wrote:
You are confusing "served from a web-server" with "compiled on a web-server". Served from a web-server means you are downloading a file from the web-server, it does not necessarily mean that the files has been generated / compiled on the server.
The server.name and server.port tokens are replaced at runtime (ie. on the client when the swf has been downloaded and is running) not compile time (ie. while mxmlc / ant / wet-tier compiler is running). You do not need to compile on the server to take advantage of this.
Hi Paul,
In Flex, there is feature that lets developer to put all service-config.xml file configuration information into swf file. with
-services=path/to/services-config.xml
IF
services-config.xml
have tokens in it and user have not specified additional
-context-root
and this swf file is not served from web-app-server (like tomcat for example) than it will not work,
Flash player have no possible way to replace token values of service-config.xml file durring runtime if that service-config.xml file have been baked into swf file during compilation,
for example during development you can launch your swf file from your browser with file// protocol and still be able to access blazeDS services if
-services=path/to/services-config.xml
have been specified durring compilation.
I dont know any better way to exmplain this, but in summary there is two places that you can tell swf about service confogiration,
1) pass -services=path/to/services-config.xml parameter to compiler this way you tell swf file up front about all that good stuff,
or 2) you put that file on the webserver( in this case, yes you should have replacement tokens in that file) and they will be repaced at runtime .
Maybe you are looking for
-
Unable to load impl class error after WAR file rebuilt
Hi I have the source code for a working WAR file. I wanted to make a small change to the code and rebuilt the WAR. Now the previous WAR version works but even when I rebuild the WAR from the unedited code I get the error "unable to load impl class" a
-
Black background in native Display List elements overlayed with Starling
Hello, I'm having an issue in the iPad, where all native DisplayObjects are shown with an opaque black background instead of being transparent while being displayed over Starling graphics using "nativeOverlay". This doesn't happen in the PC, in ADL,
-
Looking for a script to connect bodytext to footnote and cross-references
Hi, Need to do the following: I was provided with separate (tagged-text) files: bodytext, (foot)notes and cross-references. Now I am looking for a solution (script?) that can do the following: to restore the connection between the body-text, the foot
-
Event handling issue in firefox
This script works well in IE. In Firefox, select looses focus. Event fires, when u click on other element then control moves to next element. I want to stay focus on the same textbox till user enters correct phone no in Firefox. How to make this scri
-
Hi team. I have a 4.6 C version an the import / export works fine. But in the SAP ERP Central Component 5.0 I do the Export. Review the abap memory and se the areas, but empty. And when I do the import the data are clear. Do you have any idea. And i