XDB creation of folders with PL/SQL problem
Hi Forum,
I'm struggling with the problem of creating folders and resources automatically using PL/SQL. I'm working with Oracle 9.2
What I'd like to achieve is a proc like so:
create_folder(path in varchar2)
This proc should create the folder for me. Problem is:
1. If a subfolder is not existing, dbms_xdb.create_folder throws an error.
2. If a folder is existing, the same happens.
So my approach is:
split the path '/a/b/c/d/test.xml' into chunks like:
/a
/a/b
/a/b/c
/a/b/c/d
Now, check for each entry, whether folder exists. If not, create folder.
The way I implemented this is by a pipelined PL/SQL function split_path:
create type path_table as table of varchar2;
create or replace function split_path (path in varchar2)
return path_table pipelined
is
i number := 1;
begin
while instr(path, '/', 2, i) > 0 loop
pipe row (substr(path, 1, instr(path, '/', 2, i) - 1));
i := i + 1;
end loop;
return;
end split_path;
This function pumps out any sub-path.
Now, I create a create_folder function like so:
procedure create_folder (path in varchar2)
is
i number := 1;
-- cursor for all non-existing pathes (via pipelined function split_path)
cursor path_cur is
select column_value
from table(mds_tools.split_path(path))
where column_value not in (select any_path from resource_view);
begin
-- Create all non-existing folders
for entry in path_cur loop
result := dbms_xdb.createFolder(entry.column_value);
end loop;
-- exception handling goes here
end create_folder;
So, this way, I'm checking any sub folder against the existing cursors and try to create a folder if it's not existing.
Nice try, so far, but: It doesn't work.
Oracle gives me an "End of communication" error, when trying to run this.
It seems to bomb out as soon as the second pipe is pumped out of the function and I don't understand, why.
If this should be the wrong approach, how could I improve this?
Thanks for any help,
Jürgen
The createDirectoryTree procedure in the following package may help...
-- XDB_HELPER should be created under XDBPM
alter session set current_schema = XDBPM
create or replace package XDB_UTILITIES_10200
AUTHID CURRENT_USER
as
function getBinaryContent(file bfile) return BLOB;
function getBinaryContent(filename varchar2, directoryName varchar2 default USER) return BLOB;
function getBinaryContent(file bfile, tempBLOB IN OUT BLOB) return BLOB;
function getBinaryContent(filename varchar2, directoryName varchar2 default USER, tempBLOB IN OUT BLOB) return BLOB;
function getFileContent(file bfile, charset varchar2 default 'WE8MSWIN1252') return CLOB;
function getFileContent(filename varchar2, directoryName varchar2 default USER, charset varchar2 default 'WE8MSWIN1252') return CLOB;
function getFileContent(file bfile, charset varchar2 default 'WE8MSWIN1252', tempCLOB IN OUT CLOB) return CLOB;
function getFileContent(filename varchar2, directoryName varchar2 default USER, charset varchar2 default 'WE8MSWIN1252', tempCLOB IN OUT CLOB) return CLOB;
procedure createHomeFolder(userName varchar2);
procedure createPublicFolder;
procedure createDirectoryTree(path varchar2);
procedure uploadFiles(FILE_LIST varchar2 default 'ls.xml', UPLOAD_DIRECTORY_NAME varchar2 default USER, REPOSITORY_FOLDER_PATH varchar2 default '/home/' || USER , BATCH_SIZE number default 1);
procedure put_xml(XML XMLTYPE);
function printNestedTables(XML_TABLE varchar2) return XMLType;
procedure printXMLToFile(xmlContent XMLType, targetDirectory varchar2, Filename VARCHAR2);
function getDefaultTableName(PATH VARCHAR2) return VARCHAR2;
function getXMLReference(PATH VARCHAR2) return REF XMLType;
function getXMLReferenceByResID(RESOID RAW) return REF XMLType;
function getVersionsByPath(path VARCHAR2) return RESOURCE_ID_TABLE pipelined;
function getVersionsByResid(RESID RAW) return RESOURCE_ID_TABLE pipelined;
function isCheckedOut(PATH VARCHAR2) return number;
function isCheckedOutByRESID(RESOID RAW) return number;
procedure updateXMLContent(path VARCHAR2, content XMLType);
procedure updateBinaryContent(path VARCHAR2,content BLOB);
procedure updateCharacterContent(path VARCHAR2,content CLOB,db_charset VARCHAR2);
procedure renameCollectionTable (XMLTABLE varchar2, XPATH varchar2, COLLECTION_TABLE_PREFIX varchar2);
end XDB_UTILITIES_10200;
show errors
create or replace package body XDB_UTILITIES_10200
as
-- When using getFileContent() the application must explicitly free the CLOB that the function returns
function getBinaryContent(file bfile,
tempBLOB IN OUT BLOB)
return BLOB
is
targetFile bfile;
dest_offset number := 1;
src_offset number := 1;
lang_context number := 0;
conv_warning number := 0;
begin
targetFile := file;
if (tempBLOB is null) then
DBMS_LOB.createTemporary(tempBLOB,true,DBMS_LOB.SESSION);
else
DBMS_LOB.trim(tempBLOB,0);
end if;
DBMS_LOB.fileopen(targetFile, DBMS_LOB.file_readonly);
DBMS_LOB.loadBlobfromFile
tempBLOB,
targetFile,
DBMS_LOB.getLength(targetFile),
dest_offset,
src_offset
DBMS_LOB.fileclose(targetFile);
return tempBLOB;
end;
function getBinaryContent(file bfile)
return BLOB
is
tempBLOB BLOB := NULL;
begin
return getBinaryContent(file,tempBLOB);
end;
function getBinaryContent(filename varchar2,
directoryName varchar2 default USER,
tempBLOB IN OUT BLOB)
return BLOB
is
file bfile := bfilename(directoryName,filename);
begin
return getBinaryContent(file,tempBLOB);
end;
function getBinaryContent(filename varchar2,
directoryName varchar2 default USER)
return BLOB
is
tempBLOB BLOB := NULL;
begin
return getBinaryContent(filename,directoryName,tempBLOB);
end;
function getFileContent(file bfile,
charset varchar2 default 'WE8MSWIN1252',
tempCLOB IN OUT CLOB)
return CLOB
is
targetFile bfile;
dest_offset number := 1;
src_offset number := 1;
lang_context number := 0;
conv_warning number := 0;
begin
targetFile := file;
if (tempCLOB is null) then
DBMS_LOB.createTemporary(tempCLOB,true,DBMS_LOB.SESSION);
else
DBMS_LOB.trim(tempCLOB,0);
end if;
DBMS_LOB.fileopen(targetFile, DBMS_LOB.file_readonly);
DBMS_LOB.loadClobfromFile
tempCLOB,
targetFile,
DBMS_LOB.getLength(targetFile),
dest_offset,
src_offset,
nls_charset_id(charset),
lang_context,
conv_warning
DBMS_LOB.fileclose(targetFile);
return tempCLOB;
end;
function getFileContent(file bfile,
charset varchar2 default 'WE8MSWIN1252')
return CLOB
is
tempCLOB CLOB := NULL;
begin
return getFileContent(file,charset,tempCLOB);
end;
-- When using getFileContent() the application must explicitly free the CLOB that the function returns
function getFileContent(filename varchar2,
directoryName varchar2 default USER,
charset varchar2 default 'WE8MSWIN1252',
tempCLOB IN OUT CLOB)
return CLOB
is
file bfile := bfilename(directoryName,filename);
begin
return getFileContent(file,charset,tempCLOB);
end;
function getFileContent(filename varchar2,
directoryName varchar2 default USER,
charset varchar2 default 'WE8MSWIN1252')
return CLOB
is
tempCLOB CLOB := NULL;
begin
return getFileContent(filename,directoryName,charset,tempCLOB);
end;
procedure createHomeFolder(userName varchar2)
as
targetResource varchar2(256);
realUserName varchar2(64);
result boolean;
begin
realUserName := upper(userName);
targetResource := '/home';
if (not dbms_xdb.existsResource(targetResource)) then
result := dbms_xdb.createFolder(targetResource);
dbms_xdb.setAcl(targetResource,'/sys/acls/bootstrap_acl.xml');
update RESOURCE_VIEW
set res = insertChildXML
res,
'/Resource',
'Comment',
xmlelement("Comment",'Contains home folder for each XDB User.')
where equals_path(res,targetResource) = 1;
end if;
targetResource := targetResource || '/' || realUserName;
if (not dbms_xdb.existsResource(targetResource)) then
result := dbms_xdb.createFolder(targetResource);
update RESOURCE_VIEW
set res = insertChildXML
res,
'/Resource',
'Comment',
xmlelement("Comment", realUserName || '''s home folder.')
where equals_path(res,targetResource) = 1;
end if;
dbms_xdb.setAcl(targetResource,'/sys/acls/all_owner_acl.xml');
update resource_view
set res = updateXml(res,'/Resource/Owner/text()',realUserName)
where equals_path(res,targetResource) = 1;
end;
procedure createPublicFolder
as
begin
xdb_helper.createPublicFolder(USER);
end;
procedure createDirectoryTree(path varchar2)
as
pathSeperator varchar2(1) := '/';
parentFolderPath varchar2(256);
result boolean;
folderExists number(6):= 1;
begin
-- dbms_output.put_line('Processing ' || path);
select count(*)
into folderExists
from resource_view
where equals_path(res,path) = 1;
-- dbms_output.put_line('FolderExists = ' || folderExists);
if (folderExists = 0) then
parentFolderPath := substr(path,1,instr(path,pathSeperator,-1)-1);
-- dbms_output.put_line('FolderExists = ' || FolderExists);
createDirectoryTree(parentFolderPath);
result := dbms_xdb.createFolder(path);
end if;
end;
procedure uploadFiles(FILE_LIST varchar2 default 'ls.xml', UPLOAD_DIRECTORY_NAME varchar2 default USER, REPOSITORY_FOLDER_PATH varchar2 default '/home/' || USER , BATCH_SIZE number default 1)
as
pathSeperator varchar2(1) := '/';
DIRECTORY_PATH varchar2(256);
SUBDIRECTORY_PATH varchar2(256);
TARGET_FOLDER_PATH varchar2(256);
TARGET_FILE_PATH varchar2(256);
TARGET_FILE_NAME varchar2(256);
RESOURCE_PATH varchar2(256);
sqlStatement varchar2(256);
FILELIST_XML XMLTYPE := XMLType(bfilename(UPLOAD_DIRECTORY_NAME,FILE_LIST),nls_charset_id('AL32UTF8'));
CONTENT_XML XMLType;
result boolean;
filecount binary_integer := 0;
FILELIST_DOM DBMS_XMLDOM.DOMDOCUMENT;
FILES_NL DBMS_XMLDOM.DOMNODELIST;
DIRECTORY_NL DBMS_XMLDOM.DOMNODELIST;
FILENAME_NL DBMS_XMLDOM.DOMNODELIST;
FILES_NODE DBMS_XMLDOM.DOMNODE;
DIRECTORY_NODE DBMS_XMLDOM.DOMNODE;
FILE_NODE DBMS_XMLDOM.DOMNODE;
TEXT_NODE DBMS_XMLDOM.DOMNODE;
ENCODING_ATTR DBMS_XMLDOM.DOMATTR;
REPLACE_ATTR DBMS_XMLDOM.DOMATTR;
PATH VARCHAR2(256);
FILE_NAME VARCHAR2(256);
ENCODING_TEXT VARCHAR2(32);
ATTR_VALUE VARCHAR2(256);
REPLACE_OPTION BOOLEAN;
REPLACE_DEFAULT BOOLEAN;
DEBUG_BUFFER VARCHAR2(255);
begin
-- Create the set of Folders in the XDB Repository
FILELIST_DOM := DBMS_XMLDOM.newDOMDocument(FILELIST_XML);
DIRECTORY_NL := DBMS_XMLDOM.GETELEMENTSBYTAGNAME(FILELIST_DOM,'directory');
FOR i in 0 .. (DBMS_XMLDOM.GETLENGTH(DIRECTORY_NL) - 1) LOOP
DIRECTORY_NODE := DBMS_XMLDOM.ITEM(DIRECTORY_NL,i);
TEXT_NODE := DBMS_XMLDOM.GETFIRSTCHILD(DIRECTORY_NODE);
DIRECTORY_PATH := DBMS_XMLDOM.GETNODEVALUE(TEXT_NODE);
DIRECTORY_PATH := REPOSITORY_FOLDER_PATH || DIRECTORY_PATH;
createDirectoryTree(DIRECTORY_PATH);
END LOOP;
-- Load the Resources into the XML DB Repository
FILES_NL := DBMS_XMLDOM.GETELEMENTSBYTAGNAME(FILELIST_DOM,'files');
FILES_NODE := DBMS_XMLDOM.ITEM(FILES_NL,0);
REPLACE_DEFAULT := FALSE;
REPLACE_ATTR := DBMS_XMLDOM.getAttributeNode(DBMS_XMLDOM.MAKEELEMENT(FILES_NODE),'replace');
if not (DBMS_XMLDOM.ISNULL(REPLACE_ATTR)) then
REPLACE_DEFAULT := xdb_dom_helper.varchar_to_boolean(DBMS_XMLDOM.getVALUE(REPLACE_ATTR));
end if;
FILENAME_NL := DBMS_XMLDOM.GETELEMENTSBYTAGNAME(FILELIST_DOM,'file');
FOR i in 0 .. (DBMS_XMLDOM.GETLENGTH(FILENAME_NL) - 1) LOOP
FILE_NODE := DBMS_XMLDOM.ITEM(FILENAME_NL,i);
TEXT_NODE := DBMS_XMLDOM.GETFIRSTCHILD(FILE_NODE);
TARGET_FILE_PATH := DBMS_XMLDOM.GETNODEVALUE(TEXT_NODE);
TARGET_FILE_NAME := substr(TARGET_FILE_PATH,instr(TARGET_FILE_PATH,pathSeperator,-1)+1);
TARGET_FOLDER_PATH := substr(TARGET_FILE_PATH,1,instr(TARGET_FILE_PATH,pathSeperator,-1));
TARGET_FOLDER_PATH := substr(TARGET_FOLDER_PATH,instr(TARGET_FOLDER_PATH,pathSeperator));
TARGET_FOLDER_PATH := substr(TARGET_FOLDER_PATH,1,length(TARGET_FOLDER_PATH)-1);
RESOURCE_PATH := REPOSITORY_FOLDER_PATH || TARGET_FOLDER_PATH || '/' || TARGET_FILE_NAME;
-- dbms_output.put_line('Source = ' || TARGET_FILE_PATH);
-- dbms_output.put_line('File = ' || TARGET_FILE_NAME);
-- dbms_output.put_line('Target = ' || RESOURCE_PATH);
ENCODING_ATTR := DBMS_XMLDOM.getAttributeNode(DBMS_XMLDOM.MAKEELEMENT(FILE_NODE),'encoding');
ENCODING_TEXT := 'AL32UTF8';
if not (DBMS_XMLDOM.ISNULL(ENCODING_ATTR)) then
ENCODING_TEXT := DBMS_XMLDOM.getValue(ENCODING_ATTR);
dbms_output.put_line('Encoding for ' || TARGET_FILE_NAME || ' = ' || ENCODING_TEXT);
end if;
REPLACE_ATTR := DBMS_XMLDOM.getAttributeNode(DBMS_XMLDOM.MAKEELEMENT(FILE_NODE),'Replace');
REPLACE_OPTION := REPLACE_DEFAULT;
if not (DBMS_XMLDOM.ISNULL(REPLACE_ATTR)) then
REPLACE_OPTION := xdb_dom_helper.varchar_to_boolean(DBMS_XMLDOM.getValue(REPLACE_ATTR));
end if;
CONTENT_XML := xmltype(bfilename(UPLOAD_DIRECTORY_NAME,TARGET_FILE_PATH),nls_charset_id(ENCODING_TEXT));
if (REPLACE_OPTION and dbms_xdb.existsResource(RESOURCE_PATH)) then
dbms_xdb.deleteResource(RESOURCE_PATH);
end if;
result := dbms_xdb.createResource(RESOURCE_PATH,CONTENT_XML);
filecount := filecount + 1;
if (filecount = BATCH_SIZE) then
filecount := 0;
commit;
end if;
END LOOP;
end;
procedure put_xml(XML XMLTYPE)
as
buffer CLOB;
offset binary_integer := 1;
maxLength binary_integer;
endofLine binary_integer := 1;
linesize binary_integer;
begin
buffer := xml.getClobVal();
maxLength := dbms_lob.getLength(buffer);
endofline := dbms_lob.instr(buffer,chr(10),offset,1);
while (endofLine > 0) loop
linesize := endofline - offset;
if (linesize > 255) then
dbms_output.put_line(dbms_lob.substr(buffer,255,offset));
offset := offset + 255;
else
dbms_output.put_line(dbms_lob.substr(buffer,linesize,offset));
offset := offset + linesize + 1;
end if;
endofline := dbms_lob.instr(buffer,chr(10),offset,1);
end loop;
linesize := maxLength - offset;
dbms_output.put_line(dbms_lob.substr(buffer,linesize+1,offset));
end;
function getDefaultTableName(path varchar2)
return varchar2
as
targetURL varchar2(4096);
schemaURL varchar2(1024);
elementName varchar2(2000);
defaultTableName varchar2(32);
begin
select extractValue(res,'/Resource/SchemaElement')
into targetURL
from resource_view
where equals_path(res,path) = 1;
schemaURL := substr(targetURL,1,instr(targetURL,'#')-1);
elementName := substr(targetURL,instr(targetURL,'#')+1);
select extractValue
schema,
'/xsd:schema/xsd:element[@name="' || elementName || '"]/@xdb:defaultTable',
xdb_namespaces.XMLSCHEMA_PREFIX_XSD || ' ' || xdb_namespaces.XDBSCHEMA_PREFIX_XDB
into defaultTableName
from user_xml_schemas
where schema_URL = schemaURL;
-- dbms_output.put_line('schemaURL = ' || schemaURL);
-- dbms_output.put_line('XPath = ' || '/xsd:schema/xsd:element[@name="' || elementName || '"]/@xdb:defaultTable');
-- dbms_output.put_line('Namespaces = ' || xdb_namespaces.XMLSCHEMA_PREFIX_XSD || ' ' || xdb_namespaces.XDBSCHEMA_PREFIX_XDB );
-- dbms_output.put_line('Default Table = ' || defaultTableName );
return defaultTableName;
end;
function getXMLReferenceByResID(resoid RAW)
return REF XMLType
as
begin
return xdb_helper.getXMLReferenceByResID(resoid);
end;
function getXMLReference(path varchar2)
return REF XMLType
as
begin
return xdb_helper.getXMLReference(path);
end;
function isCheckedOut(PATH VARCHAR2)
return number
as
begin
return xdb_helper.isCheckedOut(PATH);
end;
function isCheckedOutbyRESID(RESOID RAW)
return number
as
begin
return xdb_helper.isCheckedOutByRESID(RESOID);
end;
procedure cloneXMLContent(path varchar2)
as
begin
update resource_view
set res = updateXML(res,'/Resource/DisplayName',extract(res,'/Resource/DisplayName'))
where equals_path(res, path) = 1;
end;
procedure updateXMLContent(path varchar2, content xmltype)
as
defaultTableName varchar2(32);
sqlStatement varchar2(1000);
begin
defaultTableName := getDefaultTableName(path);
cloneXMLContent(path);
sqlStatement := 'update "' || defaultTableName || '" d set object_value = :1 where ref(d) = xdb_utilities.getXMLReference(:2)';
dbms_output.put_line('SQL Statement ' || sqlStatement);
execute immediate sqlStatement using content , path;
end;
procedure renameCollectionTable (XMLTABLE varchar2, XPATH varchar2, COLLECTION_TABLE_PREFIX varchar2)
as
SYSTEM_GENERATED_NAME varchar2(256);
COLLECTION_TABLE_NAME varchar2(256);
CLUSTERED_INDEX_NAME varchar2(256);
PARENT_INDEX_NAME varchar2(256);
RENAME_STATEMENT varchar2(4000);
begin
COLLECTION_TABLE_NAME := COLLECTION_TABLE_PREFIX || '_TABLE';
CLUSTERED_INDEX_NAME := COLLECTION_TABLE_PREFIX || '_DATA';
PARENT_INDEX_NAME := COLLECTION_TABLE_PREFIX || '_LIST';
select TABLE_NAME
into SYSTEM_GENERATED_NAME
from ALL_NESTED_TABLES
where PARENT_TABLE_NAME = XMLTABLE
and PARENT_TABLE_COLUMN = XPATH
and OWNER = USER;
RENAME_STATEMENT := 'alter table ' || USER || '."' || SYSTEM_GENERATED_NAME || '" rename to "' ||COLLECTION_TABLE_NAME || '"';
-- dbms_output.put_line(RENAME_STATEMENT);
execute immediate RENAME_STATEMENT;
begin
select INDEX_NAME
into SYSTEM_GENERATED_NAME
from ALL_INDEXES
where TABLE_NAME = COLLECTION_TABLE_NAME
and INDEX_TYPE = 'IOT - TOP'
and OWNER = USER;
RENAME_STATEMENT := 'alter index ' || USER || '."' || SYSTEM_GENERATED_NAME || '" rename to "' || CLUSTERED_INDEX_NAME || '"';
-- dbms_output.put_line(RENAME_STATEMENT);
execute immediate RENAME_STATEMENT;
exception
when NO_DATA_FOUND then
null;
end;
begin
select INDEX_NAME
into SYSTEM_GENERATED_NAME
from ALL_IND_COLUMNS
where COLUMN_NAME = XPATH
and TABLE_NAME = XMLTABLE
and TABLE_OWNER = USER;
RENAME_STATEMENT := 'alter index ' || USER || '."' || SYSTEM_GENERATED_NAME || '" rename to "' || PARENT_INDEX_NAME || '"';
-- dbms_output.put_line(RENAME_STATEMENT);
execute immediate RENAME_STATEMENT;
exception
when NO_DATA_FOUND then
null;
end;
end;
function processNestedTable(currentLevel in out number, currentNode in out XMLType, query SYS_REFCURSOR)
return XMLType
is
thisLevel number;
thisNode xmlType;
result xmlType;
begin
thisLevel := currentLevel;
thisNode := currentNode;
fetch query into currentLevel, currentNode;
if (query%NOTFOUND) then
currentLevel := -1;
end if;
while (currentLevel >= thisLevel) loop
-- Next Node is a decendant of sibling of this Node.
if (currentLevel > thisLevel) then
-- Next Node is a decendant of this Node.
result := processNestedTable(currentLevel, currentNode, query);
select xmlElement
"Collection",
extract(thisNode,'/Collection/*'),
xmlElement
"NestedCollections",
result
into thisNode
from dual;
else
-- Next node is a sibling of this Node.
result := processNestedTable(currentLevel, currentNode, query);
select xmlconcat(thisNode,result) into thisNode from dual;
end if;
end loop;
-- Next Node is a sibling of some ancestor of this node.
return thisNode;
end;
function printNestedTables(XML_TABLE varchar2)
return XMLType
is
query SYS_REFCURSOR;
result XMLType;
rootLevel number := 0;
rootNode xmlType;
begin
open query for
select level, xmlElement
"Collection",
xmlElement
"CollectionId",
PARENT_TABLE_COLUMN
) as XML
from USER_NESTED_TABLES
connect by PRIOR TABLE_NAME = PARENT_TABLE_NAME
start with PARENT_TABLE_NAME = XML_TABLE;
fetch query into rootLevel, rootNode;
result := processNestedTable(rootLevel, rootNode, query);
select xmlElement
"NestedTableStructure",
result
into result
from dual;
return result;
end;
procedure printXMLToFile(xmlContent XMLType, targetDirectory varchar2, Filename VARCHAR2)
is
fHandle utl_file.File_Type;
xmlText CLOB := xmlContent.getClobVal();
xmlTextCopy CLOB;
xmlTextSize binary_integer := dbms_lob.getLength(xmlText) + 1;
offset binary_integer := 1;
buffer varchar2(32767);
linesize binary_integer := 32767;
byteCount binary_integer;
lob1 clob;
begin
dbms_lob.createtemporary(xmlTextCopy,TRUE);
dbms_lob.copy(xmlTextCopy, xmlText, xmlTextSize);
-- dbms_output.put_line('Text Size = ' || xmlTextSize);
fhandle := utl_file.fopen(targetDirectory,Filename,'w',linesize);
while (offset < xmlTextSize) loop
if (xmlTextSize - offset > linesize) then
byteCount := linesize;
else
byteCount := xmlTextSize - offset;
end if;
-- dbms_output.put_line('Offset = ' || Offset || ' ByteCount = '|| byteCount);
dbms_lob.read(xmlTextCopy, byteCount, offset, buffer);
-- dbms_output.put_line('After Read : ByteCount = '|| byteCount);
offset := offset + byteCount;
utl_file.put(fHandle, buffer);
utl_file.fflush(fHandle);
end loop;
utl_file.new_line(fhandle);
utl_file.fclose(fhandle);
dbms_lob.freeTemporary(xmlTextCopy);
end;
procedure updateBinaryContent(path VARCHAR2,content BLOB)
is
xmllob BLOB;
begin
update RESOURCE_VIEW
set res = updateXML(res,'/Resource/DisplayName/text()',extractValue(res,'/Resource/DisplayName/text()'))
where equals_path(res,path) = 1;
select extractValue(res,'/Resource/XMLLob')
into xmllob
from RESOURCE_VIEW
where equals_path(res,path) = 1;
dbms_lob.open(xmllob,dbms_lob.lob_readwrite);
dbms_lob.trim(xmllob,0);
dbms_lob.copy(xmllob,content,dbms_lob.getLength(content),1,1);
dbms_lob.close(xmllob);
end;
procedure updateCharacterContent(path VARCHAR2,content CLOB,db_charset VARCHAR2)
is
xmllob BLOB;
source_offset integer := 1;
target_offset integer := 1;
warning integer;
lang_context integer := 0;
begin
update RESOURCE_VIEW
set res = updateXML(res,'/Resource/DisplayName/text()',extractValue(res,'/Resource/DisplayName/text()'))
where equals_path(res,path) = 1;
select extractValue(res,'/Resource/XMLLob')
into xmllob
from RESOURCE_VIEW
where equals_path(res,path) = 1;
dbms_lob.open(xmllob,dbms_lob.lob_readwrite);
dbms_lob.trim(xmllob,0);
dbms_lob.convertToBlob(xmllob,content,dbms_lob.getLength(content),source_offset,target_offset,nls_charset_id(db_charset),lang_context,warning);
dbms_lob.close(xmllob);
end;
function getVersionsByPath(path VARCHAR2)
return RESOURCE_ID_TABLE pipelined
as
RESOURCE_ID raw(16);
SOURCE_LIST DBMS_XDB_VERSION.RESID_LIST_TYPE;
begin
select resid
into RESOURCE_ID
from resource_view
where equals_path(res,path) = 1;
pipe row (RESOURCE_ID);
SOURCE_LIST := DBMS_XDB_VERSION.GETPREDECESSORS(PATH);
while SOURCE_LIST.COUNT > 0 loop
pipe row (SOURCE_LIST(1));
SOURCE_LIST := DBMS_XDB_VERSION.GETPREDSBYRESID(SOURCE_LIST(1));
end loop;
return;
end;
function getVersionsByResid(RESID RAW)
return RESOURCE_ID_TABLE pipelined
as
SOURCE_LIST DBMS_XDB_VERSION.RESID_LIST_TYPE;
begin
pipe row (RESID);
SOURCE_LIST := DBMS_XDB_VERSION.GETPREDSBYRESID(RESID);
while SOURCE_LIST.COUNT > 0 loop
pipe row (SOURCE_LIST(1));
SOURCE_LIST := DBMS_XDB_VERSION.GETPREDSBYRESID(SOURCE_LIST(1));
end loop;
return;
end;
end XDB_UTILITIES_10200;
show errors
grant execute on XDB_UTILITIES_10200 to public
create or replace public synonym XDB_UTILITIES for XDB_UTILITIES_10200
desc XDB_UTILITIES
alter session set current_schema = SYS
/
Similar Messages
-
Please help me with PL/SQL problem
Hi to all
This is my problem. I have a database with several tables. I will mention just some important for this problem. I have a table called Invoice, where I have following atributes
sifrac number(9) not null primary key,
datrac date default sysdate,
sifkup number(5),
sifprod number(5) not null,
ukcena number(5,2)
Then I have table called History of customer where I have
constraint pk_istkup primary key(sifrac,sifkup),
sifrac number(9) constraint fk_sifrac2 references racun(sifrac),
sifkup number(5) constraint fk_sifkup3 references kupac(sifkup) this is primary key in a table customer,
datrac date default sysdate,
ukcena number(5,2) this is total price of purchased stuff per one invoice.
What I would like to do now is make a trigger before insert or update table Invoice which check table History of customer and make a calculation of all total prices per one customer and if that customer made a purchase which is more than 1000 dollars then it have to make a calculation of total price*discount percent.How can I do that.
Thanks to all in advanceBilly Verreynne wrote:
LKBrwn_DBA wrote:
This type of functionality (a business rule to compute discount) would normally be added at the application level and not in a trigger. Why? Does business rule code need Java to be expressed correctly? Does Java (or whatever application layer language) used provide a better set of instructions for doing business rules than PL/SQL? Is business code written using a special keyboard and a pretty font?
And what happens when new system feeds invoice data for new department/division directly into the database, bypassing the app layer? What happens to that app layer business logic now?
It is a fallacy that business rules and logic needs to reside in a separate layer as that is somehow better. I disagree. LKBrwn_DBA didn't mention Java as an application layer. And he was not strict about it. So yes it is possible to use a trigger. But business logic tends to be changed fequently. So the rules for the logic might change. I would implement such logic using a pacakged pl/sql api. Triggers I would use for data validations and checks that are less likely to be changed.
As always it depends. But the general advice to have a certain level of business logic (e.g. apis) and another level of data integration and consitency layer (e.g. constraints and triggers) is a good advice.
As for bypassing the application layer. If an new system is able to do that, it can wreck even more havoc. A good anti mechanism is to expose only the APIs layer in a separate schema. The new system will have access to the schema and to the packages that are specified there. But it won't have direct dml to the tables.
Main question for me would be: Is that a business rule or is it a data integration rule (e.g. keep redundant data in different tables harmonized). This influences where the logic will be implemented.
Edited by: Sven W. on Oct 2, 2009 8:59 AM -
Does anyone feel like being nice and helping me with an sql problem?
i know its not java but ive posted on sql forums and got no where, so i was hoping someone here would know how to do what i want to do
the link to the forum post is
http://forums.mysql.com/read.php?10,49695,49695#msg-49695
the basic thing is
im trying to sort a shopping basket into the most popular products
so if the data was
basketID||orderID||productID||quantity
1||1||2||1
2||1||3||6
3||1||4||1
4||2||2||1
5||2||4||1
6||3||4||1
then im using this statement
SELECT productID,COUNT(*) AS cat_num FROM shopbasket_table GROUP BY productID ORDER BY cat_num DESC LIMIT 0,10
which sorts them like
productID
4
2
3
but this doesnt take in to account the quantity in the basket which it really should
as product 3 has 6 in the basket
so it should be
3
4
2
anyone know enough about sql to know what im missing from my statement?
sorry again for posting on the java forum, u peeps are just super smart though and im sure someone here would know :)I don't know how to do it in mysql, but it appears to be a "crosstab" kind of problem. This article may help
-
Its me again with a SQL problem
i use now prepared statements... now i have to insert a Date/Time object into my access database.
there it must have the following format:
19.02.2002 18:25:45
when i setDate(), i recieve the format: 19.02.2002
when i setTime(),i recieve the format: 18:25:45
what to do to combine them?
thx in advance
christhank u very much!
it works fine... -
At the creation of MCD we got the problem with Request
Hi All,
we are all very new to SAP MI,
At the creation of CD we got the problem with Request
<i><b>Creation of CD</b></i>
we gave these entries
<b>1.Mobile Solution Name : CIBERNW
Version : 1001
Description : Ciber Netweaver Mobile
Cmponent Type : APPLICATION
Runtime Enviroment : JSP</b>
In SyncBO tab we specified our SyncBO that is <b>ZNWW_EX01</b>
we selected the check two checkboxs that is
<b>->SyncBOs Expect Initial Value
->Data Visible to all</b>
2.when i am trying to <b>save the MCD</b> it will open one dialog box that is
<b>"Object can only created in SAP Package "</b> -> Continue
<b>"Link to Transport "</b> it says
<b>"Include MCD in Transport Request", "Yes","No"</b>
when i will go for <b>"Yes"</b>
it will give one more dialog box that is
<b>"prompt of workbeanch Request"</b>
it will give one Request bydefault that is <b>"CNWK900030"</b>
there we have some option that is
<b> ->Continue
->Create Request
->Own Request</b>
which one we will select ?
i will go for <b>Continue</b> it will open other dialog box it says
<b>"Include MiniApp in Transport Request"</b>
it says <b>"MiniApp must be assigned to a transport request"</b>
i will go for continue it will the message in the status bar
<b>"MCD Changed"</b>
can you please tell me this process is Right or wrong
if it is wrong can you please tell me the right process
and it will some default Requests which Request we need to select
or we need to create the Request where we need to create that
what is process we need to follow ?
Thanks and Regards
Dileep PainnamaneniHi Dileep,
<<Creation of MCD >>
<<we gave these entries >>
<b><<1.Mobile Solution Name : CIBERNW
Version : 1001
Description : Ciber Netweaver Mobile
Cmponent Type : APPLICATION
Runtime Enviroment : JSP>>
In SyncBO tab we specified our SyncBO that is ZNWW_EX01
we selected the check two checkboxs that is
->SyncBOs Expect Initial Value
->Data Visible to all</b>
Every thing is fine. We need to check Link to <b>SAP MI Home page</b> check box
<b>2.when i am trying to save the MCD it will open one dialog box that is
"Object can only created in SAP Package " -> Continue
"Link to Transport " it says
"Include MCD in Transport Request", "Yes","No"
when i will go for "Yes"
it will give one more dialog box that is
"prompt of workbeanch Request"
it will give one Request bydefault that is "CNWK900030"
there we have some option that is
->Continue
->Create Request
->Own Request
which one we will select ?
i will go for Continue it will open other dialog box it says
"Include MiniApp in Transport Request"
it says "MiniApp must be assigned to a transport request"
i will go for continue it will the message in the status bar
"MCD Changed"</b>
In SAP when ever we create any object(tables or MCDs) :
there are two things CUSTOMER NAME SPACE(stored locally in that system only) and FORIEGN NAME SPACE(can be transported)
CUSTOMER NAME SPACE objects starts with 'Z' or 'Y'
FORIEGN NAME SPACE objects starts with any other digit other than 'Z' or 'Y'
So youhave created MCD name CIBERNW which starts with 'C' (its not customer name space with z or y)
so it will be stored in package(so that this package can be transported to any other system later)
So what ever you have done is correct.
You can create your own request also.
But confirm once that whether you are supposed to store your MCD this that package.
<b>
can you please tell me this process is Right or wrong
if it is wrong can you please tell me the right process
and it will some default Requests which Request we need to select
or we need to create the Request where we need to create that
what is process we need to follow ?</b>
So this is the concept of request.
So this request is nothing but....
When ever we create tables or MCDs we try to save it..so if we are trying to create objects in Foreign name space(i.e without 'Z' or 'Y' inthe beginning) so it will ask to create this object in a package which requires request(transport request)
All objects are stored in package,( so this package contains many objects like MCD,SYNBOS etc what ever we store in it) so we can transport this package from one system to another system so to transport we need to generate a transport request for that package and them release that transport request.....
So once the package is released and we try to edit or create new objects in that package it will ask for some new request.....
Yes we can create our own request and later release it.
But in your case u can take up the default request and continue.
If this MCD is for only testing purpose(for our selfs)..means this MCD is just for our testing sake..its better to create it in Customer name space..starts with 'Z' or 'Y'.
I hope its clear.
Cheers,
Karthick -
Problems with PL/SQL packages
Hello,
I face the following problem with PL/SQL stored procedures. The Oracle
version is 8.0.5 on Windows NT 4. The PL/SQL package has a set of procedures and functions.
The main procedure of the PL/SQL package is triggered from VC++ executable. If for some reason,
an exception is caught in the stored procedure (like no_data_found
exception), then the following problem occurs.
If we try to trigger the stored procedure again through the VC++ executable,
the variables in the stored procedures have the values as in the previous
execution. They are not getting initialised. (The same database connection
is used in VC++ executable).
Currently, only if a new connection to the database is used , the problem is
solved.
Also, change in the input parameters of the procedure is not reflected, once the procedure fails because of any exception. Only the input which was given during the time of execution when the procedure failed,is considered.
What could be the reason for this problem and how can this be corrected?
Please send in your suggestions.
Thanks and Regards,
Ramya Priya
nullHi Keith,
I am connecting to the database as the package owner..
I have noticed earlier that I have problems when capturing triggers also.. The content of one large trigger contains 36371 characters and when capturing it from DB, the content was truncated to 28020 characters in Designer.
Our ideas with capturing the DB packages/procedures were to use the Designer as version control system.
We wanted to have all objects used in a project in Designer.. entities, tables, triggers, packages, procedures, Forms files, etc. in order to make a configuration for a project release.
Thank you,
Claudia -
Problem with NW04s SR2 installation with MS SQL Server 2000 SP4
Im struggling with the NW04s installation with MS SQL Server 2000.
The installation stops at the step Create/modify database schema SAPJ2EDB.
The following error/info from log file,
INFO 2007-06-06 12:02:33 [iaxxgenimp.cpp:632]
showDialog()
Execute step doConfiguration of component |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_CreateDB|ind|ind|ind|ind|0|0|NW_MSS_DB|ind|ind|ind|ind|2|0|NW_MSS_SRVCFG|ind|ind|ind|ind|6|0.
INFO 2007-06-06 12:02:35 [iaxxgenimp.cpp:632]
showDialog()
Execute step doTempdb of component |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_CreateDB|ind|ind|ind|ind|0|0|NW_MSS_DB|ind|ind|ind|ind|2|0|MssDowntimeConfig|ind|ind|ind|ind|7|0.
INFO 2007-06-06 12:02:36 [iaxxgenimp.cpp:632]
showDialog()
Execute step doSwitch of component |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_CreateDB|ind|ind|ind|ind|0|0|NW_MSS_DB|ind|ind|ind|ind|2|0|MssDowntimeConfig|ind|ind|ind|ind|7|0.
INFO 2007-06-06 12:02:36 [iaxxgenimp.cpp:632]
showDialog()
Execute step doTempDBAnalyze of component |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_CreateDB|ind|ind|ind|ind|0|0|NW_MSS_DB|ind|ind|ind|ind|2|0|MssDowntimeConfig|ind|ind|ind|ind|7|0.
INFO 2007-06-06 12:02:37 [iaxxgenimp.cpp:632]
showDialog()
Execute step doTempDBBeforeRestart of component |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_CreateDB|ind|ind|ind|ind|0|0|NW_MSS_DB|ind|ind|ind|ind|2|0|MssDowntimeConfig|ind|ind|ind|ind|7|0.
INFO 2007-06-06 12:02:38 [iaxxgenimp.cpp:632]
showDialog()
Execute step doRestartServer of component |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_CreateDB|ind|ind|ind|ind|0|0|NW_MSS_DB|ind|ind|ind|ind|2|0|MssDowntimeConfig|ind|ind|ind|ind|7|0.
INFO 2007-06-06 12:02:58 [ianxbservi.cpp:697]
CIaNtServices::stop(const map<iastring,iastring>&)
The service 'MSSQLSERVER' stopped successfully on host 'GBCZ672C'.
INFO 2007-06-06 12:03:10 [ianxbservi.cpp:632]
CIaNtServices::start(const map<iastring,iastring>&)
The service 'MSSQLSERVER' started successfully on host 'GBCZ672C'.
INFO 2007-06-06 12:03:21 [ianxbservi.cpp:632]
CIaNtServices::start(const map<iastring,iastring>&)
The service 'SQLSERVERAGENT' started successfully on host 'GBCZ672C'.
INFO 2007-06-06 12:03:21 [iaxxgenimp.cpp:632]
showDialog()
Execute step doTempDBAfterRestart of component |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_CreateDB|ind|ind|ind|ind|0|0|NW_MSS_DB|ind|ind|ind|ind|2|0|MssDowntimeConfig|ind|ind|ind|ind|7|0.
INFO 2007-06-06 12:03:22 [iaxxgenimp.cpp:632]
showDialog()
Execute step doChangeTempSetNewSize of component |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_CreateDB|ind|ind|ind|ind|0|0|NW_MSS_DB|ind|ind|ind|ind|2|0|MssDowntimeConfig|ind|ind|ind|ind|7|0.
INFO 2007-06-06 12:03:39 [iaxxgenimp.cpp:632]
showDialog()
Execute step CheckParameters of component |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_CreateDB|ind|ind|ind|ind|0|0|NW_MSS_DB|ind|ind|ind|ind|2|0|MssSchemaCreate|ind|ind|ind|ind|9|0.
INFO 2007-06-06 12:03:39 [iaxxgenimp.cpp:632]
showDialog()
Execute step CreateDirectories of component |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_CreateDB|ind|ind|ind|ind|0|0|NW_MSS_DB|ind|ind|ind|ind|2|0|MssSchemaCreate|ind|ind|ind|ind|9|0.
INFO 2007-06-06 12:03:40 [iaxxgenimp.cpp:632]
showDialog()
Execute step CreateDatabase of component |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_CreateDB|ind|ind|ind|ind|0|0|NW_MSS_DB|ind|ind|ind|ind|2|0|MssSchemaCreate|ind|ind|ind|ind|9|0.
ERROR 2007-06-06 12:03:40 [iaxxgenimp.cpp:731]
showDialog()
FCO-00011 The step CreateDatabase with step key |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_CreateDB|ind|ind|ind|ind|0|0|NW_MSS_DB|ind|ind|ind|ind|2|0|MssSchemaCreate|ind|ind|ind|ind|9|0|CreateDatabase was executed with status ERROR .
ERROR 2007-06-06 12:03:40
lib=iamodmssql module=CIaNtMssDmo
MDB-05053 Errors when executing sql command: <p nr="0"/> If this message is displayed as a warning - it can be ignored. If this is an error - call your SAP support.
INFO 2007-06-06 12:04:04 [iaxxgenimp.cpp:774]
showDialog()
An error occured and the user decided to retry the current step: "|NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_CreateDB|ind|ind|ind|ind|0|0|NW_MSS_DB|ind|ind|ind|ind|2|0|MssSchemaCreate|ind|ind|ind|ind|9|0|CreateDatabase".
ERROR 2007-06-06 12:04:05 [iaxxgenimp.cpp:731]
showDialog()
FCO-00011 The step CreateDatabase with step key |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_CreateDB|ind|ind|ind|ind|0|0|NW_MSS_DB|ind|ind|ind|ind|2|0|MssSchemaCreate|ind|ind|ind|ind|9|0|CreateDatabase was executed with status ERROR .
Please let me know if you can help or if there is any other way around.
Many Thanks in advance.
Ritin JainHi All,
I was not able to solve the problem with MS SQL 2000, but I was able to resolve the issue with MS SQL 2005.
You have to chhose the following settings while instalation,
Service Account - Select one of the following options:
1) Use the built-in System account for each service and choose Local system or Network Service.
2) Use a domain user account, and enter the user name and password.
Under Start services at the end of setup make sure that SQL Server and SQL Server Agent are selected.
Authentication Mode
1) Select Mixed Mode (Windows Authentication and SQL Server Authentication).
This mode is required for a Java or ABAP+Java system.
If you choose this mode, you have to set the password for the sa login.
Note: The password for the sa login must comply with the Windows password policy.
Collation Settings
1) Select SQL collations (used for compatibility with previous versions of SQL Server).
2) From the drop-down list select Binary order based on code point comparison, for use with the 850 (Multilingual) Character Set.
I hope this helps! -
Does anyone out there use dynamic SQL with DB2? If so, are the sql statements causing a PreparedStatement to be executed on DB2. I posted this question similarly before, but never resolved it, and it is killing me. I have to resolve this ASAP!
Here is the problem: My DB2 Admin says that EVERY TIME I access the database, my Java app is causing the database to create a PreparedStatement. However, I'm using Statement objects exclusively, with dynamic SQL. He says that DB2 needs an "access path" for the client, and that it converts the Statement to a PreparedStatement, as this is the only way to get this "access path". He says the only solution is either stored procedures or SQLJ, which will do the binding in advance, and increase performance tremendously. However, I am STRONGLY opposed to using SQLJ, and if we do stored procedures, we'd have to write one for every possible SQL statment! I KNOW there is a better solution.
Is anyone out there having these problems with JDBC and DB2? Surely someone out there uses DB2 and JDBC and either has these problems or can confirm that something is incorrectly configured on the database side.
Any help would be great. Thanks, WillNow I'm wondering if maybe the PreparedStatements are ONLY being called on the database when I call getConnection(), and not when I call executeQuery() or executeUpdate() from the Statement object. I just can't see why the database would have to make an access path for every SQL statement executed, but I could see it creating an access path for every connection requested. Any thoughts on that theory?
-
Problem with MS SQL 2005 JDBC Conection
Dear all,
I am new user of MS SQL Server 2005 database and Java developer.
When I conect to MS SQL Server 2005 i have a problem with conection.
First I creat new class named DaoTest to test MS SQL conection.
Here I show my code complete.
{color:#0000ff}
import java.sql.Connection;
import java.sql.Statement;
import com.microsoft.sqlserver.jdbc.SQLServerDataSource;
public class DaoTest {
private Connection connection;
public DaoTest() {
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
SQLServerDataSource ds = new SQLServerDataSource();
ds.setUser("sa");
ds.setPassword("deanweb");
ds.setServerName("localhost");
ds.setPortNumber(1434);
ds.setDatabaseName("common");
connection= ds.getConnection();
} catch (Exception e) {
e.printStackTrace();
public static void main(String[] args) throws Exception {
DaoTest daoTest1 = new DaoTest();
DaoTest daoTest2 = new DaoTest();
}{color}
{color:#000000}and when I run this class a error appeared:{color}
{color:#ff0000}com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSChannel.read(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.Prelogin(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDataSource.getConnectionInternal(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDataSource.getConnection(Unknown Source)
at DaoTest.<init>(DaoTest.java:21)
at DaoTest.main(DaoTest.java:32)
{color:#000000}But when i change main methol as{color}:
{color}{color:#0000ff}public static void main(String[] args) throws Exception {
DaoTest daoTest1 = new DaoTest();
daoTest1.connection.close();
DaoTest daoTest2 = new DaoTest();
}{color}
->>successful.
{color:#ff0000}{color:#000000}That mean I {color}**can not**{color} creat more than one instance of class DaoTest if i do not close {color:#000000}*daoTest1*'{color}s conection.
I only see this error with MS SQL Server,none in Postgres or HSQL.
Please help me.
Thank for reading and I am waiting for your reply.
sorry my english.
[email protected]
Edited by: DrNhut on Jun 24, 2008 3:39 AM
Edited by: DrNhut on Jun 24, 2008 3:44 AMThank you.
I try your code but it didn't work.
So,here my code with your opinion
String connectionUrl = "jdbc:sqlserver://localhost:1434;"
+ "databaseName=common;selectMethod=cursor;";
// Declare the JDBC objects.
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try {
// Establish the connection.
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
con = DriverManager.getConnection(connectionUrl,"sa","deanweb");
} catch (Exception e) {
e.printStackTrace();
public static void main(String[] args) throws Exception {
DaoTest daoTest1 = new DaoTest();
// daoTest1.connection.close();
DaoTest daoTest2 = new DaoTest();
}It throws same error with my last posted.
I can't use your code exactlyString connectionUrl = "jdbc:sqlserver://localhost:1434/common;selectMethod=cursor";because it throws a new exception:com.microsoft.sqlserver.jdbc.SQLServerException: The port number 1434/common is not valid.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)May be I change my DBMS instead of MS SQL 2005.
(I nead a database can manage big data.So,I choose MS SQL).
thank you.
DrNhut.
Edited by: DrNhut on Jun 25, 2008 6:39 PM -
Problems configuring Platform Domain with MS Sql Server
Hi,
We are having problems configuring a Platform Domain with MS Sql Server 2000.
We are using Weblogic version 7.0.0.2. These are the steps we followed
1.We manually created a database called TestDB and created a user account called
"system", pwd ==>> "weblogic" in SQL server and assigned him as the DB owner for
the TestDB created.
2. Changed dbsettings_properties files (Commented pointbase entries and uncommented
SQL Server entries. I gave the connection parameter as connection=jdbc:weblogic:mssqlserver4:localhost:1433
in this file.
3. Modified Config.xml and changed properties for DataSyncPool, WLIPool, CommercePool,WLIPool
and modified the RDBMS realm properties to point to the database.
4. ran the create_db script and it seemed to have run fine looking at the log
file.
5. I then tried to start the BEA Server instance and I get the following error.
I am also attaching the config.xml file for reference.
Appreciate any help/suggestions. Thanks in Advance.
Vikram
<Apr 9, 2003 2:57:45 AM EDT> <Error> <RDBMSRealm> <000000> <An error occured cre
ating a database connection for the realm.
java.sql.SQLException: Invalid port: weblogic:mssqlserver4:localhost:1433
at weblogic.jdbc.mssqlserver4.ConnectionInfo.<init>(ConnectionInfo.java:
193)
at weblogic.jdbc.mssqlserver4.ConnectDriver.parse(ConnectDriver.java:333
at weblogic.jdbc.mssqlserver4.ConnectDriver.connect(ConnectDriver.java:1
02)
at com.bea.p13n.security.realm.RDBMSDelegate.<init>(RDBMSDelegate.java:1
69)
at com.bea.p13n.security.realm.RDBMSDelegate$DFactory.getInstance(RDBMSD
elegate.java:962)
at com.bea.p13n.security.realm.internal.Pool.<init>(Pool.java:53)
at com.bea.p13n.security.realm.RDBMSRealm.createPool(RDBMSRealm.java:153
at com.bea.p13n.security.realm.RDBMSRealm.<init>(RDBMSRealm.java:140)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:232)
at weblogic.security.acl.Realm.getRealm(Realm.java:87)
at weblogic.security.acl.Realm.getRealm(Realm.java:65)
at weblogic.security.SecurityService.initializeRealm(SecurityService.jav
a:353)
at weblogic.security.providers.realmadapter.AuthorizationProviderImpl.in
itialize(AuthorizationProviderImpl.java:72)
at weblogic.security.service.SecurityServiceManager.createSecurityProvid
er(SecurityServiceManager.java:1875)
at weblogic.security.service.AuthorizationManager.initialize(Authorizati
onManager.java:206)
at weblogic.security.service.AuthorizationManager.<init>(AuthorizationMa
nager.java:127)
at weblogic.security.service.SecurityServiceManager.doATZ(SecurityServic
eManager.java:1613)
at weblogic.security.service.SecurityServiceManager.initializeRealm(Secu
rityServiceManager.java:1426)
at weblogic.security.service.SecurityServiceManager.loadRealm(SecuritySe
rviceManager.java:1365)
at weblogic.security.service.SecurityServiceManager.initializeRealms(Sec
urityServiceManager.java:1487)
at weblogic.security.service.SecurityServiceManager.initialize(SecurityS
erviceManager.java:1207)
at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:723)
at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
at weblogic.Server.main(Server.java:32)
>
<Apr 9, 2003 2:57:45 AM EDT> <Emergency> <WebLogicServer> <000342> <Unable to
in
itialize the server: Fatal initialization exception
Throwable: java.lang.IllegalAccessError: Exception[com.bea.p13n.security.realm.R
DBMSException: An error occured creating a database connection for the realm.]
java.lang.IllegalAccessError: Exception[com.bea.p13n.security.realm.RDBMSExcepti
on: An error occured creating a database connection for the realm.]
at weblogic.security.acl.Realm.getRealm(Realm.java:94)
at weblogic.security.acl.Realm.getRealm(Realm.java:65)
at weblogic.security.SecurityService.initializeRealm(SecurityService.jav
a:353)
at weblogic.security.providers.realmadapter.AuthorizationProviderImpl.in
itialize(AuthorizationProviderImpl.java:72)
at weblogic.security.service.SecurityServiceManager.createSecurityProvid
er(SecurityServiceManager.java:1875)
at weblogic.security.service.AuthorizationManager.initialize(Authorizati
onManager.java:206)
at weblogic.security.service.AuthorizationManager.<init>(AuthorizationMa
nager.java:127)
at weblogic.security.service.SecurityServiceManager.doATZ(SecurityServic
eManager.java:1613)
at weblogic.security.service.SecurityServiceManager.initializeRealm(Secu
rityServiceManager.java:1426)
at weblogic.security.service.SecurityServiceManager.loadRealm(SecuritySe
rviceManager.java:1365)
at weblogic.security.service.SecurityServiceManager.initializeRealms(Sec
urityServiceManager.java:1487)
at weblogic.security.service.SecurityServiceManager.initialize(SecurityS
erviceManager.java:1207)
at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:723)
at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
at weblogic.Server.main(Server.java:32)
>
The WebLogic Server did not start up properly.
Exception raised:
java.lang.IllegalAccessError: Exception[com.bea.p13n.security.realm.RDBMSExcepti
on: An error occured creating a database connection for the realm.]
at weblogic.security.acl.Realm.getRealm(Realm.java:94)
at weblogic.security.acl.Realm.getRealm(Realm.java:65)
at weblogic.security.SecurityService.initializeRealm(SecurityService.jav
a:353)
at weblogic.security.providers.realmadapter.AuthorizationProviderImpl.in
itialize(AuthorizationProviderImpl.java:72)
at weblogic.security.service.SecurityServiceManager.createSecurityProvid
er(SecurityServiceManager.java:1875)
at weblogic.security.service.AuthorizationManager.initialize(Authorizati
onManager.java:206)
at weblogic.security.service.AuthorizationManager.<init>(AuthorizationMa
nager.java:127)
at weblogic.security.service.SecurityServiceManager.doATZ(SecurityServic
eManager.java:1613)
at weblogic.security.service.SecurityServiceManager.initializeRealm(Secu
rityServiceManager.java:1426)
at weblogic.security.service.SecurityServiceManager.loadRealm(SecuritySe
rviceManager.java:1365)
at weblogic.security.service.SecurityServiceManager.initializeRealms(Sec
urityServiceManager.java:1487)
at weblogic.security.service.SecurityServiceManager.initialize(SecurityS
erviceManager.java:1207)
at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:723)
at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
at weblogic.Server.main(Server.java:32)
Reason: Fatal initialization exception
Throwable: java.lang.IllegalAccessError: Exception[com.bea.p13n.security.realm.R
DBMSException: An error occured creating a database connection for the realm.]
java.lang.IllegalAccessError: Exception[com.bea.p13n.security.realm.RDBMSExcepti
on: An error occured creating a database connection for the realm.]
at weblogic.security.acl.Realm.getRealm(Realm.java:94)
at weblogic.security.acl.Realm.getRealm(Realm.java:65)
at weblogic.security.SecurityService.initializeRealm(SecurityService.jav
a:353)
at weblogic.security.providers.realmadapter.AuthorizationProviderImpl.in
itialize(AuthorizationProviderImpl.java:72)
at weblogic.security.service.SecurityServiceManager.createSecurityProvid
er(SecurityServiceManager.java:1875)
at weblogic.security.service.AuthorizationManager.initialize(Authorizati
onManager.java:206)
at weblogic.security.service.AuthorizationManager.<init>(AuthorizationMa
nager.java:127)
at weblogic.security.service.SecurityServiceManager.doATZ(SecurityServic
eManager.java:1613)
at weblogic.security.service.SecurityServiceManager.initializeRealm(Secu
rityServiceManager.java:1426)
at weblogic.security.service.SecurityServiceManager.loadRealm(SecuritySe
rviceManager.java:1365)
at weblogic.security.service.SecurityServiceManager.initializeRealms(Sec
urityServiceManager.java:1487)
at weblogic.security.service.SecurityServiceManager.initialize(SecurityS
erviceManager.java:1207)
at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:723)
at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
at weblogic.Server.main(Server.java:32)
[config.xml]Try removing the server section from the SchemaProperties line.
Preferrably do not use localhost or hostnames in the server
configuration file.
<RDBMSRealm
Name="wlcsRealm"
DatabaseDriver="weblogic.jdbc.mssqlserver4.Driver"
DatabasePassword="weblogic"
DatabaseURL="jdbc:weblogic:mssqlserver4:yourIPAddress:1433"
RealmClassName="com.bea.p13n.security.realm.RDBMSRealm"
SchemaProperties="user=system;password=weblogic"/>
Also consider ...
If you have a new Portal database created in SQL Server?
Does the user system have the Portal database as his default database?
-- Jim
Vikram wrote:
Hi,
We are having problems configuring a Platform Domain with MS Sql Server 2000.
We are using Weblogic version 7.0.0.2. These are the steps we followed
1.We manually created a database called TestDB and created a user account called
"system", pwd ==>> "weblogic" in SQL server and assigned him as the DB owner for
the TestDB created.
2. Changed dbsettings_properties files (Commented pointbase entries and uncommented
SQL Server entries. I gave the connection parameter as connection=jdbc:weblogic:mssqlserver4:localhost:1433
in this file.
3. Modified Config.xml and changed properties for DataSyncPool, WLIPool, CommercePool,WLIPool
and modified the RDBMS realm properties to point to the database.
4. ran the create_db script and it seemed to have run fine looking at the log
file.
5. I then tried to start the BEA Server instance and I get the following error.
I am also attaching the config.xml file for reference.
Appreciate any help/suggestions. Thanks in Advance.
Vikram
<Apr 9, 2003 2:57:45 AM EDT> <Error> <RDBMSRealm> <000000> <An error occured cre
ating a database connection for the realm.
java.sql.SQLException: Invalid port: weblogic:mssqlserver4:localhost:1433
at weblogic.jdbc.mssqlserver4.ConnectionInfo.<init>(ConnectionInfo.java:
193)
at weblogic.jdbc.mssqlserver4.ConnectDriver.parse(ConnectDriver.java:333
at weblogic.jdbc.mssqlserver4.ConnectDriver.connect(ConnectDriver.java:1
02)
at com.bea.p13n.security.realm.RDBMSDelegate.<init>(RDBMSDelegate.java:1
69)
at com.bea.p13n.security.realm.RDBMSDelegate$DFactory.getInstance(RDBMSD
elegate.java:962)
at com.bea.p13n.security.realm.internal.Pool.<init>(Pool.java:53)
at com.bea.p13n.security.realm.RDBMSRealm.createPool(RDBMSRealm.java:153
at com.bea.p13n.security.realm.RDBMSRealm.<init>(RDBMSRealm.java:140)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:232)
at weblogic.security.acl.Realm.getRealm(Realm.java:87)
at weblogic.security.acl.Realm.getRealm(Realm.java:65)
at weblogic.security.SecurityService.initializeRealm(SecurityService.jav
a:353)
at weblogic.security.providers.realmadapter.AuthorizationProviderImpl.in
itialize(AuthorizationProviderImpl.java:72)
at weblogic.security.service.SecurityServiceManager.createSecurityProvid
er(SecurityServiceManager.java:1875)
at weblogic.security.service.AuthorizationManager.initialize(Authorizati
onManager.java:206)
at weblogic.security.service.AuthorizationManager.<init>(AuthorizationMa
nager.java:127)
at weblogic.security.service.SecurityServiceManager.doATZ(SecurityServic
eManager.java:1613)
at weblogic.security.service.SecurityServiceManager.initializeRealm(Secu
rityServiceManager.java:1426)
at weblogic.security.service.SecurityServiceManager.loadRealm(SecuritySe
rviceManager.java:1365)
at weblogic.security.service.SecurityServiceManager.initializeRealms(Sec
urityServiceManager.java:1487)
at weblogic.security.service.SecurityServiceManager.initialize(SecurityS
erviceManager.java:1207)
at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:723)
at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
at weblogic.Server.main(Server.java:32)
<Apr 9, 2003 2:57:45 AM EDT> <Emergency> <WebLogicServer> <000342> <Unable to
in
itialize the server: Fatal initialization exception
Throwable: java.lang.IllegalAccessError: Exception[com.bea.p13n.security.realm.R
DBMSException: An error occured creating a database connection for the realm.]
java.lang.IllegalAccessError: Exception[com.bea.p13n.security.realm.RDBMSExcepti
on: An error occured creating a database connection for the realm.]
at weblogic.security.acl.Realm.getRealm(Realm.java:94)
at weblogic.security.acl.Realm.getRealm(Realm.java:65)
at weblogic.security.SecurityService.initializeRealm(SecurityService.jav
a:353)
at weblogic.security.providers.realmadapter.AuthorizationProviderImpl.in
itialize(AuthorizationProviderImpl.java:72)
at weblogic.security.service.SecurityServiceManager.createSecurityProvid
er(SecurityServiceManager.java:1875)
at weblogic.security.service.AuthorizationManager.initialize(Authorizati
onManager.java:206)
at weblogic.security.service.AuthorizationManager.<init>(AuthorizationMa
nager.java:127)
at weblogic.security.service.SecurityServiceManager.doATZ(SecurityServic
eManager.java:1613)
at weblogic.security.service.SecurityServiceManager.initializeRealm(Secu
rityServiceManager.java:1426)
at weblogic.security.service.SecurityServiceManager.loadRealm(SecuritySe
rviceManager.java:1365)
at weblogic.security.service.SecurityServiceManager.initializeRealms(Sec
urityServiceManager.java:1487)
at weblogic.security.service.SecurityServiceManager.initialize(SecurityS
erviceManager.java:1207)
at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:723)
at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
at weblogic.Server.main(Server.java:32)
The WebLogic Server did not start up properly.
Exception raised:
java.lang.IllegalAccessError: Exception[com.bea.p13n.security.realm.RDBMSExcepti
on: An error occured creating a database connection for the realm.]
at weblogic.security.acl.Realm.getRealm(Realm.java:94)
at weblogic.security.acl.Realm.getRealm(Realm.java:65)
at weblogic.security.SecurityService.initializeRealm(SecurityService.jav
a:353)
at weblogic.security.providers.realmadapter.AuthorizationProviderImpl.in
itialize(AuthorizationProviderImpl.java:72)
at weblogic.security.service.SecurityServiceManager.createSecurityProvid
er(SecurityServiceManager.java:1875)
at weblogic.security.service.AuthorizationManager.initialize(Authorizati
onManager.java:206)
at weblogic.security.service.AuthorizationManager.<init>(AuthorizationMa
nager.java:127)
at weblogic.security.service.SecurityServiceManager.doATZ(SecurityServic
eManager.java:1613)
at weblogic.security.service.SecurityServiceManager.initializeRealm(Secu
rityServiceManager.java:1426)
at weblogic.security.service.SecurityServiceManager.loadRealm(SecuritySe
rviceManager.java:1365)
at weblogic.security.service.SecurityServiceManager.initializeRealms(Sec
urityServiceManager.java:1487)
at weblogic.security.service.SecurityServiceManager.initialize(SecurityS
erviceManager.java:1207)
at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:723)
at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
at weblogic.Server.main(Server.java:32)
Reason: Fatal initialization exception
Throwable: java.lang.IllegalAccessError: Exception[com.bea.p13n.security.realm.R
DBMSException: An error occured creating a database connection for the realm.]
java.lang.IllegalAccessError: Exception[com.bea.p13n.security.realm.RDBMSExcepti
on: An error occured creating a database connection for the realm.]
at weblogic.security.acl.Realm.getRealm(Realm.java:94)
at weblogic.security.acl.Realm.getRealm(Realm.java:65)
at weblogic.security.SecurityService.initializeRealm(SecurityService.jav
a:353)
at weblogic.security.providers.realmadapter.AuthorizationProviderImpl.in
itialize(AuthorizationProviderImpl.java:72)
at weblogic.security.service.SecurityServiceManager.createSecurityProvid
er(SecurityServiceManager.java:1875)
at weblogic.security.service.AuthorizationManager.initialize(Authorizati
onManager.java:206)
at weblogic.security.service.AuthorizationManager.<init>(AuthorizationMa
nager.java:127)
at weblogic.security.service.SecurityServiceManager.doATZ(SecurityServic
eManager.java:1613)
at weblogic.security.service.SecurityServiceManager.initializeRealm(Secu
rityServiceManager.java:1426)
at weblogic.security.service.SecurityServiceManager.loadRealm(SecuritySe
rviceManager.java:1365)
at weblogic.security.service.SecurityServiceManager.initializeRealms(Sec
urityServiceManager.java:1487)
at weblogic.security.service.SecurityServiceManager.initialize(SecurityS
erviceManager.java:1207)
at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:723)
at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
at weblogic.Server.main(Server.java:32)
<Domain Name="epmsDomain">
<Log
FileName="logs/wl-domain.log"
Name="epmsDomain"
/>
<!-- Configuration Wizard Cluster and Admin/Managed Node support -->
<Server
Name="platformServer"
ListenAddress="localhost"
ListenPort="7501"
NativeIOEnabled="true"
TransactionLogFilePrefix="logs/"
>
<SSL
Name="platformServer"
ListenPort="7502"
Enabled="true"
ServerCertificateChainFileName="ca.pem"
ServerCertificateFileName="democert.pem"
ServerKeyFileName="demokey.pem"
/>
<Log
FileName="logs/weblogic.log"
/>
<WebServer
DefaultWebApp="splashPage"
LogFileName="./logs/access.log"
LoggingEnabled="true"
Name="platformServer"
/>
</Server>
<!-- WLP Pool -->
<JDBCConnectionPool
Name="commercePool"
DriverName="weblogic.jdbc.mssqlserver4.Driver"
URL="jdbc:weblogic:mssqlserver4:localhost:1433"
Properties="user=system;password=weblogic;server=jdbc:weblogic:mssqlserver4:localhost:1433"
Password="weblogic"
InitialCapacity="20"
MaxCapacity="20"
CapacityIncrement="1"
RefreshMinutes="0"
ShrinkingEnabled="false"
Targets="platformServer"
TestConnectionsOnReserve="false"
TestTableName="WEBLOGIC_IS_ALIVE"
/>
<!-- WLI Pool -->
<JDBCConnectionPool
CapacityIncrement="2"
DriverName="weblogic.jdbc.mssqlserver4.Driver"
InitialCapacity="8"
LoginDelaySeconds="1"
MaxCapacity="36"
Name="wliPool"
Properties="user=system;password=weblogic;server=jdbc:weblogic:mssqlserver4:localhost:1433"
Password="weblogic"
RefreshMinutes="0"
ShrinkPeriodMinutes="15"
ShrinkingEnabled="true"
Targets="platformServer"
URL="jdbc:weblogic:mssqlserver4:localhost:1433"
/>
<JDBCTxDataSource
EnableTwoPhaseCommit="false"
JNDIName="weblogic.jdbc.jts.commercePool"
Name="commercePool"
PoolName="commercePool"
Targets="platformServer"
/>
<JDBCDataSource
JNDIName="weblogic.jdbc.pool.commercePool"
Name="commercePool"
PoolName="commercePool"
Targets="platformServer"
/>
<JDBCDataSource
JNDIName="WLAI_DataSource"
Name="WLAI_DataSource"
PoolName="wliPool"
Targets="platformServer"
/>
<JDBCTxDataSource
EnableTwoPhaseCommit="true"
JNDIName="com.bea.wlpi.TXDataSource"
Name="TXDataSource"
PoolName="wliPool"
Targets="platformServer"
/>
<JDBCTxDataSource
EnableTwoPhaseCommit="true"
JNDIName="WLCHub.DS"
Name="WLCHub.DS"
PoolName="wliPool"
Targets="platformServer"/>
/>
<!-- Configure WebLogic Workshop to run in Platform domain -->
<JDBCTxDataSource
EnableTwoPhaseCommit="true"
JNDIName="cgDataSource"
Name="cgDataSource"
PoolName="commercePool"
Targets="platformServer"/>
<JDBCTxDataSource
EnableTwoPhaseCommit="true"
JNDIName="cgSampleDataSource"
Name="cgSampleDataSource"
PoolName="commercePool"
Targets="platformServer"/>
<JMSConnectionFactory JNDIName="weblogic.jws.jms.QueueConnectionFactory"
Name="cgQueue" Targets="platformServer"/>
<JMSJDBCStore ConnectionPool="commercePool" Name="cgJDBCStore" PrefixName="WEBLOGIC"/>
<JMSServer Name="cgJMSServer" Store="cgJDBCStore" Targets="platformServer">
<JMSQueue JNDIName="jws.queue" Name="cgJWSQueue" StoreEnabled="default"/>
</JMSServer>
<JTA Name="epmsDomain" TimeoutSeconds="3600"/>
<!-- End: Configure WebLogic Workshop to run in Platform domain -->
<!-- WLP DATASYNC -->
<JDBCConnectionPool
Name="dataSyncPool"
DriverName="weblogic.jdbc.mssqlserver4.Driver"
URL="jdbc:weblogic:mssqlserver4:localhost:1433"
Properties="user=system;password=weblogic;server=jdbc:weblogic:mssqlserver4:localhost:1433"
Password="WEBLOGIC"
InitialCapacity="1"
MaxCapacity="5"
CapacityIncrement="1"
RefreshMinutes="0"
ShrinkingEnabled="false"
TestConnectionsOnReserve="false"
TestTableName="WEBLOGIC_IS_ALIVE"
Targets="platformServer"/>
/>
<JDBCTxDataSource
EnableTwoPhaseCommit="false"
JNDIName="weblogic.jdbc.jts.dataSyncPool"
Name="dataSyncPool"
PoolName="dataSyncPool"
Targets="platformServer"/>
/>
<!-- General Config -->
<Security
GuestDisabled="false"
Name="epmsDomain"
PasswordPolicy="wl_default_password_policy"
Realm="wl_default_realm"
CompatibilityMode="true"
/>
<PasswordPolicy
Name="wl_default_password_policy"
/>
<Realm
Name="wl_default_realm"
CachingRealm="wlcsCachingRealm"
FileRealm="wl_default_file_realm"
/>
<CachingRealm
BasicRealm="wlcsRealm"
CacheCaseSensitive="true"
Name="wlcsCachingRealm"
/>
<RDBMSRealm DatabaseDriver="weblogic.jdbc.mssqlserver4.Driver"
DatabasePassword="weblogic"
DatabaseURL="jdbc:weblogic:mssqlserver4:localhost:1433"
SchemaProperties="user=system;password=weblogic;server=jdbc:weblogic:mssqlserver4:localhost:1433"
Name="wlcsRealm"
RealmClassName="com.bea.p13n.security.realm.RDBMSRealm"/>
<FileRealm
Name="wl_default_file_realm"
/>
<StartupClass
ClassName="com.beasys.commerce.ebusiness.security.KeyBootstrap"
FailureIsFatal="false"
Name="KeyBootstrap"
Targets="platformServer"
/>
<!-- WLI configuraion for Platform -->
<JMSConnectionFactory Name="WLI_B2B_TopicFactory"
JNDIName="com.bea.wli.b2b.server.TopicConnectionFactory"
AllowCloseInOnMessage="true"
UserTransactionsEnabled="true"
Targets="platformServer"
/>
<JMSConnectionFactory
AllowCloseInOnMessage="true"
JNDIName="com.bea.wli.b2b.rosettanet.QueueConnectionFactory"
Name="RNQueueFactory"
Targets="platformServer"
UserTransactionsEnabled="true"
/>
<JMSConnectionFactory
AllowCloseInOnMessage="false"
DefaultDeliveryMode="Persistent"
DefaultPriority="4"
DefaultTimeToLive="0"
JNDIName="com.bea.wlai.JMSConnectionFactory"
MessagesMaximum="10"
Name="WLAI_JMSConnectionFactory"
OverrunPolicy="KeepOld"
UserTransactionsEnabled="true"
Targets="platformServer"/>
/>
<JMSConnectionFactory
AllowCloseInOnMessage="true"
JNDIName="com.bea.wlpi.TopicConnectionFactory"
Name="wlpiFactory"
Targets="platformServer"
UserTransactionsEnabled="true"
/>
<JMSConnectionFactory
AllowCloseInOnMessage="true"
JNDIName="com.bea.wlpi.QueueConnectionFactory"
Name="wlpiQueueFactory"
Targets="platformServer"
UserTransactionsEnabled="true"
/>
<JMSJDBCStore
ConnectionPool="wliPool"
Name="JMSWLIStore"
PrefixName="PBPUBLIC"
/>
<JMSServer Name="WLIJMSServer"
Targets="platformServer"
TemporaryTemplate="TemporaryTemplate"
Store="JMSWLIStore">
<JMSTemplate Name="TemporaryTemplate"/>
<!-- B2B -->
<JMSQueue Name="WLI_B2B_RNEncoderQueue"
JNDIName="com.bea.wli.b2b.rosettanet.EncoderQueue"/>
<JMSTopic Name="WLI_B2B_Topic"
JNDIName="com.bea.wli.b2b.server.B2BTopic"/>
<JMSQueue Name="WLI_B2B_OutboundQueue"
JNDIName="com.bea.b2b.OutboundQueue"/>
<!-- BPM -->
<JMSTopic Name="wlpiEvent"
JNDIName="com.bea.wlpi.EventTopic"/>
<JMSQueue Name="WLI_BPM_Timer"
JNDIName="com.bea.wli.bpm.TimerQueue"
StoreEnabled="true"
Template="WLI_JMSTemplate"/>
<JMSQueue Name="WLI_BPM_Event"
JNDIName="com.bea.wli.bpm.EventQueue"
StoreEnabled="true"
Template="WLI_JMSTemplate"/>
<JMSQueue Name="WLI_BPM_ValidatingEvent"
JNDIName="com.bea.wli.bpm.ValidatingEventQueue"
StoreEnabled="true"
Template="WLI_JMSTemplate"/>
<JMSTopic Name="WLI_BPM_Error"
JNDIName="com.bea.wli.bpm.ErrorTopic"/>
<JMSTopic Name="WLI_BPM_Audit"
JNDIName="com.bea.wli.bpm.AuditTopic"/>
<JMSTopic Name="WLI_BPM_Notify"
JNDIName="com.bea.wli.bpm.NotifyTopic"/>
<!-- AI -->
<JMSQueue Name="WLAI_ASYNC_REQUEST_QUEUE"
JNDIName="com.bea.wlai.ASYNC_REQUEST_QUEUE"/>
<JMSQueue Name="WLAI_ASYNC_RESPONSE_QUEUE"
JNDIName="com.bea.wlai.ASYNC_RESPONSE_QUEUE"/>
<JMSQueue Name="WLAI_EVENT_QUEUE"
JNDIName="com.bea.wlai.EVENT_QUEUE"/>
<JMSTopic Name="WLAI_EVENT_TOPIC"
JNDIName="com.bea.wlai.EVENT_TOPIC"/>
<!-- App View control -->
<JMSQueue JNDIName="com.bea.wlai.WORKSHOP_ASYNC_RESPONSE_QUEUE" Name="WLAI_WORKSHOP_ASYNC_RESPONSE_QUEUE"/>
<JMSQueue JNDIName="com.bea.wlai.WORKSHOP_EVENT_QUEUE" Name="WLAI_WORKSHOP_EVENT_QUEUE"/>
<!-- WLI -->
<JMSQueue Name="WLI_FailedEvent"
JNDIName="com.bea.wli.FailedEventQueue"
StoreEnabled="true"/>
<JMSTemplate Name="WLI_JMSTemplate"
ErrorDestination="WLI_FailedEvent"
RedeliveryDelayOverride="60000"
RedeliveryLimit="10"/>
</JMSServer>
<JMSJDBCStore Name="JMSWLIStore"
ConnectionPool="wliPool"
PrefixName="platformServer"/>
<!-- Distributed queue/topic configuration for WLI components -->
<!-- End WLI configuraion for Platform -->
<!--===========================================================================-->
<!-- Configure the J2EE enterprise applications supporting the Platform -->
<!--===========================================================================-->
<!-- The enterprise application containing the WLS-based Tax and Payment WebService -->
<Application
Deployed="true"
Name="taxWSApp"
Path="C:/bea/user_projects/epmsDomain/beaApps/taxWSApp"
TwoPhase="true"
>
<EJBComponent
Name="tax"
URI="tax.jar"
Targets="platformServer"
/>
<WebAppComponent
Name="tax-webservice"
URI="tax-ws"
Targets="platformServer"
/>
</Application>
<Application
Deployed="true"
Name="paymentWSApp"
Path="C:/bea/user_projects/epmsDomain/beaApps/paymentWSApp"
TwoPhase="true"
>
<EJBComponent
Name="payment"
URI="payment.jar"
Targets="platformServer"
/>
<WebAppComponent
Name="payment-edit webservice"
URI="pay-ws"
Targets="platformServer"
/>
</Application>
<!-- The enterprise application containing the installed/online links documentation -->
<Application
Deployed="true"
Name="wlpDocsApp"
Notes=""
Path="C:/bea/weblogic700/portal/lib"
TwoPhase="true"
>
<WebAppComponent
IndexDirectoryEnabled="false"
Name="wlpDocs"
Targets="platformServer"
URI="wlpDocs.war"
ServletReloadCheckSecs="300"
/>
</Application>
<!-- The enterprise application containing the WLP components -->
<Application
Deployed="true"
Name="portalApp"
Notes=""
Path="C:/bea/user_projects/epmsDomain/beaApps/portalApp"
TwoPhase="true"
>
<ApplicationConfiguration
Name="portalApp"
Targets="platformServer"
URI="META-INF/application-config.xml"
/>
<EJBComponent
Name="events"
Targets="platformServer"
URI="events.jar"
/>
<EJBComponent
Name="pipeline"
Targets="platformServer"
URI="pipeline.jar"
/>
<EJBComponent
Name="property"
Targets="platformServer"
URI="property.jar"
/>
<EJBComponent
Name="rules"
Targets="platformServer"
URI="rules.jar"
/>
<EJBComponent
Name="usermgmt"
Targets="platformServer"
URI="usermgmt.jar"
/>
<EJBComponent
Name="customer"
Targets="platformServer"
URI="customer.jar"
/>
<EJBComponent
Name="ebusiness"
Targets="platformServer"
URI="ebusiness.jar"
/>
<EJBComponent
Name="portal"
Targets="platformServer"
URI="portal.jar"
/>
<EJBComponent
Name="campaign"
Targets="platformServer"
URI="campaign.jar"
/>
<EJBComponent
Name="catalogws"
Targets="platformServer"
URI="catalogws.jar"
/>
<EJBComponent
Name="document"
Targets="platformServer"
URI="document.jar"
/>
<EJBComponent
Name="ejbadvisor"
Targets="platformServer"
URI="ejbadvisor.jar"
/>
<EJBComponent
Name="mail"
Targets="platformServer"
URI="mail.jar"
/>
<EJBComponent
Name="placeholder"
Targets="platformServer"
URI="placeholder.jar"
/>
<WebAppComponent
Name="toolSupport"
Targets="platformServer"
URI="toolSupport"
ServletReloadCheckSecs="300"
/>
<WebAppComponent
Name="tools"
Targets="platformServer"
URI="tools"
ServletReloadCheckSecs="300"
/>
<WebAppComponent
Name="datasync"
Targets="platformServer"
URI="datasync"
ServletReloadCheckSecs="300"
/>
<WebAppComponent
Name="splashPage"
Targets="platformServer"
URI="splashPage"
ServletReloadCheckSecs="300"
/>
<!-- The enterprise application containing the WLP P13N Console components -->
</Application>
<Application
Deployed="true"
TwoPhase="true"
StagedTargets="platformServer"
Name="p13nConsoleApp"
Path="C:/bea/weblogic700/portal/lib"
>
<WebAppComponent
Name="p13nConsole"
ServletReloadCheckSecs="300"
Targets="platformServer"
URI="p13nConsole.war"
/>
</Application>
<!-- The enterprise application containing the WLI components -->
<Application Deployed="true" LoadOrder="900" Name="EAI" Path="C:/bea/weblogic700/samples/workshop/wlai/ear/" TwoPhase="true">
<EJBComponent
DeploymentOrder="100"
Name="repository-ejb.jar"
Targets="platformServer"
URI="repository-ejb.jar"/>
<EJBComponent Name="WLI-B2B Startup"
DeploymentOrder="200"
Targets="platformServer"
URI="b2b-startup.jar"/>
<EJBComponent DeploymentOrder="300" Name="b2b-rosettanet.jar" Targets="platformServer" URI="b2b-rosettanet.jar"/>
<WebAppComponent DeploymentOrder="400" Name="b2b.war" Targets="platformServer" URI="b2b.war"/>
<WebAppComponent DeploymentOrder="500" Name="b2bconsole.war" Targets="platformServer" URI="b2bconsole.war"/>
<EJBComponent DeploymentOrder="600" Name="WLI-AI Server" Targets="platformServer" URI="wlai-server-ejb.jar"/>
<WebAppComponent DeploymentOrder="700" Name="wlai" Targets="platformServer" URI="wlai.war"/>
<EJBComponent DeploymentOrder="800" Name="WLI-AI Async Processor" Targets="platformServer" URI="wlai-asyncprocessor-ejb.jar"/>
<EJBComponent DeploymentOrder="900" Name="WLI-AI Event Processor" Targets="platformServer" URI="wlai-eventprocessor-ejb.jar"/>
<EJBComponent DeploymentOrder="1000" Name="wlpi-ejb.jar" Targets="platformServer" URI="wlpi-ejb.jar"/>
<EJBComponent DeploymentOrder="1100" Name="wlpi-master-ejb.jar" Targets="platformServer" URI="wlpi-master-ejb.jar"/>
<EJBComponent DeploymentOrder="1200" Name="wlpi-mdb-ejb.jar" Targets="platformServer" URI="wlpi-mdb-ejb.jar"/>
<EJBComponent DeploymentOrder="1300" Name="WLXTEJB.jar" Targets="platformServer" URI="WLXTEJB.jar"/> -
Trying to import a .mov file made with gotomeeting - no problems in past doing this. After 3 attempts recording the hour long video and trying to upload it to iMovie, it says No importable files -None of the selected files or folders can be imported. Change the selection and try again. What could the reason be?
After much research and troubleshooting, GoToMeeting replied with the final answer: We do not support the uploading of recordings to editing software. If you are having issues uploading a recording, unfortunately, we do not have tools or steps to resolve this. It is not a supported feature. I am sorry for any inconvenience this may have caused you.
The no longer plan to support editing of recordings made with their software. So, we are planning to find a new meeting provider. -
Problems when starting with oracle SQL developer
Hello,
I am very much new with oracle SQL developer. I use oracle 10g and have a database named 'pallabDB' with username: xxxxxx and paswd:yyyyyy. I have installed oracle SQL developer.But i am unable to start up.What i should do? If any body replies it will be a great help.Thanks in advance.But i am unable to
start up.How to understand this sentence without confusion?
Can you explain exactly what is your problem at start up of SQL Developer? -
I am having a parent program which fires the child process.
I want the parent program to wait until all the child program are completed.
for this i have written this code.
from the curosr c1 i am taking all the child processes.
Now when i am putting the exit condition(EXIT WHEN J = V_COUNT1) in the for loop then
everything is working fine and parent program completes only after all
the child processes are completed.
but when i am not putting this condition the parent program does not complete it remains in the loop
i dont understand why?
declare
cursor c1 is
SELECT fcr.request_id
FROM
fnd_concurrent_programs fcp,
fnd_concurrent_requests fcr
WHERE
fcp.concurrent_program_id = fcr.concurrent_program_id
AND fcp.concurrent_program_name LIKE 'WSHRDPIK' -- name of the pick slip report
AND fcr.request_id > (SELECT max(fcr.request_id)
FROM fnd_concurrent_requests fcr,
fnd_concurrent_programs fcp
WHERE fcp.concurrent_program_id = fcr.concurrent_program_id
AND fcp.concurrent_program_name LIKE 'OAI_PROCESS_SHIPMENTS')
AND phase_code NOT LIKE 'C'
AND requested_by IN (SELECT user_id
FROM fnd_user
WHERE user_name LIKE 'MAKANIV');
BEGIN
open c1;
FETCH c1 Bulk Collect into v_count;
close c1;
v_count1 := v_count.count;
for i in v_count.first..v_count.last loop
v_success := FND_CONCURRENT.GET_REQUEST_STATUS(v_count(i)
,NULL
,NULL
,v_phase
,v_status
,v_dev_phase
,v_dev_status
,v_message);
WHILE v_dev_phase != 'COMPLETE'
LOOP
v_success:= FND_CONCURRENT.WAIT_FOR_REQUEST(v_count(i)
,2
,10
,v_phase
,v_status
,v_dev_phase
,v_dev_status
,v_message);
EXIT WHEN v_dev_phase = 'COMPLETE';
END LOOP;
-- J:= J + 1;
-- EXIT WHEN J = V_COUNT1;
END loop;
END;Dear Salvatore,
Have you opened the CURSOR ??
Try the following :
=============================================
declare
cursor C1 (INPUT_VAR in number) is select column1 from table where column2 =INPUT_VAR ;
begin
for I in C1 (1111) Loop --- you can try any number
dbms_output.put_line(I.ID) ;
end loop;
end ;
=============================================
Bst Rgds ,
Franco Lin
I am new to this forum, and new to PL/SQL. I am writing my first larger project that will be in part implemented with PL/SQL. I have a simple cursor that sound like that:
CURSOR name
IS
SELECT column1
FROM table
WHERE column2 = PL/SQL-variable;
When I run this Function the SELECT returns nothing. When I make the same SELECT from SQL*PLUS I receive 1 row.
I have checked the variable via dbms_output.put_line, and make the mentioned SELECT with it.
Has anyone a solution for this?
Thanks in advance for any help.
Regards
Salvatore Cagliari
null -
Problem using DG4ODBC with named SQL Server instance
I am running DG4ODBC on a 64 bit LINUX machine with the Microsoft SQL Server driver installed. I have successfully tested this with a SQL Server instance that was not named (GENERALI_DSN).The named instance gives the following when trying to query:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[unixODBC][Microsoft][SQL Server Native Client 11.0]Login timeout expired {HYT00}[unixODBC][Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF]. {08001,NativeErr = -1}[unixODBC][Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. {08001,NativeErr = -1}
ORA-02063: preceding 2 lines from DEVMISC
odbc.ini
[GENERALI_DSN]
Driver = SQL Server Native Client 11.0
Server = CLTDMJCWBYZ.eu.scor.local
User = everest
Password = everest
Database = Everest_Generali
[DEVMISC_DSN]
Driver = SQL Server Native Client 11.0
Server = [USVCLTDEVSQL02\DEVMISC]
User = link_user
Password = password1
Database = DBA
initDG4ODBC2.ora
# HS init parameters
HS_FDS_CONNECT_INFO = DEVMISC_DSN
HS_FDS_TRACE_LEVEL = DEBUG
HS_FDS_SHAREABLE_NAME = /usr/lib64/libodbc.so
# ODBC specific environment variables
set ODBCINI=/home/oracle/.odbc.ini
listener.ora
SID_LIST_LISTENER_GW =
(SID_LIST =
(SID_DESC =
(SID_NAME=DG4ODBC)
(ORACLE_HOME=/home/oracle/product/11.2.0)
(ENV=LD_LIBRARY_PATH=/usr/lib64:/home/oracle/product/11.2.0/lib:/opt/micro
soft/sqlncli/lib)
(PROGRAM=dg4odbc)
(SID_DESC =
(SID_NAME=DG4ODBC2)
(ORACLE_HOME=/home/oracle/product/11.2.0)
(ENVS=LD_LIBRARY_PATH=/usr/lib64:/home/oracle/product/11.2.0/lib:/opt/micr
osoft/sqlncli/lib)
(PROGRAM=dg4odbc)
LISTENER_GW =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = usvcltprdoragw)(PORT = 1521))
tnsnames.ora
DG4ODBC =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=usvcltprdoragw)(PORT=1521))
(CONNECT_DATA=(SID=DG4ODBC))
(HS=OK)
DG4ODBC2 =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=usvcltprdoragw)(PORT=1521))
(CONNECT_DATA=(SID=DG4ODBC2))
(HS=OK)
I can't figure out why the named instance does not work but the other one does. Any help would be greatly appreciated!Did you check with the ODBC test utility isql (it is installed by default when you install the unixODBC Driver manager) if your ODBC driver can connect at all to that named instance? I have some doubts that it will work either as there was a blog commented by a MS engineer:
Introducing the new Microsoft ODBC Drivers for SQL Server - Microsoft SQLNCli team blog - Site Home - MSDN Blogs
who states that named instance connections are not supported using that driver.
- Klaus -
[SOLVED] Problems opening folders with UTF-8 encoded characters
Hello everyone, I'm having an issue when I acess folders in all my programs ( except Dolphin File Manager). Every time I open the folder navigation window in my programs, folders with UTF-8 encoded characters ( such as "ç", "á ", "ó", "í", etc ) are not shown or the folder name not show these characters, therefore, I can not open documents inside these folders.
However, as you saw, I can type these characters normally. Here's my "locale.conf" :
LANG="en_US.UTF-8:ISO-8859-1"
LC_TIME="pt_BR.UTF-8:ISO-8859-1"
And here's the output of the command "locale -a" :
C
en_US.utf8
POSIX
Last edited by regmoraes (2015-04-17 12:55:19)Thing is, when I run locale -a, I get
$ locale -a
C
de_DE@euro
de_DE.iso885915@euro
de_DE.utf8
en_US
en_US.iso88591
en_US.utf8
ja_JP
ja_JP.eucjp
ja_JP.ujis
ja_JP.utf8
japanese
japanese.euc
POSIX
So an entry for every locale I have uncommented in my locale.conf. Just making sure, by "following the steps in the beginner's guide", you also mean running locale-gen?
Are those folders on a linux filesystem like ext4 or on a windows (ntfs?)
Maybe you are looking for
-
How can I manage browser settings in a K12 environment?
I would like to set up firefox on a network share, allowing twenty to thirty teachers access it via an shared tools folder. All security settings,defaults, plug ins and updates must be controlled by me, not the users. Client pc's run XPSP3.
-
Looking for a more suitable animation tool
I've been creating animations from sprites in After Effects, with mixed results. The input is a number of pixel art sprites (exported from elsewhere), and the output is a video, characters running around and interacting. I have AFX doing quite a lo
-
Getting error while running sapinst.exe
Hi Gurus, I have an error while running sapinst.exe. =============================== Error: Home directory is not available for user sapsdt Opened sylib722.dll exe dir is I:\usr\sap\***\tmp\3\sapinst_exe.10440.1359197818 MessageLib initialized succes
-
Flash player work with Safari, but not with Internet Explorer
My flash player had a problem so I uninstalled it. I had a problem downloading the player with Internet Explorer, so I successfully download it with Safari. The player works fine with Safari, but I cannot get it to work with Internet Explorer 8. I
-
How to Bing the Field of G/L A/c in the Reptative area of Outgoing Payment
Hi, All Experts, I have a issue on PLD that I cant able to bring the field of G/L A/c in the rep area of Outgoing invoice... However I had tried it from the table Outgoing Invoice row but it is not coming Properly... The mail issue is that to make a