JDBC set up in IAS9I
Hi,
Anybody could i tell me how to configure a JDBC connection in ias 9i release 2? (step by step) or where can i found it??
Thanks, again
Javier,
Please post this question on the J2EE (http://forums.oracle.com/forums/forum.jsp?id=486963) discussion forum.
Thanks,
Ashesh Parekh
Oracle9iAS Product Management
Similar Messages
-
Java beginner, please help!! (oracle jdbc setting)
Hi, I am a java beginner. I can't access remote oracle db from my computer. please help me. I can't figure out the problem.
1.The error------------------------------------------------------------
Exception in thread "main" java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:532)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at testdb.main(testdb.java:9)
2.JDBC DRIVER is in----------------------------------------------------
c:\j2sdk1.4.1_02\jdbc\classes12.zip
3.CLASSPATH is --------------------------------------------------------
.;c:\j2sdk1.4.1_02\bin;c:\j2sdk1.4.1_02\jdbc;
4.My program is--------------------------------------------------------
import java.sql.*;
class testdb
public static void main (String args[])
throws SQLException,ClassNotFoundException
Connection conn=
DriverManager.getConnection("jdbc:oracle:thin:@111.31.111.11:1526:ORA81","scott","tiger");
Statement stmt = conn.createStatement();
ResultSet rset=stmt.executeQuery("SELECT EMPNO FROM EMP");
while (rset.next()) {
System.out.println (rset.getString(1));
5. Why can't i connect to db?Hi...i have the same problem and can't seem to solve it
this is my source code
import java.io.*;
import java.sql.*;
import java.util.*;
public class TextToDatabaseTable {
public static void main (String[] args) {
try {
// connect to db
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@cs-bid:1521:SVRDESK", "lynn", "abc");
catch( Exception e) {
e.printStackTrace();
and this is my error
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at TextToDatabaseTable.main(TextToDatabaseTable.java:12)
and i try the methods above
C:\download\Lynn>java -classpath c:\download\lynn;classes12.zip TextToDatabaseTable
C:\download\Lynn>java TextToDatabaseTable
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at TextToDatabaseTable.main(TextToDatabaseTable.java:12)
i'm using oracle 8i with tomcat on win 2k server.
i dunno what's wrong with it...do i need to set any classpath?
i have TOMCAT_HOME and JAVA_HOME Variables in My Environment Variables.
Do i need to set anything for these variables?
Do i need to download any patches? I'm kinda confused.
Thanks! -
Synch JDBC Receiver - stored procedure
Hi All ,
Can you please let me know whether we can go for a Synch JDBC receiver which needs to excute a stored procedure at the target DB system ? If Yes , Please let me know the procedure .
Thank you.
Regards,
Midhuhi midhu,
Yes you can use stored procedure in receiver JDBC,Set action field to execute and for table field map to Stored procedure name.
Please refer
/people/luis.melgar/blog/2008/05/13/synchronous-soap-to-jdbc--end-to-end-walkthrough
/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
Regds,
Srinivas -
I am now using XSQL servlet and try to run the demo. However, I have configed the JDBC setting in the xml config and change the connection parameter in the .xsql file.
The following exception throws:
Oracle XSQL Servlet Page Processor 1.0.0.0 (Production)
XSQL-007: Cannot acquire a database connection to process page.
IO 2'1`: The Network Adapter could not establish the connection
Can anyone help meHave you modified the <connection> entries in the XSQLConfig.xml file to make the JDBC connection details appropriate for your database?
-
Get/update jdbc settings by using wlst
Hi all!
Today I have task to get current jdbc setting and save it to file, but something is wrong in my code:
cd('/JDBCSystemResources')
file=open(filename, "w")+
+jdbclist=cmo.getJDBCSystemResources()+
+for ijdbc in jdbclist:+
+dName=ijdbc.getName();+
+cd('/JDBCSystemResources/'+dName+'/JDBCResource/'+dName+'/JDBCDriverParams/'+dName+'/Properties/'+dName+'/Properties/user')+
+userlogin=cmo.getValue()+
+print dName, userlogin+
+s=dName+' '+userlogin+'\n'+
+file.write(s)+
Problem invoking WLST - Traceback (innermost last):
(no code object) at line 0
File "C:\wlst\tmp\demo.py", line 27
dName=ijdbc.getName();
^
SyntaxError: invalid syntax
It worked if run from wl console, but failed by running from script.
What is wrong?
Thank you!I just went through the similar thing. Here is what I did:
cd('/')
dsList=cmo.getJDBCSystemResources()
for i in dsList:
dsName=i.getName();
cd('/JDBCSystemResources/'+dsName+'/JdbcResource/'+dsName+'/JDBCDriverParams/NO_NAME_0/Properties/NO_NAME_0/Property/user') -
Inserting and retrieving data from a al32UTF8 database USING SQL Developer
hi guys,
Before i post my questions , i think its better for me to provide you guys with my understandings first so that it easier to understand where/if i have gone wrong..
I am using Window XP and Oracle 10g
Non-unicode client - a client program that need to use the OS code page for mapping of the retrieved unicode data from the database as well as the support of displaying/inserting the characters from that code page to the database.
E.G sqlplusw.exe
Therefore, when using a non-unicode client
1) we have to set the OS code page (Control panel - regional and language setting - advance - language for non unicode program ) to the code page that contain the characters we are going to display/insert.
2) we will also have to set the NLS_LANG characterset to the character set of the code page we are going to insert so that when we do a insert (for e.g in thai ) , oracle will know, and auto conversion to UNICODE can take place. This is also true when we retrieve unicode data from the database so that conversion to the correct character set can take place.
INSERTING
THAI ---> conversion ----> UNICODE
RETRIEVING
THAI <---- conversion <---- UNICODE
I hope my basic understanding is correct up till this point.
Unicode client - a client program that supports the displaying/inserting of unicode characters without the need of setting the OS code page (Control panel - regional and language setting - advance - language for non unicode program )
E.G isqlplus http or SQL developer
However,
1) There is still a need to set the NLS_LANG so that correct conversion can take place between the client and the database.
For e.g, when retrieving if we set the NLS_LANG character set to ZHS16GBK (chinese) and the data store in unicode in database is E.G (THAI) , then the conversion would be wrong .
Since it is a unicode supported client, then the NLS_LANG character set should be set to UNICODE as well.
Here come my questions
*Important - please help if you are busy and have no other time to answer the rest of the questions
*Q1) If i were to use a unicode client, what should i set my NLS_LANG character set to ?
AMERICAN_AMERICA.UTF8 ?
*Q2) Where do i set the NLS_LANG character set information in SQL Developer, i know there is a metalink for setting NLS_LANG using isqlplus but i cant seems to google any result for SQL developer.
Q3) Is my basic understanding right until this point ? If not, please explain in a more generalised term as i am really not familiar with character sets, code page, unicode , glyphs and fonts..
Q4) If a unicode client does not need to refer to the OS code page (set in regional and language) , is there a UNICODE code page for the client to refer to , or is there any Window API available ?
Q5)
There is still a need to set the NLS_LANG so that correct conversion can take place between the client and the >>database.
For e.g, when retrieving if we set the NLS_LANG character set to ZHS16GBK (chinese) and the data store in >>unicode in database is E.G (THAI) , then the conversion would be wrong .am i right on this point for UNICODE supported client ?
Thanks for spending time to read my questions and i hope to hear advices from you guys soon.
Million thanks again for sharing.
Best Regards,
Noob but willing to learnThe requirement to always set NLS_LANG is not true for JDBC, which ignores NLS_LANG altogether. Java programs fetch text data into String variables, which use Unicode UTF-16 by design. JDBC sets character set conversion so that data is converted between UTF-16 and the database or national character set.
The requirement to set NLS_LANG is not generally true for OCI, either. The first call in an OCI problem can be OCIEnvNlsCreate(). This call has two parameters that allow the caller to define the character set to use for VARCHAR2/CHAR/LONG/CLOB/statement text and the character set to use for NVARCHAR2/NCHAR/NCLOB. Only if these character sets are specified as 0, NLS_LANG character set is used. Also, OCI programs can specify different character sets for each bind or define variable (i.e. input/output buffer). Note: OCI programs always use NLS_LANG to initialize the language and territory settings for the client program and the database session. Only the character set can be specified is OCIEnvNlsCreate().
OCIEnvNlsCreate() can specify the client character set as UTF-16 (in platform endianess). This is not possible with NLS_LANG.
Various interfaces building on OCI, such as Oracle ODBC and ODP .NET, explicitly initialize OCI with Unicode character set, and thus ignore the NLS_LANG character set as well.
Thnx,
Sergiusz -
Migration from OAS 10g to Weblogic 10.3
Hello,
I migrate large app from OAS 10g to Weblogic 10.3.
1.
The main part of the job was to prepare descriptors for Weblogic. Unfortunatelly I don't find any tool that could do the job:( There are some problems with descriptors namespaces. This schema and namespaces given in 10.3 docs are not working (not available):
http://edocs.bea.com/wls/docs103/ejb/DD_defs_reference.html
So I use the one from 10 release in weblogic-ejb-jar.xml:
weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/10.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/10.0 http://www.bea.com/ns/weblogic/10.0/weblogic-ejb-jar.xsd">
and form 9 release in weblogic-cmp-rdbms-jar.xml:
<weblogic-rdbms-jar xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-rdbms20-persistence.xsd">
There are also some bugs in docs about ejb relations.
After fixing some schema compliance exc this step success.
2. Next the EJBComplianceChecker - its much more restrictive than OAS verification. So updates in ejb interfaces are necessary. It is not a problem with small app but when there ale a lot of code/branches to migrate it's become a problem. I have been looking for some switch that could help with this but with no result/
EJBComplianceChecker - Spec veryfication level
3. Now after EJB compliance checker done its job with success I have an exception that I do not understand:
An error occurred during activation of changes, please see the log for details.
Exception
preparing module: EJBModule(corpo_ejb.jar)
Unable to deploy EJB: corpo_ejb.jar from corpo_ejb.jar:
There are 1 nested errors:
java.io.IOException: JDT compilation error! at
weblogic.ejb.container.ejbc.CompilerForJDT.compile(CompilerForJDT.java:66)
at
weblogic.ejb.container.ejbc.EJBCompiler.doCompile(EJBCompiler.java:357)
at
JDT compilation error!
Could you please give me some point where the problem could be? I don't have any idea where to start looking for..
What are your experiences with migrations from OAS to Weblogic 10?
Thanks in advance!
Edited by: Stoigniew Sztank on Oct 10, 2008 4:00 AM
Edited by: Stoigniew Sztank on Oct 10, 2008 4:01 AM
Edited by: Stoigniew Sztank on Oct 10, 2008 4:02 AM
Edited by: Stoigniew Sztank on Oct 10, 2008 4:04 AM
Edited by: Stoigniew Sztank on Oct 10, 2008 8:05 AMHi Stoigniew Sztank,
I am working on migrating Enterpirse application developed using Struts, Ejb2.0, JMS. Its been deployed on OAS 10G and Websphere, but I need to deploy the application on Weblogic 10.3. It seems you have migrated a J2ee application from OAS 10G to Weblogic 10.3. Please can you list me the steps that you followed to migrate the application.
As per my understanding follwing things needsto be taken care of:-
1) Weblogic Descriptor files:
1.1 Weblogic.xml:- we added security roles and ejb-reference-description for the ejbs.
1.2 Weblogic-ejb-jar.xml for all the ejbs used in the application.
1.3 Weblogic-application.xml
1.4 Resource Adapter
2) JMS queue set up
3) JDBC set up
It would be a great help if you can let me know what are the steps to migrate the application.
Thanks and Regards
Deepak Dani -
EUS password authentication in sql developer failing with username/password
We have recently changed to use Enterprise User Security (EUS) for our client authentication (password global authentication).
This is working fine but we are encountering an issue with SQL Developer whereby we can't logon using our EUS details, it simply returns the following on the logon screen:
Status : Failure - Test failed: ORA-01017: invalid username/password; logon denied
Logging on via sql plus client and server software and other 3rd party tools like pl/sql developer works correctly.
It appears to be an issue with sql developer itself.
We are using the latest Production release of sql developer 2.1
Does anyone have any ideas?
This is an issue for
Edited by: david butler on Jan 14, 2010 10:45 AMFurther to this, I have now found a suitable resolution to this that doesn't require an external client.
There is a jdbc setting that will allow you to use EUS password authentication.
Add the jdbc line option (below) in the sqldeveloper.conf file (backup the sqldeveloper.conf file first).
AddVMOption -Doracle.jdbc.thinLogonCapability=o3
The sqldeveloper.conf file can be found wherever you have installed sqldeveloper, under <INSTALL_HOME>\sqldeveloper\bin\sqldeveloper.conf.
After you add this option, restart SQL Developer and you should be able to use your EUS username / password to authenticate via SQL Developer. -
Making LOV off of an exposed method from second application module
Hello,
I am on JDev 11.1.1.4.0.
My ADF project worked fine until the spec changed on how Lookups are going to be handled. Previuosly, all the lookup tables were in the same database as other tables. Change is that FND Lookups will be created in the "Oracle" and my ADF project should connect to "Oracle" to get appropriate lookup values to build LOVs while maintaining the main database connection intact.
After some research, I now have 2 Application Modules, one my project and the other for Lookups to create LOVs. I went to Application Module configuration wizard to edit JDBC setting to point to "Oracle" database and created a read only view with the following SQL:
SELECT LOOKUP_CODE, MEANING, DESCRIPTION FROM FND_LOOKUP_VALUES
WHERE LOOKUP_TYPE = 'MY_LOOKUP'
AND ENABLED_FLAG = 'Y'
AND LANGUAGE = 'US'I can run both AMs via "Oracle Business Component Browser" fine. However, I somehow have to set the lookup view object as data source to create LOV on the main updatable view object's attribute. If I set it the way I used to do treating the lookup view as a view object residing in the same AM I am getting "table or view does not exist" error. I guess it is something to do with the lookup view object, but I cannot seem to make any kind of progress on this.
Any help would be greatly appreciated.
Thank you
Bones Jones
Edited by: Bones Jones on May 19, 2011 10:40 AMWell, I think I have found a solution which I didn't have to write a single line of code. My mistake was to think that I have to write code to achieve this.
Here is what I did:
*I already have the main AM and View Objects created for my project. The following steps are done on top of that to bring LOV to life
1. Create a new, pretty empty AM, named LovAM.
1.1 Right click on the newly created AM and select 'Configurations'
1.2 Click JDBC Name value and click 'Edit'
1.3 Select the second database source where Lookup is defined. If not listed, go back out and create a new Database connection and come back.
2. Create a View Object with the following SQL:
SELECT
TO_NUMBER(LOOKUP_CODE) ID,
MEANING NAME,
DESCRIPTION
FROM
FND_LOOKUP_VALUES
WHERE
LOOKUP_TYPE = 'MY_LOOKUP' AND ENABLED_FLAG = 'Y' AND LANGUAGE = 'US'3. Notice you now have LovAMDataControl
4. Create a jspx page and create a table with the main data control's binding (This was a part of the requirements).
5. I create a read-only table with LovAMDataControl.LovLookUp1 binding (I think this creates/exposes correct binding in the pageDef).
6. Now I drag-and-drop an attribute that I have been wanting to display LOV from the main binding.
7. Selected single select listbox. You will be presented with 'Edit zlist Binding' screen.
8. Base Data Source is the main data control binding.
9. Select Dynamic List
10. Select LovAM data control binding as List Data Source.
11. (optional) Selected 'Name' as Display Attribute.
11.1. (optional) I don't want to see the table created in step 5. On the jspx page, go to Source tab and delete the table from there. I think this keeps binding in pageDef while the UI component is deleted from the page.
12. Save and Run
Now, I didn't have to create Root Application Module in the code, but still achieved what I wanted.
Thanks
Bones Jones -
Creating a database with Sun Java Application Server 9
I am using a slightly outdated reference book on J2EE programming. It gives 2 methods of creating a database used in its casestudies. The first is an ANT script that gives the following output:
D:\original\CaseStudy-2-5\CaseStudy\Day02\exercise>asant database
Buildfile: build.xml
env-user:
prop-user:
set-user:
env-password:
prop-password:
read-password:
set-password:
set-j2ee:
create-jdbc:
set-j2ee:
asadmin:
[echo] asadmin.bat create-jdbc-resource user admin password password --
connectionpoolid PointBasePool --enabled=true jdbc/Agency
[exec] Usage: create-jdbc-resource [--terse=false] [--echo=false] [--intera
ctive=true] [--host localhost] [--port 4848|4849] [--secure | -s] [--user admin_
user] [--passwordfile file_name] --connectionpoolid id [--enabled=true] [--descr
iption text] [--target target(Default server)] jndi_name
[exec] CLI193 Password option "password" is not allowed on the command line
. Please use --passwordfile option or asadmin login command.
set-j2ee:
asadmin:
[echo] asadmin.bat list-jdbc-resources user admin password password
[exec] Usage: list-jdbc-resources [--terse=false] [--echo=false] [--interac
tive=true] [--host localhost] [--port 4848|4849] [--secure | -s] [--user admin_u
ser] [--passwordfile file_name] [target (Default server)]
[exec] CLI193 Password option "password" is not allowed on the command line
. Please use --passwordfile option or asadmin login command.
set-dbpath:
BUILD FAILED
D:\original\CaseStudy-2-5\CaseStudy\common\targets.xml:87: D:\Sun\SDK\pointbase\
lib not found.
Total time: 2 seconds
D:\original\CaseStudy-2-5\CaseStudy\Day02\exercise>
I've checked and there is no Sun\SDK\pointbase folder. The book was written for SDK 1.4 and I believe another application server. There is also a Java program that attempts to create it with jdbc. Its output looks like this :
D:\original\CaseStudy-2-5\CaseStudy\Day02\exercise\classes>java CreateAgency
java.lang.ClassNotFoundException: com.pointbase.jdbc.jdbcUniversalDriver
java.lang.ClassNotFoundException: com.pointbase.jdbc.jdbcUniversalDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at CreateAgency.main(Unknown Source)
D:\original\CaseStudy-2-5\CaseStudy\Day02\exercise\classes>
I am not conversant enough to discuss the corrections for the ANT script but I'm reasonably certain the Java program could work if I had the right strings in these lines.
// PointBase
private static final String driver = "com.pointbase.jdbc.jdbcUniversalDriver";
private static final String protocol = "jdbc:pointbase:server://localhost/sun-appserv-samples,new";
private static final String user = "pbPublic";
private static final String password = "pbPublic";
Can anyone help me with the correct driver and protocol?
I am using the latest download version SDK JavaEE5
the entire java program looks like this:
import java.sql.*;
public class CreateAgency {
// Cloudscape
//private static final String driver = "COM.cloudscape.core.RmiJdbcDriver";
//private static final String protocol = "jdbc:cloudscape:rmi:Agency;create=true";
//private static final String user = "";
//private static final String password = "";
// PointBase
private static final String driver = "com.pointbase.jdbc.jdbcUniversalDriver";
private static final String protocol = "jdbc:pointbase:server://localhost/sun-appserv-samples,new";
private static final String user = "pbPublic";
private static final String password = "pbPublic";
public static void main(String[] args) {
Connection conn=null;
Statement s=null;
try {
Class.forName(driver);
System.out.println("Loaded driver: "+driver);
conn = DriverManager.getConnection(protocol,user,password);
System.out.println("Connected to: "+protocol);
conn.setAutoCommit(false);
s = conn.createStatement();
System.out.println("Dropping exisiting BMP tables...");
try {s.execute("drop table ApplicantSkill");} catch (SQLException ex){}
try {s.execute("drop table Applicant");} catch (SQLException ex){}
try {s.execute("drop table JobSkill");} catch (SQLException ex){}
try {s.execute("drop table Job");} catch (SQLException ex){}
try {s.execute("drop table Matched");} catch (SQLException ex){}
try {s.execute("drop table Customer");} catch (SQLException ex){}
try {s.execute("drop table Location");} catch (SQLException ex){}
try {s.execute("drop table Skill");} catch (SQLException ex){}
System.out.println("Dropped tables");
System.out.println("Creating new tables...");
s.execute("create table Skill(name varchar(16) CONSTRAINT pk_skill PRIMARY KEY (name), description varchar(64))");
s.execute("create table Location(name varchar(16)CONSTRAINT pk_location PRIMARY KEY (name), description varchar(64))");
s.execute("create table Applicant(login varchar(16) CONSTRAINT pk_applicant PRIMARY KEY (login), name varchar(64), email varchar(64), summary varchar(512), location varchar(16), CONSTRAINT fk_location FOREIGN KEY (location) REFERENCES Location(name))");
s.execute("create table ApplicantSkill(applicant varchar(16), skill varchar(16), CONSTRAINT fk_applicant FOREIGN KEY (applicant) REFERENCES Applicant(login), CONSTRAINT fk_skill FOREIGN KEY (skill) REFERENCES Skill(name))");
s.execute("create table Customer(login varchar(16) CONSTRAINT pk_customer PRIMARY KEY (login), name varchar(64), email varchar(64), address1 varchar(64), address2 varchar(64))");
s.execute("create table Job(ref varchar(16), customer varchar(16), description varchar(512), location varchar(16), CONSTRAINT pk_job PRIMARY KEY (ref,customer), CONSTRAINT fk_customer FOREIGN KEY (customer) REFERENCES Customer(login), CONSTRAINT fk_location FOREIGN KEY (location) REFERENCES Location(name))");
s.execute("create table JobSkill(job varchar(16), customer varchar(16), skill varchar(16), CONSTRAINT fk_job FOREIGN KEY (job,customer) REFERENCES Job(ref,customer), CONSTRAINT fk_skill FOREIGN KEY (skill) REFERENCES Skill(name))");
s.execute("create table Matched(applicant varchar(16), job varchar(16), customer varchar(16), exact boolean, CONSTRAINT fk_job FOREIGN KEY (job,customer) REFERENCES Job(ref,customer), CONSTRAINT fk_applicant FOREIGN KEY (applicant) REFERENCES Applicant(login))");
System.out.println("Created tables");
System.out.println("Inserting table records...");
s.execute("insert into Location values ('London','London UK')");
s.execute("insert into Location values ('Washington','Washington DC, USA')");
s.execute("insert into Location values ('Verona','Verona, Renaissance Italy')");
s.execute("insert into Location values ('Wessex','Wessex, Kingdom of England')");
s.execute("insert into Skill values ('Tree Surgeon','Tree Surgeon')");
s.execute("insert into Skill values ('Cigar Maker','Cigar Maker')");
s.execute("insert into Skill values ('Bodyguard','Bodyguard')");
s.execute("insert into Skill values ('Cook','Cook')");
s.execute("insert into Skill values ('Lawyer','Lawyer')");
s.execute("insert into Skill values ('Critic','Critic')");
s.execute("insert into Applicant values ('juliet','Juliet Capulet', 'juliet@localhost' , 'Dutiful daughter', 'London' )");
s.execute("insert into Applicant values ('romeo','Romeo Montague', 'romeo@localhost' , 'Dutiful son', 'Wessex' )");
s.execute("insert into Applicant values ('julius','Julius Caesar', 'julias@localhost' , 'Roman Emperor', 'Washington' )");
s.execute("insert into Applicant values ('brutus','Marcus Brutus', 'marcus@localhost' , 'Roman Senator', 'Washington' )");
s.execute("insert into Applicant values ('proteus','Proteus', 'proteus@localhost' , 'Gentleman', 'Verona' )");
s.execute("insert into Applicant values ('valentine','Valentine', 'valentine@localhost' , 'Gentleman', 'Verona' )");
s.execute("insert into ApplicantSkill values ('juliet', 'Cook')");
s.execute("insert into ApplicantSkill values ('romeo', 'Cook')");
s.execute("insert into ApplicantSkill values ('romeo', 'Bodyguard')");
s.execute("insert into ApplicantSkill values ('julius', 'Tree Surgeon' )");
s.execute("insert into ApplicantSkill values ('julius', 'Tree Surgeon' )");
s.execute("insert into ApplicantSkill values ('brutus', 'Critic' )");
s.execute("insert into ApplicantSkill values ('brutus', 'Lawyer' )");
s.execute("insert into ApplicantSkill values ('proteus', 'Lawyer' )");
s.execute("insert into ApplicantSkill values ('proteus', 'Critic' )");
s.execute("insert into ApplicantSkill values ('valentine', 'Critic' )");
s.execute("insert into ApplicantSkill values ('valentine', 'Cigar Maker' )");
s.execute("insert into Customer values ('george','George Washington', 'george@localhost', 'White House', 'Washington')");
s.execute("insert into Customer values ('winston','Winston S Churchill', 'winston@localhost', '10 Downing Street', 'London')");
s.execute("insert into Customer values ('abraham','Abraham Lincoln', 'abe@localhost', 'Springfield', 'Illinois')");
s.execute("insert into Customer values ('alfred','Alfred the Great', 'alf@localhost', 'Wessex', 'England')");
s.execute("insert into Job values ('Tree pruner', 'george', 'Must be honest', 'Washington')");
s.execute("insert into Job values ('Cigar trimmer', 'winston', 'Must like to talk and smoke', 'London')");
s.execute("insert into Job values ('Theatre goer', 'abraham', 'Should be intelligent and articulate', 'Washington')");
s.execute("insert into Job values ('Cake maker', 'alfred', 'Should have a good sense of smell', 'Wessex')");
s.execute("insert into JobSkill values ('Tree pruner','george','Tree Surgeon')");
s.execute("insert into JobSkill values ('Cigar trimmer', 'winston', 'Cigar Maker')");
s.execute("insert into JobSkill values ('Cigar trimmer', 'winston', 'Critic')");
s.execute("insert into JobSkill values ('Theatre goer', 'abraham', 'Bodyguard')");
s.execute("insert into JobSkill values ('Theatre goer', 'abraham', 'Lawyer')");
s.execute("insert into JobSkill values ('Theatre goer', 'abraham', 'Critic')");
s.execute("insert into JobSkill values ('Cake maker', 'alfred', 'Cook')");
System.out.println("Inserted records");
conn.commit();
System.out.println("Committed transactions");
catch (SQLException ex) {
System.out.println("SQL Exception thrown: "+ex);
ex.printStackTrace();
try { conn.rollback(); } catch (Exception e) {}
catch (ClassNotFoundException ex) {
System.out.println(ex);
ex.printStackTrace();
finally {
try { s.close(); } catch (Exception ex) {}
try { conn.close(); } catch (Exception ex) {}
}JavaEE Tutorial has a chapter on security:
http://java.sun.com/javaee/5/docs/tutorial/doc/
Usually a no-arg InitialContext() is used, rather than InitialContext(props). For more info, see
Glassfish EJB FAQ:
https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
-cheng -
Cannot access 'BookstoreServlet' in J2EE tutorial
ok so i've successfully created a jdbc-pool and a jdbc-resource...once i deploy the war file for the bookstore demo, i get:
HTTP Status 404 - Servlet BookStoreServlet is not available
type Status report
message Servlet BookStoreServlet is not available
description The requested resource (Servlet BookStoreServlet is not
available) is not available.
Apache Tomcat/5.0
i can perfectly access the 'hello1' example created earlier in the tutorial....i'm using jre 1.4.2 beta 2 with j2ee sdk 1.4 beta 2
ne help please? ...tks allFirst, you can try the http://localhost:8080/bookstore1/banner.
If /banner cann't run, it should be the deploy problem.
If this can run, but /bookstore and other alias cann't run, the reason
should be the database connect issue.
To resolve database connect issue:
1. Get the database name:
go to $InstallDir\pointbase\tools\serveroption
run startserver.bat to start pointbase
run startconsole.bat to start database console, after you connect to databse,
you can see the jdbc:pointbase:sample on the menu. Here sample is the database name.
2. Verify JDBC setting in application server:
Application Server
--> JDBC
--> Connection Pool
--> PointBasePool
--> Properties
DatabaseName = jdbc:pointbase:server://localhost:9092/sample
(notice: here the sample must same as the database name in Item 1)
User=pbpublic
Password=pbpublic
3. Notice:
1) When run sample, first start pointbase database, then start application server
2) At the beginning, you can type "c" in pointbase service consle to see active connections link to database.
If after the application server started, if no active connections shown, this means your JDBC setting is wrong. You need to double check your setting.
3) Seems the pointbase only can accept 1 connect at the same time. So before run application server, you need to close the pointbase admin console.
I am also a beginner to J2EE.
Also looking forward for your kindly support!
Thanks in advance! -
How can I speed up the connection to the database?
I am running a JSP application with regular JavaBeans not EJB and connecting to the database through these beans. The connection is set to stay in memory as long as the bean is in session. However when I am running more than 7 sql statements seperatly the execution of the page slows down.
I have tried using connection pooling but doesn't help much.
I am not using the JDBC setting in JRUN, I am connecting through the jdbc.odbc drivers provided by the JDK. Basically coded the connection and the connection pool.
Is there something else that can be done to speed up the execution of the page?
Thanks in advanceThank you all for your input I was trying to work this project to learn JSP so I am not looking at purchasing any drivers right now. That is the reason why I stuck to the JDBC-ODBC Bridge. Are there any other drivers available for MS SQL Servers that are free.
Jschell,
That suggests you are taxing the system. It could be >connections. It could also be network, cpu, bus, etc. It >could also be memory, if your app starts swapping to >the hard drive it will get substantially slower.How can i figure out which of the above (i.e. memory, cpu, connections, network) are causing the problem.
(Presumably you explicitly close your >ResultSets/Statements/Connections when you are >done with them.)You are right about that yes I am closing them at the end of the session, which I think should be after all of the SQL's get executed but I could be wrong it might be openeing a new connection for each SQL which inturn might be the reason for this whole problem. I will take a look into that.
Thank you all once again. -
Need Help - JBO-26000 Error on Tomcat?
I have been deploying my JDev 10.1.3 project (ADF BC) as a .war file to Tomcat 5.5.9 and running it successfully for several months successfully. Today while making code changes, I started to encounter a JBO-26000 error preventing me from running this application. I tried re-installing the ADF filters on Tomcat but this did not help.
Note! I have another project that I can still deploy and run successfully as a .war file in Tomcat, so it points to something specific to this application.
Does anyone have any suggestions? I don't know where to look for the problem?
Thanks.
**** Error Message from Web Browser:***********
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
oracle.jbo.JboException: JBO-26000: A Generic exception occurred during loading Customizations.
oracle.jbo.uicli.mom.JUMetaObjectManager.loadFromXML(JUMetaObjectManager.java:918)
racle.jbo.mom.DefinitionManager.loadLazyDefinitionObject(DefinitionManager.java:548)
oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:426)
oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:359)
oracle.jbo.uicli.mom.JUMetaObjectManager.defExists(JUMetaObjectManager.java:306)
oracle.jbo.uicli.mom.JUMetaObjectManager.loadCpx(JUMetaObjectManager.java:548)
oracle.adf.model.servlet.ADFBindingFilter.initializeBindingContext(ADFBindingFilter.java:441)
oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:230)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
******* From Tomcat Log files *************
May 17, 2006 7:01:10 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet Faces Servlet threw exception
oracle.jbo.JboException: JBO-26000: A Generic exception occurred during loading Customizations.
at oracle.jbo.uicli.mom.JUMetaObjectManager.loadFromXML(JUMetaObjectManager.java:918)
at oracle.jbo.mom.DefinitionManager.loadLazyDefinitionObject(DefinitionManager.java:548)
at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:426)
at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:359)
at oracle.jbo.uicli.mom.JUMetaObjectManager.defExists(JUMetaObjectManager.java:306)
at oracle.jbo.uicli.mom.JUMetaObjectManager.loadCpx(JUMetaObjectManager.java:548)
at oracle.adf.model.servlet.ADFBindingFilter.initializeBindingContext(ADFBindingFilter.java:441)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:230)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
## Detail 0 ##
java.lang.NullPointerException
at oracle.jbo.uicli.mom.JUApplicationDefImpl.loadDataControls(JUApplicationDefImpl.java:616)
at oracle.jbo.uicli.mom.JUApplicationDefImpl.loadContainees(JUApplicationDefImpl.java:579)
at oracle.jbo.mom.ContainerDefImpl.loadFromXMLFile(ContainerDefImpl.java:354)
at oracle.jbo.uicli.mom.JUApplicationDefImpl.loadFromXMLFile(JUApplicationDefImpl.java:350)
at oracle.jbo.uicli.mom.JUApplicationDefImpl.createAndLoadFromXML(JUApplicationDefImpl.java:531)
at oracle.jbo.uicli.mom.JUMetaObjectManager.loadFromXML(JUMetaObjectManager.java:886)
at oracle.jbo.mom.DefinitionManager.loadLazyDefinitionObject(DefinitionManager.java:548)
at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:426)
at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:359)
at oracle.jbo.uicli.mom.JUMetaObjectManager.defExists(JUMetaObjectManager.java:306)
at oracle.jbo.uicli.mom.JUMetaObjectManager.loadCpx(JUMetaObjectManager.java:548)
at oracle.adf.model.servlet.ADFBindingFilter.initializeBindingContext(ADFBindingFilter.java:441)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:230)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)Thanks John!
I just solved the problem 5mins ago :)
I'm using Jdeveloper 11g (11.1.1.2.36.55.36) and Tomcat6.
The point is that it had nothing to do with tomcat jdbc setting in context.xml or server.xml files.
After deploying your application to tomcat, bc4j.xcfg is the first place to look for errors regarding connection to database.(at least in my case) -
JDev 11g Pr3 Not able to switch schema on database navigator
I have a schema called FACETSEDI that is used to access a schema named FACETS.
When I connect to the DB using the FACETSEDI login, I can run queries against the FACETS tables, but I can't browse them, since the navigator is pointing at the FACETSEDI schema.
Is there some custom JDBC URL I can use to cause the connection to force a switch on the session (simulate a ALTER SESSION SET current_schema = facets) ?Absolutely:
1. Start JDeveloper
2. Go to the database navigator
3. Create a connection to the database
username: facetsedi
password: mypassword
driver: thin
hostname: facets
SID: facets1
4. Connect to the database
5. Expand the Tables node - and all I see are tables in the FACETSEDI schema
What I need is to be able to see the tables in the FACETS schema.
Can't find a way to specify this with a custom JDBC setting (like with SQL server I could specify a parameter in the URL to connect to the correct database schema).
There used to be a "show all schemas" setting on the IDE that let you pick which schema you wanted to see. -
Problems in starting up Connection Pools in SQLServer7
Hi
We are running both Commerce and Personlaization Server 3.5 with an SQL erver
7 backend. I recently migrated the database from Cloudscape to SQL Server and
added the following entry into my weblogicCommerce.properties file
<I>
# ---------------SQL Server ----------------------#
commerce.usermgmt.RDBMSRealm.driver=weblogic.jdbc.mssqlserver4.Driver
commerce.usermgmt.RDBMSRealm.dbUrl=jdbc:weblogic:mssqlserver4:wlcsDatabase@WEBLOGICSRVR01:1433
commerce.usermgmt.RDBMSRealm.dbUser=sa
commerce.usermgmt.RDBMSRealm.dbPassword=mcpassword
</I>
After doing this, the commercePool (Connection Pool) that comes with the installation
of the Commerce server did not work and came up with some java exceptions i.e.
<I>
Could not create pool connection. The DBMS driver exception was:
java.sql.SQLException: Can't open a socket on none:1433. Check host and port num
ber and make sure the security manager allows this connection. You can also try
running the SocketApplet (java.net.UnknownHostException: none).
at weblogic.jdbcbase.mssqlserver4.BaseConnection.prepareConnection(BaseC
onnection.java:176)
at weblogic.jdbc.mssqlserver4.Driver.newConnection(Driver.java:32)</I>
Can any one give me an idea on what I need to do to resolve this problem?
Thanxhii..did u change the startup and bea/wlcs/bin/win32/set-environment.cmd
files where u need to change the classpath related with SQL Server.After
that you will have to change JDBC setting thru console using
http://ip:7501/console/index.jsp
Do that and hope it will work.
Rajesh
"Bola Taylor" <[email protected]> wrote in message
news:3b724a71$[email protected]..
>
Hi
We are running both Commerce and Personlaization Server 3.5 with an SQLerver
7 backend. I recently migrated the database from Cloudscape to SQL Serverand
added the following entry into my weblogicCommerce.properties file
<I>
# ---------------SQL Server ----------------------#
commerce.usermgmt.RDBMSRealm.driver=weblogic.jdbc.mssqlserver4.Driver
commerce.usermgmt.RDBMSRealm.dbUrl=jdbc:weblogic:mssqlserver4:wlcsDatabase@W
EBLOGICSRVR01:1433
commerce.usermgmt.RDBMSRealm.dbUser=sa
commerce.usermgmt.RDBMSRealm.dbPassword=mcpassword
</I>
After doing this, the commercePool (Connection Pool) that comes with theinstallation
of the Commerce server did not work and came up with some java exceptionsi.e.
>
<I>
Could not create pool connection. The DBMS driver exception was:
java.sql.SQLException: Can't open a socket on none:1433. Check host andport num
ber and make sure the security manager allows this connection. You canalso try
running the SocketApplet (java.net.UnknownHostException: none).
atweblogic.jdbcbase.mssqlserver4.BaseConnection.prepareConnection(BaseC
onnection.java:176)
atweblogic.jdbc.mssqlserver4.Driver.newConnection(Driver.java:32)</I>
>
>
Can any one give me an idea on what I need to do to resolve this problem?
Thanx
Maybe you are looking for
-
Writing binary data to ASP file from applet through URLConnection
Hi Everybody, I am facing a proble with HttpURLConnection.I want to write some binary data from applet to an ASP file.The other end ASP file read this binary data and process , Here problem is I have opened URLConnection to the page and Created Outpu
-
Hi I have the following data example Fields are >> UniqueID: Date: Account No Corresponding data row1>> 0001: 21/02/2008: 1000 Corresponding data row2>> 0002: 21/02/2008: 4001 Corresponding data row3>> 0003: 22/02/2008: 1000 Fields are >> UniqueID: D
-
Maximum record limit in BW ?
Hi, Is there any maximum limit for the number of records that can be scheduled in BW from the source system in one <b>Initialization/Full Update</b>. Any help would be appreciated. Thanks & Regards Hari
-
HI ! There is any way to run a command SQL*PLUS through a block pl/sql. For example to run the "copy from" command in a block pl/sql. Thanks for you time.
-
How to enable Arabic text in Photoshop cs3?
Greetings everyone, I want my Photoshop cs3 to support Arabic text. I have searched the internet to find any clue but couldn't. Please help.