POPUP get date - wich name ?
Hello,
I need a popup to choose a data (with matchcode).
I found it
'CNEV_01_POPUP_GET_DATE'
It's run ok, but I would to change the title text ... I tried to copy and modify from standard,
but the text title is not modified...
Any other idea ?
tks,
rob
Hi ROb,
try to use the below function module..
CALL FUNCTION 'POPUP_TO_GET_VALUE'
EXPORTING
fieldname = 'RECORD_ID' "Field name in the table
tabname = 'ZCIN_7B1_MAIN' "table name
titel = 'Enter Record id' "Pop-Up title
valuein = p_recordid "any default value
IMPORTING
answer = w_answer
valueout = p_recordid. "In the Popup the value entered is stored here
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
Prabhudas
Similar Messages
-
Getting "Data source name not found and no default driver specified"
Hi all,
I'm trying to create a connection in SQL Developer (1.5.0.53) to an Access MDB using the Access Tab on the "New / Select Database Connection" window. I navigate to my MDB and then click the Test button and this is what I get:
"Status : Failure - Test failed: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
I do have the 1.6 JVM.
Not a show stopper, but would like to see how SQL Developer works with Access tables, so any help would be appreciated.
TIA,
SteveThis error message sounds like the MS Access ODBC driver or the Jet Engine drivers are not found. First of all you need to check the PATH environment setting if it includes the windows/system32 directory as this is the default directory for the MS Access ODBC drivers.
Next check if you are a normal user or a local admin user. As local admin open the ODBC Adminstartor (Control Panel/administrative tools) and check if a MS Access ODBC driver is registered.
If all above is true, please get from www.sysinternals.com and et the process monitor. Open it and apply a filter: Process name is sqldevloper.exe
Then start SQL Developer and open your created MS Access link. Process mon will now track all info containing all additional DLLs it tries to load.
Check out the generated log file from the bottom (last info about the mdb file load) to the top and look if it really finds all libraries, especially the MsAccess and Jet libraries. -
How to get Data Source Name and Source System for InfoPackage
Hello Guys,
I'm creating a routine that can be use by any InfoPcakges...
how can I get the Source System and Data Source in a Routine?Hi
Please check the table RSLDPIO,
In this table search with Info Package-->You will get Data source related to this info package
then goto RSDS >here search with Data source>you will get from which Source system this is extracting data
Hope this helps
Regards,
Venkatesh -
I have developed a batch harness whereby all scheduled tasks (W2012) invoke a common powershell script that acts as a wrapper to all our housekeeping jobs.
The first step in the wrapper is to create a Transcript file using following code
if ($Host.name -ne "Windows PowerShell ISE Host") # Transcript does not work within ISE
$timestamp = (get-date -format "yyyy-MM-dd-HH-mm-ss.fff")
$path = "c:\corp\$timestamp" + "_$pid.txt"
Start-Transcript -path $path -append
As expected the folder contains files with timestamp & pid in name
08/08/2013 11:00 AM 14,388 2013-08-08-11-00-01.158_1620.txt
08/08/2013 11:00 AM 12,506 2013-08-08-11-00-01.485_936.txt
08/08/2013 11:00 AM 12,994 2013-08-08-11-00-01.735_9328.txt
08/08/2013 11:00 AM 12,024 2013-08-08-11-00-01.766_8624.txt
08/08/2013 11:00 AM 13,902 2013-08-08-11-00-01.860_1756.txt
08/08/2013 11:01 AM 15,142 2013-08-08-11-01-31.392_10120.txt
08/08/2013 05:00 AM 14,982 _1692.txt
However note the last file, it has a zero length date time value in the name
The error recorded by PowerShell is
get-date : The term 'get-date' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Corp\Powershell\DMPRun-ScheduledTask.ps1:171 char:18
+ $timestamp = (get-date -format "yyyy-MM-dd-HH-mm-ss.fff")
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (get-date:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
IE get-date has failed and returned a zero length field as the timestamp
Can anyone think of a good reason why get-date would fail intermittently?
Do I have to code defensively for base Powershell functions?I implemented David's suggestion and now I intermittently get
import-module : Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
At D:\temp\loop_jc2_2013_11_25_08_55_02.ps1:15 char:1
+ import-module Microsoft.Powershell.Utility
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Import-Module], UnauthorizedA
ccessException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.Pow
erShell.Commands.ImportModuleCommand
I added a trap chain (My Powershell skills do not yet include recursive trap coding, any suggestions welcome)
trap {
trap {
"Trap1"
"Exception: " + $_
"Error: " + $Error[0]
"Message: " + $_.Exception.Message
"InnerException: " + $_.Exception.InnerException
"StackTrace: " + $_.Exception.StackTrace
"FailedItem: " + $_.Exception.ItemName
import-module Microsoft.Powershell.Management
import-module Microsoft.Powershell.Security
import-module Microsoft.Powershell.Utility
"Trap2"
"Exception: " + $_
"Error: " + $Error[0]
"Message: " + $_.Exception.Message
"InnerException: " + $_.Exception.InnerException
"StackTrace: " + $_.Exception.StackTrace
"FailedItem: " + $_.Exception.ItemName
import-module Microsoft.Powershell.Management
import-module Microsoft.Powershell.Security
import-module Microsoft.Powershell.Utility
import-module Microsoft.Powershell.Management
import-module Microsoft.Powershell.Security
import-module Microsoft.Powershell.Utility
trap {
"Trap3"
"Exception: " + $_
"Error: " + $Error[0]
"Message: " + $_.Exception.Message
"InnerException: " + $_.Exception.InnerException
"StackTrace: " + $_.Exception.StackTrace
"FailedItem: " + $_.Exception.ItemName
exit 1
get-date
Now I intermittently get ..
Trap2
Exception: Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
Error: Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
Message: Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
InnerException:
StackTrace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.Mutex.CreateMutexWithGuaranteedCleanup(Boolean initiallyOwned, String name, Boolean& createdNew, SECURITY_ATTRIBUTES secAttrs)
at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew, MutexSecurity mutexSecurity)
at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew)
at System.Management.Automation.AnalysisCache.CacheExportedCommands(PSModuleInfo module, Boolean force, ExecutionContext context)
at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadUsingModulePath(PSModuleInfo parentModule, Boolean found, IEnumerable`1 modulePath, String name, SessionState ss, ImportModuleOptions options, ManifestProcessingFlags manifestProcessingFlags,
PSModuleInfo& module)
at Microsoft.PowerShell.Commands.ImportModuleCommand.ImportModule_LocallyViaName(ImportModuleOptions importModuleOptions, String name)
at Microsoft.PowerShell.Commands.ImportModuleCommand.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
FailedItem:
import-module : Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
At D:\temp\loop_jc2_2013_11_25_09_19_52.ps1:26 char:1
+ import-module Microsoft.Powershell.Security
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Import-Module], UnauthorizedA
ccessException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.Pow
erShell.Commands.ImportModuleCommand -
Hi Experts,
I am trying to build a PowerShell Script to get the details Like Scope,Last Deployed date and Name for a Solution Deployed in the Farm.
Can anyone advise on this please.
RegardsGet-SPSolution|Select Name,Scope,LastOperationResult,LastOperationEndTime|Export-CSV "SPInstalledSolutions.csv" -NoTypeInformation
SPSolution properties
Get-SPSolution
This post is my own opinion and does not necessarily reflect the opinion or view of Slalom. -
How to get back Queue name in SMQ1 when Data source is present in RSA7
Hello Friends,
Its very urgent issue.Please provide me your valuable solutions.
1) I have Queue name in SMQ1 and Data source name in RSA7 are present for particular Data source in CRM source system. I deleted Queues in SMQ1 and they present in RSA7 so whenever I do changes in Data source record that changes i can see in RSA3 and DB table but I can't able to see that changes in RSA7.
2) That Data source is Delta enabled and Initialization also set for that.
3) when i do delta scheduling no records are coming in BI side.
Please tell me how can i get back my Queue in SMQ1 and get changes reflects in RSA7 data source also.Try below:
http://sharepoint247.wordpress.com/2013/05/24/handy-email-utility-for-any-sharepoint-project/
interface IEmailConfigurationManager
/// <summary>
/// Gets Email Template by it's ID
/// </summary>
/// <param name="emailTemplateId"></param>
/// <returns></returns>
EmailTemplate GetEmailTemplate(string emailTemplateId);
/// <summary>
/// Gets Email Template by it's ID by updating the email template properties
/// </summary>
/// <param name="emailTemplateId"></param>
/// <param name="subjectProperties"></param>
/// <param name="bodyProperties"></param>
/// <returns></returns>
EmailTemplate GetEmailTemplate(string emailTemplateId,
IDictionary<string, string> subjectProperties,
IDictionary<string, string> bodyProperties);
/// <summary>
/// Add new email template.
/// </summary>
/// <param name="emailTemplateId"></param>
/// <param name="emailTemplateSubject"></param>
/// <param name="emailTemplateBody"></param>
void AddEmailTemplate(string emailTemplateId, string shortDescription,
string emailTemplateSubject, string emailTemplateBody);
https://spemailutility.codeplex.com/
http://social.msdn.microsoft.com/Forums/en-US/ef945d33-50c5-4b89-8bb9-32a95498b419/how-to-change-email-template-for-the-approval-workflow?forum=sharepointcustomizationlegacy -
How to get data by using only file name in XI
Dear All.
I have 2 senarios . How can I configure it in the Configuration?
1. get data from file name (xxx.txt) --> HTTP
2. convert data into text file --> File
Thak you in advance.
Audnt think so?, using a webpage to send the file to XI, you will sending data again to XI as a file, pls tell what is the puropose of using the webpage to copy file?
is this webpage only used to move the file from one loaction to other from which the XI can acess?
to which location this file is placed? if XI reads this file from somelocation then you do as relied in above use filesender adapter and do FCC then..... -
Get table partition name dynamically for given date range
Dear All,
Could you please tell me how to get the partition name dynamicaly for given date range ?
Thank you.SQL> select table_name,
partition_name,
to_date (
trim (
'''' from regexp_substr (
extractvalue (
dbms_xmlgen.
getxmltype (
'select high_value from all_tab_partitions where table_name='''
|| table_name
|| ''' and table_owner = '''
|| table_owner
|| ''' and partition_name = '''
|| partition_name
|| ''''),
'//text()'),
'syyyy-mm-dd hh24:mi:ss')
high_value_in_date_format
from all_tab_partitions
where table_name = 'SALES' and table_owner = 'SH'
TABLE_NAME PARTITION_NAME HIGH_VALUE_IN_DATE_FORMAT
SALES SALES_1995 01-JAN-96
SALES SALES_1996 01-JAN-97
SALES SALES_H1_1997 01-JUL-97
SALES SALES_H2_1997 01-JAN-98
SALES SALES_Q1_1998 01-APR-98
SALES SALES_Q2_1998 01-JUL-98
SALES SALES_Q3_1998 01-OKT-98
SALES SALES_Q4_1998 01-JAN-99
SALES SALES_Q1_1999 01-APR-99
SALES SALES_Q2_1999 01-JUL-99
SALES SALES_Q3_1999 01-OKT-99
SALES SALES_Q4_1999 01-JAN-00
SALES SALES_Q1_2000 01-APR-00
SALES SALES_Q2_2000 01-JUL-00
SALES SALES_Q3_2000 01-OKT-00
SALES SALES_Q4_2000 01-JAN-01
SALES SALES_Q1_2001 01-APR-01
SALES SALES_Q2_2001 01-JUL-01
SALES SALES_Q3_2001 01-OKT-01
SALES SALES_Q4_2001 01-JAN-02
SALES SALES_Q1_2002 01-APR-02
SALES SALES_Q2_2002 01-JUL-02
SALES SALES_Q3_2002 01-OKT-02
SALES SALES_Q4_2002 01-JAN-03
SALES SALES_Q1_2003 01-APR-03
SALES SALES_Q2_2003 01-JUL-03
SALES SALES_Q3_2003 01-OKT-03
SALES SALES_Q4_2003 01-JAN-04
28 rows selected. -
To get current data block name
Hi;
I have 2 data blocks on my form and I want to get current data block name on my form. How can I do this???
Thank youLike Rosario said, use the :SYSTEM.CURSOR_BLOCK.
you can also use :SYSTEM.TRIGGER_BLOCK in triggers to find which block was responsible of the firing event of a trigger.
Do not use :SYSTEM.CURRENT_% variables in Forms 9i and above, those are only there for compatibility reasons.
You can also check the online help for more details on :SYSTEM.% system variables.
Tony -
When copying one of my old cassettes to a CD how do I get the data - album name, artist, etc. to show up when the CD is inserted into a player?
To what format file are you saving from Audacity? Although technically AIFF format can save data tags within the file itself I have not found this to always work with all applications. Likely the information you enter into Audacity is just being saved in the file name. When you add this file to iTunes, if iTunes cannot find tags it recognizes it will simply add the track with the file name as the track name. You need to add the tracks to iTunes, then enter the information using File > Get Info for a track or series of tracks,
Some of the above information may vary slightly depending upon the file format being used.
It helps when asking questions here to provide as much information at the onset as possible. We didn't know until this stage that all these menus were in fact part of Audacity and not iTunes. -
How can I organize data by name in a drop down menu?
I created a spread sheet with several drop down menus. The problem I am having is how to organize my data by name. Every new entry is at the bottom of the drop down and can't be moved to a different location. This gets very confusing as I add more names to the drop down cell. In this case my entries consist of Chemical names that make it very hard to recognize or to locate once I open the drop down menu. Any suggestions?
Hello
Some times ago I've written a set of AppleScript scripts to manipulate popup menu items in Numbers 09. You may try the Script 3 (sort popup items.applescript) for instance in the following thread.
Alphabetize pop-up menu
https://discussions.apple.com/thread/5177915?tstart=0
https://discussions.apple.com/message/22530570
https://discussions.apple.com/message/22530926
https://discussions.apple.com/message/22541516
Hope this may help,
H -
Table are not prefixed with Schema in SQL request - Unable to get Data
I began this new thread because I closed the [previous one|Unable to get data (DSN connection); a little bit early, I believed it was OK but no the problem still here.
First my architecture :
Oracle 9g
+500 Reports made under CR developper 8.5 or 9.0
Report opened in VB .net application, framework 2.0 using CR runtime 8.5 and 9.0
We want to upgrade CR version to 2008, so modification of reports will be done with CR 2008 Developper, and we want to
use only CR 2008 runtime.
The problem :
Everything works fine in CR Developer, but the same report with the same parameters failed when called inside .net.
The error is "Unable to get data", the database connection is OK but the queries mades from inside the report are wrong :
The tables/views in the from statement are not prefixed with the Schema, so Oracle don't find them.
Example (SQL monitoring done with TOAD)
Execution of postes.rpt report directly in CR :
Timestamp: 10:30:03.881
Successful logon attempt (session tag: 0x6464CB8)
username: 'APPLI_HUET'; database: 'DEV'
SELECT ...
FROM "COMMUN"."ETAB" "ETAB" INNER JOIN "GESTION_DES_TEMPS"."POSTES" "POSTES"
ON "ETAB"."N_ETAB"="POSTES"."N_ETAB"
WHERE "POSTES"."N_ETAB"=2 ORDER BY "POSTES"."N_POSTE"
Timestamp: 10:50:29.178
Logoff (session tag: 0x6464CB8).
Same report, same authentication but throught .net program :
Timestamp: 11:01:24.569
Successful logon attempt (session tag: 0xA93FC38)
username: 'APPLI_HUET'; database: 'DEV'
SELECT ...
FROM "ETAB" "ETAB" INNER JOIN "POSTES" "POSTES"
ON "ETAB"."N_ETAB"="POSTES"."N_ETAB" WHERE "POSTES"."N_ETAB"=2 ORDER
BY "POSTES"."N_POSTE"
Runtime error occurred: 942 (ORA-00942: Table ou vue inexistante)
The .net code :
Dim _report As New ReportDocument()
_report.Load("report.rpt", OpenReportMethod.OpenReportByDefault)
Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
myConnectionInfo.ServerName = "DSN_file"
myConnectionInfo.UserID = p_Userid
myConnectionInfo.Password = p_Password
' to see code in this method se my original post
SetDBLogonForReport(myConnectionInfo, _report)
SetDBLogonForSubreports(myConnectionInfo, _report)
Dim frmViewer As New CrystalReportViewer
frmViewer.CrystalReportViewer1.ReportSource = _report
frmViewer.Show()
Any ideas ?Thanks for the and sorry but I don't understand.
I've made a research of Location on this forum the more intersting thread I've found is rpt-files do not function anymore after deploying to a different database, but I still don't understand.
I take a look at all code sample and I can't found anything.
You say that .Location need to be set, indeed Location property of CrystalDecisions.CrystalReports.Engine.Table object only contains table name.
I tried to overrides this value by the fully qualified table name (ie Schema.Table, for example GESTION_DES_TEMPS.POSTES), and it work BUT it wouldn't be the solution, my code is designed to be generic, I can't have a database to know wich schema add before differents table name.
Why when we execute the report directly in CR 2008 developper we don't have to redefine the table location ?
Another test :
I've made a new report directly in CR 2008 with a DSN, launch it in .net with the same DSN (server) : OK
Then I launch it in .net with another DSN, it work also.
Why report done with Crystal 8.5 or 9.0 have this problem ?
I'me gonna be mad....
Edited by: Yoann DAVID on Jan 8, 2010 3:32 PM -
Hi all,
I have an iMovie project in iMovie HD 6.0.3. (Mac OS 10.5.8)
It plays, but I cannot copy the file (including saving it to a flash drive). I get either a message
"the finder cannot complete the operation because some data in [name of
iMovie file] could not be read or written (Error Code 26)" or the
message "A project file is missing. The file [name of the QuickTime
movie inside the project.dv] couldn't be opened and is being skipped."
This happened suddenly, I was able to save a backup version numerous
times while working on the project.
I followed some of Karl Petersen's advise on apple discussions. I opened
the package contents, and everything seems to be there. The source file
(original QuickTime movie) is there and can be opened and played. I
replaced the current project file with the backup in the package
contents, but that did not change anything. I was able to export the
movie timeline into a new project as a single clip, but would like to be
able to copy the current project.
Thanks for any ideas..Make sure all drives are formatted as "Mac OS Extended". (Journalling preferred, but not necessary).
-
I prepared a GUI user connection application in NebBeans 5.5 accessing mySql database in the company server. The application run very well in desktop.
However, when I post it to the company server web, it gets nothing from the database.
Can any one give advice???
Thank you in advance.
The following is my application
import java.util.Vector;
import java.awt.event.*;
import java.awt.*;
import java.awt.event.*;
public class UserConnection extends javax.swing.JFrame {
//constants for database
private final String userName = "labmanage";
private final String password = "labmanage";
private final String server = "jdbc:mysql://svr.corp.com/labmanage";
private final String driver = "com.mysql.jdbc.Driver";
private JDBCAdapter data = new JDBCAdapter(server, driver, userName, password);
//variables
private String user, pwd;
private Vector<Vector<String>> userTable = new Vector<Vector<String>>();
private Vector<String>colUserNames = new Vector<String>();
* Creates new form UserConnection
public UserConnection() {
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 ">
private void initComponents() {
userLabel = new javax.swing.JLabel();
pwdLabel = new javax.swing.JLabel();
userTextField = new javax.swing.JTextField();
passwordField = new javax.swing.JPasswordField();
submitButton = new javax.swing.JButton();
statusLabel = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
statusTextArea = new javax.swing.JTextArea();
changePwdButton = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("User's Connection");
setBackground(new java.awt.Color(153, 204, 255));
setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
setFont(new java.awt.Font("aakar", 1, 12));
userLabel.setText("User Name:");
pwdLabel.setText("Password:");
submitButton.setText("Submit");
submitButton.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
submitButtonMouseClicked(evt);
submitButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
submitButtonActionPerformed(evt);
submitButton.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
submitButtonKeyTyped(evt);
statusLabel.setText("Status:");
statusTextArea.setColumns(20);
statusTextArea.setEditable(false);
statusTextArea.setLineWrap(true);
statusTextArea.setRows(3);
statusTextArea.setText("Initial assigned password is \"dime\".");
statusTextArea.setWrapStyleWord(true);
jScrollPane1.setViewportView(statusTextArea);
changePwdButton.setText("Change password");
changePwdButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
changePwdButtonActionPerformed(evt);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(userLabel)
.add(pwdLabel)
.add(statusLabel))
.add(35, 35, 35)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(submitButton)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(changePwdButton))
.add(passwordField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 230, Short.MAX_VALUE)
.add(userTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 230, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 230, Short.MAX_VALUE))
.addContainerGap())
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(userLabel)
.add(userTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(pwdLabel)
.add(passwordField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(statusLabel)
.add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(15, 15, 15)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(submitButton)
.add(changePwdButton))
.addContainerGap(27, Short.MAX_VALUE))
pack();
}// </editor-fold>
private void submitButtonKeyTyped(java.awt.event.KeyEvent evt) {
if(evt.getKeyCode() == KeyEvent.VK_ENTER) {
submitButton.doClick();
submitButton.requestFocus();
changePwdButton.requestFocus();
private void changePwdButtonActionPerformed(java.awt.event.ActionEvent evt) {
String command = evt.getActionCommand();
if(command.equals("Change password")) {
passwordField.setText("");
//Get connection to the changing password panel
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new ChangePassword().setVisible(true);
private void submitButtonActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
String command = evt.getActionCommand();
if(command.equals("Submit")) {
user = getUser();
pwd = getPwd();
data = new JDBCAdapter(server, driver, userName, password);
data.executeQuery("SELECT * FROM USERTABLE");
colUserNames = data.getColumnNames();
userTable = data.getDataTable();
if(colUserNames.elementAt(0).equals("")) {
statusTextArea.setText("Can not connect to database");
boolean checkUser = false;
int i = 0;
while(!checkUser && i<userTable.size()) {
if(user.equalsIgnoreCase((String) userTable.elementAt(i).elementAt(0))) {
//Find the user in database
checkUser = true;
//Check user's password
if(pwd.equals((String)userTable.elementAt(i).elementAt(1))) {
//Check for initial default password. The user is requested
//to change his password
if(pwd.equals((String) "dime")) {
statusTextArea.setText("You are requested to change your " +
"initial assigned password. Click 'Change password' please.");
else {
//Set UserConnection Panel to invisible
setVisible(false);
dispose();
//Get connection to the table
if(userTable.elementAt(i).elementAt(2).equals("0")) {
//Get connection to non-editable table
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
PVRackReportNonEdit rackReport = new PVRackReportNonEdit();
rackReport.createAndShowDialog();
else {
if(userTable.elementAt(i).elementAt(2).equals("1")) {
//Get connection to editable table
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
PVRackReport rackReport = new PVRackReport(user);
rackReport.createAndShowDialog();
//PVRackReport rackReport = new PVRackReport();
else statusTextArea.setText("You do not get approval for viewing data. " +
"Please contact the administrator for details.");
else {
passwordField.setText("");
statusTextArea.setText("Please enter corrected password or" +
"the administrator for details.");
i++;
if(!checkUser) {
passwordField.setText("");
statusTextArea.setText("Not find such user's name." +
"contact the admistrator for details.");
private void submitButtonMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
* @param args the command line arguments
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new UserConnection().setVisible(true);
public String getUser() {
return userTextField.getText();
public String getPwd() {
return passwordField.getText();
// Variables declaration - do not modify
private javax.swing.JButton changePwdButton;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JPasswordField passwordField;
private javax.swing.JLabel pwdLabel;
private javax.swing.JLabel statusLabel;
private javax.swing.JTextArea statusTextArea;
private javax.swing.JButton submitButton;
private javax.swing.JLabel userLabel;
private javax.swing.JTextField userTextField;
// End of variables declaration
Here is my JDBCAdapter
package rackdemo2;
* This is an adaptor which transforms the JDBC interface
* to the PVRackTableDialogue
import java.util.Vector;
import java.sql.*;
import javax.swing.table.AbstractTableModel;
import javax.swing.event.TableModelEvent;
public class JDBCAdapter {
Connection connection;
Statement statement;
ResultSet resultSet;
Vector<String> columnNames = new Vector<String>();
Vector<Vector<String>> rows = new Vector<Vector<String>>();
ResultSetMetaData metaData;
public JDBCAdapter(String url, String driverName,
String user, String passwd) {
try {
Class.forName(driverName);
connection = DriverManager.getConnection(url, user, passwd);
statement = connection.createStatement();
catch (ClassNotFoundException ex) {
System.err.println("Cannot find the database driver classes.");
System.err.println(ex);
catch (SQLException ex) {
System.err.println("Cannot connect to this database.");
System.err.println(ex);
public void executeQuery(String query) {
if (connection == null || statement == null) {
System.err.println("There is no database to execute the query.");
return;
try {
resultSet = statement.executeQuery(query);
metaData = resultSet.getMetaData();
int numberOfColumns = metaData.getColumnCount();
// Get the column names and cache them.
// Then we can close the connection.
for(int column = 0; column < numberOfColumns; column++) {
columnNames.addElement(metaData.getColumnLabel(column+1));
// Get all rows.
while (resultSet.next()) {
Vector<String> newRow = new Vector<String>();
for (int i = 1; i <= columnNames.size(); i++) {
String tempString = resultSet.getString(i);
if(!tempString.equals("null")) {
newRow.addElement(tempString);
else {
newRow.addElement("");
rows.addElement(newRow);
//Modify dataTable to add empty row to separate chassis
if(numberOfColumns>1) {
int nRow = rows.size();
Vector<String> row = new Vector<String>();
for(int i=0; i<numberOfColumns; i++){
row.add("");
if(nRow>0 || numberOfColumns>0) {
//Adding blank row to separate chassis
int i = 0;
while(i<nRow) {
if(!rows.elementAt(i).elementAt(0).equals("")) {
if(i>0) {
rows.add(i, row);
i++;
nRow = rows.size();
i++;
close();
catch (SQLException ex) {
System.err.println(ex);
public void close() throws SQLException {
resultSet.close();
statement.close();
connection.close();
// MetaData
public Vector<String> getColumnNames() {
return columnNames;
public Vector<Vector<String>> getDataTable() {
return rows;
public int getColumnCount() {
return columnNames.size();
// Data methods
public int getRowCount() {
return rows.size();
}Thank you for your answer.
I'm very new to mySql as server. When I was assigned
to write the application, the administrator has set
up mySql database in the company web server for my
application. My program runs very when using my
workplace desktop with java web start or with java
web start in netbeans (all paths should be link to my
desktop hard disk, i.e. users/application/). I can
not run the application at home because I can not
access to the company intranet server (for security
purpose). The problem happens when I post the
application in the company web page (I have to modify
all paths in jnlp file to the company web address).
The program then runs without exception except it
seems that it gets no data from the database (for
example, when I type my username, it returns that
"There is no such user name. contact.." as what I
code in the application for not correcting user name)
It happens for not only using my company desktop but
also for others.
Please help me.
Thank you in advance.And all this could have been answered yesterday, in your other thread, when I asked you "Is the DB configured to allow that user to connect to the DB from where that user is attempting to connect from?"
Seeing as how you get that error, the obvious answer was, "No." At which point we could have continued.
Configure the needed users into the DB, without forgetting to allow them access from the machines from which they are going to access from.
Although, I agree with Rene, that you should set up a server of some sort, located on the same machine as the DB, for communicating with the DB. -
Getting data in a combobox from database
I have done database connectivity in flex using .net. Now I am getting data in flex in a data grid. Everuthing is working fine if I take data in a data grid.
My problem is that if I try to take that data in any other control, other than data grid, it shows up no data, it only shows "object[object].
for ex:
if I am getting 3 rows from databse and I try to get those in a combo box, den I am getting 3 items in combo box like this:
object[object]
object[object]
object[object]
instead of actual data.
I am stuck in this problem for last 3 days. I have tried lot of things but nuthing is working. Plz anyone help me out soon. Its really urgent.
I am working on a live project and not able to proceed because of this problem.Hi Bhavika,
You need to tell your combobox which value should be displayed in the ComboBox...for display...
You are getting 3 rows from database which are objects since you haven't told your combobox which value to be displayed it is displaying as [Object,Object]...
So you need to tell your ComboBox which values to be displayed ..and you can do this by assigning the labelField property of the ComboBox..
Say in your object you have three properties say..data, value, name...etc;;
Then if you want display name as your ComboBox display label then simply write ....labelField="name" in your ComboBox ...
Thanks,
Bhasker Chari
Maybe you are looking for
-
Regarding Terms of Payment Key
hi all, How can we get Payment terms based on Terms of Payment key. Plz suggest how can we get. Regards Reddy
-
JAX-WS web service client and Windows integrated Security authentication
I am currently developing a JAX-WS web service client running on WebLogic 10.3.2.0. The client is connecting to exchange web service running on IIS. Everything works well when EWS is configured with Http basic authentication. The problems started whe
-
How to return rows where count = 0
Hi, I have the below query that returns the quarters along with the number of issues: select MQTR as Quarter, count(MQTR) from tbl1, tbl2 where Fdate=Cdate and cycle_missed = 'Yes' group by MQTR order by 1 output: 2006-Q2 1 2006-Q3 1 2007-Q
-
I am trying to download songs that i purchased from Itune, but it will no let me download ones
need help
-
The app "sonic & sega all star racing" crash when I start a race
Hi guys, recently I downloaded the app "sonic & sega all star racing" on my iPod touch and I don't know why but every time that I wanna start a race o a test drive the app always crash And I don't know what to do. Someone please tell me what I can do