How to grant the java objects of sys to scott?
I'm trying to execute socket program. The client part is located in Database 8.1.6, and Server part is located outside of database.
From the trigger, the client program is invoked, and it is executed. But, it makes a error like below...
ORA-29532:
java.security.AccessControlException: the Permission (java.net.SocketPermission
127.0.0.1:5000 connect,resolve) has not been granted by
dbms_java.grant_permission to
SchemaProtectionDomain(SCOTT|PolicyTableProxy(SCOTT))
I checked the class status 'java.net.Socket' from user_objects. In scott, it doesn't exist, but I logged in db as 'sys'. Sys has the java.net.Socket permission. Its status is valid. So, I guess if scott has the permission java.net.Socket class object, scott can run the socket program. RIght?
please, help me.
Any opinion will be helpful...
Thanks in advance. Have a nice day..
as SYS try:
SQL> grant javauserpriv to scott;
SQL> grant javasyspriv to scott;
APC
Similar Messages
-
How to retrieve the java object in a proxy service in osb -- Plz help
Hi all,
I have a singleton java class which runs whenever the weblogic server gets started and store the output in its object. I need to access this java object from a proxy service in osb.
We tried using java call out and retrieved that object but we couldn't know how to parse that object into XML.
We are not sure of using the java call out in osb to solve this purpose because whenever we use a java callout, that particular java code will run which is not the case of singleton class.
So kindly help us how to retrieve the java object which holds the output without running the java code every time because its already run and holding the output in its object.
Regards
Prabhuhere the doc http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html#wp1106656
but I guess you are already at the stage of getting a POJO in a first Java Callout and passing the POJO to a second Java Callout, which should then return it to OSB as a XMLObject.
My recommendation is to write a Java function which returns a XMLObject and uses a XMLCursor to populate it with the values of the POJO.
An XMLObject returned to the OSB is automatically transformed in a "XML" variable (which in reality is represented as a XMLObject in the Pipeline context)
Here some code sample:
http://www.javamonamour.org/2010/09/how-to-create-xmlobject-using-xmlcursor.html -
How to use the Java objects or methods in pl/sql function as a parameter
dear all,
I java object passed as a parameter in pl/sql. how can i access the java objects as parameter in pl/sql function. please give a soultion to me
mohan reddyI'm not sure whether this would help you.
Have a look at this program to list files from a directory.
CREATE GLOBAL TEMPORARY TABLE DIR_LIST
( FILENAME VARCHAR2(255) )
ON COMMIT DELETE ROWS
Table created.
create or replace
and compile java source named "DirList"
as
import java.io.*;
import java.sql.*;
public class DirList
public static void getList(String directory)
throws SQLException
File path = new File( directory );
String[] list = path.list();
String element;
for(int i = 0; i < list.length; i++)
element = list;
#sql { INSERT INTO DIR_LIST (FILENAME)
VALUES (:element) };
Java created.
SQL>
create or replace
procedure get_dir_list( p_directory in varchar2 )
as language java
name 'DirList.getList( java.lang.String )';
SQL> exec get_dir_list( 'C:\Bhagat' );
PL/SQL procedure successfully completed.
Thanks,
Bhagat -
How to pass the java object into the spring controller
Hi Friends
When I hit the url at the first time my call goes to the spring controller and sets the userDetails objects in the modelAndView.addObject("userDetails", userDetails.getUserDetails()) and returns the userDetails.html page. if I click any link in the same page i want to pass same (userDetails) object thru javascript or jquery and calls the another(controller) method and returns the same (userDetails.html) page.
It means how can i pass the java object thru javascript or jquery and calls the controller. if i get the same object in my controller i can avoid calling the db again. please help me out to resolve this issue. i am tired of fixing this issue.
Regards
Sherin PoojaIf you want to avoid calling the database again then cache the data.
However before you do that make sure that calling the database, in the context of YOUR system, is going to be an actual problem.
For example there is absolutely no point in caching a User object when only one user an hour is actually using the system. -
How to get the profile object in simple java class (Property accessor)
Hi All,
Please guide me how to get the profile object in simple java class (Property accessor) which is extending the RepositoryPropertyDescriptor.
I have one requirement where i need the profile object i.e i have store id which is tied to profile .so i need the profile object in the property accessor of the SKU item descriptor property, which is extending RepositoryPropertyDescriptor.
a.I dont have request object also to do request.resolvename.
b.It is not a component to create setter and getter.It is simple java class which is extending the RepositoryPropertyDescriptor.
Advance Thanks.Iam afraid you might run into synchronization issues with it. You are trying to get/set value of property of a sku repository item that is shared across various profiles.
Say one profile A called setPropertyValue("propertyName", value).Now another profile B accesses
getPropertyValue() {
super.getPropertyValue() // Chance of getting value set by Profile A.
// Perform logic
There is a chance that profile B getting the value set by Profile A and hence inconsistency.
How about doing this way??
Create PropertyDescriptor in Profile (i.e user item descriptor), pass the attribute CustomCatalogTools in userProfile.xml to that property.
<attribute name="catalogTools" value="atg.commerce.catalog.CustomCatalogTools"/>
getPropertyValue()
//You have Profile item descriptor and also storeId property value.
// Use CustomCatalogTools.findSku();
// Use storeId, profile repository item, sku repository item to perform the logic
Here user itemdescriptor getPropertyValue/setPropertyValue is always called by same profile and there is consistency.
-karthik -
XSLT - How to pass a Java object to the xslt file ?
Hi ,
I need help in , How to pass a java object to xslt file.
I am using javax.xml.transform.Tranformer class to for the xsl tranformation. I need to pass a java object eg
Class Employee {
private String name;
private int empId;
public String getName() {
return this.name;
public String getEmpId() {
return this.empId;
public String setName(String name) {
this.name = name;
public String setEmpId(int empId){
this.empId = empId;
How can i access this complete object in the xsl file ? is there any way i can pass custom objects to xsl using Transformer class ?This is elementary. Did you ask google ? http://www.google.com/search?q=calling+java+from+xsl
ram. -
How can I drop the java objects from a schema
hi..good afternoon all...
How can I drop the java objects from a database schema???
suppose the credentials are scott/tiger@db1
Another thing is that...I have to do this from cmd(command prompt) as there is no plsql developer or sqldeveloper installed in the machine.
plss help...thanks in advance...hi...i have already tried all the options..but it is showing the error..
ora:01435 - user does not exist
but when i have given the command...
select object type, object_name, status from user_objects where object_type like'%JAVA%';
then it is showing that the java_object is present....
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL>
SQL>
SQL> set linesize 200
SQL>
SQL>
SQL>
SQL> select object_type, object_name, status from user_objects where object_type
like '%JAVA%';
OBJECT_TYPE OBJECT_NAME
STATUS
JAVA CLASS javaclass1
VALID
JAVA SOURCE javaclass1
VALID
SQL> drop java source javaclass1.java;
drop java source javaclass1.java
ERROR at line 1:
ORA-01435: user does not exist
SQL> -
How to get the UserTransaction object in stateless session bean
Hi, I am using jboss server and jdk5 version and using EJB.
My Application flow :
JSP à Action(Struts) à Service Locator à Session bean à Entity Bean(cmp) à DB.
I tried to get the UserTransaction object in my Action. Its my code.
InitialContext ctx = new InitialContext();
UserTransaction uTrans = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
After used uTrans.begin(),uTrans.commit() and uTrans. rollback () also.
Its working fine .
But, I used the the same code inside in my session bean its not working.
Stateless Session Manager Bean code :
public class SampleManagerBean implements SessionBean {
public void ejbCreate() throws CreateException { }
public void ejbRemove() { }
public void ejbActivate() { }
public void ejbPassivate() { }
public void setSessionContext(SessionContext sessionContext) {
this.sessionContext = sessionContext;
public void createSample() throws EJBException
try{
InitialContext ctx = new InitialContext();
UserTransaction ut = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
}catch(Exception e) {
System.out.println( Exception === > +e)
Its throws the error ie: javax.naming.NameNotFoundException: UserTransaction not bound
How to get the UserTransaction object in my session bean. Kindly give solution the above errors.
- Thendralfirst of all, you could just use sessionContext.getUserTransaction(). however, that would only work if your bean is using bean-managed transactions. the default is container-managed transaction, in which case you cannot get a UserTransaction object. if you want to manage transactions, you need to add the TransactionManagementType.BEAN annotation to your ejb.
-
How to Populate the JTable Object programatically with SQL Results
I'm wondering if someone could help me on how to populate the JTable Object with SQL Results wherein the Row of tjhe JTable object is automatically adjusted depending on how many records you have queried.
Thanks in advance and God bless! (",)
* frmMain.java
* Created on October 4, 2006, 6:15 AM
package tds;
import java.io.*;
import java.awt.Toolkit;
import javax.swing.JFrame;
import javax.imageio.*;
import javax.swing.JFrame;
import java.sql.*;
import javax.swing.table.DefaultTableModel;
* @author Dexter.Carlit
public class frmMain extends javax.swing.JFrame {
private Connection connection = null;
private DefaultTableModel model;
/** Creates new form frmMain */
public frmMain() {
initComponents();
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
jSplitPane = new javax.swing.JSplitPane();
jScrollPane1 = new javax.swing.JScrollPane();
jPanel3 = new javax.swing.JPanel();
jScrollPane2 = new javax.swing.JScrollPane();
jTree1 = new javax.swing.JTree();
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
jPanel4 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jTextField3 = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jTextField4 = new javax.swing.JTextField();
jPanel5 = new javax.swing.JPanel();
jScrollPane3 = new javax.swing.JScrollPane();
jGrid = new javax.swing.JTable();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jProgressBar1 = new javax.swing.JProgressBar();
jPanel2 = new javax.swing.JPanel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
getAccessibleContext().setAccessibleName("frmMain");
jSplitPane.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
jSplitPane.setDividerLocation(200);
jSplitPane.setDividerSize(10);
jScrollPane2.setViewportView(jTree1);
org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel3Layout.createSequentialGroup()
.add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 916, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 410, Short.MAX_VALUE)
jScrollPane1.setViewportView(jPanel3);
jSplitPane.setLeftComponent(jScrollPane1);
jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
jLabel1.setText("First Name:");
jLabel2.setText("Last Name:");
jLabel3.setText("Position :");
jLabel4.setText("Department:");
jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Search Results"));
jGrid.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
new String [] {
"LName", "FName", "Position", "Department", "Office No", "Local No", "Office Mobile No", "Home No", "MobileNo", "Email Address"
jGrid.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
jGrid.setColumnSelectionAllowed(true);
jGrid.setName("");
jGrid.setTableHeader(jGrid.getTableHeader());
jScrollPane3.setViewportView(jGrid);
jScrollPane3.getAccessibleContext().setAccessibleName("rset");
org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 386, Short.MAX_VALUE)
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
jButton1.setText("Find");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton1MouseClicked(evt);
jButton2.setText("Clear");
jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton2MouseClicked(evt);
org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
.add(jLabel1)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE))
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
.add(jLabel2)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextField2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)
.add(1, 1, 1))
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
.add(jLabel3)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextField3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel4)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextField4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE))
.add(jPanel4Layout.createSequentialGroup()
.add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 66, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 66, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
jPanel4Layout.linkSize(new java.awt.Component[] {jButton1, jButton2}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel1)
.add(jTextField1))
.add(18, 18, 18)
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel2)
.add(jTextField2))
.add(16, 16, 16)
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel3)
.add(jTextField3)
.add(jLabel4)
.add(jTextField4))
.add(14, 14, 14)
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jButton2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(jButton1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jProgressBar1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 438, Short.MAX_VALUE))
.addContainerGap())
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jProgressBar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
jTabbedPane1.addTab("Search", jPanel1);
org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 458, Short.MAX_VALUE)
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 401, Short.MAX_VALUE)
jTabbedPane1.addTab("Directory", jPanel2);
jSplitPane.setRightComponent(jTabbedPane1);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jSplitPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 675, Short.MAX_VALUE)
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jSplitPane)
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked
jGrid.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null, null, null, null, null, null, null},
{null, null, null, null, null, null, null, null, null, null},
{null, null, null, null, null, null, null, null, null, null},
{null, null, null, null, null, null, null, null, null, null}
new String [] {
"LName", "FName", "Position", "Department", "Office No", "Local No", "Office Mobile No", "Home No", "MobileNo", "Email Address"
jGrid.updateUI();
}//GEN-LAST:event_jButton2MouseClicked
private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
try {
//Load and register SQL Server driver
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
//Establish a connection
Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://X.X.X.X:1433","MyAccount","MyPassword");
//Create a Statement object
Statement sql_stmt = connection.createStatement();
//Create a ResultSet object, execute the query and return a
// resultset
ResultSet rset = sql_stmt.executeQuery("SELECT * FROM EpxDirectory..Directory Order By LName");
// Populates a JTABLE Object
int i=0;
while (rset.next()){
String LName = rset.getString(1);
String FName = rset.getString(2);
String Position = rset.getString(3);
String Dept_Code = rset.getString(4);
String OffPhoneNo = rset.getString(5);
String LocalNo = rset.getString(6);
String OffMobileNo = rset.getString(7);
String HomePhoneNo = rset.getString(8);
String MobileNo = rset.getString(9);
String Email = rset.getString(10);
jGrid.updateUI();
jGrid.setValueAt(rset.getString(1).trim(),i,0);
jGrid.setValueAt(rset.getString(2).trim(),i,1);
jGrid.setValueAt(rset.getString(3).trim(),i,2);
jGrid.setValueAt(rset.getString(4).trim(),i,3);
jGrid.setValueAt(rset.getString(5).trim(),i,4);
jGrid.setValueAt(rset.getString(6).trim(),i,5);
jGrid.setValueAt(rset.getString(7).trim(),i,6);
jGrid.setValueAt(rset.getString(8).trim(),i,7);
jGrid.setValueAt(rset.getString(9).trim(),i,8);
jGrid.setValueAt(rset.getString(10).trim(),i,9);
i++;
//Close the ResultSet and Statement
rset.close();
sql_stmt.close();
//Close the database connection
connection.close();
System.out.println(Integer.toString(i) + " rows found");
} catch(Exception e) {
System.out.println("Failed to connect; Please view Stack Trace");
e.printStackTrace();
}//GEN-LAST:event_jButton1MouseClicked
private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
}//GEN-LAST:event_formWindowOpened
public static void run(){
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
frmMain frmMain = new frmMain();
frmMain.setLocationRelativeTo(null); // Center the JFrame on the
frmMain.setVisible(true);
private void exitApplication() {
// try {
// //gui.putStatus("Closing the connection....please wait.....");
// if(connection != null) {
// // connection.close(); //Closing the connection object.
// } catch(SQLException ex) { //Trap SQLException
// //gui.putStatus(ex.toString());
System.exit(0); //Exit the aplication
* @param args the command line arguments
public static void main(String args[]) {
run();
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JTable jGrid;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JProgressBar jProgressBar1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JSplitPane jSplitPane;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField4;
private javax.swing.JTree jTree1;
// End of variables declaration//GEN-END:variables
}Use code tags.
Don't mix GUI and JDBC together. Split them out into separate classes.
You have a good start, but you will need to loop through your resultset and also pull the ResultSet metaData for you column headings -
How to handle the java.policy file ?
Can somebody tell me how to handle the java.policy file?
I always get java.net.SocketExceptions and java.security.AccessControlExceptions while connecting to an appserver from an applet.
What do I have to write in the java.policy file, where do I have to place it and do I have to call it in some way form my applet?
Thanks in advance.
don callThe java.policy file goes in your jre installation directory in .../jre/lib/security (there should be one there already).
I used it to allow otherwise restricted permissions for an applet using javax.comm. Add something like the following to the file:
grant codeBase "URL:http://yourDomainName/rootDirectoryOfYourApp/*" {
permission java.security.AllPermission;
This will give the applet downloaded from your site all permissions. You might want to give only certain permissions, I don't know.
Teri -
How to use the Java embedding activity in BPel
hi all,
How to use the java embedding activity in BPEL
pls can u provide sample example1 Use [Oracle BPEL Process Manager Client Java API Reference|http://download-uk.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/overview-summary.html] and especially [com.collaxa.cube.engine.ext|http://download-uk.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/com/collaxa/cube/engine/ext/BaseBPELXExecLet.html]
Instead of System.Out.println use addAuditTrailEntry(java.lang.String message)
2. If you want to import a package write in code (Source View) of bpel process
+<bpelx:exec import="package_name"/>+ for example +<bpelx:exec import="java.util.regex.Matcher"/>+
example 1:
String bodyAsString;
StringBuffer myStringBuffer = new StringBuffer();
try {
bodyAsString = (String)getVariableData("BodyString");
addAuditTrailEntry("bodyAsString1: "+ bodyAsString);
Pattern pattern = Pattern.compile("goodDay");
Matcher matcher= pattern.matcher(bodyAsString);
while (matcher.find()) {
matcher.appendReplacement(myStringBuffer, "shitDay");
matcher.appendTail(myStringBuffer);
bodyAsString = myStringBuffer.toString();
addAuditTrailEntry("bodyAsString2: "+ bodyAsString);
} catch (Exception ex) {
addAuditTrailEntry("Failed+bodyAsString",ex.getMessage());
I put in code (Source View) the following
<bpelx:exec import="java.util.regex.Matcher"/>
<bpelx:exec import="java.util.regex.Pattern"/>
example2:
Object temp;
try {
temp = ((XMLElement)getVariableData("inputVariable","payload","/ns2:FiscalisMessage/ns2:Body")).getChildNodes().item(1);
setVariableData("AdjReceipt",temp);
addAuditTrailEntry("ok",temp.toString());
catch (Exception ex) {
addAuditTrailEntry("Failed :",ex);
I put in code (Source View) the following
<bpelx:exec import="oracle.xml.parser.v2.XMLElement"/> -
How to access the remote Objects Without Db_links?
Hi ,
I want to know how to access the remote objects without db_link.That is i want to access a object in some other server which has different database.SanjayBala, just so you know that it is possible to create a database link in Oracle to non-Oracle databases in some circumstances. Look up Generic Connectivity aslo know as Heterogenous Services. With 11g Oracle has basically renamed the feature and replaced it with somethinkg named ike DG4ODBC.
I have not spent time studying the details for DB4ODBC but with HS Oracle provided the interface and you had to obtain the necessary ODBC driver on your own. I had Oracle on AIX reading and writing to SQL Server on Windows but the developers chose to write a java program and connect to both via it. On Windows and Linux platforms the necessary ODBC drivers might be available without the requirement to go out and purchase one.
The Oracle Open Gateway product is an advanced version of the above features with drivers for specific non-Oracle databases included like DB2 or Informix.
HTH -- Mark D Powell -- -
How to instantiate a java object (using JNI)?(n'more)
hey bschauwe, thanks for your last post, you were guessing but your 4th guess was right on the money of how id like to do it.
"4. An alternative way to return data to java from C is to instantiate a java object (using JNI), then use JNI to call that object's setters, then return the object at the end of the C routine."
I know now how to get the object's setters, I am just unsure how to instantiate a java object from the native C code using JNI. Also you said to returnt he object at the end of the c routine, that is just a good ol' return statement right? no other functions to release memory or anything are needed? So basically it would be something like:
JNIEXPORT jobject retObj JNICALL Java_AbfaRegion_getJSourceData
(JNIEnv *env, jobject thisObj)
//instantiate the java object on retObj????
//call setters with values from the c structures...
//return retObj??? no other memory releasing needed?
}Thanks again for all your help,
ShaneK sounds straight forward enough, the index in my book had nothing on <init> and I wasnt aware of the NewObject call. So my final (well for demonstration purposes) code should look something like:
JNIEXPORT jobject retObj JNICALL Java_AbfaRegion_getJSourceData
(JNIEnv *env, jobject thisObj)
jclass clazz;
jclass clazzTemp;
jmethodID mid;
jint val;
jobject tempObj;
//first instanciate the object
clazz = (*env)->GetObjectClass(env, retObj);
mid = (*env)->GetMethodID(env, clazz, "<init>", "()V");
//Get Object
tempObj = (*env)->NewObject(env, clazz, mid);
//get Class reference to instantiated class
clazzTemp = (*env)->GetObjectClass(env, tempObj);
//Start calling setters to set the object up.
mid = (*env)->GetMethodID(env, clazzTemp, "SetHeight", "(I)V");
(*env)->CallVoidMethod(env,tempObj, mid, struct->myHeight);
//set more members ...
//return the object back to java with its members filled out.
//before returning do I need to call (*env)->DeleteLocalRef(tempObj); ??
return tempObj;
}So is this how i do it for a function that is nativly defined as:
public native JSources getJSourceData();?
if this is right, then im cooking, and cannot thank you enough!
-Shane -
How to Use the JAVA SCRIPT code in .htm page of the component
Hi .
In my requirement i have to use Java Script Function in .htm code ..how to use the java script code and functions in .htm???
thank you
B.ManiCheck this document [Arun's Blog|http://wiki.sdn.sap.com/wiki/display/CRM/CRMWebClientUI-TalkingwithJava+Script]
Regards
Kavindra -
How to get the view Object in UserDefined Action
Hi All,
Any body tell me how to get the view object , like the view object avilable in the wdDoModifyView() method as parameter.
I have requirement like, i want to change the , no of rows displaying in the table should be changed at the runtime based onthe no of rows selected in the dropdown box.
The action which i created will be assigned to that dropdown box, on select of the available option, i will get the view object and change the properties of the "maxrows" of the table .
so for getting the view object in the the Action methods tell me what is the procedure for getting the current view object.Hello Vishal,
Simply create a value attribute (say rowCount) of type 'integer' and bind it to the 'visibleRowCount' property of your table. Then, in the actionHandler get the value from the UI element (in your case, I guess it is drop down) and set it to the attribute 'rowCount' like this.
wdContext.currentContextElement.setRowCount(
wdContext.current<nodeElement>.set<AttributeBound toDropDown>);
Bala
Maybe you are looking for
-
how can someone use a stolen iphone? does erasing the phone (which I feel like I should do) make it easier for the thief to use the iphone? If I don't erase it, it doesn't seem like anyone should be able to use the phone because of my password. Also
-
CSS - background image repeat-y
Hello, QUESTIONThis works great in IE v6.0. How can I get the background position to work in Firefox 2.0? Instead of a tiled background that I can control where it begins to tile within a DIV, in Firefox 2.0 it displays the image once and doesn't til
-
poor imports on D750 raw files.. at iso 800 and above can't even use them.. however if I import into NX then export as tiff it works fine. Kelly
-
Suggestion for bluetooth headset with display with...
Suggestion Sir, we are all windows fan, we all are using windows laptop and windows pc, we want best windows smartphone and Tablet, but Android overtaken all over world, for android accessories played important role, we need windows also must domaina
-
Ok guys, I have searched everywhere and I reckon I have tried everything. Basically I have a sequence that I sent to color, go to color, colour correct everything, render and then select Send to Final Cut Pro. FCP open, says importing XML, gets to ab