Connecting to a database through the Proxy using JDBC
Hi,
I am working on core java.
I want to established connection to remote database(I am working on local network behind the proxy)
how can i do this using core java
thanks in advance
regards
Man479
The only issue I see here is configuring the proxy to allow the client program to connect to a certain port on the server. And that issue would normally be dealt with by asking the person who manages the proxy to set it up that way.
Similar Messages
-
Can i connect to the database through the internet
hi all
i installed a database oracle 8i enterprise edition on a pc that exists in a town far from me . i wonder can i connect to this database through the internet from my house
please i need a answer
thanks in advanceYou can connect from an Oracle client to any Oracle database in the world that meets certain requirements.
First you need an open network connection between the two points so either no firewall exists between the two stations or the firewall(s) have been configured to allow Oranet traffic. This means both databases must have access to the Internet and certain ports are open.
Second you will need the IP address and port for the remote listener, which in turn must be up and running on the target server.
Then you must have the Service Name or SID and a valid username/password combination for the target database. Plus the username must have create session privilege.
That should be about it.
HTH -- Mark D Powell -- -
I just bought my cintiq 12wx and was wonderding if i can connect it to my macbook pro 2011 through the thurderbolt using a mini displayport to vga adaptor? Please help!
Yes, it should work with a mini-displayport to VGA adapter. Since a 12wx also can take DVI you could use a mini-displayport to DVI adapter instead. Why go analog when you can keep it in digital!
I guess the usb is for the pen. -
How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.
If the data is on a remote server (for example, PHP running on a web server, talking to a MySQL server) then you do this in an AIR application the same way you would do it with any Flex application (or ajax application, if you're building your AIR app in HTML/JS).
That's a broad answer, but in fact there are lots of ways to communicate between Flex and PHP. The most common and best in most cases is to use AMFPHP (http://amfphp.org/) or the new ZEND AMF support in the Zend Framework.
This page is a good starting point for learning about Flex and PHP communication:
http://www.adobe.com/devnet/flex/flex_php.html
Also, in Flash Builder 4 they've added a lot of remote-data-connection functionality, including a lot that's designed for PHP. Take a look at the Flash Builder 4 public beta for more on that: http://labs.adobe.com/technologies/flashbuilder4/ -
Connecting to a database in JSP but using connection in bean
I have a bean which connects to a database which is as follows:
package MyPackage;
import java.sql.*;
public class DataSourceBean{
public DataSourceBean(){
public void setDriver(String driver) throws ClassNotFoundException {
Class.forName(driver);
public void setUrl(String aUrl){
url=aUrl;
public void setUsername(String aUsername){
username=aUsername;
public void setPassword(String aPassword){
password=aPassword;
public static Connection getConnection() throws SQLException{
return DriverManager.getConnection(url, username, password);
private static String url;
private static String username;
private static String password;
}I then connect to a database through my JSP page:
<jsp:useBean id="db" class="MyPackage.DataSourceBean" scope="application">
<jsp:setProperty name="db" property="driver" value="sun.jdbc.odbc.JdbcOdbcDriver" />
<jsp:setProperty name="db" property="url" value="jdbc:odbc:MyDB" />
</jsp:useBean>This opens the database for the session, but I then want to allow people to login using a seperate bean.
My question is how do I use the connection created in the JSP page above in my login bean?
I have also tried connecting to a database in my LoginBean by using:
DataSourceBean dsb=new DataSourceBean();
yet it doesn't recognise DataSourceBean for some reason.
BTW my book suggests opening up the database using scope="application" but to me it seems that keeping the database open is risky, is it OK to keep the database open for the whole session? do you have any other suggestions for accessing the database through my DataSourceBean?
Thanks for any help.hi shock,
there are a number of considerations when it comes to the database connections.
first of all is the database server yours or are you buying a hosting scheme?
if the database server is yours then you may consider building a database connection pool and keeping it in a session parameter. there's no harm in that because connections are opened as needed and closed when not needed. you can specify the minimum and maximum number of connections and connectio keep-alive times.
if you purchase your database from a host they possibly would object to having a db connection pool as connections are valuable for them. but in this case there is no harm to create a connection to the database per request because creating database connections are costly only for the database server. your application will not slow down that much.
for performance check sites: www.crystaltours.com or www.seckinkonaklar.com
in both sites all connections are created per request and the complete content (including menus and application properties) comes from the database.
my suggestion is that if you are writing a commercial application that will be hosted in a server that is not yours then create a connection per request (no pooling here).
i also would suggest to put your database access code in a single class -not in a bean- for easy maintenance, you can use that class in your beans.
i hope this was your answer.
cem. -
I want to connect Visual foxpro database through forms6i.
Hi ,
I want to connect Visual foxpro database through forms6i.
actually i want to access Visual foxpro database in forms6i and retrive and update data from forms6i.
please help me urgently how can i do this in forms6i.
Thanks,
Md.Muniruzzaman Khan
Email : [email protected]do the following steps for hetrogenous service
Step 1
Create ODBC named Access1.
Step 2
Go to urs inithsodbc.ora file which reside at
ORACLE_HOME\hs\admin\inithsodbc.ora
and overrite by
# This is a sample agent init file that contains the HS parameters that are
# needed for an ODBC Agent.
# HS init parameters
HS_FDS_CONNECT_INFO = Access1
HS_FDS_TRACE_LEVEL = off
# Environment variables required for the non-Oracle system
#set <envvar>=<value>
Step 3
Add the following entry to the tnsnames.ora file:
ACCESS1.WORLD =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
(CONNECT_DATA=(SID=ACCESS1))
(HS=OK)
Step 4
Add the following entry into the listener.ora file:
(SID_DESC=
(SID_NAME=ACCESS1)
(ORACLE_HOME=D:\Oracle)
---Define urs oracle home path in mine case it is at D:\Oracle--
(PROGRAM=hsodbc)
Step 5
Reload the listener from contol panel services yours listener service
Step 6
Create a database link using:
CREATE DATABASE LINK access1.world CONNECT TO "MyUser" IDENTIFIED BY "MyPassword" USING 'ACCESS1.WORLD';
Step 7
Connect to scott/tiger
Query the table using:
SELECT *
FROM [email protected];
Step 8
Same you can connect to urs forms and write above sql in cursor
Acknowledge me.
Khurram Siddiqui -
How do I use GarageBand as a amp/speaker to listen to my Electronic Drum set? I have a MIDI-USB cord already but I can't figure out how to listen to my set through the software using my computer speakers?
If you want to listen to the sounds of your drum set, you should use an audio cable and connect it to the computer's line-in, then create a real instrument track.
If you use a Midi/USB interface, you'll have to create a software instrument track and select one of GB's drumsets as the instrument. Hopefully your drumset's midi notes are mapped to the right sounds in GB. -
I can't connect to MySQL database from The JSP Standard Tag Library
Hi All !
I have a problem, please help me anybody !
I don't connect to MySQL database from jsp page using JSTL tag but from servlet all work correctly. I set my path and put �mysql-connector-java-3.1.13-bin.jar� in ENVIRONMENT WinXP(classpath=C:\Java\jdk1.5.0_10\jre\lib\ext\mysql-connector-java-3.1.13-bin.jar) and in War project folder �WEB-INF/lib� and in [TomcatServer]\common\lib.
I have in folder�WEB-INF/lib� following files:
antlr.jar
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-fileupload.jar
commons-logging.jar
commons-validator.jar
jakarta-oro.jar
jsf-api.jar
jsf-impl.jar
jstl.jar
mysql-connector-java-3.1.13-bin.jar
standard.jar
struts.jar
I'm using:
NetBeans 5.5 Build200610171010 (bundled Tomcat 5.5.17)
Ent.Pack 20061020 Visual Wb Pack 061103
OS WinXP SP2
Java 1.5.0_10
MySQL 5.0.18-nt
1:<%@page contentType="text/html"%>
2:<%@page pageEncoding="UTF-8"%>
8: <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
9: <%@taglib uri="http://java.sun.com/jstl/sql" prefix="sql"%>
10:
11: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
12: "http://www.w3.org/TR/html4/loose.dtd">
13:
14: <sql:setDataSource var="ds"
15: driver="com.mysql.jdbc.Driver"
16: url="jdbc:mysql://localhost:3306/test"
17: user="root"
18: password="xxxx"/>
19:
20:
21:<sql:query sql="select name, age from People" var="res"
22: dataSource="${ds}"/>
I have received report on mistake when entered code at the top:
�/index.jsp [21;0] According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions�
I used instead of (dataSource="${ds}")->(dataSource="ds") but this did not work.
After build and run I have received
=========================================START=================================
HTTP Status 500
type Exception report:
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /index.jsp(21,0) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
root cause
org.apache.jasper.JasperException: /index.jsp(21,0) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:955)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:710)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Validator.validate(Validator.java:1489)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:166)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
Apache Tomcat/5.5.17
=======================================END================================
Error: "According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions" - but according to documentation such parameter possible.
BUT WHEN JOINING With DATABASE FROM SERVLET ALL WORK FINE.
I read this doc - [http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html], this applicable if I Tomcat Admin, but i'am not Admin
I simply user, i.e. I want to place its database on virtual host (Tomcat+(JSP-JSTL)+MySQL).
There is idea how can resolve this problem
Thank you in advance ;)For all how have similar problem.
Decision instead of these ways
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
it is necessary to indicate these
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -
I have a brand new MBP 15" Retina display. Decided to download and install OSX Mavericks before I did any other setup. However since I've done this installation the only website I seem able to browse is Apple's. Google just keeps coming up not able to connect through the proxy. I still have tons to do and need to be able to access a number of websites. I also cannot get to the App Store.
Does OSX Mavericks have an issue with proxy servers?
I am writing this on my MBP 13" Retina display on which I have NOT upgraded to OSX Mavericks and I am having no issues at all.
Help please?System Preferences / Security & Privacy / General tab / Allow apps downloaded from:
Change the settings. -
How connect to oracle RAC via the RSG using port forwarding
Hi all,
I got a problem trying to connect to oracle RAC via the RSG using port forwarding .
on command line i sue to connect :
sqlplus 'username/password@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=firstRACnode)(PORT=1521))(ADDRESS=(PROTOCOL=tcp)(HOST=secondRACnode)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=MSDP)))'
but when using port forwarding i forward the port 1521 to a local port and make ssh to the DB node ( as normal with other nodes but not RAC) but it never work with me for this situation
can any one give me a help ifthere is any changes should be done on the server side , or if any one faced such a problem and found a solution
Thanks,
Prathap.782011 wrote:
I got a problem trying to connect to oracle RAC via the RSG using port forwarding .
on command line i sue to connect :
sqlplus 'username/password@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=firstRACnode)(PORT=1521))(ADDRESS=(PROTOCOL=tcp)(HOST=secondRACnode)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=MSDP)))'Not exactly sure what you are attempting, but if you doing port forwarding via ssh, the basic approach is as follows:
Step 1
Create a ssh tunnel from local machine to remote db server. Forward any local port (should not be a well known port or a port in the private/dynamic port range) to connect to the database server's listener port. If the ssh tunnel is into the db server itself, the connection (port forwarding) can be on localhost (as the Listener should be listening on it). Alternatively use a public IP of that db server.
Example (using OpenSSH on Ubuntu 9.4):
Local server port 1527 tunneled to port 1521 on database server 192.168.0.100 using o/s account johnd (we connect to port 1521 on db server via 127.0.0.1):
ssh -X -f -N -o ServerAliveInterval=3 -L 1527:127.0.0.1:1521 [email protected]
Step 2
Run sqlplus and connect to the local fowarded port on localhost, using the applicable connection settings (e.g SID/Service Name, etc).
sqlplus scott/tiger@"(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1527)) (CONNECT_DATA=(SID=orcl) (SERVER=dedicated)))"Note that the Listener must not hand our connection off - as the case would be when using RAC for example and connecting via a Service Name and not a SID. We need the Listener that accepts our connection to immediately hand us over to the database instance (via either a dedicated server or a shared server dispatcher process). -
I'm trying to update my iPhone and it's connected to my computer through the USB port, but my iPhone is still saying to plug it into iTunes. How do I fix it?
This is what my screen looks like.
-
I can not log in to iMessage iOS 6 iPhone 5. Error says " Could not sign in. Pleasecheck your network connection and try again. I do have network connection since I can browse the web using wifi!
I have tried using cellular data connection or wifi and I can not sign in?Go to Settings>General>Date and Time>Set Automatically>On.
-
Connecting to Oracle 7.3.3.4 using JDBC
Hi all,
I found the below info in the Oracle JDBC FAQ. My questions are:
1. Is there any chance for me to connect to my 7.3.3.4 database server using any JDBC drivers? If yes, what version of drivers to use?
2. Is it true that to connect to an Oracle database, I can ONLY use JDBC drivers from Oracle and no where else?
Thanks!
Rgds,
Alvin
JDBC 7.3.4 drivers can talk to RDBMS 7.3.4.
JDBC 8.0.4 drivers can talk to RDBMS 8.0.4 and 7.3.4.
JDBC 8.0.5 drivers can talk to RDBMS 8.0.5, 8.0.4 and 7.3.4.
JDBC 8.0.6 drivers can talk to RDBMS 8.0.6, 8.0.5, 8.0.4 and 7.3.4.
JDBC 8.1.5 drivers can talk to RDBMS 8.1.5, 8.0.6, 8.0.5, 8.0.4 and 7.3.4.
JDBC 8.1.6sdk drivers can talk to RDBMS 8.1.6sdk, 8.1.5, 8.0.6, 8.0.5, 8.0.4 and 7.3.4.
JDBC 8.1.6 drivers can talk to RDBMS 8.1.6, 8.1.6sdk, 8.1.5, 8.0.6, 8.0.5, 8.0.4 and 7.3.4.I used the following code to call a stored
procedure via SQLJ:
try {
#sql [iCtx] {
CALL ibs.cvs_validate.validate_port_id(:IN record_id ,:IN poe_pod_flag,:IN port_id,:OUT error_code,:OUT error_message) };
where
"ibs" is the schema
"cvs_validate" is the package
"validate_port_id" is the procedure
The code runs fine, but to get it to compile
in JDeveloper 2.0, I had to disable the "Check SQL semantics against database schema" option on the Project Properties (SQLJ) property sheet.
null -
Unable to connect to SQL database through ODBC calls
I have been looking around for an answer to this, but haven't found the exact issue I'm seeing.
I have several Excel spreadsheets which have been working until recently, which use an ODBC call to a remote SQL database. The database is running, remote connections are allowed. The SQL server is in a domain which has no external trusts. Users with accounts
in this domain can remotely access the SQl databases through ODBC just fine. Users who do not have domain accounts in this domain are being denied access by their domain account, and the SQL authentication is not passed through, even though remote access is
set to allow "everyone", and the database is set to Windows authentication and SQL authentication. This worked until early this week (the spreadsheet was created in 2010), and I have been looking fruitlessly for a fix ever since. As far as I know,
no changes were made to group policy on this domain, and no changes were made to the server or database recently, except Microsoft patches. None of the patches this month looked like they would affect this.It works locally on the server and remotely for users in the same domain. I am trying to use the SQL account and password to connect to the database, but users from outside this domain fail to reach the SQL database for authentication. It looks like Windows
authentication is not passing the SQL credentials on if the windows authentication fails. I don't know how to resolve this. The only options in SQL are "Windows authentication and SQL authentication" or "Windows authentication only". The database is already
set to the first option. Somehow, I need to set the server to allow the SQL authentication even if the Windows authentication fails.
Hi pkuti01,
SQL Server mixed mode is "Windows Authentication and SQL Server Authentication", we have to restart SQL Server service after change the authentication to mixed mode.
In your case, have you got any error message/information if you faild connect to SQL Server via ODBC? If so, please post them to us for further investigation. Furthermore, here is an article regarding steps to troubleshooting SQL connectivity issues for
your reference. Please see:
http://blogs.msdn.com/b/sql_protocols/archive/2008/04/30/steps-to-troubleshoot-connectivity-issues.aspx
If you have any feedback on our support, please click
here.
Regards,
Elvis Long
TechNet Community Support -
Update Database Through XML file using SAP B1 business objects
Hello everyone,
I am facing a problem ie I am not able to update the Database(SQL 2000) through an XML file.
Though i am able to insert the data in the databse using xml file but unable to update that data.
The tables i want to update are OITM,ITM1,OITW. While i was trying to update the Databse i was getting an error ie " -1107 Object's key is not set".
I dont want to use DTW for importing or anything.
Kindly help me out why i am facing this problem asap...Hi Pranay,
My case was that I wanted to replicate an item from one company to another (I guess that's your case also). What I finally did is copy field by field the objects I needed. Later I've find out the solution given here,
Copy items between databases
but I haven't try it out. I expect your comments about it :).
Regards,
Ian
Maybe you are looking for
-
THis is what I did, but when I get to sync, it won't sync.....what do I doLynnLynn Preparation Before you connect any device to a new library go to the Devices tab of the the preferences panel via Edit > Preferences (Windows) or iTunes > Preferences
-
Incredible slowness with LaCie 250 usb drive when trying to delete files
I connected a LaCie d2 250 gigabyte drive to the usb port of the new Airport Extreme. When I try to delete a folder containing a a fairly large amount of data (40,000 files) it took approximately 30 minutes to tally the number of files and then anoth
-
I have recently tried to import mail from a Mac using Mail (2.0.5) to a computer using Mail (1.3.11). The imported folders appear but no mail is visible in the folders. Is there anything I am missing or is this even possible? I have tried switching t
-
I Recently updated my iPhone 4 to ios7, since my phone will not connect to my ihome. I use a dock extender because my phone won't fit with the case on, but it worked fine before I updated. How can I fix this?
-
Can MacBook Pro 13" change display card myself?
If I want to get a higher performance display card, can I change it myself?? Or it is disabled to change the card?