JDBC connexion to database
I am trying to do connexion to an AXION database using JDBC.
try {
String uriDataBase = "jdbc:axiondb:bddgeoral:/bddgeoral";
conn = DriverManager.getConnection(uriDataBase);
}catch(Exception e) {
e.printStackTrace();
}I have the following error :
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:532)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
at initsalience.salience.connectToDataBase(salience.java:30)
at initsalience.salience.<init>(salience.java:15)
Thanks for your help,
I am trying to do connexion to an AXION database
using JDBC.
try {
String uriDataBase =
"jdbc:axiondb:bddgeoral:/bddgeoral";
conn =
DriverManager.getConnection(uriDataBase);
}catch(Exception e) {
e.printStackTrace();
de]
I have the following error :
java.sql.SQLException: No suitable driver
at
java.sql.DriverManager.getConnection(DriverManager.jav
a:532)
at
t
java.sql.DriverManager.getConnection(DriverManager.jav
a:193)
at
t
initsalience.salience.connectToDataBase(salience.java:
30)
at initsalience.salience.<init>(salience.java:15)
Thanks for your help,make sure , you have to register the driver first. before use getConnection
Similar Messages
-
[FMWGEN][DB2 JDBC Driver]Remote Database Not Found:
while connecting to DB 2 i am getting this error can any help me what to do resolve this. thanks
If working with Database adapter then refer section "Deployment with Third Party Databases" and "JDBC Driver and Database Connection Configuration" at-
http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/adptr_db.htm#BGBBHJGC
Regards,
Anuj -
How to use unload query using JDBC with Informix database
Hi friends,
How can i use unload query using JDBC with Informix database?
When i use it as "unload to 'abc.txt' select * from ........" it gives syntax error.I want to take the data of a table to a file.With dbaccess i can use it but i need to do it using jdbc.
Thanks,
Raneesh.To the best of my ability to tell, the right way to use this product from within Power Query would be to use its API. Unfortunately, we don't currently support either of the methods needed to be able to authenticate with the service (OAuth 2.0 and a relatively-custom
digest-based method). Adding a mechanism to allow use of arbitrary OAuth-protected resources is a fairly high priority for us, and I hope we'll be able to deliver something before mid-2015.
Scraping the website is very hard to do well -- both from an authentication and from a data discovery perspective. -
Problem de connexion à la database human_resources
Je suis un vrai débutant avec JDevelopper.
Je suivais le tutorial de l’Oracle et j’ai essayé de créer une connexion à la database human_resources avec le nom hr et mot de passe par défaut hr.
J’ai pris les valeurs par défaut de l’assistant mais voilà l’erreur que j’ai obtenu :
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:ORCLUser,
Sorry, I don't speak French. Are you using Oracle XE? If so, use XE for the SID.
Searching for "ORA-12505 HR" found [url http://forums.oracle.com/forums/thread.jspa?messageID=1700877]this
John -
JDBC Adapter - Established database connection failed
Hi Guys,
we have installed the JDBC Adapter based on the How To Guide and we checked after the installation the Libaries :Cluster --> Server --> Libraries --> com.sap.aii.af.jmsproviderlib and the box Box "JARs Contained" was filled.
So in my point of view we have done everything right during the installation.
Now the developer tested theJDBC Adapter and he comes back with following Error:
Attempt to establish database connection failed with SQL error com.sap.aii.adapter.jdbc.sql.DriverManagementException: Cannot establish connection to URL "jdbc:microsoft:sqlserver://xxx.x.xx.xxx:1433; databaseName=CZZ03;":ClassNot FoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
Do you have any ideas?
Regards
MarkusHello Markus,
To install JDBC driver follow the how to guide.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guides/how%20to%20install%20and%20configure%20external%20drivers%20for%20jdbc%20and%20jms%20adapters.pdf
Configuration of JDBC Adapter for SQL Server
JDBC Driver = com.microsoft.jdbc.sqlserver.SQLServerDriver
Connection = jdbc:microsoft:sqlserver://hostname:<port>;DatabaseName=<DBName>
UserID and Password.
If the connection is not working find the correct port number.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40b92770-db81-2a10-8e91-f747188d8033
JDBC- X I - R/3 Scenario
/people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
Thanks,
Satya Kumar
Reward Points If it is Useful.. -
Is there any incompatibility in using different JDBC and Oracle database versions?
Hi everybody,
I hope you can answer me ASAP.
Which version of JDBC driver for Oracle could I use to access an Oracle database version 8.0.4.3.0 running on a SUN machine?
Is it necessary to use the specific driver concerning to that version or could we use the JDBC version 8.1.6?
If we decide to use JDBC 8.1.6 to work against the 8.0.4.3.0 database, will we find any incompatibility or problem?
Thanks.
nullI don't know the answer to your question, but while looking for something else, I found a table listing "requirements and compatibilities for oracle jdbc drivers" that might answer your question:
http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/a83724/getsta1.htm#1008206
(My aologies if that URL gets broken apart by this posting software and you have to piece it together.)
Hope this helps. -
Regarding File to JDBC/MS Access database
Hi all,
I am trying to insert some values in to MS access database table.I kept the .mdb file in the local PI folder.I am getting connection error
com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: DriverManagerException: Cannot establish connection to URL 'jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=//test/data/input/Employee.mbd': SAPClassNotFoundException: jdbc.odbc.JdbcOdbcDriver
i have given the configuration as:
JDBC Driver: jdbc.odbc.JdbcOdbcDriver
Connection: jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=//test/data/input/Employee.mbd
Please give me some pointers.
Regards,
AnikaHi Anika,
Also please check for :
You can set the configuration as following:-
JDBC Driver : sun.jdbc.odbc.JdbcOdbcDriver
Connection : jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ= Full Path of DB file;
eg of full path:D:\USERS\Employee\employee.mdb
Please go through these steps: (Assuming you are working on Windows)
1) An ODBC driver for your database must be installed on the Windows computer running the application server.
Check if there's an ODBC driver for MS Acess on the application Server.
2) To connect through an ODBC driver, you must install the Sun JDBC-ODBC Bridge driver on the Windows computer running the application server. The driver comes with the Sun Java 2 SDK, Standard Edition, for Windows.
Also there is another point.
sun.jdbc.odbc.JdbcOdbcDriver
This driver is a part of the JDK kit and so, you need not install the driver on your XI server. Check the SAP Note JDBC FAQ for this info.
3)Define a DSN on the Windows system hosting your application server.
4)These parameters you need to give while configuring the JDBC receiver adapter channel
Regards
joel
Edited by: joel trinidade on Mar 26, 2009 12:45 PM -
Servlets/JDBC - Connect to database ONCE and not in every servlet - How?
Hello, I'm using servlets and JDBC.
In every servlet , i connect to the database and then i close the connection, but this is not ptactical.
I would like to connect to the database once (at the beginning) when container starts and then close the connection.
How am i supposed to do that?
Thanks, in advance!Bad idea. Don't do that. The connection will timeout sooner or later (depends on DB used, it's usually around 30 mins) and your application will crash.
You should always acquire and close the connection (and statement and resultset!) in the shortest possible scope. To improve connecting performance just use connection pooling.
Create a DAO class which does all the task and just instantiate and assign it as Servlet class variable during Servlet's init() method. For more insights and code samples start here: [http://balusc.blogspot.com/2008/07/dao-tutorial-data-layer.html].
To go back to your fundamental question, doing some stuff during startup and shutdown of webapp, you could use the ServletContextListener for this. But again, do NOT do this to get hold of an external resource such as a connection! It's receipt for trouble. -
RFC XI JDBC to external database.... Get data in multiple rows
Hi,
We have been really struggling with this scenario. We have created a RFC that has 1 Import parameter (Order_ID) and table parameter (3 Columns: Order_ID, Partner_type, Partner_no).
When we call this RFC in SAP, it should make a connection to external database via JDBC and get multiple row data for every Order_ID. We are not using Oracle Stored Procedure, instead we are using simple Select statement. Did all the mapping and configured correctly. However, we are getting short-dump when we execute RFC. When we checked in XI, it says " Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd at "
Has anyone tried getting multiple row information from external database(Oracle) using Select statement in XI ? IF so, can you pl let us know if we need to something different in Mapping ?
NiranjanNiranjan,
Check this blog of mine to see how the datatype for Synchronous Select should be constructed,
https://weblogs.sdn.sap.com/pub/wlg/3928. [original link is broken] [original link is broken] [original link is broken] [original link is broken]
If this looks good, a few checks
1. Check the request inbound payload , i.e the RFC request in MONI. Is this as expected?
2. Check the output of the request mapping and check if this is as expected.
3. Check the response from JDBC, is this as per the datatype defined.
4. Check the mapping from JDBC response to RFC response.
To me this looks like an issue with the JDBC response structure.
Meanwhile to understand how to test mapping, check blog of michal,
/people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios
Regards
Bhavesh -
Problem in JDBC connection to database
Hi,
I m new to JDBC. I want to retrive some data from the database in my JSP page. How do i do it ??? I written a following code,
String custid = null;
String custname = null;
String custref = null;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@<server>:1521:yoda","scott","tiger");
Statement stmt = conn.createStatement();
String strCustomer = "select customer_id from fmm_user_access where login_id = '" + username + "';";
ResultSet rset = stmt.executeQuery(strCustomer);
while (rset.next())
custid = rset.getString(1);
custref = "1."+custid;
strCustomer = "select full_name from fmm_ofin_customers where customer_ref ='"+ custref + "'";
ResultSet rset1 = stmt.executeQuery(strCustomer);
while (rset1.next())
custname = rset1.getString(1);
conn.close();
} //try
catch (Exception e) {e.getMessage();}
Are there any setup issues which i m missing, like setting some paths. Please advise.
Thanks in advance
UnmeshHi Unmesh,
I did not see any code in your JSP page which is printing the output of your query.
You may want to modify your JSP to display the results like this
<%@ page import="java.sql.*" %>
<HTML><BODY>
<%
strCustomer = "select full_name from fmm_ofin_customers where customer_ref ='"+ custref + "'";
ResultSet rset1 = stmt.executeQuery(strCustomer);
while (rset1.next())
custname = rset1.getString(1); %>
Customer Name is <%=custname%>
<BR>
<% }
conn.close();
........... %>
</BODY></HTML>
And you will need to ensure that the JDBC drivers( classes12.jar or ojdbc14.jar) are in your classpath.
A couple of other observations I have about your code is
1. You must explicitly close the ResultSet and Statement objects after you finish using them: rset.close();stmt.close()
2. Try using PreparedStatements for your insert statements which allows you to define bind parameters. In your case -
PreparedStatement pstmt =
conn.prepareStatement ("select customer_id from fmm_user_access where login_id = ?");
pstmt.setString (1, userName);
You can refer to JDBC samples on OTN for more information : http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/content.html
Hope this helps.
Sujatha. -
ADF panel opening too many JDBC Thin Client database sessions.
Hi All,
I have several ADF Panels, which allows the user to run a few simple queries against an Oracle database done using ADF view objects and ADF view links and ADF application module.
Each ADF panel as I said contains several View Link queries, and links under the form of Jbuttons to other ADF Panels running other ADF View Links.
Running the ADF Panel as described here opens up to 21 database sessions displaying as “JDBC Thin Client” when I look them up from v$session.
Why do I end up with that many database sessions.
Why doesn’t it just use one or two database sessions to run all these View Links? It seems that it is opening one database session for each of these view links.
How can I change this destructive behavior? I only one to see one or two database sessions for the entire ADF panel no matter how many ADF View Links it contains.
Your suggestions are most appreciated.
Thanks.
Bobby A.Thanks for your response.
I took a quick look at the docs you pointed me to. It seems that I can set some parameters in bc4j.xcfg of each application module Home to control number of database connections that the application module will create. In that case maybe you can recommend which parameters and what value they should be set to.
Your response will be most helpful as my background is rather in database admin and not java.
Thanks.
Bobby A. -
BI Publisher JDBC for Unidata database
Does any one know how to setup the BI Publisher - JDBC add a data source to connect to Unidata database?
I followed up the IBM Unidata JDBC instuction and found it not really working at all.
Any one been setup like that please give me a light.
thanks
CKThere is information to converting Crystal Reports to BIP Publishers
http://www.oracle.com/technology/products/xml-publisher/index.html
http://download.oracle.com/otndocs/xmlp/CrystaltoBIP.pdf
Maybe it could interest you
Regards
Christophe -
JDBC Adapter - Dynamic database address
Hi,
For a JDBC recevier adapter, is it possible to specify the address of the database dynamically.
Thanks
MartinHi,
I dont think this is possible.
Regards,
Bhavesh -
Can JDBC specify dynamic Database
Now we have two DB2 database, with different IP address.
One of those is running in normal situation, if it is down, the other will automatically start.
Why this happened, how can the XI get information from the other DB? Is it possible to specify dynamic database destination in JDBC Adapter?
Thanks in advance.Hi YiNing,
look at my answers in
Re: JDBC Problem in a Productive Sys!!!
There is also a further link to a similar problem.
Regards Mario -
JDBC - Connecting Multiple Databases
Hi JDBC's
I would like to know if it is possible to retrive a data from different tables and from different databases using a single query, which mean can I retrive data from multiple tables multiple databases in a single JDBC connection?
If not, How do I implement it?
Any Ideas or please point me to any related solution if you have.
Thanks.Although theoretically possible in fact a single JDBC connection cannot work with several databases. To implement this feature somebody has to write another aggregating JDBC driver which parse SQL statement and work with other databases in background. I like this idea, but currently there is no such driver available.
Scriptella ETL (http://scriptella.javaforge.com) offers an interesting solutions for cross-database operations. See example on how -to copy a table from oracle to hsqldb: http://snippets.dzone.com/posts/show/3511
If you want to join 2 tables from different databases and copy the result to a third database use the following code:
<query connection-id="db1">
SELECT * FROM Table1
<query connection-id="db2">
SELECT * FROM Table2 WHERE Table2_ID=?Table1_ID
<script connection-id="db3">
INSERT INTO Table3 VALUES (?rownum, ?Table1_Field, ?Table2_Field);
</script>
</query>
</query>
Message was edited by:
ejboy
Maybe you are looking for
-
Printing and PDF Preview - ADS Server needed?
I have a technical question about the technical background of printing in cPro 4.5: If I use PDF Print Forms, how is the generation of the PDF working. Does this happen locally on my server, and do I need special components on my server, or do i need
-
How to include group access level in a ws call
I want to include a Group Access Label in a Permission for a Course using an iTunes web service call. I don't see how to do this in the docs. (The example in iTunesUAdministratorsGuide.pdf at page 111 doesn't include the Group Access Label. And it's
-
Improving Oracle9i DB performance using IMPORT/EXPORT
Hi, I'm experiencing wrong performance on Oracle9.2.0.6 DB for production system. I have one schema and two tablespaces: the first one for data (18 datafiles sized each 1GB), and the second one for indexes (15 datafiles sized each 1GB). I tryed to tu
-
Want to add one more table in Inner join
Hi all, my code is show below. SELECT a~budat a~mblnr b~matnr b~menge b~bwart INTO CORRESPONDING FIELDS OF TABLE it_rawmat FROM mkpf as a inner join mseg as b on a~mblnr = b~mblnr where b~bwart = '261' and b~werks in werks
-
Issue with comparing two dates
I am a little confused by this. here is the query SELECT CASE WHEN TRUNC (mm.revised_validation_due_date) > TRUNC (mm.next_validation_date) THEN 'greater' ELSE 'not' END compare, mm.revised_validation_due_date - mm.next_validation_date datediff, mm.r