Problem with connection to multiple Databases
i'm trying to write a sql query that returns data from tables that reside in
different databases on different servers, STYX and MICA to be exact.
I log into STYX and write the following simple SQL statement (what is
returned is really irrelevant, i'm just trying to figure out the process
right now)
select a.reason_code, b.reason
from [email protected] a,
hedgessw.reason_code b
where a.reason_code = b.reason_code
hedgessw.reason_code is on STYX
the other table is on MICA
i get the following error code
ORA-02019: connection description for remote database not found
this seems to imply that i need to create a "connection description" for the
remote database before i can establish the link.
is this the case?
if so, how do i create this?
any help you can offer would be greatly appreciated!
thanks in advance
null
What error messages are you getting?
What happens when you try to display the page?
General comments
- JSPs shouldn't be connecting to databases. That should be done in the data access layer, not the view layer. Put the code in beans/java code.
- Why reinvent the wheel? There are a couple of excellent taglibs out there that already do DB connections. Check out the JSTL sql tags.
Similar Messages
-
Urgent: Problems with connecting to a database
I have problems with getting a connection to both Oracle and Access.
For Access I added the .jar files in my classpath.
For Oracle I don't know which files I should add to the classpath.
Here's the code:
To connect with Access:
public class AccessDatabase extends JFrame {
private Connection conn;
private Statement stmt;
public AccessDatabase() throws SQLException,IOException{
DriverManager.registerDriver(new easysoft.sql.jobDriver());
System.out.println("Connecting...");
conn= DriverManager.getConnection ("jdbc:odbc:easysoft:db1");
System.out.println("Connected");
stmt=conn.createStatement();
ResultSet r=stmt.executeQuery("select name,adress from Tabel1");
while(r.next()){
String a=r.getString("name");
String b=r.getString("adress");
System.out.println(a+""+b);
and for Oracle:
public class AccessDatabase extends JFrame {
private Connection conn;
private Statement stmt;
public AccessDatabase() throws SQLException,IOException{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
System.out.println("Connecting...");
conn= DriverManager.getConnection ("jdbc:odbc:easysoft:db1");
System.out.println("Connected");
stmt=conn.createStatement();
ResultSet r=stmt.executeQuery("select name,adress from Tabel1");
while(r.next()){
String a=r.getString("name");
String b=r.getString("adress");
System.out.println(a+""+b);
}}}For getting connection from oracle you need to do 2 things.
1-- As said earlier put classes12.zip in classpath
2. For getting connection use as below ---
instead of --conn= DriverManager.getConnection ("jdbc:odbc:easysoft:db1");
Use thin driver ---
conn = DriverManager.getConnection (jdbc:oracle:thin:@servername:portno , UserName,Password);
replace servername UserName,Password in code you will get the connection.
Thanks
Rakesh -
Problem with connection in Mysql database in struts application
Helllo
i've just started learning struts for my new project where i'm having problem in accessing mysql database
the datasource being defined in struts-config.xml is as follows:
<data-sources >
<data-source type="org.apache.tomcat.dbcp.dbcp.BasicDataSource">
<set-property property="driverClassName" value="com.mysql.jdbc.Driver" />
<set-property property="user" value="root" />
<set-property property="password" value="" />
<set-property property="minCount" value="" />
<set-property property="maxCount" value="" />
<set-property property="description" value="A" />
<set-property property="url" value="jdbc:mysql:///dnbotind_nbotdb" />
<set-property property="readOnly" value="false" />
<set-property property="autoCommit" value="true" />
<set-property property="loginTimeout" value="" />
</data-source>
</data-sources>as i run the application
it gives the errors HTTP status 404-Servlet action is not available
Thx in advancestudent-java wrote:
it gives the errors HTTP status 404-Servlet action is not availableThis is unrelated to the datasource configuration.
HTTP 404 is a "Page not found" error. The request URL is simply wrong. Either there's a typo in the URL, or there is a typo in the servlet mapping, or the servlet is not there where you think. -
Problem with online split backup, database oracle
Hello,
we use for backup our SAP system online split backup, our database is almost 3TB big. Backup is functional but sometimes (4x-5x per month) backup fail with error bellow. If i understant this problem correctly brbackup lost connection to oracle after split disk system and cant stop backup mode in database and backup failed. How can i solve this problem? Exist some parameter for brbackup for reconnect to db when brbackup lost connection? Thanks for your help!
BR0051I BRBACKUP 7.00 (25)
BR0262I Enter database user name[/password]:
BR0055I Start of database backup: bebnhrzd.anf 2009-09-22 14.52.25
BR0484I BRBACKUP log file: /oracle/BP1/sapbackup/bebnhrzd.anf
BR0351I Restoring /oracle/BP1/sapbackup/cntrlBP1.dbf
BR0355I from /oracle/BP1/sapbackup/cntrlBP1.dbf ...
BR0280I BRBACKUP time stamp: 2009-09-22 14.53.10
BR0319I Control file copy created: /oracle/BP1/sapbackup/cntrlBP1.dbf 21676032
BR0280I BRBACKUP time stamp: 2009-09-22 14.53.13
BR0315I 'Alter database begin backup' successful
BR0280I BRBACKUP time stamp: 2009-09-22 14.53.14
BR0295I Splitting mirror disks...
BR0280I BRBACKUP time stamp: 2009-09-22 16.07.43
BR0296I Split of mirror disks successful
BR0280I BRBACKUP time stamp: 2009-09-22 16.17.44
BR0301E SQL error -3135 at location BrBackAlter-3, SQL statement:
'/* BRBACKUP */ ALTER DATABASE END BACKUP'
ORA-03135: connection lost contact
BR0280I BRBACKUP time stamp: 2009-09-22 16.17.44
BR0318E 'Alter database end backup' failed
BR0280I BRBACKUP time stamp: 2009-09-22 16.17.44
BR0301E SQL error -3114 at location BrBackAlter-3, SQL statement:
'/* BRBACKUP */ ALTER DATABASE END BACKUP'
ORA-03114: not connected to ORACLE
BR0280I BRBACKUP time stamp: 2009-09-22 16.17.44
BR0318E 'Alter database end backup' failed
BR0280I BRBACKUP time stamp: 2009-09-22 16.17.44
BR0301W SQL error -3114 at location BrbDbLogClose-1, SQL statement:
'UPDATE SAP_SDBAH SET RC = '0005', ENDE = '20090922161744', OBJ = ' ', LINE = '# 224 0 0 81358 7817759352 0 0 ALL online_split util_file -
7.00 (25)' WHERE BEG = '20090922145225' AND FUNCT = 'anf' AND SYSID = 'BP1''
ORA-03114: not connected to ORACLE
BR0326W Update of database log header failed
BR0056I End of database backup: bebnhrzd.anf 2009-09-22 16.17.44
BR0280I BRBACKUP time stamp: 2009-09-22 16.17.44
BR0054I BRBACKUP terminated with errors
Backup utility finished with returncode 5
Backup FAILEDHello,
in note 534729 is nothing about ORA-03135: connection lost contact only error ORA-03114 which refer to the note 335199 and in this note in nothing about ORA-03114 I want to say two things: this two oracle errors (ORA-03135 and ORA-03114) are not in alertSID.log on db server or in syslog on backup server. This error are only reported from brbackup which is running on backup server which is "client side". We don't have problem with connection from work processes on all instances to db server, we have only problem with brbackup which lost connection after split disk system. How i say this problem occurs only sometimes. I was tested network connection from backup server to db server via niping a this is result:
(root@hytti) #./niping -c -H kiuru -B 30000
Sat Sep 26 14:10:58 2009
connect to server o.k.
send and receive 10 messages (len 30000)
times -
avg 7305 usecs
max 46234 usecs
min 2168 usecs
bw 8020.50 kb/sec
excluding max and min:
av2 3081 usecs
bw2 19013.91 kb/sec
do you have any idea?? Thanks! -
Application that connects to multiple databases.
I am developing an application that performs many task, but one in particular is connecting to multiple databases and creating user accounts in each all with the push of a single button. I have tried putting connect statements in the trigger code but I don't get the desired results.
How would I get my application to switch database connections while in execution?
Please reply to the forum, or email me @ [email protected]
Thank you.
TravisHi
The only possible way which I could find for your requirement is that of DB Links. Establish DataBase Links among the multible databases, with which you want to work in one session. Peform all your actions through the DB Links. -
I am facing a Problem with reading images from database
Hi everybody..
any help will be most appreciated, I am facing problem with reading images from database. I am pasting my code...
string connect = "datasource = localhost; port = 3306; username = root; password = ;";
MySqlConnection conn = new MySqlConnection(connect); // creating connecting string
MySqlCommand sda = new MySqlCommand(@"select * from management.add_products ", conn); //creating query
MySqlDataReader reader;
try
conn.Open(); // Opening Connection
reader = sda.ExecuteReader(); // Executing my Query..
while (reader.Read())
byte[] imgg = (byte[])(reader["Picture"]);
if (imgg == null)
pc1.Image = null;
else
MemoryStream mstream = new MemoryStream(imgg);
pc1.Image = System.Drawing.Image.FromStream(mstream);
It says Parameter not Valid... i am reading all the images from databaseI agree with Viorel. You are getting the error because the format of the data is incorrect probably because the data was modify. It may not be the reading of the database the is incorrect, but the application that wrote the data into the database. You need
to compare the imgg array data with the data before it was written to the database to see if the data matches. I usually start by comparing the number of bytes which is easier to check then compare the actual to isolate which function is changing the
byte count.
An image is binary data. The standard VS methods for reading and writing data (usually stream classes) default to ASCII encoding which will corrupt binary data. The solution usually is to use UTF8 encoding instead of the default ascii encoding.
Ascii encoding with stream often aligns the data and adds extra null bytes to the end of the data which can produce these type errors.
jdweng -
Connecting to Multiple database
Hi how could i use Dreamweaver CS3 to connect to multiple
databases in phpmyadmin?Maneet Puri wrote:
> Hi,
>
> I have used a lot the extensions of Dreamweaver for
implementing various
> dynamic features with connectivity to MySQL databases,
and I don't think there
> is any extension which allows connecting to the multiple
MySQL database. To do
> this you will have to make changes to scripts, at one
point of time from one
> script in one instance there can just be one connection
to one MySQL database,
> what you can do is switch between the users and database
of mysql. PHP offers a
> function mysql_change_user() to switch users and connect
to various different
> MySQL database.
What is stopping you from having more than one database
connection
string? You can select the connection from each behaviour
that needs
different databases.
Or is then intent to combine the data from 2 database into
one recordset?
Dooza
Posting Guidelines
http://www.adobe.com/support/forums/guidelines.html
How To Ask Smart Questions
http://www.catb.org/esr/faqs/smart-questions.html -
Problem with connection with db netbeans
hello all!
i created a db in
jdbc:derby://localhost:1527/simple [demo on DEMO] ---->Demo
my user name demo and the pass demo
in the info of the db i get this:
display name:
jdbc:derby://localhost:1527/simple [demo on DEMO]
the problem lines is
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
and
Connection con = DriverManager.getConnection("jdbc:derby://localhost:1527/simple", "APP", "demo");
i tried to change the APP to demo but the same.
the errors are:
java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
java.sql.SQLException: No suitable driver found for jdbc:derby://localhost:1527/simple
the img of the work is here:http://yfrog.com/0cimpatg
thanks for all!user12163960 wrote:
thanks the first line ok! THE LINE IS WORKING NOW:
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
now i have problem with:
Connection con = DriverManager.getConnection("jdbc:derby://localhost:1527/simple", "APP", "demo");
the error:
java.sql.SQLException: No suitable driver found for jdbc:derby://localhost:1527/simple
You should really read the Derby manual.
When you use a url with jdbc:derby://localhost: then you must start a Derby server first.
If you want to use the embedded engine, the URL is: jdbc:derby:/path/to/database
More details are here: http://db.apache.org/derby/docs/10.6/devguide/cdevdvlp34964.html -
Problem with connecting and syncing (quicktime.qts)
Hi,
I have a problem with connecting and syncing my Iphone to itunes.
iphone alone on PC -> uploading files (fotos) is possible
itunes starts normaly, if iphone is not conected.
if i connect iphone after starting itunes, or if i start itunes after connecting iphone i get an itunes-error with message:
AppName: itunes.exe AppVer: 9.0.2.25 ModName: quicktime.qts
ModVer: 7.65.17.80 Offset: 00909a47
i test different things...
- used another USB-port
- used another PC
- used macbook of my wife instead PC
- deinstalled and new installed of itunes (older and newer versions) folow tutorials of apple
- use another USB-Cable...
I'm resigned, Please help me..
TomAppName: itunes.exe AppVer: 9.0.2.25 ModName: quicktime.qts
In this context, that can sometimes indicate trouble with a content file on the phone (or Touch).
Do you have any podcasts stored on the iPhone at the moment? If so, if you delete them from the phone, can you connect to iTunes without the error? -
I have a problem.
I bought Pages and Numbers for my iMac and so far everything was OK.
Suddenly i have a problem with connection to iCloud.
Dokuments created on iMac in Pages or Numbers are not transfered to iCloud. Not uploaded to iCloud. There is a sign (small shape of iCloud), that they are waiting to be uploaded to iCloud.
I think the iCloud is OK.
i can see and manage documents in iCloud. i can create them on iPad and see them and delete them in iCloud.
But not on iMac.
i dont know what has happened and I am not abble to find the solution. It was OK till some days ago….I have a similar problem! Everything stopped working after upgrading to Mac OS 10.8.4 through the App Store. Help!
-
Problem with connecting to free wifi after upgrading to Windows 8.1 from Windows 8
Hi
I had problems with connecting to free Wifi after upgrading my PC(Notebook) to Windows 8.1 from Windows 8. As I travel a lot within europe, I am used to being able to connect to Free Wifi(those that dont need a key or password to enter) but soon after downloading
Windows 8.1 I almost never was able to do this. I'd always get «LIMITED» even though the signal was strong.This was so fustrating,so much so that I reset my PC to clear it of Windows 8.1 and am now back to Windows 8.This is a shame because I was really liking
using Windows 8.1 and if not for this problem(which is a big one) I'd still be using it. If I download Windows 8.1 again from the Windows store what is the probability that I'll have the same problems?
Thanks PortozzygirlMore often than not when a device isn't working it is because the driver has become corrupted. Re-installing a fresh copy should help
http://windows.microsoft.com/en-us/windows7/Update-a-driver-for-hardware-that-isnt-working-properly?SignedIn=1
http://captaindbg.com/how-to-update-drivers-on-windows-7/ (works on win 8 too)
Wanikiya and Dyami--Team Zigzag -
After I've upgraded my iPhone iOS to 5.0.1, I got problems with connectivity. If my iPhone lose network, then it gets frozzen and I cannot make calls. After restart the telephone still does not work.
1. Download the iOS 5.0.1: http://www.tobias-hartmann.net/2011/11/download-ios-5-0-1-veroffentlicht-direkte -downloadlinks/
2. open itunes,Click in iTunes while holding down the Shift key (on Windows) or Alt key (Mac) to restore and firmware -
I am new to Mac...How do I get connected to a server on my network via a hyper link IP address path? When I try to open in a URL and login as a registered user with proper login it errors out saying there was a problem with connecting to the server?
Some of the following is going to use some technical terms — this area is inherently somewhat technical.
If you don't understand some part of the following reply, please ask.
Is this your own OS X Server system on your own network, or is this some other server within some larger organization?
You're posting this in the OS X Server forum, which is a software package that allows OS X systems to provide web-based and many other services; to become servers.
If it's your OS X Server on your network, then the network and DNS configurations are suspect, or the server is somehow malfunctioning or misconfigured. This is unfortunately fairly common, as some folks do try to avoid setting up DNS services.
If it's a larger organization and somebody else is managing the server and the network, then you'll probably need to contact the IT folks for assistance; to learn the network setup and DNS requirements, and if there's a problem with the server itself.
The basic web URL "hyper link IP address path" — without using DNS — usually looks something the following, where you'll need to replace 10.20.30.40 with the IP address of your server:
http://10.20.30.40
UptimeJeff has posted a URL that specifies the AFP file system; an OS X file share. That's used if you're connecting to an Apple storage service somewhere on your network. You might alternatively need to specify smb://10.20.30.40 or such, if it's a Windows file server. (There can be additional requirements for connecting to Windows Server systems, too.)
If there's local IT staff available here, please contact them for assistance. If these are your own local systems and your own local OS X Server system, then some information on the server will be needed. (If you're on a NAT'd network, you'll also need to get DNS services configured and working on your local OS X Server system and your network — you'll not be able to skip this step and reference ISP DNS servers here — or things can and usually will get weird.) -
Problem with connecting to DB2 from ADFBC
I have a problem with connection to DB2 data using ADF BC components. Everything looks fine till I run the page(JSF) to see the data of a db2 table. I created a read only view object. This view is registered in the AM and from AM the view is returning the rows without any problem. But when I am running the page which has the view as a table these errors are thrown. Please help me to fix this.
JBO-30003: The application pool (od.mft.views.MFTServiceLocal) failed to checkout an application module due to the following exception:
oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.jbo.DMLException, msg=JBO-26061: Error while opening JDBC connection.
at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2002)
## Detail 0 ##
oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.jbo.DMLException, msg=JBO-26061: Error while opening JDBC connection.
at oracle.jbo.pool.ResourcePool.useResource(ResourcePool.java:336)
## Detail 0 ##
oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.DMLException, msg=JBO-26061: Error while opening JDBC connection.
at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:545)
## Detail 0 ##
oracle.jbo.DMLException: JBO-26061: Error while opening JDBC connection.
at oracle.jbo.server.ConnectionPool.createConnection(ConnectionPool.java:220
## Detail 0 ##
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:545)
Thanks
GangsSteve, the tester works good as expected and its retreiving the rows. As I said earlier the problem is with the JSF page when I ran the page on Embeded Oc4j of Jdev the page showing the above. The exception does not show on the console.
Please let me know if you need any more details.
thanks
Gangs -
Connection to multiple databases using a single EJB
How can I connect to multiple Databases (using @PersistenceContext) using an EJB?
Did I need to connect various Entity Managers corresponding to the each database and simply send my Queries?
I am using Glassfish Application Server
Netbeans IDE
Java Derby Database
Oracle Database
Java Persistence API
Thanks in AdvanceYes, you need a persistence context and thus entity manager per database. Depending on what you want to achieve you may also need to go to the next level in your skill set and learn all about distributed transactions.
Maybe you are looking for
-
Install glassfish tools in Luna M7
Hi all I installed the latest eclipse Luna milestone and tried to install glassfish tools for eclipse but it failed due to a "missing dependency" > Cannot complete the install because one or more required items could not be found. Software being inst
-
Is there a way to download/view PDF files on the iPad without using another computer?
I just recently purchased the new iPad. I have also downloaded iBooks and a PDF reader. Is there any way to view and/or download PDF files from my iPad, without using an outside computer? Please help!
-
What can I do to get Adobe to download a pdf file it has converted into a doc or docx file? Any help appreciated!
-
Bridge is not linked up with Photoshop 2014
When I go to a photo in Bridge it opens in Windows photo viewer and does not even give the option of Photoshop. This is not right with this program - never had that problem and it is very bad for my work flow.
-
Problem withDeploy a Webdynpro application with generation of an Excel file
Considered, the problem that we have is the following one: we are generating a file Excel from a Webdynpro application. At the time of executing it it throws the following error to us: java.lang.NoSuchMethodError: java.lang.StringBuffer.append (Ljava