How to add multiple databases for a single frontend
We have a project based on distributed databases and we have to workout on .Net framework.I want to know some information of connecting multiple databases for a single frontend and how can we access them.
If so we have connected 2 databases for a single frontend in future if I want add one more database to it how it will be possible to do it without disturbing the current connectivity.
Please help me in resolving this problem.
Thanks......
hi,
what do you mean by connecting 2 databases? can you explain further?
using entityframework you can connect to different databases
public class CustomerContext : DbContext
public ReportContext()
: base("DefaultConnection")
public DbSet<Customers> Customers { get; set; }
and your connectionstring (config file)
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=D:\\Database\Project.mdf;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
you can add more connection strings on it.
https://msdn.microsoft.com/en-us/library/vstudio/cc716756(v=vs.100).aspx
https://msdn.microsoft.com/en-us/library/ms254978(v=vs.110).aspx
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Similar Messages
-
How can i add multiple validations for a single input box in adf?
hi,
i want to add multiple validation for a single input text control in adf like number validation and its existence in database.
MY JDEV VERSION IS 11.1.1.5.0
pls help !!!!Hi,
1.I want to validate if the value entered is pure integer
Option 1-
select the component and in the Property Inspector, in the "Core" category select a "Converter" format, select javax.faces.Number, if the user put a string, adf show a dialog error or message error...
Option 2-
or use the Regular expression:-
http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_validateRegExp.html
https://blogs.oracle.com/shay/entry/regular_expression_validation
Also check this:-
http://docs.oracle.com/cd/E15523_01/web.1111/b31973/af_validate.htm#BABHAHEI
Option 3-
Frank in his great book 'Oracle Fusion Developer Guide' shows a example using a javascript for input which is allowed only for numbers. You can manipulate for your requirement.
Here is the code:
function filterForNumbers(evt) {
//get ADF Faces event source, InputText.js
var inputField = evt.getSource();
var oldValue = inputField.getValue();
var ignoredControlKeys = new Array(AdfKeyStroke.BACKSPACE_KEY, AdfKeyStroke.TAB_KEY, AdfKeyStroke.ARROWLEFT_KEY, AdfKeyStroke.ARROWRIGHT_KEY, AdfKeyStroke.ESC_KEY, AdfKeyStroke.ENTER_KEY, AdfKeyStroke.DELETE_KEY);
//define the key range to exclude from field input
var minNumberKeyCode = 48;
var maxNumberKeyCode = 57;
var minNumberPadKeyCode = 96;
var maxNumberPadKeyCode = 105;
//key pressed by the user
var keyCodePressed = evt.getKeyCode();
//if it is a control key, don't suppress it
var ignoreKey = false;
for (keyPos in ignoredControlKeys) {
if (keyCodePressed == ignoredControlKeys[keyPos]) {
ignoreKey = true;
break;
//return if key should be ignored
if (ignoreKey == true) {
return true;
//filter keyboard input
if (keyCodePressed < minNumberKeyCode || keyCodePressed > maxNumberPadKeyCode) {
//set value back to previous value
inputField.setValue(oldValue);
//no need for the event to propagate to the server, so cancel
//it
evt.cancel();
return true;
if (keyCodePressed > maxNumberKeyCode && keyCodePressed < minNumberPadKeyCode) {
//set value back to previous value
inputField.setValue(oldValue);
evt.cancel();
return true;
2.I want to check if the value exists in my respective DB You must be having EO or VO if you want to validate with database in that case use the solution suggested by Timo.
Thanks
--NavinK -
Does anyone know how to add multiple pictures to a single frame in iMovie?
Does anyone know how to add multiple pictures to a single frame in iMovie?
Maybe you would be better off posting this in the iPhoto or iDVD categories of the forums.
http://discussions.apple.com/category.jspa?categoryID=143
http://discussions.apple.com/category.jspa?categoryID=128
The answer to your question depends on what you ant to do with the DVD.
Do you want a DVD menu, slide show etc.
iPhoto will allow you to burn straight to a DVD. Just select the album you want to burn then go to share in the tool bar and select Burn. -
How to use multiple hierarchies for a single char in single query
Hi,
Is there any way that we can use multiple hierarchies for a single char in single query. I tried and it just allows me to select one hierarchy even if I use hierarchy variable.
I have a requirement where user wants to see information related to a cost center with different cost center groups in different hierarchies (every year has different cost center group hierarchies).
Suppose I want to see information related to a cost center from year 2001-2004.in these four year cost center may have been associated to different groups depending upon that year hierarchy. How can I do that?
Thanks
JonaNope. Now way to do this.
There is always just one hierarchy assigned to a characteristic. And even if the hierarchy was time dependent, it only reads it for one key date and not according to transaction data.
Regards,
Beat -
Urgent ! How to add multiple JToolBars in a single JFrame
How to implement multiple JToolBars in a single JFrame
or what is the concept behind floating toolBars.If anybody can help me ,Thisis very urgentIf you insist on multiple toolbars, use the following code:
JToolBar tb1 = new JToolBar();
//add stuff
JToolBar tb2 = new JToolBar();
//add stuff
//put the toolbars on the top of the window
JPanel toolbars = new JPanel(new BorderLayout());
toolbars.add(tb1, BorderLayout.NORTH);
toolbars.add(tb2, BorderLayout.CENTER);
getContentPane().add(toolbars, BorderLayout.NORTH);Stephen -
How to show multiple messages for a single exception
hi
Please consider this example application created using JDeveloper 11.1.1.3.0
at http://www.consideringred.com/files/oracle/2010/MultipleMessagesExceptionApp-v0.01.zip
It has a class extending DCErrorHandlerImpl configured as ErrorHandlerClass in DataBindings.cpx .
Running the page and entering a value starting with "err" will result in an exception being thrown and multiple messages shown.
See the screencast at http://screencast.com/t/zOmEOzP4jmQ
To get multiple messages for a single exception the MyDCErrorHandler class is implemented like
public class MyDCErrorHandler
extends DCErrorHandlerImpl
public MyDCErrorHandler()
super(true);
@Override
public void reportException(DCBindingContainer pDCBindingContainer,
Exception pException)
if (pException instanceof JboException)
Throwable vCause = pException.getCause();
if (vCause instanceof MyMultiMessageException)
reportMyMultiMessageException(pDCBindingContainer,
(MyMultiMessageException)vCause);
return;
super.reportException(pDCBindingContainer, pException);
public void reportMyMultiMessageException(DCBindingContainer pDCBindingContainer,
MyMultiMessageException pException)
String vMessage = pException.getMessage();
reportException(pDCBindingContainer, new Exception(vMessage));
List<String> vMessages = pException.getMessages();
for (String vOneMessage : vMessages)
reportException(pDCBindingContainer, new Exception(vOneMessage));
}I wonder if calling reportException() multiple times is really the way to go here?
question:
- (q1) What would be the preferred use of the DCErrorHandlerImpl API to show multiple messages for a single exception?
many thanks
Jan Verveckenfyi
Looks like using MultipleMessagesExceptionApp-v0.01.zip in JDeveloper 11.1.1.2.0 (11.1.1.2.36.55.36) results in a different behaviour compared to when used in JDeveloper 11.1.1.3.0 (11.1.1.3.37.56.60)
see http://www.consideringred.com/files/oracle/img/2010/MultipleMessages-111130versus111120.png
When using JDeveloper 11.1.1.2.0 each exception seems to result in two messages where there is only one message (as intended/expected) per exception when using JDeveloper 11.1.1.3.0 .
(Could be somehow related to the question in forum thread "multiple callbacks to DCErrorHandlerImpl".)
But, question (q1) remains and is still about JDeveloper 11.1.1.3.0 .
regards
Jan -
How to add 3 legends for a single series barchart?? JAVAFX
Here is my code to generate 10 bars of different colors. I want to add legend respectively but it only one shows yellow legend
1. I think it shows only 1 color because there is only 1 series. Is it possible to add more than 1 legend for a single series?
or
2. or can i display another image for legend in barchart??
output :http://i.stack.imgur.com/fSNu7.png
file i want to display in barchart:http://i.stack.imgur.com/cchch.png
public class DynamicallyColoredBarChart extends Application {
@Override
public void start(Stage stage) {
final CategoryAxis xAxis = new CategoryAxis();
xAxis.setLabel("Bars");
final NumberAxis yAxis = new NumberAxis();
yAxis.setLabel("Value");
final BarChart<String, Number> bc = new BarChart<>(xAxis, yAxis);
bc.setLegendVisible(false);
XYChart.Series series1 = new XYChart.Series();
for (int i = 0; i < 10; i++) {
// change color of bar if value of i is >5 than red if i>8 than blue
final XYChart.Data<String, Number> data = new XYChart.Data("Value " + i, i);
data.nodeProperty().addListener(new ChangeListener<Node>() {
@Override
public void changed(ObservableValue<? extends Node> ov, Node oldNode, Node newNode) {
if (newNode != null) {
if (data.getYValue().intValue() > 8) {
newNode.setStyle("-fx-bar-fill: navy;");
} else if (data.getYValue().intValue() > 5) {
newNode.setStyle("-fx-bar-fill: red;");
series1.getData().add(data);
bc.getData().add(series1);
stage.setScene(new Scene(bc));
stage.show();
public static void main(String[] args) {
launch(args);
...Edited by: 993431 on Mar 12, 2013 1:42 PMEither:
1. Use a chart which displays multiple series, then you can allow the built-in legend to show OR
2. Use a single dynamically colored series have you have done and create your own custom legend.
import javafx.application.Application;
import javafx.scene.*;
import javafx.scene.chart.*;
import javafx.stage.Stage;
public class ThreeSeriesBarChart extends Application {
@Override public void start(Stage stage) {
final CategoryAxis xAxis = new CategoryAxis();
xAxis.setLabel("Bars");
final NumberAxis yAxis = new NumberAxis();
yAxis.setLabel("Value");
final BarChart<String, Number> bc = new BarChart<>(xAxis, yAxis);
XYChart.Series lowSeries = new XYChart.Series();
lowSeries.setName("Not Achieved");
XYChart.Series medSeries = new XYChart.Series();
medSeries.setName("Achieved");
XYChart.Series hiSeries = new XYChart.Series();
hiSeries.setName("Exceeded");
bc.setBarGap(0);
bc.setCategoryGap(0);
for (int i = 0; i < 10; i++) {
final XYChart.Data<String, Number> data = new XYChart.Data("Value " + i, i);
if (data.getYValue().intValue() > 8) {
hiSeries.getData().add(data);
} else if (data.getYValue().intValue() > 5) {
medSeries.getData().add(data);
} else {
lowSeries.getData().add(data);
bc.getData().setAll(lowSeries, medSeries, hiSeries);
bc.getStylesheets().add(getClass().getResource("colored-chart.css").toExternalForm());
stage.setScene(new Scene(bc));
stage.show();
public static void main(String[] args) {
launch(args);
import javafx.application.Application;
import javafx.beans.value.*;
import javafx.geometry.Pos;
import javafx.scene.*;
import javafx.scene.chart.*;
import javafx.scene.control.Label;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.scene.shape.*;
import javafx.stage.Stage;
public class DynamicallyColoredBarChart extends Application {
@Override public void start(Stage stage) {
final CategoryAxis xAxis = new CategoryAxis();
xAxis.setLabel("Bars");
final NumberAxis yAxis = new NumberAxis();
yAxis.setLabel("Value");
final BarChart<String, Number> bc = new BarChart<>(xAxis, yAxis);
bc.setLegendVisible(false);
XYChart.Series series1 = new XYChart.Series();
for (int i = 0; i < 10; i++) {
// change color of bar if value of i is >5 than red if i>8 than blue
final XYChart.Data<String, Number> data = new XYChart.Data("Value " + i, i);
data.nodeProperty().addListener(new ChangeListener<Node>() {
@Override
public void changed(ObservableValue<? extends Node> ov, Node oldNode, Node newNode) {
if (newNode != null) {
if (data.getYValue().intValue() > 8) {
newNode.setStyle("-fx-bar-fill: -fx-exceeded;");
} else if (data.getYValue().intValue() > 5) {
newNode.setStyle("-fx-bar-fill: -fx-achieved;");
} else {
newNode.setStyle("-fx-bar-fill: -fx-not-achieved;");
series1.getData().add(data);
bc.getData().add(series1);
LevelLegend legend = new LevelLegend();
legend.setAlignment(Pos.CENTER);
VBox chartWithLegend = new VBox();
chartWithLegend.getChildren().setAll(bc, legend);
chartWithLegend.getStylesheets().add(getClass().getResource("colored-chart.css").toExternalForm());
stage.setScene(new Scene(chartWithLegend));
stage.show();
class LevelLegend extends GridPane {
LevelLegend() {
setHgap(10);
setVgap(10);
addRow(0, createSymbol("-fx-exceeded"), new Label("Exceeded"));
addRow(1, createSymbol("-fx-achieved"), new Label("Achieved"));
addRow(2, createSymbol("-fx-not-achieved"), new Label("Not Achieved"));
getStyleClass().add("level-legend");
private Node createSymbol(String fillStyle) {
Shape symbol = new Ellipse(10, 5, 10, 5);
symbol.setStyle("-fx-fill: " + fillStyle);
symbol.setStroke(Color.BLACK);
symbol.setStrokeWidth(2);
return symbol;
public static void main(String[] args) { launch(args); }
/** colored-chart.css: place in same directory as other bar chart application files and setup your build system to copy it to the output directory */
.root {
-fx-not-achieved: red;
-fx-achieved: green;
-fx-exceeded: blue;
.default-color0.chart-bar { -fx-bar-fill: -fx-not-achieved; }
.default-color1.chart-bar { -fx-bar-fill: -fx-achieved; }
.default-color2.chart-bar { -fx-bar-fill: -fx-exceeded; }
.level-legend {
-fx-padding: 10;
-fx-border-width: 2;
-fx-background-color: rgba(211, 211, 211, 0.5);
-fx-border-color: derive(rgba(211, 211, 211, 0.7), 10%);
} -
How to send multiple data for a single element
Hi All,
I have a requirement where I have to send multiple data for single element per single transaction. For example
Id details
1 abcd
1 efgh
1 def
Now, when I am selecting this ID from database, I have to get all the details in a single xsd like
<id>1</id>
---><details>abcd</details>
<details>efgh</details>
<details>def</details>
ThanksHi,
The following XSLT...
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:variable name="root" select="/"/>
<root>
<xsl:for-each select="distinct-values(/root/entry/id)">
<xsl:variable name="id" select="."/>
<entry>
<id><xsl:value-of select="$id"/></id>
<xsl:for-each select="$root/root/entry[id = $id]">
<details><xsl:value-of select="details"/></details>
</xsl:for-each>
</entry>
</xsl:for-each>
</root>
</xsl:template>
</xsl:stylesheet>Will work for a document like this...
<root>
<entry>
<id>1</id>
<details>detail1</details>
</entry>
<entry>
<id>1</id>
<details>detail2</details>
</entry>
<entry>
<id>2</id>
<details>detail3</details>
</entry>
</root>Hope this helps...
Cheers,
Vlad -
How to access multiple database present in single instance
Hi Team,
In oracle 11.2, can there be multiple databases in an instance??? In one of our environment, I could see multiple databases in an instance. Could you please help me in giving the data dictionary or query to access those databases?
Actually, querying v$database, I could see only one database which is same as instance name. But in inventory, there are multiple database in an instance?
I am still not exactly clear about this. Can someone help me with this?
Thanks!
VidhyaIn Oracle one instance manages one (1) database. A database consists of multiple *schemas*.
Other vendors erroneously call a schema 'database'.
So, no, you didn't see multiple databases.
There is also one datadictionary, consisting of a set of views.
All views beginning with dba_ list the entire database, all schemas.
All views beginning with all_ list the objects you have access to.
All views beginning with user_ list your own objects.
The view DICT show you the contents of the datadictionary.
Oracle also has online documentation at http://docs.oracle.com
From your question it is clear you should read the document called the 'Oracle Concepts Manual'.
You can find all documentation for 11gR2 here Oracle Database Online Documentation 11g Release 2 (11.2)
Too many people here don't make any effort to read it. This is probably the reason why you got no response.
Sybrand Bakker
Senior Oracle DBA -
How to add mouse listener for a single row alone
I have a requirement. In a JTable when I double click a particular row the cells in the row should set to the width which I have provided.
The problem with my code is when I click fourth row in the table, the first row gets adjusted.
So how I need help is
only if I click the first row, the first row cell size should get adjusted not when I click fourth row.
Similarly if I give some cell width and height for fourth row cells, then when I double click the fourth row, the fourth should alone get adjusted and not the other rows.
Hope I have explained clearly.
How can it be achieved?
Please find below my code. Everything is hardcoded. So it may look messy. Please excuse.
// Imports
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
class SimpleTableExample extends JFrame {
// Instance attributes used in this example
private JPanel topPanel;
private JTable table;
private JScrollPane scrollPane;
String data1 = "";
String data2 = "123456789ABCDEFGHIJKLMNOPQRSTUVQWXYZabcdefghijklmnopqrstuvwxyzaquickbrownfoxjumpedoverthelazydog";
int size = data2.length();
// Constructor of main frame
public SimpleTableExample() {
// Set the frame characteristics
setTitle("Simple Table Application");
setSize(400, 200);
setBackground(Color.gray);
// Create a panel to hold all other components
topPanel = new JPanel();
topPanel.setLayout(new BorderLayout());
getContentPane().add(topPanel);
// Create columns names
String columnNames[] = { "SEL", "DESIGN DATA", "PART NUMBER" };
// Create some data
String dataValues[][] = { { data1, data2, "67", "77" },
{ "", "43", "853" }, { "", "89.2", "109" },
{ "", "9033", "3092" } };
DefaultTableModel model = new DefaultTableModel(dataValues, columnNames);
model.addColumn("PART TITLE");
model.addColumn("SPECIAL INSTRUCTIONS");
table = new JTable(model) {
public boolean isCellEditable(int rowIndex, int colIndex) {
return false;
// set specific row height
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
int colInd = 0;
TableColumn col = table.getColumnModel().getColumn(colInd);
int width = 50;
col.setPreferredWidth(width);
int colInd2 = 1;
TableColumn col2 = table.getColumnModel().getColumn(colInd2);
int width2 = 100;
col2.setPreferredWidth(width2);
int colInd3 = 2;
TableColumn col3 = table.getColumnModel().getColumn(colInd3);
int width3 = 10;
col3.setPreferredWidth(width3);
int colInd4 = 3;
TableColumn col4 = table.getColumnModel().getColumn(colInd4);
int width4 = 10;
col4.setPreferredWidth(width4);
int colInd5 = 4;
TableColumn col5 = table.getColumnModel().getColumn(colInd5);
int width5 = 10;
col5.setPreferredWidth(width5);
table.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
JTable target = (JTable) e.getSource();
int row = target.getSelectedRow();
int column = target.getSelectedColumn();
TableColumn col1 = table.getColumnModel().getColumn(0);
col1.setPreferredWidth(50);
TableColumn col2 = table.getColumnModel().getColumn(1);
col2.setPreferredWidth(400);
table.getColumnModel().getColumn(1).setCellRenderer(
new TableCellLongTextRenderer());
table.setRowHeight(50);
TableColumn col5 = table.getColumnModel().getColumn(4);
col5.setPreferredWidth(200);
// Create a new table instance
// table = new JTable(dataValues, columnNames);
// Add the table to a scrolling pane
scrollPane = new JScrollPane(table);
topPanel.add(scrollPane, BorderLayout.CENTER);
// Main entry point for this example
public static void main(String args[]) {
// Create an instance of the test application
SimpleTableExample mainFrame = new SimpleTableExample();
mainFrame.setVisible(true);
class TableCellLongTextRenderer extends JTextArea implements TableCellRenderer {
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
this.setText((String) value);
this.setWrapStyleWord(true);
this.setLineWrap(true);
// set the JTextArea to the width of the table column
setSize(table.getColumnModel().getColumn(column).getWidth(),
getPreferredSize().height);
if (table.getRowHeight(row) != getPreferredSize().height) {
// set the height of the table row to the calculated height of the
// JTextArea
table.setRowHeight(row, getPreferredSize().height);
return this;
Edited by: 915175 on Aug 3, 2012 4:24 AMHi
Try below code. Hope this will help
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
public class SimpleTableExample extends JFrame {
private JPanel topPanel;
private JTable table;
private JScrollPane scrollPane;
String data1 = "";
String data2 = "123456789ABCDEFGHIJKLMNOPQRSTUVQWXYZabcdefghijklmnopqrstuvwxyzaquickbrownfoxjumpedoverthelazydog";
int size = data2.length();
// Constructor of main frame
public SimpleTableExample() {
// Set the frame characteristics
setTitle("Simple Table Application");
setSize(400, 200);
setBackground(Color.gray);
// Create a panel to hold all other components
topPanel = new JPanel();
topPanel.setLayout(new BorderLayout());
getContentPane().add(topPanel);
// Create columns names
String columnNames[] = { "SEL", "DESIGN DATA", "PART NUMBER" };
// Create some data
String dataValues[][] = { { data1, data2, "67", "77" },
{ "", "43", "853" }, { "", "89.2", "109" },
{ "", "9033", "3092" } };
DefaultTableModel model = new DefaultTableModel(dataValues, columnNames);
model.addColumn("PART TITLE");
model.addColumn("SPECIAL INSTRUCTIONS");
table = new JTable(model) {
public boolean isCellEditable(int rowIndex, int colIndex) {
return false;
// set specific row height
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
int colInd = 0;
TableColumn col = table.getColumnModel().getColumn(colInd);
int width = 50;
col.setPreferredWidth(width);
int colInd2 = 1;
TableColumn col2 = table.getColumnModel().getColumn(colInd2);
int width2 = 100;
col2.setPreferredWidth(width2);
int colInd3 = 2;
TableColumn col3 = table.getColumnModel().getColumn(colInd3);
int width3 = 10;
col3.setPreferredWidth(width3);
int colInd4 = 3;
TableColumn col4 = table.getColumnModel().getColumn(colInd4);
int width4 = 10;
col4.setPreferredWidth(width4);
int colInd5 = 4;
TableColumn col5 = table.getColumnModel().getColumn(colInd5);
int width5 = 10;
col5.setPreferredWidth(width5);
// Cell Render should apply on each column -- add by Rupali
for(int i=0; i< table.getColumnModel().getColumnCount(); i++){
table.getColumnModel().getColumn(i).setCellRenderer( new TableCellLongTextRenderer());
table.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
JTable target = (JTable) e.getSource();
int row = target.getSelectedRow();
int column = target.getSelectedColumn();
setTableCellHeight(table,row,column); //Added by Rupali
TableColumn col1 = table.getColumnModel().getColumn(0);
col1.setPreferredWidth(50);
TableColumn col2 = table.getColumnModel().getColumn(1);
col2.setPreferredWidth(400);
TableColumn col5 = table.getColumnModel().getColumn(4);
col5.setPreferredWidth(200);
// Create a new table instance
// table = new JTable(dataValues, columnNames);
// Add the table to a scrolling pane
scrollPane = new JScrollPane(table);
topPanel.add(scrollPane, BorderLayout.CENTER);
* Created By Rupali
* This will set cell's height and column's width
* @param table
* @param row
* @param column
public void setTableCellHeight(JTable table, int row, int column) {
// set the JTextArea to the width of the table column
setSize(table.getColumnModel().getColumn(column).getWidth(),
getPreferredSize().height);
if (table.getRowHeight(row) != getPreferredSize().height) {
// set the height of the table row to the calculated height of the
// JTextArea
table.setRowHeight(row, getPreferredSize().height);
// Main entry point for this example
public static void main(String args[]) {
// Create an instance of the test application
SimpleTableExample mainFrame = new SimpleTableExample();
mainFrame.setVisible(true);
class TableCellLongTextRenderer extends JTextArea implements TableCellRenderer {
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
this.setText((String) value);
this.setWrapStyleWord(true);
this.setLineWrap(true);
return this;
} -
How to have multiple orders for a single contract
Hi all, my question is:
How to have multiple orders with respect to a contract which is valid for many years? The orders are given periodically over the lifetime of the contract. Once the order is given, the order quantity needs to be confirmed and then the order needs to be billed.
Thanks in advance.Hi Bappaditya,
To get multiple orders from a contract, you can either create an order as a follow up document from the contract
Or
Maintain the contract determination settings.
In such a case, everytime you create an order the contract determination happens, for the particular business partner and product.
For this to happen you need to maintain the customizing settings:
1. Copy Control between contract and order
2. Contract determination setting in the order transaction type
The qunatity confirmation can be done by standard setting at itme category level.i.e. If the quantity is more than that stated in the contract an error is raised.
For billing of order you will have to maintain the billing setings like billing type, biliing item category, billing item determination.
Hence every time your order is created it comes in the billind due list from where you can create the blling document.
Wish the information is helpful.
Regards,
Shalini Chauhan -
How to add multiple email for imessages
i want to add more than one email address in imessages but when i do this it always show error. You can see in the pictures. Please help me. Sorry for my bad english.
you are correct, the only way to be able to send to multiple addresses for the same person in a group is to create one card per email address, with a code for the name as in john doe1, john doe2, or play with prefix, suffix or middle name fields to differentiate each card. to date there is no other way around this issue.
hope this helps. -
How to add multiple groups in a single user in ldap
I have problem with ldap ,Please clarify the following problem.
My request is --> send the multiple groups at a time with single user.
My code contain single user and single group is working.
Please see the source file ,please solve my problem. i tried , but i did not get.
package com.ldap;
import java.util.Hashtable;
import javax.naming.AuthenticationException;
import javax.naming.Context;
import javax.naming.NameAlreadyBoundException;
import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.BasicAttribute;
import javax.naming.directory.BasicAttributes;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
* This class provides methods for the user management
* @author sudhakar
public class LdapUserMgr {
public final static String USER_ID = "uid";
public final static String COMMONNAME = "cn";
public final static String SURNAME = "sn";
public final static String MEMBEROF = "wlsMemberOf";
public final static String MEMBEROF1 = "wlsMemberOf";
public final static String PASSWORD = "userpassword";
public final static String EMAIL = "mail";
* This method creates new user in the embedded ldap registry
* @return
* @throws Exception
public void createUser() throws Exception {
DirContext ctx = getLDAPConnection();
String userId="sudhakar";
String userName="sudhakar";
String userRole="Assessor";
String password="sudhakar123";
String email="[email protected]";
try{
Attributes attrNew = new BasicAttributes(true);
Attribute objclass = new BasicAttribute("objectclass");
String group = "ou=groups,ou=myrealm,dc=sudhakar_domain";
String people = "ou=people,ou=myrealm,dc=sudhakar_domain";
// add all the object classes required for the user profile
objclass.add("top");
objclass.add("person");
objclass.add("organizationalPerson");
objclass.add("inetOrgPerson");
objclass.add("wlsUser");
// put all the attributes required as part of the user profile
// add object classes
attrNew.put(objclass);
// add user Id
attrNew.put(USER_ID, userId);
// add user common name
attrNew.put(COMMONNAME, userName);
// add user surname
attrNew.put(SURNAME, userName);
// prepare the group path for the user
String role = COMMONNAME + "=" + userRole + "," + group;
// add user to a group
attrNew.put(MEMBEROF,role);
System.out.println("user role is "+role);
// i want to pass multiple user roles at a time
// add user password
attrNew.put(PASSWORD, password);
// add user mail Id
attrNew.put(EMAIL, email);
// Prepare the query string to add the user to the embedded ldap
String query = USER_ID + "=" + userId+ "," + people;
System.out.println("user query is "+query);
// add the user to the LDAP directory
ctx.createSubcontext( query, attrNew );
System.out.println("user" + userId+ "created");
catch ( NameAlreadyBoundException nabe ){
System.out.println(nabe.getMessage());
throw new NameAlreadyBoundException("User by this name already exits");
catch (NamingException namEx) {
System.out.println(namEx.getMessage());
catch(Exception ex){
System.out.println(ex.getMessage());
finally{
closeLDAPConnection(ctx);
public DirContext getLDAPConnection() throws Exception{
DirContext ctx = null;
try{
Hashtable<String,String> env = new Hashtable<String,String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://192.168.100.84:7030/");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "cn=Admin");
env.put(Context.SECURITY_CREDENTIALS,"admin");
// Create the initial directory context
ctx = new InitialDirContext(env);
return ctx;
catch (AuthenticationException authEx){
System.out.println(authEx.getMessage());
throw new AuthenticationException("Authentication failed");
catch (NamingException namEx) {
System.out.println(namEx.getMessage());
throw new NamingException("Naming Exception");
catch(Exception ex){
System.out.println(ex.getMessage());
throw new Exception("Exception Occured");
* This method closes the LDAP connection
* @param ctx
public void closeLDAPConnection(DirContext ctx){
try{
ctx.close();
catch(NamingException nex){
System.out.println(nex.getMessage());
catch(Exception ex){
System.out.println(ex.getMessage());
public static void main(String s[])throws Exception{
LdapUserMgr ldapUserMgr = new LdapUserMgr();
ldapUserMgr.createUser();
Edited by: sudhakar_kavuru on Jun 16, 2009 1:58 AMHi Sudhakar,
try some thing like this.Here I have enclosed the code snippet.
String query = USER_ID + "=" + user.getUserId()+ "," + people;
// add the user to the LDAP directory
// ctx.createSubcontext( query, attrNew );
Attribute att1 = new BasicAttribute(MEMBEROF);
String roleName=user.getUserRoleList().get(0);
String role1 = COMMONNAME + "="+roleName+"," + group;
att1.add(role1);
attrNew.put(att1);
DirContext dirContext =ctx.createSubcontext( query, attrNew );
for (int i = 1; i < user.getUserRoleList().size(); i++) {
Attributes att2 = new BasicAttributes();
String roleNameStr=user.getUserRoleList().get(i);
log.debug("roleNameStr--->"+roleNameStr);
String role2 = COMMONNAME + "="+roleNameStr+"," + group;
log.debug("role2-->"+role2);
att2.put(MEMBEROF,role2);
dirContext.modifyAttributes("", DirContext.ADD_ATTRIBUTE, att2);
} -
How to create Multiple Address for a single customer
Respected Members,
In tcode Xd01 we create on customer but there we can maintain only one address but sometimes a scenario can be that single customer can have different address .
How to do that.Any exit is available to create multiple address with creation of single customer.
This provision is given while creating a Business Partner.Tcode is BP .In this Address Overview tab is there and you maintain multiple address to single Busines partner.
Same thing can we do for the customer.
Any solutions or suggestions,please give me your support.
ThanksHello Manish,
Unfortunately Customers have only one address. However you can use contact persons to store different addresses, or (in the Sales view) you can assign other partner functions with different addresses (e.g. one customer acting as the Sold-to partner may have different Ship-to partners).
If these options do not meet your requirements, you could extend the customer master data with your own functionality and enhance transaction XD01 with your own screens for holding alternate addresses.
Regards,
John. -
How to suppress multiple lines for a single day on a PE50 form
Hello everyone,
I'm working on a timesheet based on a PE50-form. Currently, the following line is used to display one day:
Group: ED
Priority: 1
Row:
|WE CD|TEXT_________________ |ANZHL_|ANZHL_|ANZHL_ | | |
WE = SCHLW-WEEKDAY
CD = SCHLW-CDATUM
TEXT = TP-TEXT
ANZHL = ZES-ANZHL (different conditions)
As soon as there are two time recordings in the cluster, there are two rows on the timesheet. This makes sense when you want to print clockin / clockout times. However, on this form, there is no such information.
My question: Is it possible to only have one line per day even if there are multiple records in the cluster?
I read all the documentation I could find but so far, no success.hi,
what do you mean by connecting 2 databases? can you explain further?
using entityframework you can connect to different databases
public class CustomerContext : DbContext
public ReportContext()
: base("DefaultConnection")
public DbSet<Customers> Customers { get; set; }
and your connectionstring (config file)
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=D:\\Database\Project.mdf;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
you can add more connection strings on it.
https://msdn.microsoft.com/en-us/library/vstudio/cc716756(v=vs.100).aspx
https://msdn.microsoft.com/en-us/library/ms254978(v=vs.110).aspx
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Maybe you are looking for
-
In Mountain Lion, GChrome suddenly started crashing/quitting at launch
Is there a glitch in Mountain Lion in relation to Google Chrome? Or vice versa some wort of incompatibility? I've used Chrome faultlessly on my MacBook Pro (running Snow Leopard) since its original introduction. I replaced my MBP with a new MBP-Retin
-
How to remove padding after RSA decryption??
Hello, I am testing my host apps ability to read public key that was saved in file after being exported from smart card where it was generated. I have successfully used the private key on card to encrypt a small piece of data and the cryptogram is re
-
Hello, we want to use Adobe Flex in the future. We have NWDS and NWDI in place. Can we use the DTR from the NWDI to manage the source which we developed based on Adobe Flex? Regards, Alexander
-
Applying a Time Parameter to a dimension
I am trying to create a query that pulls back the data based on a Time parameter , [Time].[Time].[Quarter].&[1Qtr 13], etc., but the dimension that I am querying against is a Date field , example [Consolidated Agent].[Earliest Active Contract Date].
-
Hi I am planning some data migration and need to move some old files to a different storage (USB or network share on a different server). So I am looking for the way to move files selectively (by the last time modified) to a different drive preservi