Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

ORA-65096: Invalid common user or role name

user8708553Aug 31 2019 — edited Sep 14 2019

Hello everyone,

Hope everyone is doing well!

I just downloaded and installed Oracle Database 19c (Release 19.0.0.0.0).

And when I ran :

     create user john_doe identified by abc123;

It gave me :

     ORA-65096: Invalid common user or role name

What did I do incorrectly?  Or did I miss something in the installation step?

Thank you so much,

cmh

This post has been answered by Solomon Yakobson on Aug 31 2019
Jump to Answer

Comments

camickr
In JDK1.4.2 it only supports insert mode.

Is there a new feature in 1.5?
843805
In JDK1.4.2 it only supports insert mode.

Is there a new feature in 1.5?
I don't know about JTextPane in JDK1.5.
And I agree with you that JTextPane supports insert mode only in JDK1.4.2 but I need to have overwrite mode too in my JTextPane.
What should I do?
800351
An idea:
Override insertString() and do continuously remove/replace pre-exixting characters.
camickr
but I need to have overwrite mode too in my JTextPane
Then why didn't you state that in your original question?

Here is my version that allows you to toggle between both modes:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.event.*;
import javax.swing.plaf.*;

public class OvertypeTextArea extends JTextArea
{
	private static Toolkit toolkit = Toolkit.getDefaultToolkit();
	private static boolean isOvertypeMode;

	private Caret defaultCaret;
	private Caret overtypeCaret;

	public OvertypeTextArea(int row, int column)
	{
		super(row, column);
		setCaretColor( Color.red );
		defaultCaret = getCaret();
		overtypeCaret = new OvertypeCaret();
		overtypeCaret.setBlinkRate( defaultCaret.getBlinkRate() );
		setOvertypeMode( true );
	}

	/*
	 *	Return the overtype/insert mode
	 */
	public boolean isOvertypeMode()
	{
		return isOvertypeMode;
	}

	/*
	 *	Set the caret to use depending on overtype/insert mode
	 */
	public void setOvertypeMode(boolean isOvertypeMode)
	{
		this.isOvertypeMode = isOvertypeMode;
		int pos = getCaretPosition();

		if ( isOvertypeMode() )
		{
			setCaret( overtypeCaret );
		}
		else
		{
			setCaret( defaultCaret );
		}

		setCaretPosition( pos );
	}

	/*
	 *  Override method from JComponent
	 */
	public void replaceSelection(String text)
	{
		//  Implement overtype mode by selecting the character at the current
		//  caret position

		if ( isOvertypeMode() )
		{
			int pos = getCaretPosition();

			if (getSelectedText() == null
			&&  pos < getDocument().getLength())
			{
				moveCaretPosition( pos + 1);
			}
		}

		super.replaceSelection(text);
	}

	/*
	 *  Override method from JComponent
	 */
	protected void processKeyEvent(KeyEvent e)
	{
		super.processKeyEvent(e);

	 	//  Handle release of Insert key to toggle overtype/insert mode

	 	if (e.getID() == KeyEvent.KEY_RELEASED
	 	&&  e.getKeyCode() == KeyEvent.VK_INSERT)
	 	{
			setOvertypeMode( ! isOvertypeMode() );
	 	}
	}

	/*
	 *  Paint a horizontal line the width of a column and 1 pixel high
	 */
	class OvertypeCaret extends DefaultCaret
	{
		/*
		 *  The overtype caret will simply be a horizontal line one pixel high
		 *  (once we determine where to paint it)
		 */
		public void paint(Graphics g)
		{
			if (isVisible())
			{
				try
				{
					JTextComponent component = getComponent();
					TextUI mapper = component.getUI();
					Rectangle r = mapper.modelToView(component, getDot());
					g.setColor(component.getCaretColor());
					int width = g.getFontMetrics().charWidth( 'w' );
					int y = r.y + r.height - 2;
					g.drawLine(r.x, y, r.x + width - 2, y);
				}
				catch (BadLocationException e) {}
			}
		}

		/*
		 *  Damage must be overridden whenever the paint method is overridden
		 *  (The damaged area is the area the caret is painted in. We must
		 *  consider the area for the default caret and this caret)
		 */
		protected synchronized void damage(Rectangle r)
		{
			if (r != null)
			{
				JTextComponent component = getComponent();
				x = r.x;
				y = r.y;
				width = component.getFontMetrics( component.getFont() ).charWidth( 'w' );
				height = r.height;
				repaint();
			}
		}
	}

	public static void main(String[] args)
	{
		JFrame frame = new JFrame();
		frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
		OvertypeTextArea textArea	= new OvertypeTextArea(5,20);
		textArea.setFont( new Font("monospaced", Font.PLAIN, 12) );
		textArea.setText("abcdefg");
		frame.getContentPane().add( textArea );
		frame.pack();
		frame.setVisible(true);
	}
}
843805
thanks camickr your code worked great.
camickr
Glad you found the code helpfull.
1 - 6

Post Details

Added on Aug 31 2019
8 comments
16,492 views