JDBC 4.0, setClientInfo clarification
All:
The javadoc for setClientInfo(String name, String value) at [Connection.setClientInfo(String name,String value)|http://download.oracle.com/javase/6/docs/api/java/sql/Connection.html#setClientInfo(java.lang.String,%20java.lang.String)] specifies that "... The driver shall generate a warning if the client info name specified is not recognized by the driver. ..."
However, javadoc for setClientInfo(Properties properties) at [Connection.setClientInfo(Properties)|http://download.oracle.com/javase/6/docs/api/java/sql/Connection.html#setClientInfo(java.util.Properties)] is "quiet" on this topic -- what to do if the names are not recognized.
I am wondering if setClientInfo(String name, String value)'s behavior for unrecognized names can be extended to setClientInfo(Properties). It will be great if the specification writers or JDBC driver developers in this forum can chime in on this topic.
With regards,
mp
They both throw SQLClientInfoException so the question would seem moot to me.
It will be great if the specification writersDoubt that is going to happen.
Similar Messages
-
JDBC 4 setClientInfo()
In looking at the [JDBC 4 api docs|http://java.sun.com/javase/6/docs/api/java/sql/Connection.html#setClientInfo(java.lang.String,%20java.lang.String)], there is a method called setClientInfo(), which looks like it should allow us to set the client_identifier and other context variables. However, using the 11g drivers, I can't find any suitable property names - everything I try throws an exception. Properties I have tried include:
ClientUser
client_user
ClientInfo
client_info
ClientIdentifier
client_identifier
Further, when I query DatabaseMetaData.getClientInfoProperties, I get no results.
Has anyone successfully used this method yet? I haven't been able to find anything on Oracle's implementation of this method, and was wondering if anyone else has found any documentation from Oracle on this method and whether it should work, and if so, what property names are available?Client info properties supported by a JDBC driver may be obtained using the getClientInfoProperties() method.
Some standard client info properties that a JDBC driver may support are:
ApplicationName The name of the application that is using the connection.
ClientUser The name of the user.
ClientHostname The hostname on which the application is running.
Further, when I query DatabaseMetaData.getClientInfoProperties, I get no results.
Is the ojdbc6.jar in the classpath?
Client info properties are not listed as supported by Oracle database.
http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/jdbcvers.htm#BCFFIFAD
DB2 9 database driver supports client info properties. -
Clarification of doubt in File-XI-JDBC scenario
I had one doubt in this scenario.can anybody Plz clarify in this scenario File-XI-JDBC.
1)where we have to specify the table name in the receiver JDBC comm channel to insert the data into sql database from file.My doubt is,there are so many tables in existence.in the comm channel i am not mentioning the table name any where.
currently i am using SQL server and created one table name "EMP" with n columns.
2)Is i need to configure this sql driver to the J2ee server or by default this will be shipped with XI?
3)Generally,what are the datbase drivers shipped with XI?
Thanks in Advance
Sridhar RajuHi Sridhar
1) You dont require to mention the name of table in comm channel. You specify it in your data type . your xml format should be
<root>
<StatementName1>
<dbTableName action=UPDATE | UPDATE_INSERT>
<table>realDbTableName</table>
<access>
<col1>val1</col1>
<col2>val2new</col2>
</access>
<key1>
<col2>val2old</col2>
<col4>val4</col4>
</key1>
<key2>
<col2>val2old2</col2>
</key2>
</dbTableName>
</StatementName1>
Please refer the link for more detail
http://help.sap.com/saphelp_erp2004/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
2) Basically there is an driver file which has to be deployed to the server. But it may be there by default.
You configure and check your scenario, if driver file is not deployed you will get the message in RWB-> Adapter Monitoring.
Regards,
Mitesh. -
New to JAVA - ODBC/JDBC - clarification
Hi,
I am using Window XP. I am in my initial stages of learning JAVA.
I am using one of the books to learn the language. I wrote to the following code to interact with the database - "websites.mdb" which is in a different location than java.
import java.sql.*;
public class MakeTheConnection
public static void main (String[] args)
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String sourceURL = new String ("jdbc:odbc:websites");
Connection DatabaseConnection = DriverManager.getConnection(sourceURL);
catch (ClassNotFoundException cnfe)
System.out.println(cnfe);
catch (SQLException sqle)
System.out.println(sqle);
When I run the above code I am geting the following error:
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
I also tried creating a DSN which I tried using it here in the sourceURL but still in vain, i got the same error. I would really appreciate if somebody could help me in providing pointer or information regarding to solve this problem and be able to interact with databases. I use MS access.
Thanks in advance.
PKHi,
I created the file DSN through Control panel - > ODBC called "Test" and I used that in the following manner:
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String sourceURL = new String ("jdbc:odbc:Test");
Connection DatabaseConnection = DriverManager.getConnection(sourceURL);
I hope that is right. I am trying to execute using these code. I am getting the following error, I am not sure where the problem is.
C:\jdk1.5.0\bin>java MakeTheConnection
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Please do let me know.
Regards,
PK -
Need Clarification on JDBC--RFC Sync
Hi All,
in JDBC----RFC Sync scenario, do we use BPM to get the response from the RFC??
Why because JDBC is not having the Sync nature.
Regards
VamsiHi,
its not necessary to use BPM to get response with out BPM also we can get the response. Better try to avoid BPM because of the performance issue.
Please refer this link
http://help.sap.com/saphelp_nw70/helpdata/en/b0/676b3c255b1475e10000000a114084/content.htm
Thanks
Vikranth
Edited by: Khimavath Vikranth on Jun 4, 2008 11:31 AM
Edited by: Khimavath Vikranth on Jun 4, 2008 11:39 AM -
Hi,
I am using Window XP. I am in my initial stages of learning JAVA.
I am using one of the books to learn the language. I wrote to the following code to interact with the database - "websites.mdb" which is in a different location than java.
import java.sql.*;
public class MakeTheConnection
public static void main (String[] args)
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String sourceURL = new String ("jdbc:odbc:websites");
Connection DatabaseConnection = DriverManager.getConnection(sourceURL);
catch (ClassNotFoundException cnfe)
System.out.println(cnfe);
catch (SQLException sqle)
System.out.println(sqle);
When I run the above code I am geting the following error:
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
I also tried creating a DSN which I tried using it here in the sourceURL but still in vain, i got the same error. I would really appreciate if somebody could help me in providing pointer or information regarding to solve this problem and be able to interact with databases. I use MS access.
Thanks in advance.
PKThe use of a DSN is corrrect. You have to create User or System-DSN with name "websites" (as stated in your JDBC sourceURL) and that DSN connects to the MDB database you're trying to access. Then your program should just work fine.
For the DSN you have to use the MS-Access driver (afaik language is not important). Then your program should just work fine. -
Urgent Clarification - Microsoft SQL Server JDBC Driver Problem
Hi,
Can somebody tell me how to create a connection Pool in weblogic 7 using Microsoft
SQL Server Driver for JDBC.(should be XADataSource).
I mean the pool should be created using com.microsoft.jdbcx.sqlserver.SQLServerDataSource
class.
The error message i am getting is "Unknown source" during providing targets for
the connection pool.
Thanks in advance,
Rahul.<JDBCConnectionPool
DriverName="com.microsoft.jdbcx.sqlserver.SQLServerDataSource"
Name="SQL2000JDBC"
Properties="serverName=nc-answline-w2k;url=jdbc:microsoft:sqlserver;dataSourceName=SQL2000JDBC;user=test;databaseName=test;selectMethod=curosr;userName=test;password=test;portNumber=1435"
URL="jdbc:microsoft:sqlserver"/>
Try this is your config.xml and make sure you have mssqlsriver first thing in classpath.
Thanks,
Mitesh
Rahul wrote:
Hi,
Can somebody tell me how to create a connection Pool in weblogic 7 using Microsoft
SQL Server Driver for JDBC.(should be XADataSource).
I mean the pool should be created using com.microsoft.jdbcx.sqlserver.SQLServerDataSource
class.
The error message i am getting is "Unknown source" during providing targets for
the connection pool.
Thanks in advance,
Rahul. -
Clarification needed on JDBC Connection Pool in Clustered enviornment
Hi All,
Although I went through the bea online documentation , its not clear how
JDBC connection pool works in clustered environment.
If anyone can please answer following questions, it would be a great help.
1) Do I need to create identical connection pools (with identical ACLs) on
each WebLogic Server in the cluster ?
2) Online documentation says " If you create an identical JDBC DataSource in
each clustered WebLogic Server instance and configure those DataSources to
use different connection pools, the cluster can support load balancing for
JDBC connections. " what actually this means
3) What's the use of "JDBC MultiPools " ? Is it same as "JDBC metapool "
Thanks
Regards
Nalika
See comments inline...
Nalika wrote:
> Hi All,
>
> Although I went through the bea online documentation , its not clear how
> JDBC connection pool works in clustered environment.
> If anyone can please answer following questions, it would be a great help.
>
> 1) Do I need to create identical connection pools (with identical ACLs) on
> each WebLogic Server in the cluster ?
I don't believe that it is strictly necessary to do this but it is certainly the
most common configuration and probably the preferred one as well. WLS is smart
enough to automatically use its Type 3 driver to route requests to a connection
on another server but this type of server-to-server communication can have an
impact on performance and scalability.
> 2) Online documentation says " If you create an identical JDBC DataSource in
> each clustered WebLogic Server instance and configure those DataSources to
> use different connection pools, the cluster can support load balancing for
> JDBC connections. " what actually this means
Don't read too much into this. All that this is saying is that application
components in each server will "prefer" to use their local DataSource (all other
things being equal) and since other clustering technology (or things like
hardware load balancers) are spreading the load across the servers, you will
also spread the load across the different connection pools.
> 3) What's the use of "JDBC MultiPools " ? Is it same as "JDBC metapool "
Yes, these are one and the same.
Hope this helps,
Robert
-
Need clarification abt JDBC driver
Hi All,
I installed Oracle 10g and now accessing the DB using Java.
I am using this below code :-
Class.forName ("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection
("jdbc:oracle:thin:@localhost:1521:orcl","scott","tiger");
Using classes12.jar (type 4 driver)
I am getting this error :-
Error is: java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
localhost:1521:orcl
Please get back with solution
Regards,
Bhargava.Bhargava,
The JDBC Forum is more appropriate for your post.
In that forum you will find the following announcement that package "oracle.jdbc.driver" is deprecated.
If you have Oracle 10g database installed, then you also have the "ojdbc14.jar" file which is a JDBC driver compatible with JDK 1.4.
File "classes12.jar" is for JDK 1.2
From the error message you posted, it looks like "orcl" is not the name of your database instance.
The following SQL query will give you the instance name:
select INSTANCE_NAME from V$INSTANCEI also suggest perusing the JDBC Developer's Guide and Reference which is part of the Oracle documentation.
All of the Oracle documentation can be accessed from:
http://www.oracle.com/technology/documentation/index.html
Good Luck,
Avi.
Message was edited by:
Avi Abrami -
My application was designed based on MVC Architecture. But I made some changes to HMV base on my requirements. Servlet invoke helper classes, helper class uses EJBs to communicate with the database. Jsps also uses EJBs to backtrack the results.
I have two EJBs(Stateless), one Servlet, nearly 70 helperclasses, and nearly 800 jsps. Servlet acts as Controler and all database transactions done through EJBs only. Helper classes are having business logic. Based on the request relevant helper classed is invoked by the Servlet, and all database transactions are done through EJBs. Session scope is 'Page' only.
Now I am planning to use EJBs(for business logic) instead on Helper Classes. But before going to do that I need some clarification regarding Network traffic and for better usage of Container resources.
Please suggest me which method (is Helper classes or Using EJBs) is perferable
1) to get better performance and.
2) for less network traffic
3) for better container resource utilization
I thought if I use EJBs, then the network traffic will increase. Because every time it make a remote call to EJBs.
Please give detailed explanation.
thank you,
sudheer<i>Please suggest me which method (is Helper classes or Using EJBs) is perferable :
1) to get better performance</i>
EJB's have quite a lot of overhead associated with them to support transactions and remoteability. A non-EJB helper class will almost always outperform an EJB. Often considerably. If you plan on making your 70 helper classes EJB's you should expect to see a dramatic decrease in maximum throughput.
<i>2) for less network traffic</i>
There should be no difference. Both architectures will probably make the exact same JDBC calls from the RDBMS's perspective. And since the EJB's and JSP's are co-located there won't be any other additional overhead there either. (You are co-locating your JSP's and EJB's, aren't you?)
<i>3) for better container resource utilization</i>
Again, the EJB version will consume a lot more container resources. -
Multibyte character support in Jdbc Driver
Hi,
I want to use multibyte characters in my Application and to store it in my database.
If my database provider does not support a Multibyte data type, Can my
Jdbc Driver provide support for the same ?
For a column of type ISO88591 which is of single byte by nature , Can we insert Multibyte characters by providing some support for the same in my Jdbc Driver ?
If yes , How could this support be provided in the Jdbc Driver.
Please provide some clarification on the same.
Thanks in Advance,
JayHi,
I want to use multibyte characters in my Application
and to store it in my database.
If my database provider does not support a Multibyte
data type, Can my
Jdbc Driver provide support for the same ?
For a column of type ISO88591 which is of single byte
by nature , Can we insert Multibyte characters by
providing some support for the same in my Jdbc Driver
This is a very very bad idea in general. If your database is Oracle, it's a horrificly stupendously bad idea.
First, collation ("ORDER BY" and other things) will be badly broken.
Second, it will very likely prevent the database from being upgraded to a multi-byte version.
Third, it commonly will cause various database utilities to not work.
There are plenty of databases, many of them free, that support UTF8. -
Running Web Layout Of JDBC Query in Oracle Report Builder 11g.
javax.servlet.jsp.JspException: REP-4100: An attempt to execute data source failed. JDBCPDS-62008:A SQL error occurred: {0}. S1000 [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt
javax.servlet.jsp.JspException: REP-4100: An attempt to execute data source failed.
JDBCPDS-62008:A SQL error occurred: {0}.
S1000 [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt
at oracle.reports.jsp.ForEachTag.doStartTag(ForEachTag.java:407)
at jsp_servlet.__module1000802592._jspService(__module1000802592.java:191)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:35)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:417)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:326)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)For the more clarification, I have used JDBC Query as Data source type and Database connected via ODBC Driver in System DSN. The Driver selected from the drop-downs are jdbc-odbc.
Kindly explain the mistake I m doing. -
What is the best way to load a csv file using JDBC link? Right now I basically read a line and insert it, batching it doesn't seem to speed it up either.
Thanks
Brian Timothy
nullHai !
I think i can help u in this as i have done almost the same thing...
In Oracle for importing the data from other databases there is one bulk insert command ie SQLLDR...This commands takes parameters as a Control File(*.ctl) and data file ie(*.csv) ......You can get more help on it on the site if you search for SQL Loader....
But i think it cann't be executed from StoredProcedure's so what i am doing is running this command from my java application using Runtime.exec("SQLLDR...................") .
I think this will help you ...You are always welcome for any more clarifications....
Regards
Brijesh Kumar
SSI-Technologies -
JDBC Sender adapter - Oracle - Stored Procedure - Error
Hello,
Need few clarifications on JDBC sender adapter and stored procedures when connecting to Oracle DB.
My scenario is, Oracle to SAPBW. So in sender JDBC adapter, we have used a SP having multiple SQL statements it, esp. one of the SELECT statment having Joins on a table and View.
My questions are,
1) Is it possible to have more SQL statements in SP for Sender JDBC?
2) Is the SP of Oracle DB returns resultset or cursor?
I have tried in searching the forum perticularly for connecting to Oracle as Sender and below like said that there is a limitation of XI JDBC when connecting to Oracle.
Executing an Oracle Stored Procedure from Sender JDBC adapter
So please clarify the doubts and help me.
With regards,
JilanHi Jilan,
Unlike what was mentioned in the link given by you that oracle returns cursor and not resultset is not completely true. It may be difficult but certainly not impossible.
Refer : http://www.enterprisedt.com/publications/oracle/result_set.html
regards
joel -
BPM getting data from multiple JDBC databases
Hi - a 'high level' question...
I have a scenario where the first step in my bpm is a receive step which will be a JDBC send adapter/comm channel to a particular database. The rows returned will have a key field called "ID". For each of these rows, I need to go to a completely different JDBC database to gather more data based on this key "ID".
Not sure how to go about this, but this is my best guess
1) receive step, asynchronous which will be used by the jdbc send adapter
2) create a block, mode ForEach referring to the messages returned in the initial receive step. In this block there will be:
3)THIS IS THE PART I'M CONFUSED ON - do i need a synchronous send step, with the request message being the message from the initial receive and a response message being the message from the JDBC recieve adapter? How does the "ID" get passed in to select the proper record? How is a SQL created to get the proper record from the second database?
4 etc) After that, it would be a straight forward transform and send to the target system...which i'm ok with.
Again, my confusion is how the key field is somehow passed to the second JDBC call.
any assistance or clarification would be greatly appreciated! thanks /daveHI,
<i>For each of these rows, I need to go to a completely different JDBC database to gather more data based on this key "ID"</i>
>>>To gather more data, means you are going to select the data for each key ID. Then this data you need to send to target system right ? If so, you need to have Synchronous Send from BPM.
Your BPM steps will be like this
1) Receive the message from Database(JDBC sender)
2) Block with Foreach
3) Send the data Synchrnously to the other database with the help of Reciever JDBC adapter
4) Receive the Response, and Send this Asynchrnoulsy to the Target System.
DO you need Foreach loop here , i am just thinking ? You can pass multplr Key Values to the JDBC Receiver structure and get the Response at a time.
For more on JDBC Sync-
/people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
Regards,
Moorthy
Maybe you are looking for
-
Can you install Tiger onto a drive with data?
Hello, I would like to ask if you can install Tiger onto a hard drive that already has data files on it. I have a 250 GIG hard drive and it already has 10 GIGs of data on it. Can I install Tiger on this drive or might it corrupt my files? Its a long
-
SAPScript Duplex Printing (SD Invoice)
Hi all gurus, After reading some threads and as I told on this "answered" question from Manfred: Re: Duplex Printing SapScript: Invoice - Printer tries but fails backside? We need to print SD invoices in duplex mode. Settings that we have changed by
-
Error - "Invalid floating point operation"
I keep getting a message that says "invalid floating point operation" and the files that I am trying to read are scrambled. They used to be ok. Please advise....
-
How to get purchased applications.
I recently got a new computer and I wanted to download the apps I bought. Does this mean I have to pay for those all over again??
-
I used Firefox last night to check my bank account balance Forgot to log off before going to bed. In morning my Apple laptop was frozen, so I turned it off. Then after restart Firefox would not launch. I am using Safari to send this, but need to get