Getting Multiple Recordsets using A Single Connection using jdbc-odbc
I have a java application which uses sql 7.0 database server. I want to have multiple recordsets created using a single connection using jdbc-odbc bridge. Kindly let me know the procedure.
Well, you create a recordset, then you create another one, and so on. Are you actually having a problem or you just don't know where to start?
Similar Messages
-
Error: Current provider does not support returning multiple recordsets from a single execution
Hello,
The following piece of code which has been working for the
past five years suddenly started giving me the following error:
Current provider does not support returning multiple recordsets
from a single execution
We have recenlty moved this site to a new server. Could this
error be related to their CFAdmin settings? Eveything else on the
site seems to be working fine. Or am I using an outdated tag or
something?
Any light in this direction is appreciated, thanks.
Here's the code:There doesn't seem to be anything that seems wrong with the
code. It might have something to do with the Max Pooled Statements
or Number of Connections settings in the CF Administrator, but it
could just as easily have something to do with a setting on the
database. I would check with your provider. -
Multiple sources in a single Connection Pool
Hi Folks,
I have a requirement to import data from two diffrent data sources( for example : Two diffrent database of Oracle in two diffrent servers) using a single connection pool to the physical layers of OBIEE RPD. Can anyone please suggest whether this is possible or not? If yes please provide the steps.DB Links is an Oracle feature, not an OBIEE. You have to create your DB link in one of the schemas in DB1 so you can connect from there to DB2. Then you can simply create a query that joins data from both DBs:
SELECT * FROM DUAL d1, DUAL@DB2 d2
WHERE d1.dummy = d2.dummy
Search on Google as this is a very popular and simple feature to use. It will allow you to use one connection pool that's connection to two DBs. -
Remote Database connection throught JDBC-ODBC
Hi everybody
I've developed an application which connects to a MS Access database throught the JDBC-ODBC bridge; if the database is on my local machine I've no problem at all, but I now need to connect to a database on a remote PC. I've set the DSN entry for the database on the remote computer and try to connect using something like:
String db_name="jdbc:odbc:remote_pc_name\\\\DSN_db_name";
Properties db_prop=new Properties();
db_prop.setProperty("user","username");
db_prop.setProperty("password","user_password");
Connection dbconn=DriverManager.getConnection(db_name,db_prop);
but the ODBC driver gives me the message
"[Microsoft][ODBC Driver Manager] DSN not found and driver not specified.
I've tried other possible "connection strings" but I always get the same message.
The software works properly if I connect to the local DB with:
String db_name="jdbc:odbc:DSN_db_name";
Any idea how to connect to a remote DB through ODBC?
ThanksNo need for a separate thread really is there? its still relevant to the original.
import java.awt.*;
import java.sql.*;
public class JDBC1 extends Frame {
private static final String DB = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=\\\\http:\\\\www.cs.stir.ac.uk\\~dcl\\databasename.mdb";
public static void main(String[] arguments) {
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
System.out.println("Driver registered!");
Connection conn = DriverManager.getConnection(DB, "", "");
System.out.println("Connected!");
Statement st = conn.createStatement();
System.out.println("Statement created!");
ResultSet rec = st.executeQuery("SELECT * FROM people");
System.out.println("Queried!");
while( rec.next() ) {
System.out.println( rec.getString(2) );
st.close(); //close the statement
conn.close(); //close the connection
catch( SQLException s ) {
System.out.println("SQL Error: "+ s.toString() + " " + s.getErrorCode() );
s.printStackTrace();
catch( Exception e ) {
System.out.println("Error: "+ e.toString() + e.getMessage() );
} -
Many Statement/ResultSet using a single Connection
Hi, all,
I'm a beginner to Java and JDBC, and i faced a problem doing some tests with JDBC.
My application is designed to be a 2 tier desktop application, with a single main frame where the user can open many child frames inside it. Each child frame could, for example, display a table in a grid, so i can have many grids showing many tables at the same time.
In my first test, i create a single connection, prepare 2 statements from this connection and get 2 result sets, one from each statement.
When i get the second result set, it throws an exception saying "The result set is closed".
I searched about his in Google, and found some articles saying it is not possible to have more than one opened resultset from one connection.
Is this information accurate?
If so, is there a way to workaround this? In my case, it would te too much expensive to open many connections for each user using the application, and it's not practical, at least now, to develod a third tier to the application, to share a connection pool, for example.
Maybe i'm not able to figure out some important aspect of working with JDBC, in this case i appreciate any advice that could help in my case.
Regards,
FabianoI presume if i decide to use a connection pool, i will need a separate application to act as itWrong.If your answer was supposed to get me curious, you got it :-)
So there is probably something wrong in my assumptions, so i would appreciate if you help to point where i am wrong.
My scenario is a local network with many computers (lets say 30) running my desktop (2-tier) application, all accessing the same database.
Today, in my actual application and in the above scenario, i will have 30 connections to the database, and the database server is starting to get busy to handle them all, so i don't want to raise the number of connections.
Reading your answer, i presume one of the following
a) your solution would be to use a connection pool inside each application instance
b) there is some better technique i'm not aware about and you do, because i'm used to write 2-tier applications and i'm blind to something simple and functional
In case of :
a) If each application's connection pool have an average of 5 connections, i will have 150 connection to the database, and it will probably starve.
b) I would appreciate if you point the name of the technique, framework, or some link so i can start to study and test it
Regards,
Fabiano -
Joining data in multiple files into a single file using BPM
Hello All,
Can someone kindly give me any documentation or step by step procedure to join data in multiple file and display it all in one single file, using BPM.
Thanks in advance,
XI_Novicehi,
Check this blog also...
/people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection-in-bpm
/people/narendra.jain/blog/2005/12/30/various-multi-mappings-and-optimizing-their-implementation-in-integration-processes-bpm-in-xi
regards -
Setting up connection using a single connection string.
Post Author: DubbleOh7
CA Forum: Data Connectivity and SQL
I know about the ConnectionInfo object in for .NET crystal reports, but for security purposes we don't have access to a password of any kind, nor do we pass them around our web pages, they are used for login access only. So how can I just set a connection string for the report to access a SQL Server database? I prefer NOT to do the Dataset work around. Its a busy server and the report could contain up to 20,000 records with lots of fields. Not efficient. I also know I could make an object fill it with data from a data reader, but not sure thats as efficient as just having the report execute the stored procedure I have. I also don't want the report to pop up that login page automatically for the users since they have already logged into the website. I'm looking forward to any ideas or suggestions. Thanks in advance for any info or suggestions you may have!
Summary:
I don't want to use datasets due to inefficiency and overhead of several thousand records.
I just want to be able to use a connection string using windows authentication enabled for the report connection to a SQL Server database.
This is for SQL 2K5..calling a stored procedure
Crystal reports for ASP.NET (VB language solutions preferred)
Basically I'd like to use a trusted connection and
ReportConnection.ServerName = "SERVER"
ReportConnection.DatabaseName = "DATABASE"
ReportConnection.IntegratedSecurity = True
doesn't get me there.If your Internet Service Provider is DSL follow this link
-
Getting multiple data readings at one time using LabVIEW (GPIB) with the Fluke Hydra 2620A
I'm taking temperature readings with the 2620A using the NI LabVIEW drivers. Is there anyway to take an array of the data results? (i.e. more than one channel at a time)
Thanks.This depends upon which VIs you are using. Are you using a driver specifically for the 2620A, the 488.2 VIs, or the VISA VIs? It also depends upon how the instrument returns data. You could use the array VIs in LabVIEW to parse the string and put it into an array, but first we'll need to know how it is sent back. For instance, it is long values separated by commas, etc. Let us know how the string is configured and we'll find a way to do it.
J.R. Allen -
Can I get multiple sums in a single column based on a "code" I place.
After importing a file of check/debit card activity from my bank, can I 'code' the line items based on tax categories ie Utilities, Medical expenses, Auto expenses, etc. and then get sums for each based on that code I placed in a single column? That would mean multiple sums in a single column based on the code used for each tax related expense. For instance, I would put UT in the column for utilities expenses and MED in the same column if it were a medical expense. I would then want the sum for all items in that column for each item code. Is this possible or do I need to use a different approach to get this information.
My guess is that the SUMIF function may be your friend.
It's well described in the *iWork Formulas and Functions User Guid*e which every user may download from the Help menu.
Yvan KOENIG (VALLAURIS, France) samedi 2 janvier 2010 21:56:39 -
Macbook pro wont connect to internet using cable, but connects using wifi fine
My macbook pro wont connect to the internet using a cable, but connects using wifi fine. I use wifi at home but sometimes need to use my laptop at work and connect using a cable but it says i'm not connected to the internet?
Can you open a terminal and invoke the following commands:
ping -c 10 localhost
and
ping -c 10 google.com
You should normally get something like:
PING google.com (74.125.224.103): 56 data bytes
64 bytes from 74.125.224.103: icmp_seq=0 ttl=55 time=19.053 ms
64 bytes from 74.125.224.103: icmp_seq=1 ttl=55 time=37.692 ms
64 bytes from 74.125.224.103: icmp_seq=2 ttl=55 time=46.988 ms
64 bytes from 74.125.224.103: icmp_seq=3 ttl=55 time=33.466 ms
64 bytes from 74.125.224.103: icmp_seq=4 ttl=55 time=28.940 ms
64 bytes from 74.125.224.103: icmp_seq=5 ttl=55 time=58.070 ms
64 bytes from 74.125.224.103: icmp_seq=6 ttl=55 time=33.335 ms
64 bytes from 74.125.224.103: icmp_seq=7 ttl=55 time=33.361 ms
64 bytes from 74.125.224.103: icmp_seq=8 ttl=55 time=36.099 ms
64 bytes from 74.125.224.103: icmp_seq=9 ttl=55 time=41.111 ms
--- google.com ping statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 19.053/36.811/58.070/9.939 ms -
Why am I getting multiple copies of a single email?
I'm using Yosemite 10.10 on my mid-2012 iMac.
I've noticed that I'll often get multiple "copies" of the same email. E.g., this morning I received an email that was forwarded to me as a contact through one of my weblogs. In the Mail Inbox for the specific email account the same email appeared three times.
I've noticed this same behavior in other email Inboxes (different accounts) in Mail.
Any idea what's going on?This may have to do with the server, what kind of email are you using, and is it a group email?
Can you please provide steps you are taking with a little more detail as well? It may be a known issue, but I do not know.
I look forward to your reply! -
Multiple records as a single transaction in JDBC Receiver Adapter
Hi,
I am sending multiple records in a single message to a JDBC receiver adapter to get updated to the database. How to make all the insert a single transaction. Like all the records has to be inserted else all has to be rolled back.
For eg for table Employee two fields EMPNO and EMPNAME
EMPNO EMPNAME
1 Jay
2 Christie
These two records are in the same message and has to be updated
if one fails the other has to be rolled back.
How can i achieve it using a JDBC Receiver Adapter.
Thanks
SebinHi Rolf Micus,
My xml structure to insert 2 tables are as follow:-
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_PODB xmlns:ns0="http://abeam.com/xi/fer_filejdbc_scenarios1">
.. <STATEMENT_HEADER>
.... <ROW action="INSERT">
...... <TABLE>ZPO_HEADER</TABLE>
...... <access>
........ <PONUMBER>001</PONUMBER>
........ <PODATE>20070801</PODATE>
........ <POAMOUNT>200.99</POAMOUNT>
.... </access>
.... </ROW>
.. </STATEMENT_HEADER>
.. <STATEMENT_DETAIL>
.... <ROW action="INSERT">
...... <TABLE>ZPODETAIL</TABLE>
...... <access>
........ <PONUMBER>001</PONUMBER>
........ <PONO>1</PONO>
........ <POITEMCODE>A12345</POITEMCODE>
........ <POITEMDESC>Testing A</POITEMDESC>
........ <POITEMAMOUNT>2990.00</POITEMAMOUNT>
........ <POITEMQTY>55</POITEMQTY>
...... </access>
.... </ROW>
.. </STATEMENT_DETAIL>
</ns0:MT_PODB>
Fro the structure that you have declared..there is only contained 1 statement, try to admend your MT to have 2 statements.
If you wish to insert multiple records, just create a loop/multiple of access tag inside STATEMENT tag. For example, multiple records insert into Header should have multiple access tag in Header STATEMENT. Same goes for muliple records insert into Details STATEMENT should have multiple access tag in Details STATEMENT.
With this structure, whenever any records insert/update/delete failed...it will rollback all the transactions together, ie. Header and Details.
PS: For different table, please create different STATEMENT.
Hope it helps.
Message was edited by: Pua Ming Fei -
Compile error when connecting to JDBC:ODBC
Hi
I am not used to java so probably this is an enivorment problem, but I cannot fix, please help!
FOLLOWING CODE
import java.sql.*;
public class DBtest {
public static void main (String args[]) {
String jdbcDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
String protocolHeader = "jdbc:odbc:";
String dbName = "myodbc3-test";
String user = "";
String password = "";
Class.forName(jdbcDriver);
Connection cn =
DriverManager.getConnection(protocolHeader+dbName, user, password);
GENERATES FOLLOWING COMPILING ERROR
cd c:/Javakod/NewFolder/
javac -classpath C:\Javakod\ DBtest.java
DBtest.java:17: incompatible types
found : java.sql.Connection
required: NewFolder.Connection
DriverManager.getConnection(protocolHeader+dbName, user, password);
^
1 error
What is wrong? I am using a Win2000.This code compiles and runs fine on my Windows 2000 machine running JDK 1.4.1:
import java.sql.*;
public class AnotherConnectionTester
public static void main(String [] args)
String jdbcDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
String protocolHeader = "jdbc:odbc:";
String dbName = "myodbc3-test";
String user = "";
String password = "";
try
Class.forName(jdbcDriver);
Connection cn = DriverManager.getConnection(protocolHeader+dbName, user, password);
DatabaseMetaData meta = cn.getMetaData();
System.out.println("product name: " + meta.getDatabaseProductName());
catch (Exception e)
e.printStackTrace(System.err);
}I set up an ODBC DSN myodbc3-test to connect to an Access database. It was no problem. I guess that doesn't explain why your post didn't work. I changed the name of the class and added that meta data output so I could make sure that it connected. - MOD -
Q. How to get multiple results from a single column in a recordset using PHP
Hi everyone
Hope someone can help. I have a column called categories and about 5 categories listed. I want to show all products that are listed in say 2 categories. I only have basic php skills so only know how to pass a url value to show the products from 1 category e.g.
Select *
FROM product
WHERE category = colname
$colname = $_GET['category'];
URL...page.php?category=fruit
Questions is how do I get the products from multiple categories to show e.g. all products from categories 'fruit', 'dairy', 'meat'
Your help will be much appreciated as I am getting tired of beating my head against the wall. (should invent a PHP wall pillow and sell it online)
Thanks$colname1 = $_GET['category1'];
$colname2 = $_GET['category2'];
$colname3 = $_GET['category3'];
Select *
FROM product
WHERE category IN ('$colname1', '$colname2', '$colname3')
>Your help will be much appreciated as I am getting tired of beating my head against the wall
My guess is that you are trying to build a web application without having first learned the basics on PHP and SQL. That's certainly the hard way. -
How to insert multiple rows in a single shot using insert command?
Hi,
If we insert one row, we can use "insert into" command. I want to insert multiple rows into the table in a single shot. Is there any SQL command for insert multiple rows into the table?
Plese give the solution.
Thanks,
chelladuraiIf you would like to do it with SQL, this would be one of the ways to achive it:
SQL*Plus: Release 10.2.0.4.0 - Production on Fri Sep 25 10:12:59 2009
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Data Mining and Real Application Testing options
SQL>
SQL> desc leap
Name Null? Type
FIRST_PRICE NUMBER(16,6)
NEXT_PRICE NUMBER(16,6)
SQL>
SQL> select * from leap;
no rows selected
SQL>
SQL>
SQL> !vi multirow_insert.sql
SQL> !cat multirow_insert.sql
insert into leap(first_price, next_price) values (1,2);
insert into leap(first_price, next_price) values (3,4);
insert into leap(first_price, next_price) values (5,6);
SQL>
SQL> @multirow_insert.sql
1 row created.
1 row created.
1 row created.
SQL> commit;
Commit complete.
SQL>
SQL>
SQL> select * from leap;
FIRST_PRICE NEXT_PRICE
1 2
3 4
5 6
SQL>
Maybe you are looking for
-
Update to 6.1.1 failed - stuck in recovery mode?
I am a Vodafone customer in the UK with an iPhone 4S. I didn't actually see the warning from Vodafone saying not to update to 6.1.0 and so went ahead and did it. I had no problems whatsoever, was working perfectly fine. I then saw the release of 6
-
Singleton Instance variables concurrency
Below I have code from a class that is used for caching data from a database. The class is implemented as a singleton. My question deals with the method getCacheObj(). Does getCacheObj() return a copy of the reference to cacheObj or does it return th
-
Memory error when selecting a network printer in print dialogue
Hello, I have the following situation: Adobe Acrobat 9.0 was installed with a 30-days trial together with Adobe Reader 9.1.3 Worked perfectly I uninstalled the trial and got Adobe Acrobat Pro 9.0 installed. From this point on, whenever I open the pri
-
UnsatisfiedLinkError: no jpcsc in java.library.path
Hello, I am using the jpcsc api in my application. I get the error below. I guess i dont have my jpcsc.dll in the right directory, can someone tell me where it should be? UnsatisfiedLinkError: no jpcsc in java.library.path at java.lang.ClassLoader.lo
-
Custom controll showing repetative data
Hello Friends, Im using custom control to allow user to enter long text in zmodule pool program. I have created three such custom control in my zscreen but when im saving the data all the three custom container is updating the database table with the